Quantifying Confidence in Diabetic Retinopathy Diagnosis: A Comparative XAI Study of Deep Learning and Bayesian Neural Networks

Authors

  • Muhammad Shahan Ibad Center of Excellence in IT, Institute of Management Sciences (IMSciences), Peshawar, Pakistan
  • Syed Noor Hussain Shah Center of Excellence in IT, Institute of Management Sciences (IMSciences), Peshawar, Pakistan
  • Ali Haider Center of Excellence in IT, Institute of Management Sciences (IMSciences), Peshawar, Pakistan
  • Mehran Zaman Center of Excellence in IT, Institute of Management Sciences (IMSciences), Peshawar, Pakistan
  • Tanzeel Iqbal Center of Excellence in IT, Institute of Management Sciences (IMSciences), Peshawar, Pakistan
  • Muhammad Umais Center of Excellence in IT, Institute of Management Sciences (IMSciences), Peshawar, Pakistan

Keywords:

Diabetic Retinopathy, Deep Learning, Quantified Uncertainty, Explainable Artificial Intelligence (XAI), Bayesian Neural Network

Abstract

Diabetic Retinopathy remains the primary microvascular complication of diabetes and a leading cause of irreversible blindness globally. While deep learning models offer high diagnostic accuracy, their widespread clinical integration is profoundly limited by two fundamental, unresolved deficiencies in previous literature: the absence of comprehensive, fair comparative analysis across diverse architectures and the pervasive lack of transparent, quantifiable prediction confidence necessary for clinical acceptance. This study directly addresses these challenges by presenting a highly optimized and rigorous comparative evaluation of three powerful models: the high-capacity EfficientNetB0, the computationally efficient MobileNetV3Small, and a novel Custom Bayesian Neural Network (BNN) framework. Through robust methodology, all models achieved exceptional generalization, stabilizing with impressive final F1-Score > 0.91. The Custom BNN demonstrated clear superiority as the most reliable diagnostic tool, securing the highest Accuracy 0.9294 and F1-score 0.9289 on the objective test set. Most significantly, this work delivers a breakthrough in safety assurance by integrating sophisticated Explainable AI (XAI) and probabilistic modeling: Grad-CAM and Local Interpretable Model-agnostic Explanations (LIME) confirmed anatomically grounded decision-making, while the BNN uniquely provides quantifiable uncertainty metrics, offering a crucial 95% confidence interval (CI) for every diagnosis. These results validate a new generation of high-performance models, led by a transparent BNN architecture, that are ready for implementation to deliver reliable, trusted, and efficient Diabetic Retinopathy screening solutions worldwide.

References

M. A. Atkinson, G. S. Eisenbarth, and A. W. Michels, “Type 1 diabetes,” Lancet (London, England), vol. 383, no. 9911, pp. 69–82, 2014, doi: 10.1016/S0140-6736(13)60591-7.

R. A. DeFronzo et al., “Type 2 diabetes mellitus,” Nat. Rev. Dis. Prim. 2015 11, vol. 1, no. 1, pp. 15019-, Jul. 2015, doi: 10.1038/nrdp.2015.19.

K. B. Nielsen, M. L. Lautrup, J. K. H. Andersen, T. R. Savarimuthu, and J. Grauslund, “Deep Learning-Based Algorithms in Screening of Diabetic Retinopathy: A Systematic Review of Diagnostic Performance,” Ophthalmol. Retin., vol. 3, no. 4, pp. 294–304, Apr. 2019, doi: 10.1016/J.ORET.2018.10.014.

M. W. Nadeem, H. G. Goh, M. Hussain, S. Y. Liew, I. Andonovic, and M. A. Khan, “Deep Learning for Diabetic Retinopathy Analysis: A Review, Research Challenges, and Future Directions,” Sensors 2022, Vol. 22, Page 6780, vol. 22, no. 18, p. 6780, Sep. 2022, doi: 10.3390/S22186780.

Q. H. Nguyen et al., “Diabetic retinopathy detection using deep learning,” ACM Int. Conf. Proceeding Ser., pp. 103–107, Jan. 2020, doi: 10.1145/3380688.3380709.

G. Huo, “Deep Learning Models for Diabetic Retinopathy Detection: A Review of CNN and Transformer-Based Approaches,” 2025, doi: 10.5220/0013533700004619.

T. Karkera, C. Adak, S. Chattopadhyay, and M. Saqib, “Detecting severity of Diabetic Retinopathy from fundus images: A transformer network-based review,” Neurocomputing, vol. 597, Sep. 2024, doi: 10.1016/j.neucom.2024.127991.

W. Gong, Y. Pu, T. Ning, Y. Zhu, G. Mu, and J. Li, “Deep learning for enhanced prediction of diabetic retinopathy: a comparative study on the diabetes complications data set,” Front. Med., vol. 12, p. 1591832, Jun. 2025, doi: 10.3389/FMED.2025.1591832/BIBTEX.

