## 2 Materials and Methods
### Cotton-YOLO Structure
#### 2.3.3 Gather-and-Distribute Neck  
In real cotton field environments, owing to the complexity of the background, the features of cotton bolls are small and less prominent. The neck structure of the YOLO series, illustrated in Figure 8, employs the traditional FPN structure, comprising multiple branches for multi-scale feature fusion. However, it can only integrate features from adjacent layers fully; for other layers' information, it is only obtainable indirectly through \"recursion\". This process leads to a significant loss of small-scale information during computation, resulting in a high number of missed detections and false detections of cotton bolls. To mitigate the problem of information loss during the information transmission process in the traditional FPN structure, we introduce a new gather-and-distribute (GD) mechanism inspired by Gold-YOLO. Specifically, the gather-and-distribute process involves three modules: the feature alignment module (_FAM_), the information fusion module (_IFM_), and the information injection module (Inject). The gathering process comprises two steps. Initially, _FAM_ collects and aligns features from various levels. Subsequently, _IFM_ merges the aligned features to generate global information. After obtaining the merged global information from the gathering process, the injection module distributes this information to each level and employs simple attention  
Figure 8: Traditional neck. Figure 7: Convolutional block attention module structure. operations for injection, thereby enhancing the detection capabilities of the branches. To improve the model's ability to detect objects of different sizes, we have developed two branches: the low gather-and-distribute branch (Low-GD) and the high gather-and-distribute branch (High-GD). As illustrated in Figure 9, the input to the neck comprises feature maps _B2_, _B3_, _B4_, and _B5_ extracted by the backbone, where \(B_{i}\in\mathbb{R}^{N\times C_{\text{B}}\times R_{\text{B}}}\). The batch size is denoted by \(N\), the number of channels is denoted by \(C\), and the spatial dimensions is denoted by \(R=H\times W\). Furthermore, the dimensions of \(R_{B2}\), \(R_{B3}\), \(R_{B4}\), and \(R_{B5}\) are \(R/2\), \(R/4\), \(R/4\), and \(R/8\), respectively. Low-Order Aggregation-Distribution Branch: In this branch, Backbone's output features _B2_, _B3_, _B4_, and _B5_ are fused to obtain high-resolution features that retain small target information. The structure is shown in Figure 10a. * Low-Feature Alignment Module (_Low-FAM_)  
In the low-feature alignment module (_Low-FAM_), input features are downsampled using average pooling (_AvgPool_) operations to achieve a uniform size. By resizing the feature size to the smallest feature size in the group (\(R_{B4}=1/4R\)), \(F_{align}\) is obtained. * Low-Information Fusion Module (_Low-IFM_)  
The design of the low-information fusion module (_Low-IFM_) comprises multiple layers of reparameterized convolution blocks (_RepBlock_) and split operations. Specifically, RepBlock accepts \(F_{align}(\text{channel}=sum(C_{B2},C_{B3},C_{B4},C_{B5})\) as input and generates \(F_{fuse}(\text{channel}=C_{B4}+C_{B5})\) The intermediate channels represent adjustable values to accommodate different model sizes. The features produced by RepBlock are then split along the channel dimension into \(F_{inj\_P3}\) and \(F_{inj\_P4}\), which are subsequently merged with features from different levels. \[F_{align}=Low\_FAM(B2,\text{ }B3,\text{ }B4,\text{ }B5) \tag{1}\]  
\[F_{align}=RepBlock\big{(}F_{align}\big{)} \tag{2}\]  
\[F_{inj\_P3},F_{inj\_P4}=Split\Big{(}F_{fuse}\Big{)} \tag{3}\]  
* Information Injection Module  
To inject global information more effectively into different levels, this module utilizes split experience and attention operations to merge information, as illustrated in Figure 10c. The module receives local information (the current level's features) and global injection information (generated by _IFM_), represented as \(F_{local}\) and \(F_{inj}\).