Skip to content

Fundus image analysis for ocular disease recognition using deep learning. This repository implements image preprocessing, MIRNet enhancement, and transfer learning with ResNet50 and VGG16 for classifying multiple eye diseases. Keras Tuner is used for hyperparameter optimization.

Notifications You must be signed in to change notification settings

SnehaDharne/OcularDiseaseRecognition

Repository files navigation

Ocular Disease Recognition

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

Dataset

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:

Example images:

Preprocessing Step Example Image
Raw Raw
Cropped Cropped
Resized Resized
CLAHE CLAHE
CLAHE + MIRNet CLAHE+MIRNet

Repository structure

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

Methods

Image Preprocessing

  • 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.

Classification Models

  • 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

Evaluation Metrics

  • Per-class Precision, Recall, F1-score
  • AUC-ROC across all labels
  • Confusion matrices and class activation maps (CAMs)

Results (Example)

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.

How to Run

  1. Clone the repo:
git clone https://github.com/YOUR_USERNAME/OcularDiseaseRecognition.git
cd OcularDiseaseRecognition
  1. Ensure your environment has:
tensorflow, keras, opencv-python, numpy, pandas, matplotlib, seaborn, scikit-learn, keras-tuner
  1. Run notebooks in order:
    • odir_resize.ipynb
    • odir_crop_images.ipynb
    • odir_enhancement.ipynb
    • Model experiments (hyp_*.ipynb)

Author

Sneha Dharne MS in Computer Science (ML) – Stevens Institute of Technology LinkedInGitHub

Additional Note

  • 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.

About

Fundus image analysis for ocular disease recognition using deep learning. This repository implements image preprocessing, MIRNet enhancement, and transfer learning with ResNet50 and VGG16 for classifying multiple eye diseases. Keras Tuner is used for hyperparameter optimization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published