Diabetic Retinopathy (DR) is a late-stage ocular complication of diabetes. Proposing a high-accuracy automatic screening technology of fundus images based on deep learning is of great significance to delay the deterioration of DR. In this paper, we propose an end-to-end framework RAN for DR classification and diagnosis based on the ResNet, attention mechanism and dilated convolution was added to the framework. We implemented experiments on three DR datasets, Kaggle, Messidor and IDRid, analyzed and compared the experimental results. The focal loss function is added to solve the imbalance problem between DR datasets. The results show that the method RAN used mainly improves the results of the basic neural network when using the same dataset. Therefore, by optimizing the basic neural network, the classification and diagnosis effect of DR can be improved.