S. Toledo-Cortés, M. de la Pava, O. Perdomo, and F. A. González, “Hybrid Deep Learning Gaussian Process for Diabetic Retinopathy Diagnosis and Uncertainty Quantification,” Lect. Notes Comput. Sci. (including Subser. Lect. Notes Artif. Intell. Lect. Notes Bioinformatics), vol. 12069 LNCS, pp. 206–215, Jul. 2020, doi: 10.1007/978-3-030-63419-3_21.

M. S. H. Talukder, A. K. Sarkar, S. Akter, and M. Nuhi-Alamin, “An Improved Model for Diabetic Retinopathy Detection by using Transfer Learning and Ensemble Learning,” Jun. 2023, Accessed: Dec. 09, 2025. [Online]. Available: https://arxiv.org/pdf/2308.05178

S. Shekar, N. Satpute, and A. Gupta, “Review on diabetic retinopathy with deep learning methods,” J. Med. imaging (Bellingham, Wash.), vol. 8, no. 6, p. 060901, Nov. 2021, doi: 10.1117/1.JMI.8.6.060901.

“Diabetes Facts and Figures | International Diabetes Federation.” Accessed: Dec. 09, 2025. [Online]. Available: https://idf.org/about-diabetes/diabetes-facts-figures/

“Diabetes.” Accessed: Dec. 09, 2025. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/diabetes

“Methods for the National Diabetes Statistics Report | Diabetes | CDC.” Accessed: Dec. 10, 2025. [Online]. Available: https://www.cdc.gov/diabetes/php/data-research/methods.html

J. W. Y. Yau et al., “Global prevalence and major risk factors of diabetic retinopathy,” Diabetes Care, vol. 35, no. 3, pp. 556–564, Mar. 2012, doi: 10.2337/DC11-1909.

Z. L. Teo et al., “Global Prevalence of Diabetic Retinopathy and Projection of Burden through 2045: Systematic Review and Meta-analysis,” Ophthalmology, vol. 128, no. 11, pp. 1580–1591, Nov. 2021, doi: 10.1016/j.ophtha.2021.04.027.

W. U. Memon, Z. Jadoon, U. Qidwai, S. Naz, S. Dawar, and H. Pak, “Prevalence of Diabetic Retinopathy in Patients of Age Group 30 Years and Above Attending Multicentre Diabetic Clinics in Karachi,” Pakistan J. Ophthalmol., vol. 28, no. 2, 2012, doi: 10.36351/PJO.V28I2.435.

K. Talat, S. H. Mahmud, M. F. Ikram, S. Bano, T. Munawar, and A. Rafeh, “CORRELATION OF HBA1C LEVEL WITH DIABETIC RETINOPATHY,” J. Ayub Med. Coll. Abbottabad, vol. 37, no. 1, pp. 106–110, Mar. 2025, doi: 10.55519/JAMC-01-13925.

M. Asif, F. Noman, S. Karim, and J. Rasul, “Association of Severity of Diabetic Retinopathy with HbA1c Level.,” Ophthalmol. Pakistan, vol. 14, no. 3, pp. 79–83, Jun. 2024, doi: 10.62276/OPHTHALMOLPAK.14.03.158.

A. Y. Khapchaev, O. A. Antonova, O. A. Kazakova, M. V. Samsonov, A. V. Vorotnikov, and V. P. Shirinsky, “Long-Term Experimental Hyperglycemia Does Not Impair Macrovascular Endothelial Barrier Integrity and Function in vitro,” Biochemistry. (Mosc)., vol. 88, no. 8, pp. 1126–1138, Aug. 2023, doi: 10.1134/S0006297923080072.

“Diagnosed Prevalent Cases of Diabetic Retinopathy to Reach 17.8 Million by 2029 - Medical Product Outsourcing.” Accessed: Dec. 09, 2025. [Online]. Available: https://www.mpo-mag.com/breaking-news/diagnosed-prevalent-cases-of-diabetic-retinopathy-to-reach-178-million-by-2029/

S. Guefrachi, A. Echtioui, and H. Hamam, “Diabetic Retinopathy Detection Using Deep Learning Multistage Training Method,” Arab. J. Sci. Eng. 2024 502, vol. 50, no. 2, pp. 1079–1096, May 2024, doi: 10.1007/S13369-024-09137-9.

R. Abbasi et al., “Diabetic retinopathy detection using adaptive deep convolutional neural networks on fundus images,” Sci. Reports 2025 151, vol. 15, no. 1, pp. 24647-, Jul. 2025, doi: 10.1038/s41598-025-09394-0.

