Skip to content

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

License

Notifications You must be signed in to change notification settings

thinkercache/LIME-XAI-Facial-Disease-Classification

 
 

Repository files navigation

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].

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%