Task optimized vision transformer for diabetic retinopathy detection and classification in resource constrained early diagnosis settings
B. Ramasubramanian, Preethi Sekar, N. Nagaprasad, Tadesse Regassa Mamo, Krishnaraj Ramaswamy
Abstract
Diabetic Retinopathy (DR) is a progressive complication of diabetes and a leading cause of preventable blindness worldwide. Early detection and accurate classification of DR severity are critical for timely intervention but remain challenging, particularly in resource-constrained settings. While conventional deep learning (DL) models based on Convolutional Neural Networks (CNNs) have shown promising results, they often struggle to capture long-range dependencies in retinal fundus images and typically require substantial computational resources, limiting their utility on low-cost hardware. To address these challenges, this study introduces a Task-Optimized Vision Transformer (TOViT) model, specifically designed for DR detection and severity classification. The model integrates several optimization strategies, including layer-wise learning rate scheduling, attention head tuning, and embedding dimension refinement, to enhance feature extraction while maintaining computational efficiency. The model is further compressed through structured pruning and 8-bit quantization to support real-time deployment on Raspberry Pi-4 hardware. Evaluated on three large-scale public datasets, TOViT achieved a classification accuracy of 99%, with F1-scores exceeding 93% across all DR stages. Hardware implementation yielded real-time performance, processing at 8 frames per second with 120 ms latency, confirming its potential for use in portable, point-of-care screening devices. This work presents a scalable and clinically relevant approach for automated DR diagnosis, with promising implications for expanding access to early retinal screening in global healthcare systems.