Automated Diabetic Screening via Anterior Segment Ocular Imaging: A Deep Learning and Explainable AI Approach
Authors: Hasaan Maqsood, Saif Ur Rehman Khan, Sebastian Vollmer, Andreas Dengel, Muhammad Nabeel Asim
Organizations: BiogentX (biogentx.com, Renala Khurd, District Okara, Punjab, Pakistan. · Department of Computer Science, Rhineland-Palatinate Technical University of Kaiserslautern-Landau, Kaiserslautern, 67663, Germany. · German Research Center for Artificial Intelligence, Kaiserslautern, 67663, Germany. · Intelligentx GmbH (intelligentx.com), Kaiserslautern, Germany. · Department of Core Informatics, Graduate School of Informatics ,Osaka Metropolitan University, Saka, 599-8531, Japan.
Diabetic retinopathy screening traditionally relies on fundus photography, requiring specialized equipment and expertise often unavailable in primary care and resource limited settings. We developed and validated a deep learning (DL) system for automated diabetic classification using anterior segment ocular imaging a readily accessible alternative utilizing standard photography equipment. The system leverages visible biomarkers in the iris, sclera, and conjunctiva that correlate with systemic diabetic status. We systematically evaluated five contemporary architectures (EfficientNet-V2-S with self-supervised learning (SSL), Vision Transformer, Swin Transformer, ConvNeXt-Base, and ResNet-50) on 2,640 clinically annotated anterior segment images spanning Normal, Controlled Diabetic, and Uncontrolled Diabetic categories. A tailored preprocessing pipeline combining specular reflection mitigation and contrast limited adaptive histogram equalization (CLAHE) was implemented to enhance subtle vascular and textural patterns critical for classification. SSL using SimCLR on domain specific ocular images substantially improved model performance.EfficientNet-V2-S with SSL achieved optimal performance with an F1-score of 98.21%, precision of 97.90%, and recall of 98.55% a substantial improvement over ImageNet only initialization (94.63% F1). Notably, the model attained near perfect precision (100%) for Normal classification, critical for minimizing unnecessary clinical referrals.
Figures & tables
Reference
Approach
Limitation
Gulshan et al. [ 4 ]
Deep CNN on fundus images (128K images)
Requires specialized fundus cameras (10K–50K) and mydriatic imaging; not accessible in primary care settings
Babenko et al. [ 2 ]
External eye photos for systemic disease (145K patients)
AUC 71–82% for diabetic disease; substantially lower than our 98.21% F1-score
Trained on diabetic screening populations only; limited generalizability to non-diabetic cohorts
Wu et al. [ 25 ]
Multitask EfficientNet-B2 on heterogeneous fundus datasets
Fundus-based; requires dilation; not applicable to anterior segment screening
Gu et al. [ 24 ]
Smartphone DL app for anterior segment diseases
Low sensitivity (0.29) for abnormality detection; small training dataset (313 usable images)
Li et al. [ 3 ]
Iris/sclera analysis for diabetes
Manual feature extraction; no end-to-end learning; AUC 67–70% for HbA1c prediction
Table 1: Comparison of diabetic screening methods and their limitations
Category
Clinical Definition
Normal
Non diabetic individuals with no history of diabetes mellitus. HbA1c ¡5.7%, fasting glucose ¡100 mg/dL. No anterior segment biomarkers: absence of scleral vessel tortuosity, normal conjunctival vasculature, no iris structural changes.
Controlled
Diagnosed diabetic patients under regular pharmacological management with good glycemic control. HbA1c ¡7.0%, consistent medication adherence. Minimal or absent anterior segment manifestations.
Uncontrolled
Diagnosed diabetic patients with poor glycemic control due to irregular medication adherence or treatment resistance. HbA1c ≥ 7.0%. Visible ocular biomarkers: scleral vessel tortuosity, conjunctival hyperemia, iris structural alterations.
Table 2: Clinical Category Definitions
Figure 1: Anterior segment image samples across three clinical categories and five gaze directions, before and after quality assessment relabeling.
Figure 2: Preprocessing pipeline: original image (left), after specular reflection removal (middle), and after CLAHE enhancement (right).
Figure 3: Seven clinically validated data augmentation transformations applied to anterior segment training images.
Figure 4: Architecture overview of the SimCLR self-supervised framework for ocular feature learning, where augmented views pass through a shared encoder and projection head optimized with NT-Xent loss ( τ=0.5 ). After 10 epochs, the loss decreases from 3.33 to 2.90, yielding pretrained encoder weights for supervised fine-tuning.
Item
Description
Section
Pass
Title & Abstract
Title
Prediction model for diabetic screening
Title
Yes
Abstract
Objectives, methods, results, conclusions
Abstract
Yes
Introduction
Background
Diabetic screening challenges, SSL for medical imaging
Sec. 1, 1.1
Yes
Objectives
Study contributions and innovations
Sec. 1.2
Yes
Table 3: TRIPOD Checklist Reporting
Initialization
F1
Precision
Recall
Accuracy
ImageNet Only
0.9463
0.9397
0.9550
0.9489
ImageNet + SSL
0.9821
0.9790
0.9855
0.9830
Improvement
+3.58%
+3.93%
+3.05%
+3.41%
Table 4: Impact of Self-Supervised Pretraining (EfficientNet-V2-S)
Figure 5: Confusion matrices comparing SSL-pretrained and baseline EfficientNetV2-S on the validation set.
SSL-Pretrained
Baseline
Class
F1
Prec
Rec
F1
Prec
Rec
Control
0.99
0.98
1.00
0.95
0.94
0.96
Normal
0.99
1.00
0.98
0.94
0.92
0.97
Uncontrolled
0.97
0.96
0.98
0.95
0.96
0.94
Macro Avg
0.9821
0.9790
0.9855
0.9463
0.9397
0.9550
Table 5: Per-Class Performance: SSL vs Baseline EfficientNetV2-S
Figure 6: Per-class performance comparison between the SSL-pretrained EfficientNetV2-S and the baseline model
Figure 7: Comparison of AUC-ROC and Precision-Recall curves for SSL and baseline models.
Model
F1
Precision
Recall
Accuracy
ResNet-50 [ 28 ]
0.8855
0.8867
0.8848
0.8977
ConvNeXt-Base [ 26 ]
0.9302
0.9349
0.9278
0.9375
ViT-B/16 [ 29 ]
0.9380
0.9328
0.9441
0.9432
Swin-V2-Base [ 30 ]
0.9380
0.9328
0.9441
0.9432
EfficientNet (ImageNet) [ 27 ]
0.9463
0.9397
0.9550
0.9489
EfficientNet (SSL)
0.9821
0.9790
0.9855
0.9830
Table 6: Model Performance on Diabetic Classification
Figure 8: Grad-CAM clinical validation shows the SSL-pretrained EfficientNetV2-S consistently focuses on clinically relevant structures (sclera, iris, conjunctiva) across all diabetic categories, with minimal attention to imaging artifacts.
Figure 9: t-SNE visualization of learned feature representations comparing SSL-pretrained and baseline EfficientNetV2-S models.
Configuration
F1
Precision
Recall
Accuracy
Baseline (raw data, ImageNet init.)
30.69
30.53
31.91
35.35
+ Data Cleaning
88.62
87.84
89.77
89.20
+ Data Augmentation (4 × )
94.63
93.97
95.50
94.89
+ SSL Pretraining (SimCLR)
98.21
97.90
98.55
98.30
Total Improvement
+67.52
+67.37
+66.64
+62.95
Table 7: Ablation Study: Contribution of Each Pipeline Component. All configurations use EfficientNetV2-S with identical architecture, optimiser, and hyperparameters. Val set: 396 images (original only, no augmented leakage).
Vishwakarma Institute Of Technology, Computer Engineering Department, Pune , India · Vishwakarma Institute Of Technology, Computer Science and Engineering (AI & ML ) Department, Pune , India