Skip to main content
Frontiers in Artificial Intelligence logoLink to Frontiers in Artificial Intelligence
. 2026 Sep 21;9:1937520. doi: 10.3389/frai.2026.1937520

SSLVNet: an explainable multi-modal hybrid framework integrating self-supervised learning and vision transformers for multi-label classification of retinal diseases

M Rithiga 1, R K Nadesh 1,*
PMCID: PMC13634805  PMID: 42834895

Abstract

Introduction

Retinal Diseases are the main reason for vision loss and blindness worldwide. Initial identification of retinal abnormalities is essential for avoiding severe retinal-related complications and improving patient results. Traditional retinal disease diagnosis mainly depends on manual checks of retinal fundus images, which are slow and highly dependent on medical expertise. Deep learning methods are used in retinal disease classification. Existing methods are primarily based on labelled image data and often do not fully utilize complementary clinical information. The proposed hybrid multi-model framework classifies retinal diseases from the available retinal fundus images.

Methods

SSLVNet combines a Self-Supervised Learning encoder, Lesion Attention, CNN, ViT, and a Simplified lesion Graph. Also, Grad- CAM provides visual elucidations of the model predictions. ODIR-5K dataset, which includes multiple ocular disease categories, is used.

Results

The results are promising, with an Exact Accuracy of 84.44%, a Hamming accuracy of 96.92%, and a Macro F1-Score of 90.36%. An ablation study was done to understand the contribution of individual components in the proposed framework.

Discussion

These results indicate that the proposed work can effectively support reliable and interpretable retinal disease classification in real-world healthcare applications.

Keywords: classification, convolutional neural networks, explainable AI, lesion attention, retinal diseases, self-supervised learning, vision transformer

1. Introduction

Retinal Diseases like myopia, diabetic retinopathy, Cataract, hypertension, glaucoma, age-related macular degeneration, and abnormalities are complications of vision loss and can lead to wide-reaching blindness if they are not identified and treated at an early stage (Herrera-Chavez et al., 2024). Since many of these diseases develop slowly without noticeable symptoms, early screening becomes very important to avoid permanent vision loss. Transfer Learning and Deep Learning models have also demonstrated enhanced accuracy and robustness when applied across various retinal datasets (ul Hassan et al., 2024). Ophthalmologists use retinal fundus images for visualization of eye structures like blood vessels, the optic disc, and the macula (Shamsan et al., 2023). Retinal images are still analyzed manually by specialists. But this method takes too much time and may vary depending on the experience of the observer (Yu and Dong, 2025). Due to these limitations and growing demand, there is a need for automated systems to assist ophthalmologists in retinal disease classification, thus improving the screening efficiency (Zhang et al., 2021). In recent years, artificial intelligence techniques have been used in the analysis of medical images, especially for ophthalmic diagnosis (Shafiq et al., 2024). These methods are used to detect complex learning patterns from retinal images and have achieved good performance in identifying different eye diseases (Hu et al., 2025). Moreover, multi-label classification techniques are becoming more widely adopted because a single retinal image can display several diseases simultaneously (Aranha et al., 2023). AI-based approaches have also been explored for precision diagnosis and treatment planning in retinal diseases (Wang et al., 2024). These works show that deep learning can effectively extract important features from retinal images and support early diagnosis. Further improvements were made by introducing more advanced architectures for ocular image classification. A dual-stream feature transfer context was proposed for multi-model ocular image classification, which helped improve feature learning from different image sources (Annamalai and Palani, 2025). Many existing methods have some limitations. They use only retinal images and exclude clinical information, which can improve diagnosis. Most developed models focus only on a few diseases and cannot properly understand the relationships between different retinal problems. Another issue is that many systems are not easy to explain, so doctors may not fully trust them. Considering the gap mentioned, a hybrid multi-model framework is proposed that integrates SSL, CNN, ViT, lesion attention, and a Lesion Graph Network to extract more informative features from retinal images and to enhance disease classification. The model also employs Grad-CAM, which can highlight which region of the image is crucial for the prediction and make it more understandable. The proposed method is tested using the ODIR-5k dataset. The results show better performance and better interpretability compared to existing methods. Key contributions are,

  • Multi-modal system for all retinal disease classification.

  • Integrating Self-supervised Learning (SSL) for robust feature pattern Learning and a CNN-Vision Transformer hybrid architecture for local and global feature extraction.

  • Lesion Graph Network (LGN) for modeling relationships among retinal abnormalities.

  • Grad-CAM for Visualization.

2. Related work

