This project aims to classify retinal diseases, including cataract, diabetic retinopathy, glaucoma, and normal retina, using deep learning models. The models used include VGG16, ResNet152V2, and EfficientNetB7, all fine-tuned with pre-trained weights from ImageNet.
- Project Overview
- Dataset
- Model Architecture
- Installation
- Usage
- Results
- Visualization
- Evaluation
- Contributing
The objective of this project is to classify retinal images into four categories: cataract, diabetic retinopathy, glaucoma, and normal. The models are built using TensorFlow and Keras, employing transfer learning from pre-trained models (VGG16, ResNet152V2, and EfficientNetB7).
- The dataset consists of images from three classes: cataract, diabetic retinopathy, glaucoma, and normal.
- Data is divided into training, validation, and testing sets:
- Training Set: 2108 images
- Validation Set: 1053 images
- Test Set: 1056 images
Three models are used for classification:
- VGG16
- ResNet152V2
- EfficientNetB7
- All layers in the base models are frozen to retain the learned features from ImageNet.
- A global average pooling layer is added, followed by a dense layer with 1024 units and ReLU activation.
- The final layer is a dense layer with softmax activation for multi-class classification.
-
Clone the repository:
git clone https://github.com/your-username/retinal-disease-classification.git cd retinal-disease-classification -
Install the required packages:
pip install -r requirements.txt
-
Prepare the Dataset:
- Organize the dataset into
Train,Valid, andTestdirectories, each containing subfolders for each class (cataract,diabetic_retinopathy,glaucoma,normal).
- Organize the dataset into
-
Run the Training Script:
-
Execute the script to train the models:
python train.py
-
-
Evaluate the Models:
-
After training, evaluate the models on the test set:
python evaluate.py
-
The models achieved the following performance on the test set:
-
VGG16:
- Accuracy: 73%
- Precision, Recall, F1-Score for each class:
-
ResNet152V2:
- Accuracy: 81%
- Precision, Recall, F1-Score for each class:
-
EfficientNetB7:
- Accuracy: 25%
- Precision, Recall, F1-Score for each class:
-
The training history (accuracy and loss) for each model is plotted to show the model's performance over epochs.

-
Precision-Recall curves are plotted to evaluate the performance of each model across different thresholds.
The evaluation of each model includes:
- Confusion Matrix
- Classification Report
- Precision-Recall Curve
These metrics help in understanding the model's performance and identifying areas for improvement.
Contributions are welcome! Please feel free to submit a Pull Request.
