An Explainable Multi-Scale Attention-Based Deep Learning Framework for Trustworthy Diabetic Retinopathy Detection Using Enhanced Fundus Images

CNN Framework for Automated Diabetic Retinopathy Diagnosis

Abstract

Diabetic Retinopathy (DR) is a microvascular complication caused by prolonged hyperglycaemia that damages the retinal capillary network, putting people with diabetes at risk. Damage to these tiny vessels increases vascular permeability and results in microaneurysms, hemorrhages, and hard exudates. If left untreated, progression may lead to irreversible vision loss. Early detection and timely treatment substantially reduce the risk of blindness. Current clinical diagnosis relies on ophthalmologist assessment, which results in diagnostic delays and inter-observer variability. Inter-class similarity and intra-class variability in Fundus Images (FIs), due to heterogeneity in lesion morphology, retinal pigmentation, and imaging protocols, yields diagnostic ambiguity. Conventional Deep Learning (DL)-based frameworks act as black boxes, yielding high predictive accuracy but lacking interpretable evidence of the image features about their decisions, thereby limiting clinician trust and clinical adoption. To mitigate these limitations, we propose an explainable DL-based mechanism that classifies FIs into different DR severity grades. This study presents a heterogeneous feature-extraction method inspired by residual and inception networks, combined with attention mechanism to learn disease specific features, so that the model focuses on the most relevant patterns. Residual skip connections and multi-scale inception style branches, in combination with features refinement, helps classifying lesion severity with high precision. The proposed framework begins with segmentation of FIs to extract Regions of Interests (ROIs), followed by Channel-wise Contrast Limited Adaptive Histogram Equalization (C-CLAHE) combined with Difference of Gaussian (DoG) filtering, optimizing the color channels independently and standardizing contrast to highlight fine-grained retinal structures. Geometric minority oversampling is employed to ensure balanced representation of all severity categories during training. Proposed framework incorporates Swish activation to enhance gradient propagation and employs the class-aware focal loss formulation to mitigate class imbalance issue, emphasizing hard examples. Experimental results on the IDRiD and APTOS2019 combined test-set demonstrate that the proposed model achieves screening (healthy/diseased) and lesion-severity (mild/moderate/severe/proliferative) classification accuracies of 99.27% and 75.90%, respectively. Although, discriminating the four DR stages pose challenges like severe imbalance and inter-class differences among classes, which are better aided by proposed framework. On the DDR benchmark, the model achieves comprehensive DR-grading accuracy of 80.76% on 5-class classification task. The Heterogeneous Attention Residual-Inception Convolutional Network (HARIC-Net) outperforms several state-of-the-art (SOTA) DL-based architectures, including AlexNet, ResNet, DenseNet and Inception Net, along with recent domain specific hybrids in DR-grading task. HARIC-Net’s parameter counts of ~2 million underscores its computational efficiency and robust generalization capability. Gradient-weighted Class Activation Mapping (Grad-CAM), an Explainable Artificial Intelligence (XAI) technique, is used to visualize class-discriminative regions, and to provide interpretable predictions.

Author Biographies

  • Muhammad Nabeel Mehmood, Faculty of Computing, Riphah International University, Islamabad
    Muhammad Nabeel Mehmood is a computer science researcher specializing in computer vision, machine learning, and artificial intelligence. He is currently a Teaching Fellow in the Faculty of Computing at Riphah International University, Islamabad. His research focuses on the application of intelligent systems to real-world challenges, particularly in healthcare technologies. He is actively involved in interdisciplinary research and is committed to developing adaptive, AI-driven solutions that address critical societal needs.
  • Muhammad Hassaan Ashraf, Riphah International University Islamabad.
    Muhammad Hassaan Ashraf is a computer science researcher and educator specializing in computer vision, machine learning, and artificial intelligence. He earned his BS and MS degrees in Computer Science from COMSATS University Islamabad, where he also contributed as a Research Associate. Over the years, he has contributed to academia through various teaching and research roles, including positions at Abasyn University and COMSATS University Islamabad. Currently, he serves as a Lecturer at Riphah International University, where he teaches core subjects such as artificial intelligence, machine learning, and computer vision at both undergraduate and graduate levels. His research focuses on solving real-world problems using intelligent systems, with applications in healthcare technologies and intelligent transportation systems. He is actively engaged in interdisciplinary research and aims to develop adaptive, AI-driven solutions that address societal challenges. Through his teaching and research, he continues to inspire innovation and promote academic excellence in the field of computer science.

References