In early research works, deep learning models were widely used for retinal structure analysis. For example, a retinal blood vessel segmentation framework was proposed to support a better understanding of retinal anatomy and disease classification (Al-Fahdawi et al., 2024). Similarly, an automated retinal Screening system was developed to identify different retinal abnormalities from fundus images (Wang, 2025). The researchers have focused on improving the practical usability of these systems. Low-cost and efficient AI- based approaches have been developed to support early detection or classification in resource-limited healthcare platforms (Vohra et al., 2025). In another study, a combined model with SVM and EfficientNet was introduced (Naveen et al., 2025). An innovative hybrid framework was proposed for DR detection, which improved feature extraction and also classified retinal diseases utilizing retinal vascular structures to enhance classification performance (Sushith et al., 2025). CAD-EYE, a multi-eye disease classification method, was implemented using feature fusion techniques and achieved good performance (Khalid et al., 2024). An explainable AI-based framework was introduced for detecting age-related macular degeneration, which helped in understanding model decisions and improving clinical trust (Wang et al., 2023). In addition, retinal lesion segmentation has also been widely studied. A deep learning-based model was proposed for accurate retinal lesion segmentation, which helped in identifying the disease regions more precisely (Kumar et al., 2023). Another study combined CycleGAN with CNN models to improve retinal pathology localization, which helped in better identifying disease regions in images (Zhang et al., 2022). Conv-ViT, a model that pairs two CNNs (Inception-V3, ResNet-50) with a Vision Transformer to analyze retinal OCT scans, catches fine texture details while the transformer picks up on broader shape and structure (Dutta et al., 2023). Additionally, a study was proposed for early-stage diagnosis to help in understanding disease progression (Sattigeri et al., 2022). In addition, automated retinal disease detection using Fundus images, focusing on reducing computation time while maintaining accuracy, was explored (Rajesh et al., 2025). Several researchers have also focused on improving disease classification using hybrid and advanced deep learning methods for AMD (Osa-Sanchez et al., 2025). Federated learning approaches have also been explored for healthcare applications to improve data privacy while training deep learning models (Bashir et al., 2023). It combines local and contextual features, which helps the model identify retinal abnormalities more effectively and improves retinal disease detection (Khan et al., 2025). Finally, CNN-based frameworks have been developed for initially improving eye disease identification, showing the usefulness of deep learning in retinal eye disease classification using Explainable AI (Ahnaf Alavee et al., 2024). Transfer learning with different CNN models, including various methods like VGG16, ResNet, InceptionV3, and MobileNet (Gour and Khanna, 2021). Several CNN models use bilateral feature fusion to improve feature representation (Li et al., 2021). It combines bilateral feature enhancement with multi-scale feature extraction for ocular disease classification (Ou et al., 2022). The multi-module attention-based framework helps the model focus on important regions, leading to better gastrointestinal disease identification (Khan et al., 2024). The closest contributions of the existing literature are summarized and given in Table 1.

Table 1.

Comparison of existing methods with the proposed SSLVNet.

Author Dataset Labels Method Result
Gour and Khanna (2021) ODIR 8 ocular disease classes Transfer learning-based CNN 85.57% F1-score
Li et al. (2021) OIA-ODIR 8 ocular disease classes CNN-based bilateral feature fusion 87.93% F1-score
Ou et al. (2022) OIA-ODIR 8 ocular disease classes BFENet: two-stream interaction CNN 89.20% F1-score
Al-Fahdawi et al. (2024) OIA-ODIR 8 ocular disease classes Fundus-DeepNet: HRNet + Attention + SENet + DRBM 89.13% F1-score
Proposed SSLVNet ODIR-5K 8 ocular disease classes Self-Supervised Learning + Feature Fusion + Hierarchical Transformer + Lesion Graph Attention + Uncertainty Estimation 90.36% Macro F1-score

3. Proposed methodology

The proposed architecture is a Hybrid Multi-Model, designed and developed for automating retinal disease classification. The input is retinal fundus images. It processes and converts the data in the Self-Supervised Learning module. The data is processed from Unlabeled Retinal Images, and it is converted into Pretext tasks. Then, the CNN Dual function is used in feature extraction because CNNs are used in EfficientNet-B4, and another function are used in the Transformer backbone, which is the vision transformer (ViT-B/16). It includes local and global features like structure. The data is moved to feature fusion are include in CNN Features, ViT features. In the embedding, images will be converted to the embedding space for each patch, and a fully connected layer will be used to unify the feature vector for each patch. The Hierarchical transformer is also used in the proposed model because it can include the multi-head and self-attention layers used in the input paths. The Lesion Graph Network is a process of detecting the different nodes included in the graph. It detects the lesions of the graph attention network, and it can identify the inter-lesion spatial. Pseudo-lesion regions are obtained from the spatial attention map generated by the Lesion Attention module. The attention map is divided into a 7 × 7 grid, and the eight grid regions with the highest attention scores are selected as pseudo-lesion nodes. Then, classifying the retinal diseases can be done by using a fully connected layer and a sigmoid activation function to predict probabilities for each retinal disease. The final predicted classes are classified based on the confidence scores for the proposed model. A Grad-CAM heatmap image is used to denote the high and low importance of the image and is given in Figure 1.

Figure 1.

Flowchart diagram illustrating a machine learning pipeline for retinal disease detection from fundus images, featuring stages for self-supervised learning, dual backbone feature extraction (CNN and transformer), feature fusion, hierarchical transformer, lesion graph network, classification, uncertainty estimation, explainability with a Grad-CAM heatmap, and final output including predicted diseases, confidence scores, and heatmap visualization.

Hybrid multi-model architecture for retinal disease classification.

3.1. Input acquisition module

The first step of the proposed framework is to gather the retinal information from fundus modalities, such as retinal fundus images, which contain important information for retinal diseases. As shown in Equation 1, the input retinal image is represented as,

SSLVNetinp(x)={inpf} (1)

3.2. Self-supervised learning (SSL) module

Figure 2, The second step of the proposed framework, the SSL module can identify the unlabeled data for learning the retinal image, and another one is the pretext tasks, which includes

Figure 2.

Diagram describing pretext tasks for learning from unlabeled retinal images, including rotation prediction with varying angles, jigsaw puzzle prediction by reconstructing spatial patch arrangement, and patch reconstruction where image patches are intentionally removed or masked.

Self-supervised learning (SSL) module.

  • Rotation prediction—it will be used to rotate the retinal image at different angles.

  • Puzzle Prediction—the retinal images reconstruct the spatial arrangement of the image patches.

  • Patch Reconstruction is the process of dividing an image into patches, which are masked from the spatial representation of the image (Figure 3).

Figure 3.

Flowchart showing two images of a retina, one original and one rotated, each processed by an SSL encoder (EfficientNet-B4) to produce feature vectors. Feature learning combines these, followed by disease classification using CNN and Vision Transformer.

Retinal image rotation for Self-Supervised Learning (SSL) using the CNN EfficientNet-B4 encoder.

