Abstract:Aiming at the problems of small datasets, unbalanced categories and poor diagnostic results in deep learning diagnosis of diabetic retinopathy (DR), this paper proposes a DR grading model based on parallel images and Swin Transformer. First, build a parallel image generation model based on StyleGAN2-ada to solve the problem of too few training images and class imbalance. After FID, KID and visual evaluation, the constructed parallel images meet the requirements of subsequent work. Then, a DR diagnosis model is constructed based on the attention and window shifting mechanism to improve the diagnosis effect. Finally, a diagnostic model is trained using the parallel images. After verification, the accuracy of the diagnostic model proposed in this paper is 93.5%, the highest specificity is 99%, and the highest F1-score is 0.96. Compared with the original images, the accuracy of the model is improved by 20% and the accuracy is improved by up to 70% after training the model with parallel images. Compared with the other three deep learning models, all the indicators of the method proposed in this paper are optimal. The above results show that the model constructed in this paper can achieve better diagnostic results under a small sample data set.