[1] N. Salamat, M. M. S. Missen, and A. Rashid, “Diabetic retinopathy techniques in retinal images: A review,” Artif. Intell. Med., vol. 97, pp. 168–188, 2019, doi: https://doi.org/10.1016/j.artmed.2018.10.009.

[2] M. Nahiduzzaman et al., “Diabetic retinopathy identification using parallel convolutional neural network-based feature extractor and ELM classifier,” Expert Syst. Appl., vol. 217, May 2023, doi: 10.1016/j.eswa.2023.119557.

[3] World Health Organization (WHO), “Diabetes.”

[4] P. Lanzetta et al., “Fundamental principles of an effective diabetic retinopathy screening program,” Acta Diabetol., vol. 57, no. 7, pp. 785–798, Dec. 2020, doi: 10.1007/S00592-020-01506-8/TABLES/2.

[5] M. Mateen, T. S. Malik, S. Hayat, M. Hameed, S. Sun, and J. Wen, “Deep Learning Approach for Automatic Microaneurysms Detection,” Sensors, vol. 22, no. 2, Jan. 2022, doi: 10.3390/s22020542.

[6] S. Wang et al., “Diabetic Retinopathy Diagnosis Using Multichannel Generative Adversarial Network with Semisupervision,” IEEE Transactions on Automation Science and Engineering, vol. 18, no. 2, pp. 574–585, Dec. 2021, doi: 10.1109/TASE.2020.2981637.

[7] D. A. da Rocha, F. M. F. Ferreira, and Z. M. A. Peixoto, “Diabetic retinopathy classification using VGG16 neural network,” Research on Biomedical Engineering, vol. 38, no. 2, pp. 761–772, Dec. 2022, doi: 10.1007/S42600-022-00200-8/TABLES/6.

[8] B. Menaouer, Z. Dermane, N. E. H. Kebir, and N. Matta, “Diabetic Retinopathy Classification Using Hybrid Deep Learning Approach,” SN Comput. Sci., vol. 3, no. 5, Dec. 2022, doi: 10.1007/S42979-022-01240-8.

[9] J. R, V. Sivasubramanian, J. Prakash, and V. M, “Detection of Diabetic Retinopathy Using Convolutional Neural Networks,” ECS Trans., vol. 107, no. 1, pp. 13321–13328, Dec. 2022, doi: 10.1149/10701.13321ECST/XML.

[10] V. Vives-Boix and D. Ruiz-Fernández, “Diabetic retinopathy detection through convolutional neural networks with synaptic metaplasticity,” Comput. Methods Programs Biomed., vol. 206, p. 106094, Dec. 2021, doi: 10.1016/J.CMPB.2021.106094.

[11] M. H. Ashraf, F. Jabeen, H. Alghamdi, M. S. Zia, and M. S. Almutairi, “HVD-Net: A Hybrid Vehicle Detection Network for Vision-Based Vehicle Tracking and Speed Estimation,” Journal of King Saud University - Computer and Information Sciences, vol. 35, no. 8, p. 101657, Dec. 2023, doi: 10.1016/J.JKSUCI.2023.101657.

[12] M. H. Ashraf, M. Ahmed, M. N. Mehmood, M. E. Qureshi, and H. Alghamdi, “MSHFF-Net: An Explainable Multi-Scale Hierarchical Feature Fusion CNN for Breast Cancer Diagnosis from Histopathological Images,” in 2025 27th International Multitopic Conference (INMIC), Islamabad: IEEE, Jan. 2026, pp. 1–6.

[13] M. E. Qureshi, M. H. Ashraf, M. W. Arshad, A. Khan, H. Ali, and Z. U. Abdeen, “Hierarchical Feature Fusion With Inception V3 for Multiclass Plant Disease Classification,” Informatica, vol. 49, no. 27, Jul. 2025, doi: 10.31449/inf.v49i27.8208.

[14] N. Gharaibeh, O. M. Al-Hazaimeh, A. Abu-Ein, and K. M. O. Nahar, “A Hybrid SVM NAÏVE-BAYES Classifier for Bright Lesions Recognition in Eye Fundus Images,” International Journal on Electrical Engineering and Informatics, vol. 13, no. 3, 2021, doi: 10.15676/ijeei.2021.13.3.2.

[15] M. K. Yaqoob, S. F. Ali, M. Bilal, M. S. Hanif, and U. M. Al-Saggaf, “ResNet Based Deep Features and Random Forest Classifier for Diabetic Retinopathy Detection,” Sensors 2021, Vol. 21, Page 3883, vol. 21, no. 11, p. 3883, Dec. 2021, doi: 10.3390/S21113883.