Self-Supervised Learning is employed before supervised training. The SSL module uses a large collection of unlabeled retinal images with BCEWithLogitsLoss, using a SimCLR method, and learns to perform useful complete pretext tasks for retinal images, such as Contrastive Learning. Different augmented versions of the same image are shown as positive pairs, while dissimilar images are shown as negative pairs. The contrastive loss is given by Equation 2, where the temperature parameter π is used as shown below,

SSLVNet(LSSL)=−log(exp(Sampos/π)∑a=1nexp(Samfea/π)) (2)

Where,

  • SSLVNet(LSSL)  = Self-Supervised learning loss

  • Sampos  = Positive pair for the input data

  • Samfea  = Feature pair for the input data

  • π  = Temperature parameter for the input data

3.3. Dual backbone feature extraction

Figure 4, Dual function is the third step, which is double-backbone feature extraction to capture both local and global retinal information; the architecture uses two parallel feature-removal systems. It can involve learning the retinal patterns from the fundus images.

Figure 4.

Diagram comparing two image processing approaches: the top shows a CNN backbone (EfficientNet-B4) extracting local features like lesions and textures from input images; the bottom shows a transformer backbone (ViT-B/16) dividing input images into patches, embedding them, processing with a transformer encoder, and outputting global features such as structure and context.

Dual function for feature extraction in retinal image. (A) CNN backbone (EfficientNet-B4) for local feature extraction (lesions, textures); (B) Transformer backbone (ViT-B/16) for global feature extraction (structure, context).

3.3.1. CNN backbone (EfficientNet-B4)

Figure 5 shows the EfficientNet-B4 working as a CNN image classifier, especially designed for image processing. CNN will automatically detect feature extraction from the retinal image. In Convolutional Layers - The input image passes data from the convolutional layer, which can detect edges, textures, and patterns, and the convolution operation is defined in Equation 3, which computes the output response using the input image and kernel filters. Initially, a 9 × 9 format image is generated, which will cover the 0-black representation. Then each 3 × 3 matrix is converted to the one output matrix for using a 3 × 3 kernel matrix. Convolution with horizontal and vertical strides = 1. The pooling layer reduces the image size or spatial size. The max pooling uses the feature map to generate a 2 × 2 matrix, and the output is the max-pooled feature map value. It uses the pooled feature map to convert the Convoluted image to a max pooling image. The avg. pooling uses the feature map to generate a 2 × 2 matrix, whose output is the avg-pooled feature map value. It uses the pooled feature map to convert the Convoluted image to an average pooling image. The Fully Connected Layer performs the final classification and prediction of the output class. CNN backbone for local structures to extract from fundus images. CNNs are highly effective in detecting local image features. The input picture size is 224 × 224 × 3, and the image is processed for the preprocessing stage, such as resizing, normalization, and data augmentation. The convolution operation is the first stage process for EfficientNet-B4, which applies the convolution filters to the retinal fundus image.

Figure 5.

Diagram illustrates a convolutional neural network pipeline for retinal fundus image analysis using an EfficientNet-B4 backbone, showing preprocessing steps, sequential convolutional and pooling layers, and extraction of local feature output for lesions, textures, and fine-grained details.

CNN backbone (EfficientNet-B4).

fo/p(f1,f2)=∑i∑jQi(f1−x,f2−y)Sk(u,v) (3)

Where,

  • fo/p  = Output response

  • Qi  = Input for the retinal eye image

  • Sk  = Retinal eye kernel

The second stage MBConv Block is the process of stream convolution, which can be an 112 × 112 × 3 input layer to a 1 × 1 × 1,792 output layer. The layers are working in a block-to-block manner. So, the input layers are extended to increase the feature image. Applying filters to all the blocks, each block remains managed self-sufficiently. The output CNN feature vector is signified as shown in Equation 4,

SSLVNetf(CNN)=[f1,f2,f3,f4,…fn] (4)

Where,

  • SSLVNetf(CNN)  = It signifies the retinal fundus image information

3.3.2. Vision transformer (ViT-B/16)

Figure 6 captures the global feature information from the retinal fundus images. It uses a self-attention mechanism. It will be used for long-range needs and spatial relations. The input retinal fundus image is processed in the preprocessing stage, such as resizing, normalization, and data augmentation. The ViT does not process the full image directly. The image will be a patch partition; the patch size is 16 × 16. Every patch is converted into a feature vector. The image will be converted into multiple blocks (small blocks), and it can be processed through linear projection and positional encoding. Each patch is converted into an embedding vector. Each retinal image patch connects with every other image patch, as computed in Equation 5 using the self-attention mechanism,

Figure 6.

Diagram illustrating a vision transformer (ViT) model for retinal fundus image analysis. Shows preprocessing steps, image partitioning into 16 by 16 patches, linear projection, positional encoding, transformer blocks with multi-head self-attention, and final global feature output for structure, context, and long-range relationships.

CNN backbone – a Vision Transformer (ViT-B/16).

SSLVNetA(fQ,fK,fV)=Softmaxi(fQfKTd)fV (5)

Where,

  • SSLVNetA  = Self-attention output for using query, key, value

  • fQ  = query (Q) matrices of each patch in the input

  • fK  = key (K) matrices of each patch in the input

  • fV  = value (V) matrices of each patch in the input

  • d  = dimension

  • Softmaxi = It is used to create the attention weights

The Vision Transformer input has patch 1 and patch 2, which include the 512-dimensional embedding represented as 1×512. The 64-dimensional queries represent the current patch as 1×64, including q1 and q2 . These query representations are denoted by fQ . The 64-dimensional keys represent the content of each patch (like a label or descriptor) as 1×64, including k1 and k2. These key representations are denoted by fk. The 64-dimensional values hold the actual information of each patch to be aggregated as 1×64, including v1 and v2 . These value representations are denoted by fv.

