Coder Social home page Coder Social logo

thinkercache / lime-xai-facial-disease-classification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nhsx/lime-xai-facial-disease-classification

0.0 0.0 0.0 5.41 MB

Data Science Internship Scheme project investigating if a LIME application using superpixels is appropriate for facial healthcare image classification

License: MIT License

Jupyter Notebook 100.00%

lime-xai-facial-disease-classification's Introduction

LIME-XAI-Facial-Disease-Classification

NHSX Analytics Unit - PhD Internship Project

About the Project

status: hibernate

This repository holds code for the NHSX Analytics Unit PhD internship project led by Anwesha Mohanty from April to July 2022

Project Description - Explaining facial skin disease classification using LIME

Data Sources

_Note: No data, public or private are shared in this repository. A suitable test image can be taken from Here and saved in the data folder.

Project Stucture

  • The main code is found in the investigation folder
    • ffhqrffInceptionv3.ipynb uses the pre-trained Inception v3 as a base model and then fine tunes it using the rff-300 and FFHQ datasets in order to perform a classification for the prescence of Rosecea.
    • ffhqrffIncepv3_con.ipynb does the same as ffhqrffInceptionv3.ipynb but used pre-processed high contrast images.
    • Explain_working_con.ipynb conducts the LIME analysis by:
      • creating superpixels for an image,
      • creating randomly perturbed superpixel images from the original,
      • uses an ML classifer and the fine tuned inceptionv3 predictor,
      • calulates a distance between each perturbed image and the original,
      • computes weights for the importance of each superpixel,
      • shows the LIME explanation in terms of the most important superpixels.
  • The accompanying report is also available in the reports folder

Built With

Python v3.8

Getting Started

Installation

To get a local copy up and running follow these simple steps.

To clone the repo:

git clone https://github.com/nhsx/LIME-XAI-Facial-Disease-Classification.git

To create a suitable environment:

  • virtualenv -p /usr/local/bin/python3.8 .venv
  • source .venv/bin/activate
  • pip install -r requirements.txt

Usage

This repo contains an investigation and therefore can't be used as an active tool.

To run and tune the inceptionv3 classifiers you'll need to bring in a suitable dataset and have access to a GPU. These notebooks have been left in their google colab form.

However, if you just want to use the LIME implmentation then save a test.jpeg test image in the data folder and run Explain_working_con.ipynb to see how the superpixels are identified and weighted.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidance.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

To find out more about the Analytics Unit visit our project website or get in touch at [email protected].

lime-xai-facial-disease-classification's People

Contributors

jrpearson500 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.