Computer vision

Retinal disease classifier

Comparing ConvNet architectures for retinal image classification.


I built a classifier for retinal optical coherence tomography (OCT) images using the public Kermany dataset. The project grew from a custom convolutional network into experiments with EfficientNet-inspired scaling and squeeze-and-excitation blocks, and a residual architecture inspired by ResNet.

Custom convolutional model
>93%
EfficientNet-inspired model
>96%
Residual model
>97%

Accuracy reported in the original project presentation on its evaluation data. The lightweight EfficientNet-inspired model used approximately 150,000 parameters.

A retinal OCT scan with a Grad-CAM heatmap highlighting part of the retinal structure.
Grad-CAM from the project, showing areas of high attention for a convolutional model.

Grad-CAM from the project, showing areas of high attention for a convolutional model.

Learning from the errors

The classes were choroidal neovascularization (CNV), diabetic macular edema (DME), drusen and normal retina. I addressed class imbalance with weighting and monitored precision, recall and F1 alongside accuracy. Overfitting was a recurring problem. I experimented with batch size and model complexity, used Optuna for hyperparameter tuning, and implemented ideas from EfficientNet and ResNet. The experiments showed that adding depth was not automatically helpful, and that a small network could perform well.

Inspecting the model

Grad-CAM visualizations helped me inspect which image regions contributed to predictions. Together with the classification metrics, they provided another way to examine model behaviour.

  • TensorFlow
  • Keras
  • Grad-CAM
Next projectUBC-OCEAN Competition