3.4. Feature fusion module

The fourth step features a fusion module that is developed to combine both local and global features, including different feature extractions. The fused feature image is obtained using Equation 6,

ffusion=Concat(f0CNN,f1ViT) (6)

The fusion layer learns relationships between image features. This step makes a complete representation of retinal disease characteristics. Initially, the retinal fundus image is processed using EfficientNet-B4—local features and Vision Transformer B/16 global features are included for the proposed work.

3.5. Hierarchical transformer module

The fifth step is the hierarchical transformer module, which has the feature data from different modules. The encoding is all matching in structure. The Multi-Head Self-Attention layer, which includes multiple attention heads that focus on different retinal data, is defined in Equation 7,

SSLVNetMHA(fQ,fK,fV)=Concatope(fH1,fH2,fH3,…,fHh)WMo (7)

Where,

  • fH1,fH2,fH3,…,fHh  = Multiple attention heads for the outputs

  • Concatope  = Concatenation for the output operation

  • WMo  = weights of the output matrix

Feed Forward Network is refining the extracted images, and layer normalization is improving the convergence and training stability.

3.6. Lesion graph network (LGN)

The sixth step, lesion graph network, which is frequently considered in terms of relationships among multiple lesions. Instead of treating lesions in isolation, the proposed framework models lesion communications as happening using graph structures. The Graph Attention Network informs node features as shown in Equation 8,

SSLVNetout=ReLU(∑a=1NWiRri) (8)

Where,

  • SSLVNetout  = Output

  • Rri  = Feature of the neighboring retinal region/lesion

  • Wi = Weight showing the importance of the neighboring region

  • N = Neighboring retinal regions/lesions

3.7. Multi-label classification head

The seventh step is a module that focuses on developing an AI-based hybrid deep learning framework for automating all retinal diseases. It may contain multiple diseases instantaneously. To identify the final prediction of the class. The final output layer uses Sigmoid because multiple diseases can be predicted at the same time. The sigmoid activation function used is given in Equation 9,

σ(fzx)=f1f1+fae−x (9)

Where,

  • σ(fzx)  = Output sigmoid

  • fzx = Input value from the previous layer

  • fae  = Constant of the input

  • f1  = Input value of the current layer

3.8. Prediction uncertainty estimation

The uncertainty score is computed using Equation 10,

SSLVNetU=1n∑a=1n(Pri−Prm)2 (10)

Where,

  • SSLVNetU  = Uncertainty score of the model prediction

  • n  = Number of the predictions considered

  • Pri  = Probability of the individual prediction

  • Prm  = Mean probability of the predictions

The eighth step is ambiguity estimation for the required confidence data to add to predictions. This process helps to predict the probability distribution of each class. It can predict the confidence score for each class, for comparison of all scores, and which score is best, which helps for the final prediction.

3.9. Explainability module

The ninth step uses the heatmap (Grad-CAM) to identify the most important places in the retinal image and the less important places in the retinal image.

3.10. Final output function

The output of the proposed model includes the predicted disease for multi-classes, a confidence score for each class, and a heatmap conception, total loss combining SSL and classification loss is given in Equation 11,

fo/p=w1ffea+w2fclass (11)

Where,

  • fo/p = Total loss of the model

  • w1ffea  = learning loss

  • w2fclass  = class loss

4. Experimental setup

The hybrid multi-label proposed framework for retinal eye disease classification was implemented and evaluated using the ODIR-5k retinal eye fundus image dataset in Google Colab. It can cover the eight types of disease classes from the retinal images. Before training, all the category images were resized to 224 × 224 pixels, and the input data were normalized to ensure consistency. The proposed model combines Self-Supervised Learning, a CNN backbone for EfficientNet-B4, and a Vision Transformer (ViT-B/16). Multi-model fusion image features for feature extraction are based on CNN backbones, and finally classified multi-label retinal eye diseases are trained for 20 epochs. The ODIR-5K dataset has an imbalanced class; therefore, loss functions (Weighted BCEWithLogitsLoss) are used during training to give greater importance to minority classes. Table 2 provides the entire experimental setup.

Table 2.

Experimental details.

Sl. no Parameter Value
1 Random seed 42
2 Train size 0.7
3 Validation size 0.15
4 Test size 0.15
5 Image size 224 × 224
6 Batch size 16
7 Num workers 2
8 Optimizer AdamW
9 Learning rate 0.0001
10 Weight decay 0.01
11 Loss function Weighted BCEWithLogitsLoss
12 Decision threshold 0.5
13 Maximum epochs 20
14 Early stopping patience 5
15 Early stopping metric val_macro_f1
16 SSL epochs 5
17 SSL temperature 0.2
18 Bootstrap repeats 1000
19 Alpha (significance level) 0.05
20 Mixed precision (AMP) True

4.1. Performance evaluation metrics

SSLVnetAcc=tpos_i+tneg_jtpos_i+tneg_j+fpos_i+fneg_j (12)
SSLVPre=tpostpos+fpos (13)
  • 3) Sensitivity (Recall) is calculated using Equation 14,

SSLVnetSen_recall=tpostpos+fneg (14)
  • 4) Intersection over Union (IoU) is calculated using Equation 15,

SSLVnetIOU=tpostpos+fpos+fneg (15)
SSLVDice=2×tpos(2×tpos)+fpos+fneg (16)
  • 6) Exact Match Accuracy is calculated using Equation 17,

SSLVEMAcc=nex_accntol_sam (17)
SSLVnetHAcc=1m×n∑a=1m∑b=1nIf(Cab=Dab) (18)
SSLVnet(F1−score)=2×SSLVPre×SSLVsen_recallSSLVpre+SSLVsen_recall (19)
  • 9) The true positive rate used for the ROC curve is calculated using Equation 20,

