Skip to content
scopal affairs, foyer

APTOS Retinopathy Detection

A Kaggle experiment classifying retinal images into five grades of diabetic retinopathy. DenseNet and mixup handle a dataset with uneven image quality; quadratic weighted kappa measures agreement with the labels.

Posted on

Retina Fundus by Frank Wood on Wikipedia with moderate retinopathy symptoms
APTOS Retinopathy Detection

Entry in the Kaggle code competition APTOS 2019 Blindness Detection of the Asia Pacific Tele-Ophthalmology Society. The task: grade retinal fundus images by the severity of diabetic retinopathy (0 no retinopathy, 1 mild, 2 moderate, 3 severe, 4 proliferative) to support early detection and prevent vision loss.

Images of Retina findings for training a classifier

Training images with retina findings.

Data

The images come from several clinics, were taken with different cameras over a long period and contain artifacts, blur, and under- or overexposure. The labels are noisy as well.

Approach

  • Model: DenseNet-121 with pre-trained weights; first only the last layers are trained, then all layers.
  • Regularization: mixup (Zhang et al.), which trains on convex combinations of pairs of images and labels, plus image augmentation with imgaug.
  • Metric: quadratic weighted kappa (QWK), the agreement between the human rating and the prediction, from 0 for chance agreement to 1 for complete agreement. It is evaluated after every epoch, and the best checkpoint is kept.
  • Prediction: average over four flipped versions of each image.
  • Setup: Keras, GPU, based on the Kaggle Docker image. Kernel

Result

Leaderboard rank Score (QWK)
1089 0.903

Kernel run: private score 0.872, public score 0.721; run time 23,810 seconds on GPU.

Image viewer