Code Monkey home page Code Monkey logo

xai-matlab's Introduction

View Explainable AI for Medical Images on File Exchange

Explainable AI for Medical Images

This repository shows an example of how to use MATLAB to produce post-hoc explanations (using Grad-CAM and image LIME) for a medical image classification task.

Both methods (gradCAM and imageLIME) are available as part of the MATLAB Deep Learning toolbox and require only a single line of code to be applied to results of predictions made by a deep neural network (plus a few lines of code to display the results as a colormap overlaid on the actual images).

Example of gradCAM results.
Example of imageLIME results.

Experiment objective

Given a chest x-ray (CXR), our solution should classify it into Posteroanterior (PA) or Lateral (L) view.

Dataset

A small subset of the PadChest dataset1.

Requirements

Suggested steps

  1. Download or clone the repository.
  2. Open MATLAB.
  3. Edit the contents of the dataFolder variable in the xai_medical.mlx file to reflect the path to your selected dataset.
  4. Run the xai_medical.mlx script and inspect results.

Additional remarks

  • You are encouraged to expand and adapt the example to your needs.
  • The choice of pretrained network and hyperparameters (learning rate, mini-batch size, number of epochs, etc.) is merely illustrative.
  • You are encouraged to (use Experiment Manager app to) tweak those choices and find a better solution.

Notes

[1] This example uses a small subset of images to make it easier to get started without having to worry about large downloads and long training times.

xai-matlab's People

Contributors

ogemarques avatar

Stargazers

 avatar  avatar

Watchers

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