# Diabetic Retinopathy Diagnosis Based on RA-EfficientNet
## 2 Methodology
### Feature Extraction Network
#### 2.3.2 EfficientNet  
EfficientNet, an efficient and robust network developed by scaling three parameters i.e., depth, width, and resolution, has been adopted in the model. The network has different versions, ranging from B0 to B7, and in this paper we choose EfficientNetB0 as the feature extractor. In this network, the size of the input image is set as 224 \(\times\) 224, and the key building block of the network is mobile inverted bottleneck convolution, MBConv, which is an addition of the squeeze-and-excitation network (SENet) [18] structured on the basis of an inverted residual block, introduced in MobileNetV2 [19].  
Figure 5 is the schematic representation of EfficientNetB0. The network has 16 MBConv blocks with the kernel of each MBConv block set as 3 \(\times\) 3 or 5 \(\times\) 5. From the figure we can see that the input data, i.e., the fundus image is first placed in the network and then processed through a 3 \(\times\) 3 Conv2D layer, 16 MBConv layers and a 1 \(\times\) 1 Conv2D layer in sequence, and finally, the output of the network is sent to the layers of the next operation, which is the RA block.  
In EfficientNet, a new compound scaling method is proposed--using a compound coefficient \(\varnothing\) to uniformly scale the network width, depth, and resolution, so as to improve the accuracy of the model when the model parameters and calculation amount are maxi  
Figure 5: The Schematic representation of EfficientNet.  
mized. The maximum accuracy of the model is denoted as, and the specific formula is as Equation (1).  
\[\begin{split}\text{N}(\text{d},\text{w},\text{r})=\bigodot\widehat{ \text{F}}_{\text{i}}^{\text{d}\times\text{\ }\widehat{\text{L}}_{\text{i}}}\Big{(}\text{X}_{\text{[r}\times\text{\ }\hat{\text{H}}_{\text{i},\text{r}\times\ }\hat{\text{w}}_{\text{i},\text{w}\times\ }\widehat{\text{c}}_{\text{i}]}}\Big{)}\\ \text{i}=1,2,\cdots,\text{s}\end{split} \tag{1}\]  
In Equation (1), N represents the classification network, \(\bigodot\) represents the convolution operation, i represents the number of convolutional layers, \(\widehat{\text{F}}_{\text{j}}\), \(\widehat{\text{L}}_{\text{i}}\), \(\widehat{\text{H}}_{\text{j}}\), \(\widehat{\text{W}}_{\text{i}}\), \(\widehat{\text{C}}_{\text{j}}\) are predefined parameters in the baseline network. Meanwhile, w, d and r, are coefficients for scaling the network width, depth and resolution, and their calculations are as follows:  
\[\text{depth: d}=\alpha^{\varnothing} \tag{2}\]  
\[\text{width: w}=\beta^{\varnothing} \tag{3}\]  
\[\text{resolution: r}=\gamma^{\varnothing} \tag{4}\]  
\[\alpha\geq 1,\beta\geq 1,\gamma\geq 1\]  
In order to obtain the three dimensional parameters that satisfy the Equation (1), the composite parameter \(\varnothing\) is used to optimize the depth, width and resolution of the network. First, we fix \(\varnothing=1\), and then the best values that satisfy the Equations (1)-(4) are found for \(\alpha\), \(\beta\), \(\gamma\) through a grid search. More specifically, we find that the best value for EfficientNetB0 is \(\alpha=1.2\), \(\beta=1.1\), \(\gamma=1.15\), under a constraint of \(\alpha\cdot\beta^{2}\cdot\gamma^{2}\approx 2\). Then, we fix \(\alpha\), \(\beta\), \(\gamma\) as constants and scale up the baseline network with different \(\varnothing\) using Equations (2)-(4), to obtain EfficientNetB1 to B7.