Reliability-Aware Comparative Analysis of CNN and Swin Transformer Models for Diabetic Retinopathy Classification
This paper presents a reliability-aware comparative analysis of DenseNet121 and Swin Transformer models for diabetic retinopathy classification under identical conditions, revealing that while the Swin Transformer achieves slightly higher accuracy, the CNN demonstrates superior predictive reliability and confidence, thereby highlighting the critical need to integrate uncertainty estimation and explainability into medical AI systems beyond mere classification performance.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the quiet corners of the human eye, a silent thief often begins its work long before a person notices any change in their vision. This thief is diabetic retinopathy, a condition where high blood sugar slowly damages the delicate blood vessels at the back of the eye. As these vessels weaken, they leak or bleed, creating tiny scars and blockages that, if left unchecked, can lead to permanent blindness. The only way to stop this progression is to find the disease early, while it is still mild and treatable. For decades, doctors have relied on their own eyes and specialized cameras to spot these subtle signs, a process that is slow, demanding, and dependent on human expertise. In recent years, scientists have turned to artificial intelligence to help, teaching computers to look at retinal images and identify the stages of the disease automatically. Two powerful types of computer programs have emerged as the leading candidates for this task: one that learns by scanning images with small, sliding windows, and another that looks at the entire picture at once, weighing how different parts of the image relate to one another.
The question facing researchers is not just which of these programs can spot the disease most often, but which one can be trusted when it makes a mistake. In the high-stakes world of medicine, a computer that is confidently wrong is far more dangerous than one that is unsure. A new study from researchers in Ukraine and Hungary set out to compare these two approaches head-to-head, not just on how often they got the right answer, but on how sure they were of their answers. They took two distinct models—one based on a traditional design known as a convolutional neural network, and another based on a newer, more complex design called a Swin Transformer—and put them through the exact same rigorous training and testing. They fed both models thousands of retinal images, using identical methods to clean the pictures and balance the data, ensuring that neither model had an unfair advantage. The goal was to see if the newer, flashier technology truly offered a better tool for doctors, or if the older, more established method held a hidden strength in reliability.
The results of this careful comparison revealed a surprising twist. The newer Swin Transformer model did indeed perform slightly better at the primary task of classification. When asked to sort the images into five stages of disease severity, it achieved a score of 0.938 on a specific measure of agreement, slightly edging out the traditional model, which scored 0.922. It was also marginally better at identifying the correct stage in general. However, when the researchers looked deeper into how these models made their decisions, the picture changed. The traditional model, while slightly less accurate in its final count, proved to be far more stable and confident in its predictions. It expressed higher average confidence in its answers (0.749) and showed less uncertainty overall. The newer model, by contrast, produced answers that were less certain and more scattered, even when it was correct, maintaining a lower mean confidence level (0.704) than its counterpart.
To understand why this matters, imagine a doctor giving a diagnosis. If a doctor says, "I am 90 percent sure this is severe," and they are right, that is helpful. If they say, "I am 90 percent sure," but they are wrong, the patient might receive unnecessary treatment. The study found that the traditional model was more likely to express high confidence and showed a clearer separation between confident correct predictions and uncertain incorrect ones. The newer model, however, tended to be less consistent, with its confidence distributions overlapping more between correct and incorrect predictions. The researchers developed a new way to measure this balance, combining accuracy with confidence, and found that the traditional model actually scored higher on this measure of overall reliability. This suggests that in medical imaging, being the most accurate at sorting data does not automatically mean being the most reliable partner for a doctor.
The study also looked at how these models "saw" the disease. When the researchers asked the models to show which parts of the eye image were most important for their decision, the two models pointed to different things. The traditional model focused its attention on small, specific spots where the disease signs were visible, like tiny bleeds or blocked vessels. It acted like a specialist zooming in on the problem. The newer model, however, looked at the image more broadly, spreading its attention across large areas of the retina. While this broad view helped it catch the overall pattern slightly better, it also meant it relied on a wider, more diffuse set of clues. The researchers found that when they removed the most important parts of the image, the traditional model's confidence dropped sharply, showing it was truly focused on the disease. The newer model's confidence dropped more slowly, suggesting it was drawing on a wider, perhaps less precise, set of features.
Ultimately, this research does not declare one technology the winner and the other the loser. Instead, it offers a vital lesson for the future of medical artificial intelligence. The study demonstrates that the most accurate algorithm is not always the most trustworthy one. For a system to be truly useful in a hospital, it must not only be good at finding the disease but also good at knowing its own limits. The traditional approach, with its focused attention and steady confidence, showed that sometimes the older methods offer a stability that newer, more complex systems have yet to match. As doctors and scientists continue to build tools to fight blindness, this work suggests that the best path forward may not be to simply chase the highest accuracy numbers, but to build systems that are honest about their certainty, ensuring that every diagnosis given by a computer is one that can be safely trusted.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.