## 3 Materials and Methods
### Gated Probability Fusion Module  
Given the abundant feature maps on behalf of identification targets and their local components, a gated probability fusion module is designed to combine feature information of multiple network branches and modules as the ultimate predicting results. This proposed module aims to form a universal network sub-module based on the gating theory, which will score different input features and dynamically configure the corresponding weights so that the classification results are optimized on a large scale. Firstly, a gating network is proposed to analyze the complicated interactions of the input sub-modules through a self-gating mechanism in order to establish the nonlinear representation of probability associations among each network composition. With the internal associations, the gating network could eliminate redundant information between different feature maps and compensate for their interference effect on the final results. In detail, a concatenation layer was added after the soft-VLAD module to joint multi-dimensional feature maps from each sub-modules, which export an integral feature vector \(f=concat(F_{i},V)\). Take the feature maps \(F_{1}\) and \(F_{2}\) as an example, they are spliced with aggregated tensor V, respectively, to obtain the vector \(f[E_{1},E_{2}]\) as the input of the fusion module. Then, \(f\) will go through the gating network to achieve the intrinsic weights and respective priorities of each composition by making corresponding output labels. With the non-sparse Softmax function, the vector equation \(G_{ij}\) of the gating network outputs the \(j\)-th sample label of \(i\)-th feature maps as follows:  
\[G_{ij}=Softmax(TopK(f\cdot W_{g},k)) \tag{6}\]  
where \(W_{g}\) is a trainable matrix presenting the pertinence weights of all input sub-module and parameterizing calculations. \(TopK_{i}\) means a sparsity ranking operation, which only captures the top \(k\) gate values and sets the rest values to 0. Here, nonzero \(k>1\) is the gated parameter, which can be trained and tested in backward gradient propagation along with the whole method. \(Softmax\) represents the Softmax activation function. With sparse weighted concatenation, the gated network outputs a sparse \(N\times n\times k\) dimensions tensor, of which \(N\) is the number of sample labels and \(n\) is the feature dimensions of sub-modules. In the paper, \(N\) is set up to 512 according to the batch-size value uniformly, and \(n\) is set as 2048 equaling the output dimensions number of the concatenation layer. Then, the next step is to calculate the predicting scores of each sub-module with gated weighting. This process is achieved by multiplying the distribution representation \(E_{ij}\) of input features \(f\) by the relevant gated vector \(G_{ij}\), both of them are defined in the same dimension and matching scale. Then, the predicting scores belonging to different modules are calculated independently in Gaussian probability estimated solution as following  
\[s_{i}=G_{ij}\odot E_{ij}(f) \tag{7}\]  
\[E_{ij}(\widetilde{y}|\theta_{i})=\frac{1}{\sqrt{2\pi\sigma_{i}}}\exp(-\frac{ (\widetilde{y}-\mu_{i})^{2}}{2\sigma_{i}^{2}}) \tag{8}\]  
where \(s_{i}\) means the predicting score of \(i\)-th sub-module. \(E_{ij}\) is the probability estimation of Gaussian distribution. \(\widetilde{y}\)\(=\{\widetilde{y}_{1},\widetilde{y}_{2},\cdots,\widetilde{y}_{N}\}\) is the input middle features corresponding to original pest images and annotations. \(\theta_{i}=(\mu_{i},\sigma_{i}^{2})\) is estimated hyper-parameter according to normal Gaussian distribution, which contains the covariance matrix \(\sigma_{i}^{2}\) and average value \(\mu_{i}\). In addition, there is a normalized constraint of \(\sum\limits_{i=1}^{2}G_{ij}=1\) to make sure the regularization of total probabilities. Then, the expectation maximization algorithm (EM algorithm) is selected to estimate the log-maximum likelihood of \(\theta_{i}=(\mu_{i},\sigma_{i}^{2})\) in the fuse layer, which impends over the optimal result in constant iterations.