[16] N. Asiri, M. Hussain, F. Al Adel, and N. Alzaidi, “Deep learning-based computer-aided diagnosis systems for diabetic retinopathy: A survey,” Artif. Intell. Med., vol. 99, p. 101701, Dec. 2019, doi: 10.1016/J.ARTMED.2019.07.009.

[17] F. Li et al., “Deep learning-based automated detection for diabetic retinopathy and diabetic macular oedema in retinal fundus photographs,” Eye 2021 36:7, vol. 36, no. 7, pp. 1433–1441, Dec. 2021, doi: 10.1038/s41433-021-01552-8.

[18] K. Simonyan and A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,” 3rd International Conference on Learning Representations, ICLR 2015 - Conference Track Proceedings, Dec. 2014, [Online]. Available: https://arxiv.org/abs/1409.1556v6

[19] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna, “Rethinking the Inception Architecture for Computer Vision,” 2016.

[20] G. Huang, Z. Liu, L. van der Maaten, and K. Q. Weinberger, “Densely Connected Convolutional Networks,” 2017. [Online]. Available: https://github.com/liuzhuang13/DenseNet.

[21] K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” 2016. [Online]. Available: http://image-net.org/challenges/LSVRC/2015/

[22] M. H. Ashraf et al., “HIRD-Net: An Explainable CNN-Based Framework with Attention Mechanism for Diabetic Retinopathy Diagnosis Using CLAHE-D-DoG Enhanced Fundus Images,” 2025, doi: 10.3390/xxxxx.

[23] M. N. Hasan, M. E. R. Pial, S. Das, N. Siddique, and H. Wang, “DIA-VXNET: A framework for automated diabetic eye disease detection using transfer learning with feature fusion network,” Biomed. Signal Process. Control, vol. 100, Aug. 2025, doi: 10.1016/j.bspc.2024.106907.

[24] R. Vij and S. Arora, “Modified deep inductive transfer learning diagnostic systems for diabetic retinopathy severity levels classification,” Biomed. Signal Process. Control, vol. 99, Aug. 2025, doi: 10.1016/j.bspc.2024.106885.

[25] M. H. Ashraf, M. E. Qureshi, A. Khan, and M. Ahmed, “DRD-Net: Diabetic Retinopathy Diagnosis Using A Hybrid Convolutional Neural Network,” International Journal on Robotics, Automation and Sciences, vol. 7, no. 2, p. 96, 2025, doi: 10.33093/ijoras.2025.7.2.9.

[26] A. Bin Ahmed and M. N. Mehmood, “Forecasting Solar Project Capacity Trends Using Predictive AI: A Policy-Oriented Analysis of Urban vs. Rural Solar Deployment,” in Proceedings of the Sixth International Conference on Digital Age & Technological Advances for Sustainable Development, New York, NY, USA: ACM, May 2025, pp. 66–73. doi: 10.1145/3747897.3747909.

[27] M. H. Ashraf and H. Alghamdi, “HFF-Net: A hybrid convolutional neural network for diabetic retinopathy screening and grading,” Biomedical Technology, vol. 8, pp. 50–64, Dec. 2024, doi: 10.1016/J.BMT.2024.09.004.

[28] F. M. J. M. Shamrat et al., “An advanced deep neural network for fundus image analysis and enhancing diabetic retinopathy detection,” Healthcare Analytics, vol. 5, Sep. 2024, doi: 10.1016/j.health.2024.100303.

[29] M. Herrero-Tudela, R. Romero-Oraá, R. Hornero, G. C. G. Tobal, M. I. López, and M. García, “An explainable deep-learning model reveals clinical clues in diabetic retinopathy through SHAP,” Biomed. Signal Process. Control, vol. 102, Sep. 2025, doi: 10.1016/j.bspc.2024.107328.

[30] P. Venkatasubbu, A. V. Shreyas Madhav, K. Prakash, R. Rajaraman, and L. Bhaskara Rao, “Interpretable deep automation system for graded diagnosis of diabetic retinopathy,” Biomed. Signal Process. Control, vol. 112, Feb. 2026, doi: 10.1016/j.bspc.2025.108490.

[31] S. J. SIDIQ and T. BENIL, “A lightweight transfer learning-based ensemble approach for diabetic retinopathy detection,” International Journal of Information Management Data Insights, vol. 5, no. 2, Dec. 2025, doi: 10.1016/j.jjimei.2025.100372.

