🧠 Problem Statement Glaucoma is a chronic and irreversible eye disease that progressively damages the optic nerve, potentially leading to permanent vision loss if not detected early. Traditional diagnostic procedures require specialized expertise, are often time-intensive, and can be costly, limiting accessibility—especially in resource-constrained regions. With glaucoma being one of the leading causes of blindness globally, there is a pressing need for scalable, reliable, and automated diagnostic tools.
💡 Project Overview This project focuses on developing a deep learning-based system for glaucoma detection using fundus (retinal) images. By leveraging powerful computer vision techniques and transformer-based neural architectures, the solution aims to classify images as either Glaucoma Positive or Glaucoma Negative, providing a valuable tool for early and efficient screening.
🔧 Key Contributions Model Architecture: Utilized a ViT-B16 (Vision Transformer) model implemented with ViT-Keras for binary classification, allowing the model to capture global patterns in fundus images more effectively than traditional CNNs.
Image Preprocessing: Applied Contrast Limited Adaptive Histogram Equalization (CLAHE) and normalization techniques to enhance optic disc visibility and improve feature extraction.
Performance Evaluation: Achieved over 90% accuracy and validated the model using ROC-AUC, precision, recall, and F1 score to ensure robustness and clinical relevance.
🎯 Project Objectives High Accuracy: Maximize the model’s ability to correctly classify both positive and negative cases.
Low False Positives: Minimize incorrect identification of healthy eyes as glaucoma-affected.
Low False Negatives: Reduce the risk of missing actual glaucoma cases, which is critical for timely treatment.
🌍 Impact Once fully optimized and validated, this system can be integrated into clinical workflows or deployed in mobile/remote screening settings. It has the potential to support ophthalmologists, increase early diagnosis rates, and reduce the global burden of preventable blindness through fast, affordable, and accurate screening.
- numpy: Array manipulation and numerical operations
- pandas: Data manipulation and analysis
- scikit-learn: Machine learning utilities like metrics and preprocessing
- tensorflow: Deep learning framework; includes Keras for model building
- keras: Interface for the TensorFlow deep learning framework (optional if using TensorFlow 2.x)
- opencv-python: Image processing library (optional, for image transformations)
- Pillow: Image processing library, used with Keras for loading images
- matplotlib: Plotting and visualization of data and model metrics
- seaborn: Statistical data visualization (optional, enhances matplotlib)
You can install the modules individually with pip install, or add them to a requirements.txt file:
-
pandas
-
scikit-learn
-
tensorflow
-
opencv-python
-
matplotlib
-
scikit-learn
-
seaborn
-
numpy
- Start by opening Google Colab.
-
Ensure that you have access to a TPU by selecting
Runtime
>Change runtime type
>Hardware accelerator
>TPU
. -
Clone the repository using the following command:
!git clone https://github.com/CODEBRAKERBOYY/GlaucomaDetection.git
-
Change into the cloned directory:
%cd GlaucomaDetection
-
Install the required modules by running:
!pip install -r requirements.txt
-
To train your model or make predictions, run the following command:
!python main.py [arguments]
Arguments:
train_model
- Specify this if you want to train the model before inference.existing
- Use this after thetrain_model
argument if you want to retrain an existing model.make_predictions
/None
- This loads the existing model for inference.
Make sure you have the following modules for optimal performance:
- CUDA (if using a GPU): Ensure your system supports CUDA for faster training if you have a compatible NVIDIA GPU.
- Jupyter Notebook (optional): For interactive experimentation and visualization.
The dataset should be structured as follows:
DATASET
├── train/
│ ├── Glaucoma_Positive/
│ └── Glaucoma_Negative/
└── val/
├── Glaucoma_Positive/
└── Glaucoma_Negative/
└── test/
├── Glaucoma_Positive/
└── Glaucoma_Negative/
* While giving path as input always remember it consists only tow class one is Negative and other is Positive.
-
Perform image preprocesssing if you think it's necessary otherwise skip it.
-
Path for data images if you wants to retrain model:
-
https://drive.google.com/drive/folders/1M89d5jKBInbhvmEC95zn51zD6A25HKbF?usp=share_link