# One-Stage Disease Detection Method for Maize Leaf Based on Multi-Scale Feature Fusion
## 2 Materials and Methods
### Detection Head
#### 2.4.2 Coordinate Attention  
In this paper, the weight of key features is enhanced by adding coordinate attention (CA) [42] in the backbone to select the feature information extracted from the backbone, as shown in Figure 8 and Algorithm 1.  
Coordinate Information Embedding  
In Figure 8, the coordinate information is embedded into the CA module through the X average pool and the Y average pool. Global pooling is often used for global encoding as it compresses global spatial information into channel descriptors, and it is difficult to  
Figure 8: Coordinate attention module.  
preserve location information. To capture more precise location information, the CA module converts the global pooling into a one-to-one feature encoding operation as established by Equation (6):  
\[Z_{c}=\frac{1}{H\times W}\sum_{i=i}^{H}\sum_{j=1}^{W}x_{c}(i,j) \tag{6}\]  
Specifically, given the input \(x_{c}(i,j)\), each channel is first encoded along the horizontal and vertical coordinates using a pooling kernel of size \((H,1)\) or \((1,W)\). The output of the c channel of height h can be written as:  
\[Z_{c}^{h}(h)=\frac{1}{W}\sum_{0\leq i<W}x_{c}(h,i) \tag{7}\]  
Similarly, the output of the c channel of width w can be written as:  
\[Z_{c}^{w}(w)=\frac{1}{H}\sum_{0\leq i<H}x_{c}(j,w) \tag{8}\]  
The above two transformations, i.e., the X average pool and Y average pool of Figure 7, correspond to two aggregated features of the spatial directions of x and y, thus obtaining a pair of feature maps with perceptual capabilities in different directions. The two transformations enable spatial attention to obtain long-term dependencies along one spatial direction and to preserve precise position information along another spatial direction. This addresses the difficulty of global pooling to preserve location information and helps the network to locate the target of interest more accurately.  
Coordinate Attention Generation  
To take advantage of the embedded information in Section 3.2.1, the CA module concatenates them and then transforms them using a shared \(1\times 1\) convolutional transform function, as follows:  
\[f=\delta\left(F_{1}\left(\left[z^{h},z^{w}\right]\right)\right) \tag{9}\]  
where, \(\left[*,*\right]\) denotes a concatenation operation along the spatial dimension, \(\delta\) is a nonlinear activation function, \(f\  
summation. The SSP improvement module down-samples the feature map while retaining more fine-grained plant information in the feature map, thus reducing information loss.  
This method achieves the fusion of global and local features, thus enriching the expression capability of the feature map, and it is suitable for the feature extraction network of plant diseases.  
Suppose the activation value of each pixel in the SoftPool corresponding to the receptive field is \(\mathrm{a_{i}}\) and the other activation values in the kernel region R are \(\mathrm{a_{j}}\). Then, the weight \(\mathrm{w_{i}}\) of each pixel in the receptive field is as follows:  
\[\mathrm{w_{i}}=\frac{\mathrm{e^{\mathrm{a_{i}}}}}{\sum_{j\in\mathrm{R}}\mathrm{ e^{\mathrm{a_{j}}}}} \tag{13}\]  
After SoftPool, we can obtain the standard summation output value \(\widetilde{\mathrm{a}}\) of all weighted activations in R, as follows:  
\[\widetilde{\mathrm{a}}=\sum_{i\in\mathrm{R}}\mathrm{W_{i}}*\mathrm{a_{i}} \tag{14}\]