Sparse-BagNet validation: An Inherently Interpretable AI model improves Screening Speed and Accuracy for Early Diabetic Retinopathy
This repository contains the official implementation of the paper An Inherently Interpretable AI model improves Screening Speed and Accuracy for Early Diabetic Retinopathy.
All packages required for running the code in the repository are listed in the file requirements.txt
The code in this repository uses publicly available Kaggle dataset from the diabetic retinopathy detection challenge
The images were preprocessed by tightly cropping circular masks of the retinal fundus and resize to 512 x 512. The code is available here: fundus preprocessing
An ensemble of EfficientNets trained on the ISBI2020 challenge dataset was used to filter out images with low qualities. The resulting dataset (csv files) used to train the model and for internal evaluation is as follows:
The image names used for figures are provided in images.txt
├── main_folder
├── Kaggle_data
├── Images
├── kaggle_gradable_train.csv
├── kaggle_gradable_test.csv
├── kaggle_gradable_val.csv
├── Outputs
├── configs
├── data
├── files
├── utils
├── modules
├── main.py
├── train.py
Adjust paths to dataset in configs/paths.yaml
. Replace the value of
root
withKaggle_data/
img_dir
withImages/
Adjust paths in configs/default.yaml
. Replace the value of
save_paths
withxx
wherexx
is where the log files and model weights will be saved during the model trainingpaths.model_dir
withxx
All experiments are fully specified by the configuration file located at ./configs/default.yaml
.
The training configurations including hyperparameters turning can be done in the main config file.
- Create a virtual environment and install dependencies
$ pip install requirements.txt
- Run a model with previously defined parameters
$ python main.py
Monitor the training progress in website 127.0.0.1:6006 by running:
$ tensorborad --logdir=/path/to/your/log --port=6006
- Code for figures are available
- CSV file of the 180 images with ground truth level used for the grading tasks is available at grading dataset
- CSV file containing the outcome of the grading tasks (including the model output and the ophthalmologists's performance such as the decision time, confidence, and grade) is available at grading dataset
- CSV file of the 65 images with ground truth level used for the annotation task is available in annotation dataset
- Annotations masks from clinicians used to evaluate the performance of the model on localizing DR related lesion on the internal set is available at annotation dataset. The annotation only include Microaneurysm (MA), Hemorrhages (HE), Hard Exudates (HE), and Soft Exudates (SE) lesions.
The final models with the best validation weights used for all the experiments are as follows:
- This repository contains modified source code from kdjoumessi/interpretable-sparse-activation
@inproceedings{donteu2023sparse,
title={An Inherently Interpretable AI model improves Screening Speed and Accuracy for Early Diabetic Retinopathy},
author={Kerol Djoumessi, Ziwei Huang, Annekatrin Rickmann, Natalia Simon, Laura Kühlewein, Lisa M. Koch, Philipp Berens},
booktitle={xx},
year={2024}
}
This work includes code adaptations from Sparse BagNet (Djoumessi et al., 2023):
@inproceedings{donteu2023sparse,
title={Sparse Activations for Interpretable Disease Grading},
author={Donteu, Kerol R Djoumessi and Ilanchezian, Indu and K{\"u}hlewein, Laura and Faber, Hanna and Baumgartner, Christian F and Bah, Bubacarr and Berens, Philipp and Koch, Lisa M},
booktitle={Medical Imaging with Deep Learning},
year={2023}
}