S. Akhtar et al., “A deep learning based model for diabetic retinopathy grading,” Sci. Reports 2025 151, vol. 15, no. 1, pp. 3763-, Jan. 2025, doi: 10.1038/s41598-025-87171-9.

M. Youldash et al., “Deep Learning Empowered Diagnosis of Diabetic Retinopathy,” Intell. Autom. Soft Comput., vol. 40, no. 1, pp. 125–143, Jan. 2025, doi: 10.32604/IASC.2025.058509.

“(PDF) Automatic Detection and Classification of Diabetic Retinopathy from Optical Coherence Tomography Angiography Images using Deep Learning - A Review.” Accessed: Dec. 10, 2025. [Online]. Available: https://www.researchgate.net/publication/388266578_Automatic_Detection_and_Classification_of_Diabetic_Retinopathy_from_Optical_Coherence_Tomography_Angiography_Images_using_Deep_Learning_-_A_Review

A. Abini and S. S. S. Priya, “A novel deep learning approach for diabetic retinopathy classification using optical coherence tomography angiography,” Multimed. Tools Appl., vol. 84, no. 31, pp. 38613–38651, Sep. 2025, doi: 10.1007/S11042-025-20708-2.

S. R. U. I. Rahat, M. H. RAHMAN, Y. Arafat, M. Rahaman, M. M. Hasan, and M. Al Amin, “Advancing Diabetic Retinopathy Detection with AI and Deep Learning: Opportunities, Limitations, and Clinical Barriers,” Br. J. Nurs. Stud., vol. 5, no. 2, pp. 01–13, Jul. 2025, doi: 10.32996/BJNS.2025.5.2.1.

A. Jabbar et al., “A Lesion-Based Diabetic Retinopathy Detection Through Hybrid Deep Learning Model,” IEEE Access, vol. 12, pp. 40019–40036, 2024, doi: 10.1109/ACCESS.2024.3373467.

I. Govindharaj, R. Rampriya, G. Michael, S. Yazhinian, K. Dinesh Kumar, and R. Anandh, “Capsule network-based deep learning for early and accurate diabetic retinopathy detection,” Int. Ophthalmol. 2025 451, vol. 45, no. 1, pp. 78-, Feb. 2025, doi: 10.1007/S10792-024-03391-4.

G. Kalyani, B. Janakiramaiah, A. Karuna, and L. V. N. Prasad, “Diabetic retinopathy detection and classification using capsule networks,” Complex Intell. Syst. 2021 93, vol. 9, no. 3, pp. 2651–2664, Mar. 2021, doi: 10.1007/S40747-021-00318-9.

W. Li et al., “Predictive model and risk analysis for diabetic retinopathy using machine learning: a retrospective cohort study in China,” BMJ Open, vol. 11, no. 11, p. e050989, Nov. 2021, doi: 10.1136/BMJOPEN-2021-050989.

“(PDF) A Review of Deep Learning Models for Diabetic Retinopathy Detection and Classification using Fundus Photography.” Accessed: Dec. 10, 2025. [Online]. Available: https://www.researchgate.net/publication/390201014_A_Review_of_Deep_Learning_Models_for_Diabetic_Retinopathy_Detection_and_Classification_using_Fundus_Photography

B. Sheng et al., “An overview of artificial intelligence in diabetic retinopathy and other ocular diseases,” Front. Public Heal., vol. 10, p. 971943, Oct. 2022, doi: 10.3389/FPUBH.2022.971943/BIBTEX.

“The EfficientNetB0 network architecture. | Download Scientific Diagram.” Accessed: Dec. 10, 2025. [Online]. Available: https://www.researchgate.net/figure/The-EfficientNetB0-network-architecture_fig8_346296594

“It shows the overall architecture of MobileNet-V3 Small. It includes a... | Download Scientific Diagram.” Accessed: Dec. 10, 2025. [Online]. Available: https://www.researchgate.net/figure/It-shows-the-overall-architecture-of-MobileNet-V3-Small-It-includes-a-lightweight-neural_fig4_376364618

“Bayesian Neural Network (BNN) model architecture [37]. | Download Scientific Diagram.” Accessed: Dec. 10, 2025. [Online]. Available: https://www.researchgate.net/figure/Bayesian-Neural-Network-BNN-model-architecture-37_fig3_384422199

Downloads

Published

2025-11-25

How to Cite

Ibad, M. S., Shah, S. N. H., Haider, A., Zaman, M., Iqbal, T., & Muhammad Umais. (2025). Quantifying Confidence in Diabetic Retinopathy Diagnosis: A Comparative XAI Study of Deep Learning and Bayesian Neural Networks. International Journal of Innovations in Science & Technology, 7(4), 2881–2899. Retrieved from https://journal.50sea.com/index.php/IJIST/article/view/1655