This project focuses on classifying ocular diseases from retinal fundus images using preprocessing techniques and deep learning models with transfer learning. It supports early diagnosis of conditions such as:
- Diabetic retinopathy
- Glaucoma
- Cataract
- Age-related macular degeneration (AMD)
- Hypertension-related changes
- Myopia
- Others
We use the ODIR dataset, which includes:
- Multilabel classification (patients may have more than one disease)
- Metadata (age, sex, left/right eye images)
- Raw fundus images of varying quality The dataset and processed images are available via Google Drive:
Preprocessing Step | Example Image |
---|---|
Raw | ![]() |
Cropped | ![]() |
Resized | ![]() |
CLAHE | ![]() |
CLAHE + MIRNet | ![]() |
File | Purpose |
---|---|
odir.csv |
Metadata and labels for the fundus images |
odir_resize.ipynb |
Resizing pipeline to normalize image dimensions |
odir_crop_images.ipynb |
Crops noisy borders and focuses on retinal regions |
odir_enhancement.ipynb |
Enhances fundus image quality using histogram equalization, CLAHE, Gaussian filtering |
hyp_resnet50_mirnet_msr.ipynb |
Experiments with MIRNet enhancement + ResNet50 model |
hyp_vgg16_mirnet_msr.ipynb |
MIRNet + VGG16 pipeline |
ODIR_balanced.ipynb |
Class balancing using undersampling and training classifiers |
- Resizing and cropping for spatial consistency
- Enhancement with:
- CLAHE (Contrast Limited Adaptive Histogram Equalization)
- Gaussian blurring
- Histogram normalization
- Deep enhancement via MIRNet for denoising and contrast recovery. MIRNet utilizes invertible building blocks, residual connections, attention mechanisms, and a perceptual loss function to produce visually pleasing images with improved brightness, contrast, and details while reducing noise and artifacts.
- ResNet50 and VGG16 with ImageNet weights
- Final classification head adapted for multilabel sigmoid outputs
- Training with binary cross-entropy loss and data augmentation
- Hyperparameter tuning using Keras Tuner (random search, hyperband, Bayesian optimization) with AUC as the primary metric
- Per-class Precision, Recall, F1-score
- AUC-ROC across all labels
- Confusion matrices and class activation maps (CAMs)
Model | Preprocessing | F1 (Macro) | AUC-ROC |
---|---|---|---|
VGG16 | MIRNet + CLAHE | 0.71 | 0.91 |
ResNet50 | MIRNet + CLAHE | 0.74 | 0.93 |
MIRNet-enhanced images consistently outperformed raw image baselines. |
- Clone the repo:
git clone https://github.com/YOUR_USERNAME/OcularDiseaseRecognition.git
cd OcularDiseaseRecognition
- Ensure your environment has:
tensorflow, keras, opencv-python, numpy, pandas, matplotlib, seaborn, scikit-learn, keras-tuner
- Run notebooks in order:
odir_resize.ipynb
odir_crop_images.ipynb
odir_enhancement.ipynb
- Model experiments (
hyp_*.ipynb
)
Sneha Dharne MS in Computer Science (ML) – Stevens Institute of Technology LinkedIn • GitHub
- The example images in the Dataset section are embedded using markdown images. They are hosted on GitHub (from the assets folder of the repo). The links in the table are direct links to the images.