This repository contains the code and data used in the paper.
We propose to utilize a lightweight deep learning architecture called MobileNetV2 and transfer learning to distinguish four common eye diseases including Glaucoma, Maculopathy, Pathological Myopia, and Retinitis Pigmentosa from normal controls using a small training data. The inputs to the algorithm are fundus images. This project was implemented using the tensorflow framework. We include code and data here for ease reproduction of the results in the paper.
All experiments are performed on Google Research Colab (Many thanks to Google!!).
All data can be found in folder "Dataset". Download the Data folder then upload the sub-folder "HIGHMIDCHANCEGLAUMYOPIAmaculopathyRP" to Google Drive.
For users own data, please follow the structure of the data set folder. You may need to change the script for different number of classes.
All implementation code, including intermediate and final results, can be found in Codes folder.
ModelAndResults.ipynb
the model in this project.
Fundus5Runs.ipynb
Comparision with other models.
binarys
Binary classifier for each disease.
Upload the nodebook or use the code to Colab then connect it to Google drive.
Rerun the cells for results.
MobileNetV2 feature extractor:
An initial convolution layer, followed by
17 reversed residual blocks, and followed by
1 poinwised convolution layer.
Implemented from keras-tensorflow-applications. Pretrained on ImageNet.
The model also contains one global average layer and the final prediction layer.
Confusion Matrix, run on the test data.
0: Normal, 1: Glaucoma, 2: Pathological Myopia 3: Maculopathy, 4: Retinitis Pigmentosa
visualization using Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
A: Normal, B: Glaucoma, C: Pathological Myopia D: Maculopathy, F: Retinitis Pigmentosa. Mis-classified image are marked in red. The first is mis-classified as glaucoma, the second is misclassified as maculopathy.
Guo et al. Prediction of different eye diseases based on fundus photography via deep transfer learning. Submitted.