# GE-YOLO for Weed Detection in Rice Paddy Fields
## 2 Materials and Methods
### Network Structure of GE-YOLO  
YOLOv8, known for its exceptional performance in object detection, represents a significant advancement over YOLOv5. However, when applied to the complex environment of paddy fields and the detection of multiple weed species such as AS, PL, and BS, the relatively simple structure of YOLOv8 exhibits limitations in feature extraction, distribution, and fusion. To address these shortcomings, we propose GE-YOLO, an enhanced YOLOv8 architecture, designed to improve the model's ability to extract weed features, enhance detection accuracy, and improve generalization. GE-YOLO primarily consists of three components: Backbone, Neck, and Head. The network architecture is illustrated in Figure 4.  
The Backbone is responsible for extracting deep features from the image and establishing an image feature pyramid. In the Backbone structure, we adopt the C2f structure from YOLOv8 as the core. Compared to the C3 structure, C2f is more effective in extracting weed features while reducing the number of parameters. Additionally, at the end of the Backbone, the spatial pyramid pooling fast (SPPF) structure is employed to pool weed feature maps \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Weed Species** & **Training Set** & **Validation Set** & **Test Set** \\ \hline AS & 3441 & 672 & 639 \\ PL & 888 & 282 & 315 \\ BS & 2016 & 555 & 609 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Distribution of Weed Dataset. Figure 3: Examples of the dataset annotation process. In the figure, green boxes represent BS, red boxes represent PL, and purple boxes represent AS. (**a**) demonstrates the annotation method for cases where multiple types of weeds are present in the image; (**b**,**c**) illustrate the annotation approach for scenarios with densely distributed weeds; (**d**) shows the annotation method for cases where weeds are partially occluded. at different scales, further enhancing the network's ability to extract multi-scale features of weeds. The Neck is responsible for fusing features at different scales. The Neck network of the YOLO series mostly adopts the traditional FPN structure, which merges features at different scales through multiple connecting branches. However, this structure only allows the fusion of adjacent feature layers. For non-adjacent feature layers, it can only achieve indirect fusion through recursion. This indirect method can result in slower speeds and information loss, particularly for weeds of varying scales and irregular shapes. Therefore, we adopt a new feature aggregation and distribution mechanism, Gold-YOLO [25]. This approach discards the traditional FPN structure in the Neck network and employs a gather-and-distribute mechanism. This mechanism collects and merges information from each layer and then distributes it to different network layers via the Inject module, effectively avoiding information loss and inefficiencies. Additionally, the EMA attention mechanism is integrated into the high-level aggregation and distribution branch, enabling the network to effectively perceive global and local features while maintaining computational efficiency. The Head is responsible for generating the final detection results. The Head part retains the original design of YOLOv8, which achieves object detection through bounding box prediction, object classification, and confidence prediction. Apart from the above measures, we also use offline data augmentation and online Mosaic data augmentation during the pre-training process to enrich sample diversity, prevent overfitting, and improve the model's generalization ability. Figure 4: GE-YOLO network structure, where (**a**) shows the Backbone structure, Conv represents a standard convolution operation, and C2f is a specialized feature extraction module unique to the YOLOv8 architecture. (**b**) shows the Neck structure, composed of Gold-YOLO and the EMA attention mechanism.