Diabetic retinopathy (DR) is a progressive eye condition that is one of the most common causes of irreversible loss of vision among working-age adults in the global population. The urgent need to scale up automated screening is especially acute in resource-scarce areas, where ophthalmology specialist coverage remains disproportionately low relative to the rapidly growing number of diabetic patients. The present paper involves a systematic, controlled comparison of a Swin Transformer with two convolutional reference architectures, a basic CNN backbone and EfficientNet-B4, on five-class grading of DR severity on the APTOS 2019 fundus dataset, which consists of 3,662 labelled images. All three models are optimised under a strictly unified experimental regime, with the same AdamW optimiser settings, CrossEntropyLoss training objective, data augmentation pipeline, and evaluation process, such that any measured performance disparities can be cleanly attributed to architecture rather than incidental training effects. The Swin Transformer achieves an overall accuracy of 89.1% and a macro-average F1-score of 87.8%, which is approximately 6 percentage points higher than the CNN baseline across all reported metrics. A dedicated ablation study of augmentation further demonstrates that the benefit highly depends on input diversity: the accuracy disparity between transformer and CNN decreases to less than a single percentage point by ablating augmentation, making it a structural requirement of realising the transformer capacity on moderately-sized datasets. Another prediction distribution audit indicates that CNN results are biased towards the prevalent Grade 0 category, whereas the Swin Transformer maintains a well-calibrated distribution across all five DR severity grades. An inference interface written in Gradio is created and published to enable easy deployment in clinical settings without dedicated AI infrastructure. Taken together, these results establish that transformer-based models, with a suitable augmentation strategy, provide a clinically significant and reproducible enhancement in fine-grained DR grading over convolutional baselines, even on dataset scales previously thought inadequate to support attention-based models.
No takes yet. Share an insight, caveat, or question.
Chauhan et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: