Reliability-Aware Comparative Analysis of CNN and Swin Transformer Models for Diabetic Retinopathy Classification

Background: One of the reasons people lose their eyesight is diabetic retinopathy (DR). Convolutional neural networks (CNNs) and Vision Transformers (ViTs), two deep learning techniques, have shown excellent performance in automatic DR categorisation. Nevertheless, comparative studies of these designs are frequently conducted under various experimental conditions and primarily focus on classification accuracy. Moreover, prediction reliability and uncertainty estimation are still not properly investigated. Methods: This paper presents an uncertainty-aware comparative analysis of a DenseNet121-based CNN and a Swin Transformer architecture for DR classification under identical preprocessing, training, and evaluation conditions. Both models were evaluated on the APTOS 2019 dataset using conventional classification metrics, uncertainty-related metrics, the Reliability Score (RS) proposed by the authors, and perturbation-based explainability metrics. Monte Carlo Dropout was applied to estimate predictive uncertainty during inference. Results: The results demonstrated that the Swin Transformer achieved slightly higher classification performance, obtaining a Quadratic Weighted Kappa (QWK) of 0.938 and an F1-score of 0.860, while the CNN model achieved higher confidence (Mean Confidence = 0.749) and more stable and reliable prediction behavior. Explainability analysis additionally revealed differences in attention behavior between the architectures, where the CNN produced more localized explanations focused on lesion-like retinal regions, while the Transformer relied on more spatially distributed attention patterns. Conclusions: The obtained findings demonstrate that higher classification performance does not necessarily correspond to higher predictive reliability in medical image analysis. The study highlights the importance of integrating uncertainty estimation and explainability analysis into deep learning systems for trustworthy diabetic retinopathy diagnosis.

Authors

Institutions

Publication Details

Journal
Research Square
Published
2026-11-25
DOI
https://doi.org/10.21203/rs.3.rs-10131127/v1
Primary Topic
Retinal Imaging and Analysis
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Reliability-Aware Comparative Analysis of CNN and Swin Transformer Models for Diabetic Retinopathy Classification

Márta Seebauer, Nataliia Kuznietsova, Yelizaveta Kabanova
Research Square
Retinal Imaging and Analysis
preprint

Reliability-Aware Comparative Analysis of CNN and Swin Transformer Models for Diabetic Retinopathy Classification

Márta Seebauer, Nataliia Kuznietsova, Yelizaveta Kabanova
preprint en

Abstract

Background: One of the reasons people lose their eyesight is diabetic retinopathy (DR). Convolutional neural networks (CNNs) and Vision Transformers (ViTs), two deep learning techniques, have shown excellent performance in automatic DR categorisation. Nevertheless, comparative studies of these designs are frequently conducted under various experimental conditions and primarily focus on classification accuracy. Moreover, prediction reliability and uncertainty estimation are still not properly investigated. Methods: This paper presents an uncertainty-aware comparative analysis of a DenseNet121-based CNN and a Swin Transformer architecture for DR classification under identical preprocessing, training, and evaluation conditions. Both models were evaluated on the APTOS 2019 dataset using conventional classification metrics, uncertainty-related metrics, the Reliability Score (RS) proposed by the authors, and perturbation-based explainability metrics. Monte Carlo Dropout was applied to estimate predictive uncertainty during inference. Results: The results demonstrated that the Swin Transformer achieved slightly higher classification performance, obtaining a Quadratic Weighted Kappa (QWK) of 0.938 and an F1-score of 0.860, while the CNN model achieved higher confidence (Mean Confidence = 0.749) and more stable and reliable prediction behavior. Explainability analysis additionally revealed differences in attention behavior between the architectures, where the CNN produced more localized explanations focused on lesion-like retinal regions, while the Transformer relied on more spatially distributed attention patterns. Conclusions: The obtained findings demonstrate that higher classification performance does not necessarily correspond to higher predictive reliability in medical image analysis. The study highlights the importance of integrating uncertainty estimation and explainability analysis into deep learning systems for trustworthy diabetic retinopathy diagnosis.

Research Square
Obuda University (HU), National Technical University of Ukraine “Igor Sikorsky Kyiv Polytechnic Institute” (UA)
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