Manuscript Offprint

arXiv:2610.35961

Knowledge distillation across teacher architectures for compact diabetic retinopathy grading

Mossa Manisa, Habiba Jahan Priya, A. K. M. Fakhrul Hossain

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Diabetic retinopathy grading from retinal fundus photographs is important but difficult to deploy on resource-constrained hardware. We conducted a controlled study of offline response-based knowledge distillation for five-class diabetic retinopathy grading on APTOS 2019, comparing ResNet-50, MobileNetV3-Large, and Swin Transformer-Tiny (Swin-T) teachers distilled into a MobileNetV3-Small student. A 3×4×23 \times 4 \times 2 grid of teacher, temperature, and hard-label weight was screened at one seed, while six configurations and the no-distillation baseline were evaluated across three seeds. The highest observed single-seed quadratic weighted kappa was 0.9093 (macro-F1 0.6851) for Swin-T at temperature 4 and hard-label weight 0.7; the corresponding three-seed mean was 0.9024, compared with 0.8804 for the baseline. The student used 1.52 M parameters and 5.94 MB, representing an 18.07×18.07 \times parameter reduction relative to Swin-T. Temperature and hard-label weight effects were teacher- and configuration-dependent, while small performance differences were sensitive to random seed. Knowledge distillation produced a compact student with competitive performance under the evaluated protocol, but independent external validation remains necessary.

Keywords diabetic retinopathy · knowledge distillation · model compression · fundus image classification · quadratic weighted kappa

1 Introduction

Diabetic retinopathy (DR) is one of the leading causes of preventable visual impairment worldwide, affecting an estimated one-third of all individuals with diabetes mellitus [1]. DR is clinically classified into five severity levels such as No DR, Mild, Moderate, Severe, and Proliferative DR [2] and early detection and appropriate management are important for preventing vision-threatening progression [3]. Retinal fundus photography offers a non-invasive and scalable screening modality, and deep-learning models trained on large fundus-image datasets have demonstrated diagnostic precision similar to that of specialist ophthalmologists [4,5].

Despite this promise, deploying high-capacity architectures such as ResNet-50 [6] and Swin Transformer [7] on resource-constrained devices remains challenging due to their relatively high computational and memory requirements. This limitation is particularly relevant for community and remote screening, where AI systems may need to operate on mobile or edge devices with limited processing power and connectivity [8]. Lightweight convolutional networks, including the MobileNetV3 family, offer a practical alternative for resource-constrained deployment [9]. However, their reduced model capacity can introduce an accuracy–efficiency trade-off; in a recent diabetic retinopathy study, MobileNetV3 variants achieved lower classification accuracy than ResNet-50 while using substantially fewer parameters and providing considerably higher inference speed [10].

Knowledge distillation (KD) provides a principled approach for transferring knowledge from high-capacity models to more compact networks. In conventional offline KD, a high-capacity teacher network is first trained, after which a compact student is optimised using both the teacher's temperature-scaled soft predictions and the ground-truth labels. The resulting soft targets provide information about inter-class similarities that is absent from one-hot supervision, offering additional supervisory signals that can regularise student training [11]. While the effectiveness of KD for general image classification has been extensively demonstrated [11, 12], its effectiveness can vary with the target task and teacher–student configuration. In particular, the application of KD to ordinal diabetic retinopathy grading, where neighbouring severity levels have meaningful clinical relationships, remains comparatively less explored.

In this paper, we address three concrete questions. First, how does the choice of teacher architecture, spanning a classical convolutional neural network (CNN) (ResNet-50), a lightweight CNN (MobileNetV3-Large), and a hierarchical vision transformer (Swin Transformer-Tiny, Swin-T), affect the quality of knowledge transferred to a fixed MobileNetV3-Small student? Second, how sensitive is distillation performance to the softening temperature T and the hard-label weighting α\alpha for each teacher–student pair, and can a single optimal temperature–weighting combination be recommended across all pairings? Third, does distillation yield clinically meaningful per-class improvements, particularly for the minority and ambiguous severity grades?

