# GE-YOLO for Weed Detection in Rice Paddy Fields
## 2 Materials and Methods
### Network Structure of GE-YOLO
#### 2.2.4 Efficient Multi-Scale Attention Module  
In the actual weed images, the vegetative environment is often quite complex, with factors such as rice occlusion and the similarity in color between weeds and crops affecting detection performance. The addition of an attention mechanism can enhance the network's focus on important features in the image, eliminating interference from irrelevant background elements and thereby improving detection performance.  
Traditional conventional channel and spatial attention mechanisms have demonstrated significant efficacy in enhancing the discriminative power of feature representations. However, they often bring side effects in extracting deep visual representations due to channel dimensionality reduction when modeling cross-channel relationships. To address this issue, [PERSON], [PERSON], [PERSON], and others proposed the EMA attention mechanism [26]. This attention mechanism rearranges some channels into multiple batches and groups the channel dimensions into multiple sub-features, ensuring that spatial semantic features are well distributed within each feature group while reducing computation overhead. The architecture of the EMA attention mechanism is depicted in Figure 8, where \(h\) denotes the image height, \(w\) indicates the image width, \(c\) represents the number of channels, and \(g\) signifies the channel grouping.  
Specifically, the EMA attention mechanism utilizes a parallel substructure that aids in minimizing sequential processing and reducing the network's depth. This module is capable of performing convolutional operations without diminishing the channel dimensionality, allowing it to effectively learn channel representations and generate improved pixel-level attention for high-level feature maps.  
The EMA module is intended to effectively model both short-term and long-term dependencies, thereby improving performance in computer vision tasks. It comprises three parallel branches, with two residing in the \(1\times 1\) branch and one in the \(3\times 3\) branch. The \(1\times 1\) branch applies two separate 1D global average pooling operations to encode channel information along two spatial axes, while the \(3\times 3\) branch employs a single \(3\times 3\)  
Figure 7: Schematic diagram of the High-GD module, which consists of two parts: High-FAM and High-IFM, responsible for aggregating and distributing high-level features. _P3_, _P4_, _P5_ represent high-level features from different scales; C represents the concatenation operation.  
kernel to extract multi-scale features. To retain channel-specific information and minimize computational load, the EMA module reorganizes certain channels into batch dimensions and divides the channel dimensions into multiple sub-groups, ensuring an even distribution of spatial semantics across each feature group. Additionally, cross-dimensional interactions are utilized to aggregate the outputs of the two parallel branches, enabling the capture of pairwise pixel relationships at the pixel level.  
As shown in Figure 4, To enhance the network's attention to weed features and mitigate the impact of irrelevant backgrounds on weed detection, we introduced the EMA attention mechanism after the Inject module in the Neck network.