## 2 Datasets and Methods
### Channel Attention Module ECANet  
The wheat images collected in the field environment still pose challenges to the recognition ability of the network due to the complexity of the background, including but not limited to the loss of detail information and the lack of concentration of weight allocation, resulting in limited recognition accuracy. To overcome these limitations, this study introduces an attention mechanism module to enhance the feature expression ability of the model.  
As the network depth and model complexity increase, which makes model training difficult, the channel attention mechanism gradually appears in the public's field of vision. In recent years, SENet has attracted great interest in introducing information channel attention into convolution blocks, showing great potential for performance improvement. Later, research was carried out to improve SE modules by capturing more complex channel dependencies or combining additional spatial attention, but the higher the model accuracy, the higher the complexity, the higher the computational cost, and the higher the computational cost. The research shows that the dimensionality reduction operation adopted by SENet will have a negative impact on the prediction of channel attention, and the efficiency of obtaining dependencies is low. Based on this, an efficient channel attention (ECA) module for CNN is proposed [25], which avoids dimensionality reduction while effectively retaining channel feature information. The specific model is shown in Figure 5. The module effectively filters out information that is highly relevant to the target feature by dynamically adjusting the feature weight while suppressing irrelevant or redundant information, enhancing the robustness of the model for complex backgrounds and improving the accuracy of wheat drought stress degree identification.  
The process ideas of the ECA model are as follows:  
1. First enter the feature map, whose dimension is H \(\times\) W \(\times\) C;
2. Spatial feature compression of the input feature map; implementation: in the spatial dimension, use the global average pooling GAP to obtain a 1 \(\times\) 1 \(\times\) C feature map;
3. Perform channel featured learning on the compressed feature map; implementation: learn the importance between different channels through 1 \(\times\) 1 convolution, and the output dimension is still 1 \(\times\) 1 \(\times\) C at this time;
4. Finally, the channel attention is combined, the feature map of the channel attention is 1 \(\times\) 1 \(\times\) C, the original input feature map H \(\times\) W \(\times\) C, the channel-by-channel multiplication is carried out, and the final output is a feature map with channel attention.  
Figure 4: DenseNet network structure diagram.  
The dynamic convolutional kernel in the figure refers to the following process: the size of the convolutional kernel is adaptively changed by a function; in the layer with a large number of channels, use the larger convolutional kernel to carry out 1 \(\times\) 1 convolution to make more cross-channel interactions; in the layer with a small number of channels, use the smaller convolutional kernel to carry out 1 \(\times\) 1 convolution to make fewer cross-channel interactions. The convolution and AdaGrad functions are defined as follows:  
\[k=\psi(C)=\left|\frac{\log_{2}(C)}{\gamma}+\frac{b}{\gamma}\right|_{\text{odd}} \tag{1}\]  
In the above formula, \(k\) represents the AdaGrad kernel size; \(C\) represents the number of feature channels; odd indicates that \(k\) can only take odd numbers; \(\gamma\) and \(b\) are set to 2 and 1 in the experiment to change the ratio between the number of channels \(C\) and the sum of convolutional kernel sizes.