In progress / pendingIndependent projectPyTorch

Teaching a small network to flag diabetic retinopathy on ultra-widefield retinal images

I fine-tuned EfficientNet-B0 on about 200 ultra-widefield fundus images from the DeepDRiD dataset to separate referable diabetic retinopathy from normal eyes. It reached a validation AUC of about 0.78, and its misses taught me more than its hits.

My roleBuilt the model in PyTorch, compared weighted loss with focal loss for class imbalance, analysed the referable cases the model missed, and wrote up the results as a draft manuscript.
~0.78validation AUC
~70%accuracy
~200UWF fundus images
2loss strategies compared
1. Ultra-widefield imagesAbout 200 images from DeepDRiD, labelled normal or referable DR (severity ≥ 2). Far fewer referable cases.
2. PreprocessingResize and normalize; augment with flips, small rotations, brightness and contrast changes.
3. EfficientNet-B0Pretrained on ImageNet, final layer swapped for a two-class head, trained with Adam.Weighted cross-entropy vs focal loss
4. Normal or referable DRScored by accuracy, precision, recall, F1, AUC and the confusion matrix. Recall and AUC mattered most.
Fig. 1. The pipeline I built. Referable DR means disease that should be sent to an eye specialist.

What the model got wrong

The model was good at recognising normal retinas, but it missed a real number of referable cases, calling them normal. In screening that is the worst kind of error, because a missed case can delay treatment and cost vision.

Weighted loss and focal loss each made the model pay a little more attention to the rare class, but neither fixed the sensitivity problem. Going through the misses, I traced them to a few causes:

  • Too few images. With about 200 images the model overfits, and one train/validation split gives unstable numbers.
  • Class imbalance. Referable cases were much rarer than normal ones.
  • Possible patient-level leakage. Images from the same patient may sit in both training and validation, which would inflate results.
  • Shrinking UWF images. Resizing very wide retinal images to a small input can distort structures or erase small peripheral lesions.
  • No explanation map. Without Grad-CAM I cannot show whether the model looks at lesions or at artifacts.

Next steps

Patient-level splits with k-fold cross-validation, more data and external validation, Grad-CAM heat maps, aspect-preserving preprocessing for UWF images, and comparison with ResNet, MobileNet and Vision Transformers.

Lee JW. EfficientNet-B0-based classification of referable diabetic retinopathy using ultra-widefield fundus images. Unpublished manuscript; in progress / pending.

Best model, validation set

AUC
≈ 0.78
Accuracy
≈ 70%

Bars run from 0 to 1. Values are approximate, as reported in the draft.

What I took away

A single accuracy number hides the errors that matter. I learned to read a confusion matrix case by case and to ask what a miss would mean for a patient, which is the same question I now bring to my psychology research.

Other projects

All research by Jong Won Lee