Efficientnet-B0 and Vlm-Based Explainable Framework for Diabetic Retinopathy Detection and Severity Grading
Abstract
Diabetes mellitus (DM) is one of the most common causes of preventable blindness in the world, and DR is a major cause of working-age adults losing their vision. Mass screening programmes are necessary but limited by the availability of trained ophthalmologists, and the cost of such programmes. This paper introduces a two-stage explainable AI system for automated five-class DR grading using colour fundus photographs. The first stage uses a fine-tuned, efficientnet-b0 convolutional neural network (CNN) pre-trained on the MMRDR-CFP database using a two-phase transfer learning approach: (Phase 1, 10 epochs) frozen backbone head training and (Phase 2, 100 epochs) full model fine tuning with cosine annealing and weighted random sampling to address extreme class imbalance across the five severity grades of the International Clinical Diabetic Retinopathy (ICDR) scale (0-4). The second stage combines the Moondream2 vision-language model (VLM) with a natural language generation model that produces structured, clinician-interpretable natural-language explanations, detecting retinal pathological features like microaneurysms, haemorrhages, hard exudates, cotton-wool spots, venous beading, intraretinal microvascular abnormalities (IRMA), neovascularisation, vitreous haemorrhage, and macular oedema. Both components are integrated into a Streamlit web application that includes the ability to upload images in real time, predict the class and provide confidence scores, display the probability distribution for each class and suggest evidence-based treatment plans. On the MMRDR-CFP dataset, the proposed system performs better than all the evaluated baselines with a peak validation accuracy of 84.7%, quadratic weighted kappa (QWK) of 0.832, macro-F1 of 0.801, and average AUC of 0.931.50 randomly selected Moondream2 explanations were reviewed by ophthalmologists with a mean Likert score of 4.1/5 for clinical accuracy and 4.3/5 for actionability.