To answer these questions, we train and evaluate all teacher–student combinations on the APTOS 2019 Blindness Detection dataset under a unified experimental protocol. We conduct a temperature ablation over T∈{2,3,4,5}T \in \{2, 3, 4, 5\} for each pairing and additionally evaluate the effect of the hard-label weighting α\alpha across selected configurations. Our main findings are as follows:

• Overall KD performance. Across the three teacher architectures and four distillation temperatures, eight of the twelve single-seed KD configurations outperform the MobileNetV3-Small baseline. ResNet-50 and MobileNetV3-Large provide the most consistent improvements, while Swin-T achieves the highest single-run quadratic weighted kappa (QWK) of 0.9093 at T=4, α=0.7\alpha=0.7, with a macro-F1 of 0.6851.

• Sensitivity to distillation hyperparameters. KD performance varies substantially with both temperature T and hard-label weighting α\alpha, with the optimal temperature differing across teacher architectures: T=2 for MobileNetV3-Large, T=4 for Swin-T, and T=5 for ResNet-50. The α\alpha ablation similarly shows configuration-dependent effects, with α=0.3\alpha=0.3 favoured at the tested temperature extremes and α=0.7\alpha=0.7 generally favoured at T=4.

• Deployment efficiency. The distilled MobileNetV3-Small retains a compact 5.94 MB model footprint. This combination of competitive predictive performance and low computational overhead supports the feasibility of deploying the model for resource-constrained or mobile DR screening.

References (32)

  • Diabetes Care, 35(3):556–564, 2012
  • Ophthalmology, 110(9):1677–1682, 2003
  • Prevention of blindness by screening for diabetic retinopathy: A quantitative assessment
  • Development and validation of a deep learning algorithm for detection of diabetic retinopathy in retinal fundus photographs
  • Automated detection of diabetic retinopathy using deep learning
  • Deep residual learning for image recognition
  • Swin transformer: Hierarchical vision transformer using shifted windows
  • Mobile-ready automated triage of diabetic retinopathy using digital fundus images
  • A dual attention and multi-scale fusion network for diabetic retinopathy image analysis
  • Distilling the Knowledge in a Neural Network
  • Knowledge distillation: A good teacher is patient and consistent
  • DREAM: Diabetic retinopathy analysis using machine learning
  • Mrinal Haloi. Improved microaneurysm detection using deep neural networks. arXiv preprint arXiv:1505.04424, 2015. (opens arXiv in a new tab)
  • Convolutional neural networks for diabetic retinopathy
  • Improved automated detection of diabetic retinopathy on a publicly available dataset through integration of deep learning
  • Applying artificial intelligence to disease staging: Deep learning for improved staging of diabetic retinopathy
  • JAMA, 318(22):2211–2223, 2017
  • An ensemble deep learning based approach for red lesion detection in fundus images
  • Diabetic retinopathy detection via deep convolutional networks for discriminative localization and visual explanation
  • FitNets: Hints for thin deep nets (opens arXiv in a new tab)
  • Paying More Attention to Attention: Improving the Performance of Convolutional Neural Networks via Attention Transfer
  • Relational knowledge distillation
  • Contrastive representation distillation (opens arXiv in a new tab)
  • Training data-efficient image transformers & distillation through attention
  • Classification of diabetic retinopathy using unlabeled data and knowledge distillation
  • Computer-aided diagnosis of diabetic retinopathy lesions based on knowledge distillation in fundus images
  • Mehedi Hasan Jony, Emam Hasan, Sunny Sutradhar, Atikur Rahman, and Md
  • Enhancing diabetic retinopathy detection through transformer based knowledge distillation and explainable AI. In 2024 International Joint Conference on Neural Networks (IJCNN), pages 1–8, Yokohama, Japan, 2024
  • Knowledge distillation-based lightweight MobileNet model for diabetic retinopathy classification
  • Lesion-aware knowledge distillation for diabetic retinopathy lesion segmentation
  • Decoupled Weight Decay Regularization
  • AI-driven detection and classification of diabetic retinopathy stages using EfficientNetB0