This study explores the use of a Vision Transformer (ViT) model to classify diabetic retinopathy severity from fundus images, demonstrating promising accuracy through transfer learning and data augmentation techniques. While results fell short of state-of-the-art benchmarks, the model shows potential for improving early diagnosis through AI-driven medical imaging.
Diabetic Retinopathy (DR) is a complication of diabetes, which afflicts about 400 million people in today's world, that causes the blood vessels of the retina to swell and to leak fluids and blood. Early detection of DR can help manage it with lifestyle changes and medical interventions, preventing the need for costly treatments like laser or surgery, and providing a much better standard of life. This motivates the search for easier, affordable and accessible DR detection technology using the help of Artificial Intelligence given the huge number of potential patients. This paper investigates the application of a Vision Transformer (ViT) model for classifying diabetic retinopathy severity levels from fundus images, aiming to provide accurate predictions essential for early diagnosis and treatment. To optimize model performance, images were preprocessed to appropriate resolutions, and the dataset was divided into training, validation, and test sets. Data augmentation techniques, including geometric transformations and color adjustments, were employed to enhance data diversity and prevent overfitting. The ViT model was modified by freezing upper layers and adjusting the final fully connected layer to classify images across five severity levels, leveraging transfer learning for efficient fine-tuning. With a learning rate of 0.0002 and a batch size of 52, the model was trained with early stopping, achieving a validation accuracy of 75.96%, a loss of 0.58, a recall of 0.72, a precision of 0.700, and an F1-score of 0.675.These results demonstrate the model’s balanced performance, capturing most positive cases while maintaining reasonable precision. Yet, the results fell short of 90%+ accuracy obtained in [8] throughout our testing period and more analysis is necessary to assess. Future work will explore dynamic learning rate schedules and alternative batch sizes to further enhance model accuracy to reach the higher goal. This study highlights the Vision Transformer model’s potential for nuanced medical image classification tasks, contributing to advancements in automated diagnostic tools.
Related Projects