## 2 Materials and Methods
### Proposed Improve Centernet Model
#### 2.2.2 Multi-Scale Feature Fusion Module  
After many convolution and pooling operations, the features of small-sized pests and diseases become blurred and difficult to extract. Even these features may get deformed and lost. In the object detection task, to improve the detection ability of multi-scale objects, a common method is to fuse the shallow features and deep features together. However, direct fusion of features reduces the capacity of multi-scale representation. Furthermore, the predictions between layers are independent of each other, making it easy to ignore some important features.  
To solve these problems, [PERSON] et al. proposed a bidirectional feature fusion network called PANet [13]. PANet achieves bidirectional convergence by introducing bottom-up connectivity. As shown in Figure 5, there are some nodes in PANet with only input edges, which do not contribute much to the performance of the network, and they add additional parameters and computations.  
A weighted bidirectional feature fusion module (MFF) is proposed in this paper. First, the MFF module removes nodes with only input edges and the last node in layer 6. These nodes only pass input features without feature fusion, which contributes little to the network performance and increases the number of parameters. Second, the MFF module adds skip connections to establish connections between inputs and outputs at the same scale layer, both to avoid excessive computational costs and to better fuse features. Since input features with different resolutions contribute differently to the output, additional weights are added for each input feature to learn their importance in the output. A fast normalization fusion method with weights is adopted. Finally, the four feature maps with different resolutions are aggregated into high-resolution output through up-sampling and other operations to summarize multi-scale local information and global information to improve the performance of object detection.  
\[O=\sum_{i}\frac{w_{i}}{\varepsilon+\sum\limits_{j}w_{j}}\bullet I_{i} \tag{3}\]  
where \(O\) is the output value of the node, \(I_{i}\) is the input value from node I, \(w_{i}\) and \(w_{j}\) are the input weights of the corresponding nodes. A small quantity \(\varepsilon\) is guaranteed to be numerically stable, \(\varepsilon\) = 0.0001.  
The structure of the MFF module is shown in Figure 6.  
Figure 5: PANet structure diagram.  
First, C4 is downsampled to generate C5 and C6. Then, each node is appended with weights for fast normalized feature fusion. Taking the third layer as an example, \(P_{3}^{IN}\) is the input of the third layer, \(P_{3}^{ld}\) is the intermediate node of the third layer, and \(P_{3}^{out}\) is the output of the third layer with weight fusion.  
The intermediate node features are calculated as shown in Equation (4).  
\[P_{3}^{ld}=\text{Conv}(\frac{\omega_{1}\bullet P_{3}^{IN}+\omega_{2}\bullet \text{Resize}(P_{4}^{ld})}{\omega_{1}+\omega_{2}+\varepsilon}) \tag{4}\]  
where Conv is the convolution operation, Resize is the size scaling operation, and \(\omega_{1}\) and \(\omega_{2}\) are the learnable weights of the corresponding node inputs.  
The output node features with weight fusion are calculated as in (5).  
\[P_{3}^{out}=\text{Conv}(\frac{\omega_{1}{}^{\prime}\bullet\textbf{p}_{3}^{IN}+ \omega_{2}{}^{\prime}\bullet P_{3}^{ld}+\omega_{3}{}^{\prime}\bullet\text{ Resize}(P_{2}^{out})}{\omega_{1}{}^{\prime}+\omega_{2}{}^{\prime}+\omega_{3}{}^{ \prime}+\varepsilon}) \tag{5}\]  
where \(\omega_{1}{}^{\prime}\), \(\omega_{2}{}^{\prime}\), and \(\omega_{3}{}^{\prime}\) are the learnable weights entered by the corresponding node.  
After fast normalization fusion with weights, four layers of features with different resolutions are obtained. These features are then adjusted to the same resolution and fused into one feature.