[32] N. M. Suganthi and M. Arun, “Diabetic retinopathy grading using curvelet CNN with optimized SSO activations and wavelet-based image enhancement,” Ain Shams Engineering Journal, vol. 16, no. 1, Aug. 2025, doi: 10.1016/j.asej.2024.103239.

[33] K. Ashwini and R. Dash, “Improving Diabetic Retinopathy grading using Feature Fusion for limited data samples,” Computers and Electrical Engineering, vol. 120, Dec. 2024, doi: 10.1016/j.compeleceng.2024.109782.

[34] D. B. Soomro et al., “Automated dual CNN-based feature extraction with SMOTE for imbalanced diabetic retinopathy classification,” Image Vis. Comput., vol. 159, Aug. 2025, doi: 10.1016/j.imavis.2025.105537.

[35] S. Madarapu, S. Ari, and K. Mahapatra, “A multi-resolution convolutional attention network for efficient diabetic retinopathy classification,” Computers and Electrical Engineering, vol. 117, Jul. 2024, doi: 10.1016/j.compeleceng.2024.109243.

[36] A. K. Singh, S. Madarapu, and S. Ari, “Diabetic retinopathy grading based on multi-scale residual network and cross-attention module,” Digital Signal Processing: A Review Journal, vol. 157, Feb. 2025, doi: 10.1016/j.dsp.2024.104888.

[37] S. E. Abraham and B. C. Kovoor, “Dual-stage dynamic hierarchical attention framework for saliency-aware explainable diabetic retinopathy grading,” Eng. Appl. Artif. Intell., vol. 148, May 2025, doi: 10.1016/j.engappai.2025.110364.

[38] R. D S and K. S. Saji, “Hybrid deep learning framework for diabetic retinopathy classification with optimized attention AlexNet,” Comput. Biol. Med., vol. 190, May 2025, doi: 10.1016/j.compbiomed.2025.110054.

[39] P. Porwal et al., “Indian Diabetic Retinopathy Image Dataset (IDRiD): A Database for Diabetic Retinopathy Screening Research,” 2018, doi: 10.21227/H25W98.

[40] S. D. K. Maggie, “APTOS 2019 Blindness Detection,” 2019, Kaggle. [Online]. Available: https://kaggle.com/competitions/aptos2019-blindness-detection

[41] T. Li, Y. Gao, K. Wang, S. Guo, H. Liu, and H. Kang, “Diagnostic assessment of deep learning algorithms for diabetic retinopathy screening,” Inf. Sci. (N. Y)., vol. 501, pp. 511–522, Oct. 2019, doi: 10.1016/j.ins.2019.06.011.

[42] T. A. Soomro et al., “Impact of novel image preprocessing techniques on retinal vessel segmentation,” Electronics (Switzerland), vol. 10, no. 18, Sep. 2021, doi: 10.3390/electronics10182297.

[43] P. Ramachandran, B. Zoph, and Q. V. Le, “Searching for Activation Functions,” Oct. 2017, [Online]. Available: http://arxiv.org/abs/1710.05941

[44] M. H. Ashraf, F. Jabeen, M. Waqar, and A. Kim, “HFA-Net: Explainable Multi-Scale Deep Learning Framework for Illumination-Invariant Plant Disease Diagnosis in Precision Agriculture,” Sensors, vol. 26, no. 7, Apr. 2026, doi: 10.3390/s26072067.

Authors

  • Muhammad Nabeel Mehmood Faculty of Computing, Riphah International University, Islamabad https://orcid.org/0009-0006-1204-8978
  • Muhammad Hassaan Ashraf Riphah International University Islamabad.

DOI:

https://doi.org/10.31449/inf.v50i14.14054

Keywords:

Artificial Intelligence, Computer-Aided Diagnosis, Diabetic Retinopathy Classification, Fundus Image Analysis, Deep Learning in Medical Imaging, Explainable Artificial Intelligence (XAI), Attention-Based Convolutional Neural Networks, Multi-Scale Feature Extraction, Retinal Lesion Detection, Automated Disease Grading, Residual Inception Connection, CLAHE, Swish Activation Function, Grad-CAM

Downloads

Published

08/06/2026

How to Cite

Mehmood, M. N., & Ashraf, M. H. (2026). An Explainable Multi-Scale Attention-Based Deep Learning Framework for Trustworthy Diabetic Retinopathy Detection Using Enhanced Fundus Images: CNN Framework for Automated Diabetic Retinopathy Diagnosis. Informatica, 50(14). https://doi.org/10.31449/inf.v50i14.14054