DualMIL-ViT: A Dual-Attention Multiple-Instance Vision Transformer for Diabetic Retinopathy Grading
摘要
Diabetic retinopathy (DR) remains a leading cause of vision impairment among adults, underscoring the importance of early and accurate detection. Conventional convolutional neural networks (CNNs) often struggle to capture subtle lesions and global contextual dependencies. Meanwhile, multi-instance learning (MIL) frameworks are prone to noise interference and unstable optimization under weak supervision. To address these limitations, we propose DualMIL-ViT, a Vision Transformer–based MIL architecture that incorporates a dual attention mechanism and a soft Top-k aggregation strategy within a soft-attention MIL framework. The proposed model enhances both channel-wise and spatial feature representations while adaptively selecting discriminative instances to integrate local and global contextual cues. Furthermore, gradient clipping and label smoothing are employed to stabilize training and improve generalization. Evaluated on the APTOS dataset, DualMIL-ViT achieves an accuracy of 0.846, AUC of 0.974, Cohen’s kappa of 0.920, weighted F1-score of 0.848. Experimental results demonstrate that DualMIL-ViT effectively aggregates critical lesion information and substantially improves diagnostic performance, offering a reliable and efficient solution for automated DR grading. The source code of the proposed DualMIL-ViT is publicly available at https://github.com/hushuman/DualMiT-ViT.