The problem
Diabetic retinopathy is one of the leading causes of preventable blindness, and it often progresses silently — by the time vision blurs, the damage can be severe. The standard defence is regular retinal screening: a clinician photographs the retina with a fundus camera and grades what they see on a 0-to-4 severity scale. The problem is scale and subjectivity. Grading thousands of screening photographs is slow, tiring work for scarce ophthalmologists, and early signs like a lone microaneurysm are easy for a tired human eye to miss. Automated grading does not replace the clinician, but it can triage: clearly normal images pass through quickly while suspicious ones are flagged for urgent expert review. This project implements exactly that triage pipeline — an EfficientNetB0 network fine-tuned on the clinician-labelled APTOS 2019 dataset, evaluated with the competition's own quadratic weighted kappa metric, and wrapped in a demo that shows the full journey from fundus photograph to graded report with per-grade explanations.
Uploads a fundus photograph and reads the predicted DR grade with its probability distribution.
Follow the working sequence
How it works
- The 3,662 APTOS 2019 training images and their clinician-rated 0-4 labels are loaded and divided into stratified train and validation sets, preserving the grade distribution in both.
- Every image is resized to 224x224 and normalised with ImageNet statistics; the training split additionally passes through augmentation (rotation, horizontal flip, zoom, brightness jitter) to simulate varied imaging conditions.
- EfficientNetB0, initialised with ImageNet weights, is fine-tuned: early MBConv blocks stay frozen while later blocks and the new 5-way softmax head train with class-weighted categorical cross-entropy.
- Training is monitored on the validation split using quadratic weighted kappa; the best checkpoint is retained and training stops before overfitting sets in.
- The held-out validation set is evaluated exactly once: kappa, accuracy, confusion matrix and per-class precision/recall are generated and written into the report as the run's actual results.
- At inference time, a new fundus photograph flows through the identical preprocessing and the saved model weights, and the web demo displays the 5-grade probability distribution with the predicted grade highlighted.
Tech stack:
- Python 3, TensorFlow/Keras
- EfficientNetB0 (ImageNet weights)
- OpenCV, Albumentations (augmentation)
- NumPy, pandas, scikit-learn (metrics)
- Jupyter Notebook (training & evaluation)
- APTOS 2019 Blindness Detection dataset
- HTML/CSS/JavaScript (grading web demo)
- Git
Dataset & model details
- Dataset: APTOS 2019 Blindness Detection — Kaggle competition by the Asia Pacific Tele-Ophthalmology Society; 3,662 clinician-labelled training fundus photographs; 5 severity classes verified against the official data description: 0 No DR, 1 Mild, 2 Moderate, 3 Severe, 4 Proliferative DR.
- Task: 5-class image classification; input = 224x224x3 fundus image, output = probability distribution over the five DR severity grades.
- Model: EfficientNetB0 transfer learning — ImageNet-pretrained MBConv backbone with compound scaling, global average pooling, and a dense 5-way softmax head (approximately 5.3M parameters, architecture design target).
- Metrics: Quadratic weighted kappa (the competition's official metric), accuracy, per-class precision/recall/F1, confusion matrix. No accuracy is claimed as measured — final performance depends on the executed training run (design target: approximately 0.80+ validation kappa, stated as a target, not a result).
| Parameter | Value |
|---|---|
| Input image | Fundus photograph, resized to 224 x 224 x 3 |
| Classes | 5 (0 No DR, 1 Mild, 2 Moderate, 3 Severe, 4 Proliferative DR) |
| Model | EfficientNetB0 backbone + 5-way softmax head (transfer learning) |
| Model parameters | Approximately 5.3 million (architecture design target) |
| Training images | 3,662 (APTOS 2019 labelled set, dataset figure) |
| Validation metric | Quadratic weighted kappa (design target approximately 0.80+, not a measured claim) |
| Training time | Approximately 1-3 hours on a single GPU (expected, dataset-dependent) |
| Inference speed | Approximately 30-60 ms per image on GPU; slower on CPU (expected) |
| Demo | Single-file web app; runs offline after download |
| Medical status | Academic prototype only — not a diagnostic device |
Project features
- [EfficientNetB0 transfer learning] ImageNet-pretrained EfficientNetB0 is fine-tuned on APTOS 2019, with its original classifier replaced by a 5-way softmax head matching the five DR severity grades — full rationale documented for the viva.
- [Complete preprocessing pipeline] Fundus images are resized to 224x224, normalised with ImageNet statistics, and augmented during training (rotation, flips, zoom, brightness jitter) so the model tolerates varied cameras and lighting.
- [Quadratic weighted kappa evaluation] The APTOS competition's official metric, computed on the validation split alongside accuracy, per-class precision/recall and a confusion matrix — no cherry-picked numbers.
- [Class-imbalance handling] APTOS 2019 is heavily skewed toward No-DR images; stratified splits and class-weighted loss keep the rare severe and proliferative cases learnable.
- [Grading web demo] Upload any fundus photograph (or try the built-in samples) and receive the predicted grade with the full 5-class probability distribution and a plain-language explanation of each grade.
- [Grade reference guide] All five severity grades documented with their typical findings — microaneurysms, hemorrhages, hard exudates, venous beading, neovascularization — so the student can defend every prediction in the viva.
- [Referability flag] Grades 2-4 are flagged as referable DR, mirroring how real screening programs triage patients toward ophthalmologists; implemented as transparent demo logic, clearly labelled educational.
What is included
- Complete training & evaluation Jupyter notebook (preprocessing, augmentation, fine-tuning, metrics)
- Fine-tuned EfficientNetB0 weights with inference code
- Grading web demo: upload or sample images, probability distribution, per-grade explanations
- Confusion matrix, per-class metrics and kappa score from the actual training run
- Project report PDF (background, DR staging, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (transfer learning, EfficientNet scaling, kappa, class imbalance, medical-AI limits)
Limitations & prerequisites
- Academic prototype, NOT a diagnostic device: it must never guide real diagnosis or treatment, and it is not a replacement for an ophthalmologist.
- Model quality depends on APTOS 2019's diversity — images from different cameras, populations or capture protocols may grade less reliably.
- APTOS 2019 is heavily skewed toward No-DR images; severe and proliferative cases are rare in the data and harder to learn despite class weighting.
- Blurred, badly illuminated or ungradable fundus photographs degrade predictions; the pipeline assumes gradable-quality input.
- All performance figures are design targets stated before training — the report documents the actual achieved metrics after the run executes.
- Practical training needs a GPU; CPU-only training of this architecture is impractically slow (expected, not measured).
Frequently Asked Questions
Which dataset is used and what are its classes?
APTOS 2019 Blindness Detection, a Kaggle competition by the Asia Pacific Tele-Ophthalmology Society: 3,662 fundus photographs, each rated by a clinician on a 0-4 scale. The classes, verified against the official data description, are 0 No DR, 1 Mild, 2 Moderate, 3 Severe and 4 Proliferative DR.
Why EfficientNetB0?
It gives strong accuracy per parameter through compound scaling of depth, width and resolution, so it fine-tunes well on a few thousand medical images without demanding a large GPU. The report documents this trade-off explicitly, which makes a solid viva discussion.
Is the accuracy guaranteed?
No. Any kappa or accuracy figure is a design target for the training run, stated honestly up front. The notebook evaluates the trained model on a held-out validation split, and the report records whatever the run actually achieves — kappa, confusion matrix and per-class metrics included.
Can it work with a live camera or my own images?
It grades fundus photographs — images taken with a fundus camera or a smartphone fundus adapter. A laptop webcam cannot capture the retina, so that is out of scope. Retraining or recalibrating on images from a different camera is listed as a customization because of domain shift.
What is quadratic weighted kappa and why use it?
It is the APTOS competition's official metric: it rewards predictions close to the true grade and penalises far misses more than near misses, which suits an ordinal 0-4 severity scale far better than plain accuracy.
Is this project suitable for a final-year project?
Yes — for Computer Science, AI & Machine Learning and Biomedical programs. It demonstrates transfer learning, medical-image preprocessing, augmentation design, competition-grade evaluation and honest reporting, with the academic-prototype boundary clearly stated throughout.
Components & software requirements
- Python 3, TensorFlow/Keras
- EfficientNetB0 (ImageNet weights)
- OpenCV, Albumentations (augmentation)
- NumPy, pandas, scikit-learn (metrics)
- Jupyter Notebook (training & evaluation)
- APTOS 2019 Blindness Detection dataset
- HTML/CSS/JavaScript (grading web demo)
- Git
Dataset & model details
- Dataset: APTOS 2019 Blindness Detection — Kaggle competition by the Asia Pacific Tele-Ophthalmology Society; 3,662 clinician-labelled training fundus photographs; 5 severity classes verified against the official data description: 0 No DR, 1 Mild, 2 Moderate, 3 Severe, 4 Proliferative DR.
- Task: 5-class image classification; input = 224x224x3 fundus image, output = probability distribution over the five DR severity grades.
- Model: EfficientNetB0 transfer learning — ImageNet-pretrained MBConv backbone with compound scaling, global average pooling, and a dense 5-way softmax head (approximately 5.3M parameters, architecture design target).
- Metrics: Quadratic weighted kappa (the competition's official metric), accuracy, per-class precision/recall/F1, confusion matrix. No accuracy is claimed as measured — final performance depends on the executed training run (design target: approximately 0.80+ validation kappa, stated as a target, not a result).
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and email — the synopsis PDF downloads immediately. We may send occasional project updates; no spam, unsubscribe anytime.