SSLVnet(TposR)=tpostpos+fneg (20)
  • 10) The false positive rate is calculated using Equation 21,

SSLVnet(FposR)=fposfpos+tneg (21)
  • 11) The confusion matrix structure is given in Equation 22,

SSLVnetCM=[tposfposfnegtneg] (22)
  • 12) The Grad-CAM heatmap is computed using Equation 23,

SSLVnetgradcam=ReLUa(∑j=1i∝iAj) (23)

5. Results and discussion

Figure 7 shows the training loss reduced from 0.3304 to 0.0154 in the retinal image, and the validation loss reduced from 0.2979 to 0.1497 in the retinal image. The small changes in the train loss and validation loss are because the curve suggests decent generation and limited overfitting. This image shows that the model can learn the retinal eye image features in detail during training. The validation loss remains stable during the training process. Epoch 10 has the lowest validation loss of 0.1237.

Figure 7.

Line chart comparing training loss and validation loss over 20 epochs. Training loss decreases steadily, while validation loss plateaus after initial decline, indicating possible overfitting in later epochs.

Training and validation loss.

Figure 8 shows the model performance of the Macro F1-score over 20 training epochs. The score has increased consistently from 0.3019 to 0.9036. The highest epoch is achieved at epoch 16.

Figure 8.

Line chart showing validation Macro-F1 score across twenty epochs, with performance rising steeply and then stabilizing. The best score, 0.9036, is achieved at epoch sixteen and highlighted with a dashed vertical line.

Macro F1-score.

Figure 9 shows that the model performance displays good performance during the training process. It indicates that all three metrics improve progressively as the number of epochs increases from 24.78 to 84.68%. The highest Exact Match Accuracy of 85.73% was reached at Epoch 17. The Hamming accuracy has reached 96.92%. The F1-score improves from 30.29 to 90.36%. Validation Macro F1-score was used as the main criterion for selecting the final model checkpoint. The validation loss and Exact Match Accuracy were reported as additional performance measures, but they were not used for model selection. The highest Validation Macro-F1 was obtained at epoch 16, and the checkpoint from epoch 16 was selected as the final model. The test set was not involved in selecting the epoch or tuning the model.

Figure 9.

Line chart titled "Model Performance" showing scores over 20 epochs for three metrics: Exact Accuracy (blue), Hamming Accuracy (orange), and Macro-F1 (green). Hamming Accuracy starts highest and remains above 0.9 throughout, Macro-F1 and Exact Accuracy increase rapidly in early epochs and then plateau with Exact Accuracy lowest. Legend at bottom right.

Exact accuracy, Hamming accuracy, and F1-score graph.

Table 3 shows that the proposed SSLVNet performs the best among the other baseline models. The highest F1 score achieved by SSLVNet is 0.9036, when compared to the other models. The proposed model has reached the highest Exact Match Accuracy of 0.8444, Hamming Accuracy of 0.9692, and Macro F1-score of 0.9036.

Table 3.

Comparison of the proposed SSLVNet with baseline models.

Methods Exact match acc Hamming acc Macro F1
Proposed SSLVNet 0.8444 0.9692 0.9036
EfficientNet-B4 (CNN-only) 0.7273 0.9501 0.8134
ViT-B/16 (ViT-only) 0.7169 0.9442 0.7991
CNN + ViT fusion (no SSL/attention/graph) 0.7081 0.9469 0.7549

Table 4 shows the ablation study of the proposed SSLVNet model, that reached the best performance among other methods. Methods without the CNN branch: the F1-score is 0.6353, without the ViT branch is 0.7895, without the Lesion Graph feature is 0.7577, without Lesion Attention is 0.7930, and the proposed SSLVNet reached the highest F1-score of 0.9036.

Table 4.

Ablation study.

Methods Exact match acc Hamming acc Macro F1-score
Full model (Proposed SSLVNet) 0.8444 0.9692 0.9036
w/o lesion attention 0.7017 0.9446 0.7930
w/o lesion graph feature 0.7041 0.9424 0.7577
w/o ViT branch 0.7281 0.9500 0.7895
w/o CNN branch 0.5485 0.9159 0.6353

Table 5 shows the computational analysis for the proposed SSLVNet, with the highest computational requirements compared to the other baseline models, while requiring fewer parameters, FLOPs, model size, and peak GPU memory than the CNN + ViT fusion model.

Table 5.

Computational complexity and efficiency comparison of the proposed models.

Model Parameters (M) Trainable params (M) MACs (G) FLOPs (G) Model size (MB) Latency (ms/img) Throughput (img/s) Peak GPU memory (MB)
Proposed SSLVNet 104.729 104.729 18.348 36.695 390.508 21.721 46.038 6206.654
EfficientNet-B4 (CNN-only) 24.561 24.561 4.133 8.265 93.694 6.16 162.329 6166.724
ViT-B/16 (ViT-only) 85.805 85.805 16.848 33.695 327.319 14.448 69.216 6381.959
CNN + ViT fusion (no SSL/attention/graph) 110.753 110.753 20.981 41.962 422.49 19.421 51.492 6498.793

Figure 10 shows the disease-wise test performance metrics of the proposed model, including Sensitivity, Specificity, Precision, IoU, Dice score, and Accuracy for retinal eye disease classes. The model achieved good performance for all retinal disease classes. The results vary across the different diseases. Myopia (M) has the best performance, followed by Cataract (C), which shows very high performance. Diabetic Retinopathy (D), Glaucoma (G), and AMD (A) show good and consistent results. Hypertension (H) has low Sensitivity (78.4%). Other (O) is the most challenging class, with lower IoU (67.4%) and Dice Score (80.6%). IoU and Dice scores for the multi-label classification are used to predict the true labels, not image pixels. Table 6 provides the mapping of code with keywords.

