Incremental Cross-Domain Adaptation for Robust Retinopathy Screening via Bayesian Deep Learning
Update (September 18th, 2021)
A supporting document describing the difference between transfer learning, incremental learning, domain adaptation, and the proposed incremental cross-domain adaptation approach has been uploaded in this repository.
Update (August 15th, 2021)
Blind Testing Dataset has been released.
Introduction
This repository contains an implementation of the continual learning loss function (driven via Bayesian inference) to penalize the deep classification networks for incrementally learning the diverse ranging classification tasks across various domain shifts.
Installation
To run the codebase, please download and install Anaconda (also install MATLAB R2020a with deep learning, image processing and computer vision toolboxes). Afterward, please import the ‘environment.yml’ or alternatively install following packages:
- Python 3.7.9
- TensorFlow 2.1.0 (CUDA compatible GPU needed for GPU training)
- Keras 2.3.0 or above
- OpenCV 4.2
- Imgaug 0.2.9 or above
- Tqdm
- Pandas
- Pillow 8.2.0
Both Linux and Windows OS are supported.
Datasets
The datasets used in the paper can be downloaded from the following URLs:
The datasets description file is also uploaded here. Moreover, please follow the same steps as mentioned below to prepare the training and testing data. These steps are also applicable for any custom dataset. Please note that in this research, the disease severity within the scans of all the above-mentioned datasets are marked by multiple expert ophthalmologists. These annotations are also released publicly in this repository.
Dataset Preparation
- Download the desired data and put the training images in '…\datasets\trainK' folder (where K indicates the iteration).
- The directory structure is given below:
├── datasets
│ ├── test
│ │ └── test_image_1.png
│ │ └── test_image_2.png
│ │ ...
│ │ └── test_image_n.png
│ ├── train1
│ │ └── train_image_1.png
│ │ └── train_image_2.png
│ │ ...
│ │ └── train_image_m.png
│ ├── train2
│ │ └── train_image_1.png
│ │ └── train_image_2.png
│ │ ...
│ │ └── train_image_j.png
│ ...
│ ├── trainK
│ │ └── train_image_1.png
│ │ └── train_image_2.png
│ │ ...
│ │ └── train_image_o.png
Training and Testing
- Use ‘trainer.py’ to train the chosen model incrementally. After each iteration, the learned representations are saved in a h5 file.
- After training the model instances, use ‘tester.py’ to generate the classification results.
- Use ‘confusionMatrix.m’ to view the obtained results.
Results
The detailed results of the proposed framework on all the above-mentioned datasets are stored in the 'results.mat' file.
Citation
If you use the proposed scheme (or any part of this code in your research), please cite the following paper:
@inproceedings{BayesianIDA,
title = {Incremental Cross-Domain Adaptation for Robust Retinopathy Screening via Bayesian Deep Learning},
author = {Taimur Hassan and Bilal Hassan and Muhammad Usman Akram and Shahrukh Hashmi and Abdul Hakeem and Naoufel Werghi},
note = {IEEE Transactions on Instrumentation and Measurement},
year = {2021}
}
Contact
If you have any query, please feel free to contact us at: [email protected].