A Patch-Based Attention Framework for Automated Diabetic Retinopathy Severity Grading Using Fundus Images
Abdulnasır Yıldız, Hasan ZanBackground/Objectives: Automated diabetic retinopathy (DR) severity grading from fundus images is a challenging task due to the high resolution of retinal images and the spatially sparse nature of pathological lesions. Methods: In this study, we propose a patch-based attention framework for DR severity grading that exploits localized information while avoiding aggressive global downsampling. Each fundus image is partitioned into non-overlapping patches, which are processed using a shared ResNet-18 encoder to extract patch-level feature representations. An attention-based aggregation mechanism then assigns adaptive importance weights to the extracted features and produces an image-level representation for severity classification. The proposed framework is evaluated on the APTOS 2019 dataset. Results: An analysis of different patch configurations identifies 25 patches as the best-performing setting, achieving a multi-class accuracy of 0.852, compared with 0.817 for the whole-image baseline. A controlled ablation using the same effective input resolution further shows that attention-based aggregation achieves the highest accuracy and F1-score among the evaluated whole-image and patch-based aggregation configurations. The model also achieves a binary DR/No-DR accuracy of 0.986. Attention visualizations provide qualitative insight into the regions contributing to model predictions. Conclusions: These results demonstrate the potential of attention-guided patch-based feature learning for accurate and interpretable diabetic retinopathy severity grading.