Automated Diabetic Retinopathy Classification Using Swin Transformer: A Comparative Study with CNN-Based Approaches

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.

Authors

Institutions

Publication Details

Journal
Revolutionary Advances in Computing and Electronics An International Journal
Published
2026-10-30
DOI
https://doi.org/10.65890/race.v2i3.230
Primary Topic
Retinal Imaging and Analysis
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Automated Diabetic Retinopathy Classification Using Swin Transformer: A Comparative Study with CNN-Based Approaches

Manu Chauhan, Sarika Agarwal, Mohammad Aaftab
4 links
Revolutionary Advances in Computing and Electronics An International Journal
Retinal Imaging and Analysis
article

Automated Diabetic Retinopathy Classification Using Swin Transformer: A Comparative Study with CNN-Based Approaches

Manu Chauhan, Sarika Agarwal, Mohammad Aaftab
article en

Abstract

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.

Revolutionary Advances in Computing and Electronics An International JournalVol. 2(3)
Noida Institute of Engineering and Technology (IN)
Good health and well-being
Openalex Percentile: Top 13%
Retinal Imaging and Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon