# Lightweight Frequency Recalibration Network for Diabetic Retinopathy Multi-Lesion Segmentation
## 2 Methods
### Frequency Recalibration Module (FRCM)  
Retinal fundus images are more sensitive to variations in lighting than the ones from natural scenarios, which decreases the morphological features of lesions under different lighting conditions. Traditional convolutional neural networks (CNNs) tend to extract features based on texture rather than shape [17; 18], which limits their ability to utilize useful low-frequency shape information [14]. The frequency recalibration module (FRCM) is proposed to extract the features of both texture and shape, which is illustrated in Figure 4.  
There are three components: a Gaussian pyramid, a Laplacian pyramid, and a frequency attention module. The input feature map is transformed into a Laplacian pyramid using the difference of Gaussian (DoG): diverse Gaussian kernels and variances are incorporated into Gaussian functions to generate two-dimensional Gaussian kernels and further form a Gaussian pyramid, and the Laplacian pyramid is generated by subtracting between different levels of the Gaussian pyramid. The computational formulas for both the Gaussian and Laplacian pyramids are, respectively, presented in Equations (1) and (2):  
\[G_{l}(x)=x^{H\times W\times C}*\frac{1}{\sigma_{l}\sqrt{2\pi}}e^{-\frac{\beta _{+}^{2}\rho}{2\tau_{l}^{2}}} \tag{1}\]  
\[LP_{l}=\left\{\begin{aligned} G_{0},l=1\\ G_{l-2}-G_{l-1},2\leq l\leq 5\end{aligned}\right. \tag{2}\]  
where \(H\), \(W\), and \(C\) denote the height, width, and number of channels of the feature map, respectively, \(x\in R^{H\times W\times C}\) the input feature map of the FRCM, \(l\) the \(l\)-th level of the Gaussian pyramid ranging from \(G_{0}\) to \(G_{4}\), \(c_{l}\) the variance of the Gaussian pyramid in the \(l\)-th layer, \(i\) and \(j\) the two-dimensional Gaussian kernel coordinates, \(*\) the convolution operation, and \(LP_{l}\) the \(l\)-th layer of the Laplace pyramid.  
Figure 3: Structure of the MobileNetV2 and its components.  
The Laplacian pyramid, which consists of different frequency layers and a frequency attention module inspired by the ECA-net [19], is introduced in this paper. First, each layer of the Laplacian pyramid undergoes global max pooling to acquire global spatial information and generate weights for all input channels. Then, different from [14], one-dimensional convolution with shared weights is used to capture the dependencies of channels for each layer instead of the fully connected layer, which can reduce the model parameter number and enhance inter-channel information interaction capabilities. The calculation for global max pooling and inter-channel dependencies of feature maps in each layer are shown in Equations (3) and (4), respectively. The feature maps for each channel are computed by multiplying the learned weights with the input channel features \(L\tilde{P}_{l}^{f}=w_{l}^{f}LP_{l}^{f}\).  
\[GMP_{l}^{f}=\frac{1}{H\times W}\sum_{i}^{H}\sum_{j}^{W}LP_{l}^{f}(i,j) \tag{3}\]  
\[w_{l}^{f}=\sigma(1 DConv(GMP_{l}^{f})) \tag{4}\]  
where \(H\) and \(W\) represent the height and width of the feature map separately, \(LP_{l}^{f}\) the \(f\)-th channel of the feature map in the \(l\)-th layer, \(GMP_{l}^{f}\) the output of \(LP_{l}^{f}\) through global max pooling, \(w_{l}^{f}\) the learned weight for the \(f\)-th channel of the \(l\)-th layer, \(1 DConv\) and \(\sigma\) the one-dimensional convolution and sigmoid functions, respectively, and \(L\tilde{P}_{l}^{f}\) the output obtained by \(LP_{l}^{f}\).  
After recalibrating the feature maps of each layer, the frequency attention module fuses the features from all layers through 3D convolutional operations to produce the final output \(x^{\prime}\) of the FRCM, which can be formulated as follows:  
\[x^{\prime}=\sigma(\sum_{l=1}^{L}w_{l}^{\prime}L\tilde{P}_{l}^{f})\]