Explainable AI for Medical Images
Updated 28 Jul 2021
Both methods (
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).
Given a chest x-ray (CXR), our solution should classify it into Posteroanterior (PA) or Lateral (L) view.
- MATLAB 2020a or later
- Deep Learning Toolbox
- Deep Learning Toolbox™ Model for SqueezeNet Network support package
- Parallel Computing Toolbox (only required for training using a GPU)
- Download or clone the repository.
- Open MATLAB.
- Edit the contents of the
dataFoldervariable in the
xai_medical.mlxfile to reflect the path to your selected dataset.
- Run the
xai_medical.mlxscript and inspect results.
- 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.
 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.
Oge Marques (2021). Explainable AI for Medical Images (https://github.com/ogemarques/xai-matlab/releases/tag/1.0), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!