Figure 10.

Grouped bar chart titled “Disease-wise Test Performance” displaying sensitivity, specificity, precision, IoU, Dice score, and accuracy percentages for disease classes N, D, G, C, A, H, M, and O. Each category exhibits varied performance, with most metrics above 80 percent and particularly high specificity and accuracy observed across all disease classes.

Disease-wise test performance metrics.

Table 6.

ODIR-5K diagnostic keyword mapping.

Code Disease Diagnostic keywords
N Normal normal fundus
D Diabetic retinopathy diabetic retinopathy; no proliferative retinopathy
G Glaucoma glaucoma
C Cataract cataract
A Age-related macular degeneration age-related macular degeneration; macular degeneration
H Hypertensive retinopathy hypertensive retinopathy; hypertension
M Myopia myopic retinopathy; myopia; myopic maculopathy
O Other other diagnostic conditions not mapped to N, D, G, C, A, H, M

The false positive rate at the 0.5 threshold is depicted in Figure 11. The lowest FPR is observed for Cataract (C) at 0.0009, followed by Hypertension (H) and Myopia (M) at 0.0008. The highest FPR is Normal (N) at 0.0714, followed by Other (O) at 0.0516.

Figure 11.

Bar chart illustrating false positive rates for eight diseases labeled N, D, G, C, A, H, M, and O, with N and O showing the highest rates at 0.0714 and 0.0516 respectively.

Per-class false positive rate at threshold 0.5.

The ROC Curve in Figure 12 shows the performance of the classification model. The X-axis indicates the False Positive Rate, and the Y-axis indicates the True Positive Rate. The high AUC value used for Myopia (M) is 0.99.

Figure 12.

ROC curve line graph comparing eight classification models labeled N, D, G, C, A, H, M, and O. AUC values range from zero point eight seven to zero point nine nine, with M achieving the highest score.

ROC curve.

The confusion matrix of the retinal eye image classification model indicates the correct classification of the retinal eye diseases for each class. Only a few data points are misclassified. Figure 13 represents the overall model and Figure 14 provides the label-wise classification of all eight disease categories. Most samples are correctly classified as retinal diseases. Only a few samples are misclassified.

Figure 13.

Confusion matrix heatmap showing classification results with true labels N, D, G, C, A, H, M, O versus predicted labels. Most values are highest along the diagonal, indicating correct predictions. Blue color intensity increases with higher values, and a colorbar on the right shows the value scale.

Confusion matrix.

Figure 14.

Graphic displaying eight confusion matrices for classifying retinal diseases: normal, diabetes, glaucoma, cataract, AMD, hypertension, myopia, and other. Each matrix shows actual versus predicted results, with higher numbers in the top-left and bottom-right cells indicating strong classification performance for each condition.

One-vs-rest confusion matrices for all labels.

Grad-CAM is used to identify the most important places in the retinal image that contribute most to image prediction. The image shows the eye regions highlighted in colors such as red, yellow, blue, and green. The red and yellow colors indicate the most important regions in the retinal image. Correct Predictions focus on relevant retinal regions. Incorrect Predictions focus on less consistent highlight areas. Grad-CAM Visualization images with their disease name, example type, true label, predicted label, and predicted probability are now provided. Corrected positive, false positive, and false negative cases are also clearly indicated. These details have been added to make it easier to understand the relationship between the model prediction and the corresponding Grad-CAM visualization. Figure 15 shows the Grad-CAM images for correct and incorrect predictions of all the retinal eye diseases.

Figure 15.

Grid of eight circular heatmaps representing retinal scan predictions for four conditions: normal, diabetic retinopathy, glaucoma, and cataract. Left column shows correct positives with true and predicted labels equal to one; right column shows false positives with true label zero and predicted label one. Each heatmap has varied color distributions, illustrating the model's attention areas for classification.Top left: Normal, mostly blue with some red and yellow at the bottom. Top right: Normal, central red and yellow area. Second row left: Diabetic retinopathy, central orange and yellow region. Second row right: Diabetic retinopathy, lower zone yellow clusters. Third row left: Glaucoma, central red and yellow. Third row right: Glaucoma, horizontal band of color. Bottom left: Cataract, upper left red and lower half green. Bottom right: Cataract, mostly blue with upper left yellow and red region. Grid of eight circular heatmap visualizations of retinal images, each labeled with a condition—age-related macular degeneration, hypertensive retinopathy, myopia, or other—and a prediction outcome type: correct positive, false positive, or false negative. Colored regions indicate model attention, with associated probability values and true versus predicted labels, showing both accurate and misclassified cases for each condition.

Grad-CAM visualization of correct and incorrect predictions.

When compared to the other existing models, the proposed model obtained a Macro F1-score of 90.36%. Figure 16 describes the comparison of the existing methods with the proposed model.

Figure 16.

Bar chart comparing F1-scores of five methods: Gour and Khanna at 85.57 percent, Li et al. at 87.93 percent, Ou et al. at 89.20 percent, Al-Fahdawi et al. at 89.13 percent, and Proposed SSLVNet at 90.36 percent. Proposed SSLVNet achieves the highest score.

Comparison of existing methods with the proposed SSLVNet.

6. Conclusion and future work

A multi-modal automated retinal eye disease classification using the ODIR-5K dataset was implemented. The model combines self-supervised representation learning with hybrid deep neural architectures, including CNNs and ViT, to efficiently capture both localized retinal abnormalities and wider structural designs. Additionally, attention-based mechanisms and graph-oriented feature modeling are incorporated to enhance the understanding of complex lesion relationships within retinal images. Experimental results indicate the proposed system delivers reliable performance across multiple retinal disease categories. Moreover, interpretability is improved through Grad-CAM visualizations that highlight influential retinal regions, while uncertainty estimation increases the confidence and trustworthiness of predictions in clinical use. Further research may also focus on developing lightweight transformer architectures that reduce computational cost while maintaining accuracy. In addition, deploying the model in real-time clinical screening environments and integrating it into hospital decision-support systems would improve practical usability and assist clinicians in the early detection of retinal diseases.

