# Diabetic Retinopathy Diagnosis Based on RA-EfficientNet
## 3 Experiments
### Experimental Results and Discussion
#### 3.2.1 Task 1: 2-Grade Classification  
The goal of task 1 is to identify whether an image presents DR or No-DR. This is a binary classification task, requiring samples in a dataset with two types of data, DR images and No-DR images. According to this requirement, the APTOS 2019 dataset is divided into two classes, with 1857 DR images in one class and 1805 No-DR images in the other. Setting the ratio of the training set to the testing set as 8:2, i.e., 2929 images are used for training and 733 images for testing. Based on the above setup, our diagnostic model and comparison models are used for this task, and the results are presented below. EfficientNet is comprised of eight versions, from B0 to B7. Table 1 summarizes the default image input size, the number of parameters and defines the accuracy for EfficientNet models in a binary classification. Table 1 presents the performance levels for all eight of the EfficientNet models over image input size, the number of parameters and the accuracy, we can see that EfficientNetB7 achieves the highest accuracy, of 98.36% for a 2-grade classification task, but the input size is too large, and the parameter is the highest. EfficientNetB0 achieves an accuracy of 97.95%, with a small input size and lower parameter. Given the problem of hardware resources, we chose EfficientNetB0 as the feature extractor with a 224 \(\times\) 224 input size. Table 2 presents the comparison in the binary classification, displaying the evaluation metrics belonging to different CNN networks. From the table, we can see that EfficientNet performs better than other models with an accuracy, precision, F1, and a kappa score of 97.95%, 97.96%, 97.95%, and 95.90% respectively. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Input Size** & **Parameter** & **Accuracy (\%)** \\ \hline EfficientNetB0 & 224 \(\times\) 224 & 4,057,253 & 97.95 \\ EfficientNetB1 & 240 \(\times\) 240 & 6,582,914 & 97.54 \\ EfficientNetB2 & 260 \(\times\) 260 & 7,777,012 & 96.04 \\ EfficientNetB3 & 300 \(\times\) 300 & 10,792,746 & 95.90 \\ EfficientNetB4 & 380 \(\times\) 380 & 17,684,570 & 94.13 \\ EfficientNetB5 & 456 \(\times\) 456 & 28,525,810 & 95.22 \\ EfficientNetB6 & 528 \(\times\) 528 & 40,973,969 & 98.22 \\ EfficientNetB7 & 600 \(\times\) 600 & 64,113,049 & 98.36 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of different EfficientNet models. A comparison of the different CNN networks with an RA block for the binary classification is listed in Table 3. We can see from Table 3 that, as RA block can strengthen the attention of the lesion areas, the networks with an RA block perform better, presenting higher values of the evaluation indicators than the evaluation indicators in Table 2. Our network, i.e., RA-EfficientNet, also listed in the table, obtains the best results. Compared with EfficientNet in Table 2, RA-EfficientNet helps us improve the binary classification performance by nearly 4.1%. Table 4 presents the comparison of parameters of different networks for task 1. Compared with other pre-trained networks, the parameter of EfficientNet is relatively small. Although the parameter of MobileNetV2 is the smallest overall, it is not as accurate as EfficientNet. Furthermore, RA-EfficientNet performs better than the rest, with its parameter only 5.2% higher than that of EfficientNet, which means the addition of computer calculation is acceptable. The confusion matrix measures the classification accuracy of a classifier. Each column is a predicted category, and each row is the true category of data. The diagonal line indicates that its prediction is the same as the true value, and the more accurate the predictions are, the darker the color. Figure 8 provides the confusion matrix of EfficientNet and RA-EfficientNet for the 2-grade classification. Although there are 733 images available for testing, we are able to observe that the total number predicted to be No-DR or DR is 716, and the misclassification number is 17 in EfficientNet.