A Dual-Stage Diagnostic Framework For Diabetic Retinopathy Grading And Lesion Segmentation Using EfficientNetV2 And NnU-Net

31 Jul

Authors: Md. Anisur Rahman, Rahul Dahiya, Naveen Sharma, Vinay Kumar Nassa, Pradeep

Abstract: Diabetic Retinopathy (DR) remained a leading cause of preventable vision loss worldwide, with its prevalence driven by the global diabetes epidemic. This study aimed to develop an accurate and scalable automated screening solution to overcome the interpretability limitations of existing black-box classifiers. A dual-stage diagnostic framework was proposed that integrated global severity grading with pixel-level lesion segmentation. In the first stage, an EfficientNetV2-S architecture was optimised with Focal Loss (gamma = 2.0) and five-pass Test-Time Augmentation to categorise fundus images into five DR severity grades (0 to 4), achieving a peak training accuracy of 94.43% and a best validation accuracy of 61.17%. In the second stage, a self-configuring 9-stage nnU-Net performed semantic segmentation of pathological biomarkers using high-resolution patches (1024 x 1536 pixels), achieving a Dice Similarity Coefficient of 0.81 for Hard Exudate detection, which surpassed all existing IDRiD dataset benchmarks. An adaptive inference mechanism was implemented to ensure that computationally intensive segmentation was triggered only when pathology was confirmed by Stage 1, thereby preserving efficiency on standard hardware. The complete framework was deployed as a portable, cross-platform desktop application via the Eel library and PyInstaller, enabling clinical use without internet connectivity or specialist dependency management. Results demonstrated that combining weighted classification with deep segmentation significantly enhanced both the interpretability and the reliability of automated DR screening.

DOI: http://doi.org/10.5281/zenodo.21721320