Diabetic Retinopathy is a disease with an increasing prevalence and the main cause of blindness among working-age population.
The risk of severe vision loss can be significantly reduced by timely diagnosis and treatment. Systematic screening for DR has been identified as a cost-effective way to save health services resources. Automatic retinal image analysis is emerging as an important screening tool for early DR detection, which can reduce the workload associated to manual grading as well as save diagnosis costs and time. Many research efforts in the last years have been devoted to developing automated tools to help in the detection and evaluation of DR lesions.
We are interested in automating this predition using deep learning models.
Early detection through regular retinal screening can drastically reduce vision loss — yet, in many regions, access to skilled ophthalmologists remains limited.
This project aims to leverage deep learning to assist hospitals and diagnostic centers in detecting Diabetic Retinopathy from retinal fundus images.
Our motivation was to build an AI-driven, scalable, and cost-effective screening tool that can and by open-sourcing this work, the goal is to empower hospitals, clinics, and NGOs to:
- Support ophthalmologists in identifying DR at an early stage.
- Improve screening efficiency in under-resourced hospitals.
- Enable large-scale, real-time retinal analysis through automation.
By combining data-driven insights with medical imaging, the project demonstrates how AI can bridge the gap between healthcare accessibility and diagnostic accuracy, contributing toward the broader goal of preventing avoidable blindness.
Note: This project was inspired by the mission of Aravind Eye Hospital (India) and the Asia Pacific Tele-Ophthalmology Society (APTOS), which aim to bring AI-assisted screening to remote areas.
Dataset : APOTS Kaggle Blindness dataset
I am proposing Deep Learning classification technique using CNN pretrained model resnet152 to classify severity levels of DR ranging from 0 (NO DR) to 4 (Proliferative DR).
This is a collaborative project of team of three where my main work is on developing, training and testing various CNN models along with some secondary work.
Deep learning looks promising because already various types of image classification tasks has been performed by various CNN's so, we can rely on DL pretrained models or we can modify some layers if we wish to :)
A GUI based system has been made using Tkinter and used heidiSQL to maintain and store a list of predictions with their patient id and name (which is very risky , the reason we will get to it some time later).
Twilio API have been used to Make SMS connectivity to patients possible in case they are not contactable or accesible (in that case we can also use mail).
Dev Env. | Framework/ library/ languages |
---|---|
Backend development | PyTorch (Deep learning framework) |
Frontend development | Tkinter (Python GUI toolkit) |
Database connectivity | HeidiSQL (MySQL server) |
Programming Languages | Python, SQL |
API | Twilio cloud API |
Input data (raw) is like this -
I have only shown below the main layers of resnet and each of the 'layer1', 'layer2', 'layer3' and 'layer4' contains various more layers.
Click here to get started locally on your system.
- My next goal is to develop this into WebApp (probably using some light weight model as resnet models are heavy).
- Next goal will be using encryption techniques to achieve not only high accuracy but also high level of privacy in terms of differentially private basis and use technqiues such as Federated learning and Secure Multi party computation for privacy preserving deep learning classification. Btw, i have already made one project using federated learning on classification task , check out here. Acheiving a level of privacy is also very important task in medical datasets so that there can be factor of trust established between different stakeholders using the system.
- Some ideas for concurrency control has to be implemented properly using some kind of locks defined in MySQL so that multiple users can use the system at the same time when deployed on web. (Otherwise, locally you can run the executable file multiple times to open and run the GUI and it works fine).
- Reducing TYPE-II error (false negatives) as this metric is really useful in Healthcare domain.
- Check out the training code here
- Check out testing done on unseen image
- Check out the executable file (for running GUI)
- check out the model executable file (for loading to get inference locally)
- check out the Twilio API executable file (to get SMS for inference)
- for getting pre-trained weights for this model, check out getting started section here
[Note : The training files in this repo is only shown after final training as it took around more than 100 epochs to reach 97% accuracy and a lot of compute power and time.]
⭐️ this Project if you liked it !