Diabetic Retinopathy Detection: Utilizing Multiprocessing for Processing Large Datasets and Transfer Learning to Fine-Tune Deep Learning Models
Efficiently process large datasets & develop advanced model pipelines for diabetic retinopathy detection. Streamlining diagnosis.
This project efficiently handles large datasets to develop a robust deep learning model for diabetic retinopathy (DR) detection. Using PyTorch Lightning, retinal images are categorized into distinct disease stages. Multiple pretrained backbone models are integrated, with training progress monitored via TensorBoard. Additionally, a Vite-based frontend web application is provided to showcase the model’s capabilities.
The pipeline streamlines data preprocessing, model training, and deployment, making DR diagnosis more accessible and accurate.
Diabetic retinopathy is a leading cause of vision loss worldwide. Early detection is critical for preventing severe complications. This project provides a ready-to-use platform for researchers and enthusiasts to experiment with DR detection using deep learning.
- Efficient handling of large datasets using multiprocessing
- Image preprocessing pipelines (cropping, resizing, and splitting)
- Training deep learning models with transfer learning
- Monitoring experiments with TensorBoard
- Interactive Vite frontend for model demonstration
- Python 3.8+
- Node.js & npm (for frontend)
- Kaggle API key (Get here)
Install required Python libraries:
pip install -r requirements.txtActivate your Python virtual environment (example):
.venv311\Scripts\activateOption 1: Complete Zip Download
kaggle competitions download -c diabetic-retinopathy-detection
# Extract
unzip diabetic-retinopathy-detection.zip -d data/diabetic-retinopathy-detection
rm diabetic-retinopathy-detection.zipOption 2: Download in Parts
./scripts/download-dr-dataset.sh
./scripts/merge_and_extract.shPreprocess images to crop and resize:
python scripts/crop_and_resize.py --src data/diabetic-retinopathy-dataset/train data/diabetic-retinopathy-dataset/resized/train
python scripts/crop_and_resize.py --src data/diabetic-retinopathy-dataset/test data/diabetic-retinopathy-dataset/resized/testpython scripts/split_dataset.py✅ Note: You can skip dataset preparation if already completed in this studio.
Navigate to the project root directory:
cd D:\Project\diabetic-retinopathy-detectionRun the training script:
python train.pyTraining parameters are configurable via the Config class, including model architecture, learning rate, batch size, and data paths.
Explore notebook.ipynb for preprocessing and augmentation examples:
- Cropping, resizing, rotation
- Color normalization
- Advanced augmentation techniques for robust training
TensorBoard tracks metrics like loss, accuracy, learning rate, and visualizes model graphs:
pip install tensorboard
tensorboard --logdir=logs/Open the URL provided in the terminal (usually http://localhost:6006) to monitor training progress in real time.
Navigate to the project root:
cd D:\Project\diabetic-retinopathy-detectionEnsure your Python environment is activated.
Run the backend server:
python backend.pyThe backend will start an API to process retinal images and provide DR predictions.
Navigate to the frontend directory:
cd D:\Project\diabetic-retinopathy-detection\retina-bright-insight\retina-bright-insightInstall frontend dependencies:
npm installStart the Vite development server:
npm run devOpen the URL shown in the terminal (usually http://localhost:5173/) to access the frontend interface.
✅ Ensure the backend server is running before using the frontend for predictions.
- Multiprocessing for efficient large dataset handling
- Transfer learning with multiple pretrained backbone models
- Configurable training pipeline with logging and visualization
- Interactive Vite frontend for user-friendly predictions
- Languages: Python, JavaScript
- Frameworks/Libraries: PyTorch, PyTorch Lightning, TensorBoard, Vite
- Tools: Kaggle API, Multiprocessing, NumPy, Pandas
- Expand model ensemble for improved accuracy
- Integrate additional datasets for robustness
- Optimize web app for cloud deployment
- Kaggle Diabetic Retinopathy Detection Competition
- PyTorch Lightning Documentation
- Vite Documentation
- 🌐 Portfolio: Aaditya
- 💼 LinkedIn: AadityaxGupta
- 📧 Email: aadityavidit@gmail.com
💼 Developed by Aaditya Gupta | Software Developer & Full Stack Enthusiast