Acknowledgments

The author(s) express their sincere gratitude to the Vellore Institute of Technology at Vellore for providing the necessary resources and facilities to conduct this study.

Funding Statement

The author(s) declared that financial support was received for this work and/or its publication. Open access funding provided by Vellore Institute of Technology. This research received no specific grant from any funding agency.

Footnotes

Edited by: Qiangguo Jin, Northwestern Polytechnical University, China

Reviewed by: Sultan Khan, Sohar University, Oman

Vinodhini V., Sona College of Technology, India

Data availability statement

Publicly available datasets were analyzed in this study. This data can be found here: https://www.kaggle.com/datasets/andrewmvd/ocular-disease-recognition-odir5k.

Author contributions

MR: Writing – original draft, Data curation, Conceptualization, Methodology, Investigation, Visualization, Writing – review & editing, Validation. RKN: Supervision, Validation, Writing – review & editing.

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Generative AI statement

The author(s) declared that Generative AI was used in the creation of this manuscript. The authors used AI-assisted tools to improve language, readability, and presentation. After using the tools, the authors reviewed and edited the content as needed and take full responsibility for the content of the published article.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

  1. Ahnaf Alavee K., Hasan M., Hasnayen Zillanee A., Mostakim M., Uddin J., Silva Alvarado E., et al. (2024). Enhancing early detection of diabetic retinopathy through the integration of deep learning models and explainable artificial intelligence. IEEE Access 12, 73950–73969. doi: 10.1109/ACCESS.2024.3405570 [DOI] [Google Scholar]
  2. Al-Fahdawi S., Al-Waisy A. S., Zeebaree D. Q., Qahwaji R., Natiq H., Mohammed M. A., et al. (2024). Fundus-DeepNet: multi-label deep learning classification system for enhanced detection of multiple ocular diseases through data fusion of fundus images. Inf. Fusion 102:102059. doi: 10.1016/j.inffus.2023.102059 [DOI] [Google Scholar]
  3. Annamalai A., Palani D. (2025). Multi-modal fusion and vision transformers for robust early AMD prediction. Evol. Syst. 16:64. doi: 10.1007/s12530-025-09684-y [DOI] [Google Scholar]
  4. Aranha G. D. A., Fernandes R. A. S., Morales P. H. A. (2023). Deep transfer learning strategy to diagnose eye-related conditions and diseases: an approach based on low-quality fundus images. IEEE Access 11, 37403–37411. doi: 10.1109/ACCESS.2023.3263493 [DOI] [Google Scholar]
  5. Bashir A. K., Victor N., Bhattacharya S., Huynh-The T., Chengoden R., Yenduri G., et al. (2023). Federated learning for the healthcare metaverse: concepts, applications, challenges, and future directions. IEEE Internet Things J. 10, 21873–21891. doi: 10.1109/JIOT.2023.3304790 [DOI] [Google Scholar]
  6. Dutta P., Sathi K. A., Hossain M. A., Dewan M. A. A. (2023). Conv-ViT: A convolution and vision transformer-based hybrid feature extraction method for retinal disease detection. J. Imaging 9:140. doi: 10.3390/jimaging9070140, [DOI] [PMC free article] [PubMed] [Google Scholar]
  7. Gour N., Khanna P. (2021). Multi-class multi-label ophthalmological disease detection using transfer learning based convolutional neural network. Biomed. Signal Process. Control 66:102329. doi: 10.1016/j.bspc.2020.102329 [DOI] [Google Scholar]
  8. Herrera-Chavez A. I., Rodríguez-Martínez E. A., Flores-Fuentes W., Rodgíruez-Quiñonez J. C., García-Gallegos J. C., Montiel-Ross O. H., et al. (2024). Multi-label Image Classification for Ocular Disease Diagnosis Using K-fold Cross-Validation on the ODIR-5K Dataset IEEE International Symposium on Industrial Electronics. Institute of Electrical and Electronics Engineers Inc. Proceedings of the 2024 IEEE International Symposium on Industrial Electronics (ISIE), held in Ulsan, South Korea. The publisher (IEEE) is headquartered in Piscataway, NJ, USA. [Google Scholar]
  9. Hu W., Li K., Gagnon J., Wang Y., Raney T., Chen J., et al. (2025). FundusNet: a deep-learning approach for fast diagnosis of neurodegenerative and eye diseases using fundus images. Bioengineering 12:57. doi: 10.3390/bioengineering12010057, [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Khalid M., Sajid M. Z., Youssef A., Khan N. A., Hamid M. F., Abbas F. (2024). CAD-EYE: an automated system for multi-eye disease classification using feature fusion with deep learning models and fluorescence imaging for enhanced interpretability. Diagnostics 14:2679. doi: 10.3390/diagnostics14232679, [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Khan S. D., Basalamah S., Lbath A. (2024). Multi-module attention-guided deep learning framework for precise gastrointestinal disease identification in endoscopic imagery. Biomed. Signal Process. Control 95:106396. doi: 10.1016/j.bspc.2024.106396 [DOI] [Google Scholar]
  12. Khan S. D., Basalamah S., Lbath A. (2025). A novel deep learning framework for retinal disease detection leveraging contextual and local features cues from retinal images. Med. Biol. Eng. Comput. 63, 2029–2046. doi: 10.1007/s11517-025-03314-0, [DOI] [PubMed] [Google Scholar]
  13. Kumar B. N., Mahesh T. R., Geetha G., Guluwadi S. (2023). Redefining retinal lesion segmentation: a quantum leap with DL-UNet enhanced auto encoder-decoder for fundus image analysis. IEEE Access 11:36, 70853–70864. doi: 10.1109/ACCESS.2023.3294443 [DOI] [Google Scholar]
  14. Li N., Li T., Hu C., Wang K., Kang H. (2021). A benchmark of ocular disease intelligent recognition: one shot for multi-disease detection. Available online at: http://arxiv.org/abs/2102.07978 (Accessed on September 10, 2026)
  15. Naveen K. V., Anoop B. N., Siju K. S., Kar M. K., Venugopal V. (2025). EffNet-SVM: a hybrid model for diabetic retinopathy classification using retinal fundus images. IEEE Access 13, 79793–79804:548. doi: 10.1109/ACCESS.2025.3566073 [DOI] [Google Scholar]
  16. Osa-Sanchez A., Magdy Balaha H., Mahmoud A., Sewelam A., Ghazal M., Garcia-Zapirain B., et al. (2025). Explainable AI-based approach for age-related macular degeneration (AMD) detection via fundus imaging. IEEE Access 13, 341–360. doi: 10.1109/ACCESS.2024.3522862 [DOI] [Google Scholar]
  17. Ou X., Gao L., Quan X., Zhang H., Yang J., Li W. (2022). BFENet: A two-stream interaction CNN method for multi-label ophthalmic diseases classification with bilateral fundus images. Comput. Methods Prog. Biomed. 219:106739. doi: 10.1016/j.cmpb.2022.106739, [DOI] [PubMed] [Google Scholar]
  18. Rajesh I. S., Reshmi B. M., Malakreddy A B., Bilakeri S. (2025). Automatic detection of hard exudate in color retinal fundus image and diabetic maculopathy grading. IEEE Access 13, 6618–6631. doi: 10.1109/ACCESS.2025.3525499 [DOI] [Google Scholar]
  19. Sattigeri S. K., Gowda D. N., Ullas K. A., S A. M.ProfessorA (2022). Eye disease identification using deep learning. Int. Res. J. Eng. Technol. 9:974. [Google Scholar]
  20. Shafiq M., Fan Q., Alghamedy F. H., Obidallah W. J. (2024). DualEye-FeatureNet: a dual-stream feature transfer framework for multi-modal ophthalmic image classification. IEEE Access 12, 143985–144008. doi: 10.1109/ACCESS.2024.3469244 [DOI] [Google Scholar]
  21. Shamsan A., Senan E. M., Shatnawi H. S. A. (2023). Automatic classification of colour fundus images for prediction eye disease types based on hybrid features. Diagnostics 13:1706. doi: 10.3390/diagnostics13101706, [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. Sushith M., Sathiya A., Kalaipoonguzhali V., Sathya V. (2025). A hybrid deep learning framework for early detection of diabetic retinopathy using retinal fundus images. Sci. Rep. 15:15166. doi: 10.1038/s41598-025-99309-w, [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. ul Hassan M., Al-Awady A. A., Ahmed N., Saeed M., Alqahtani J., Alahmari A. M. M., et al. (2024). A transfer learning enabled approach for ocular disease detection and classification. Health Inf. Sci. Syst. 12:36. doi: 10.1007/s13755-024-00293-8, [DOI] [PMC free article] [PubMed] [Google Scholar]
  24. Vohra H., Hasan M. K., Norul Huda Sheikh Abdullah S., Islam S., Hadi Abd Rahman A., Bhojake S. N., et al. (2025). A low-cost AI-powered system for early detection of diabetic retinopathy and ocular diseases in resource limited settings. IEEE Access 13, 97322–97336. doi: 10.1109/ACCESS.2025.3572471 [DOI] [Google Scholar]
  25. Wang M. H. (2025). Integrating artificial intelligence and precision therapeutics for advancing the diagnosis and treatment of age-related macular degeneration. Bioengineering 12:548. doi: 10.3390/bioengineering12050548, [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. Wang M. H., Chong K. K. l., Lin Z., Yu X., Pan Y. (2023). An explainable artificial intelligence-based robustness optimization approach for age-related macular degeneration detection based on medical IOT systems. Electronics 12:2697. doi: 10.3390/electronics12122697 [DOI] [Google Scholar]
  27. Wang M. H., Xing L., Pan Y., Gu F., Fang J., Yu X., et al. (2024). AI-based advanced approaches and dry eye disease detection based on multi-source evidence: cases, applications, issues, and future directions. Big Data Min. Anal. 7, 445–484. doi: 10.26599/BDMA.2023.9020024 [DOI] [Google Scholar]
  28. Yu H., Dong X. (2025). Ensemble-based eye disease detection system utilizing fundus and vascular structures. Sci. Rep. 15:19298. doi: 10.1038/s41598-025-04503-5, [DOI] [PMC free article] [PubMed] [Google Scholar]
  29. Zhang Z., Ji Z., Chen Q., Yuan S., Fan W. (2022). Joint optimization of CycleGAN and CNN classifier for detection and localization of retinal pathologies on color fundus photographs. IEEE J. Biomed. Health Inform. 26, 115–126. doi: 10.1109/JBHI.2021.3092339, [DOI] [PubMed] [Google Scholar]
  30. Zhang W., Zhao X., Chen Y., Zhong J., Yi Z. (2021). DeepUWF: an automated ultra-wide-field fundus screening system via deep learning. IEEE J. Biomed. Health Inform. 25, 2988–2996. doi: 10.1109/JBHI.2020.3046771, [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

Publicly available datasets were analyzed in this study. This data can be found here: https://www.kaggle.com/datasets/andrewmvd/ocular-disease-recognition-odir5k.


Articles from Frontiers in Artificial Intelligence are provided here courtesy of Frontiers Media SA

RESOURCES