## 2 Materials and Methods
### Cotton-YOLO Structure
#### 2.3.3 Gather-and-Distribute Neck
It employs two distinct _Conv_ operations with \(F_{inj}\) to produce \(F_{local\_embed}\) and \(F_{act}\)\(F_{local\_embed}\) is calculated using _Conv_ with \(F_{act}\). Subsequently, features Fout are merged through attention calculations. Since the dimensions of \(F_{global}\) and \(F_{local}\) do not match, the module employs average pooling or bilinear interpolation to resize \(F_{global\_embed}\) and Fact according to the size of \(F_{inj}\), ensuring proper alignment. After each attention merge, a RepBlock is incorporated to further extract  
Figure 9: The architecture of the proposed gold-YOLO. and integrate information. In the low order, \(F_{local}\) is equivalent to \(B_{i}\), and the formula is noted as follows:  
\[F_{global\_act\_p_{i}}=resize\big{(}Sigmoid\big{(}Conv_{act}\big{(}F_{inj\_p_{i }}\big{)}\big{)}\big{)} \tag{4}\]  
\[F_{global\_embed\_p_{i}}=resize\Big{(}\ Conv_{global\_embed\_p_{i}}\big{(}F_{ inj\_p_{i}}\big{)}\Big{)} \tag{5}\]  
\[F_{att\_fuse\_p_{i}}=Corv_{global\_embed\_p_{i}}(B_{i})*F_{global\_act\_p_{i}}+ F_{global\_embed\_p_{i}} \tag{6}\]  
\[P_{i}=RepBlock\Big{(}F_{att\_fuse\_p_{i}}\Big{)} \tag{7}\]  
High Gather-and-Distribute Branch: The High-GD merges features \(P3\), \(P4\), and \(P5\) generated by Low-GD, as shown in Figure 10b. * High-Feature Alignment Module (_High-FAM_)  
The high-feature alignment module (_High-FAM_) includes average pooling (_ArgPool_), which reduces the dimensions of input features to a uniform size. Specifically, when the input feature dimensions are \(\{R_{P3},R_{P4},R_{P5}\}\), _ArgPool_ reduces the feature size to the smallest dimension in the feature group, where \((R_{P5}=1/8R)\). As the transformer module extracts high-level information, pooling operations help aggregate data while reducing the computational demand of subsequent transformer module steps. * High-Information Fusion Module (_High-IFM_)  
The high-information fusion module (_High-IFM_) includes transformer blocks (detailed below) and split operations, comprising three steps: (1) \(F_{align}\) obtained from _High-FAM_, is combined through a transformer to obtain \(F_{fuse}\). (2) The channel number of \(F_{fuse}\) is reduced to the sum of \(C_{P4}\) and \(C_{P5}\) through a _Conv_\(1\times 1\) operation. (3) \(F_{fuse}\) is split along the channel dimension into \(F_{inj\_N4}\) and \(F_{inj\_N5}\), which are subsequently used for fusion with the current level's features. Formulas are as follows:  
Figure 7:0  
Figure 7:1  
Figure 7:2  
The transformer fusion module consists of several stacked transformers, with the number of transformer blocks denoted by \(L\). Each transformer block comprises a multi-head attention block, a feed-forward network (FFN), and residual connections. * Information Injection Module  
The information injection module in High-GD is exactly the same as in Low-GD. In the high order, \(F_{local}\) is equal to \(P_{i}\), so the formula is expressed as follows:  
Figure 7:3  
Figure 7:4  
Figure 7:5  
Figure 7:6In this paper, we replaced the original FPN structure in the YOLOv8 neck with an aggregation and distribution mechanism (GD). To further enhance the interconnectivity of cross-layer information, we added two feature alignment modules (_FAM_) in the low-frequency aggregation and distribution branch, with each module receiving three inputs. The formula can be expressed as follows:  
Figure 7:7  
where the variable is used as in Equation (6). Specifically, as shown in Figure 10c, the variable is used as the \(x_{local}\) input in the information injection module. Therefore, in this paper, Equation (6) should be modified as follows:  
Figure 7:8  
Similarly, in the high-frequency aggregation and distribution branch, we also added two additional feature alignment modules and introduced the \(C2f\) structure after all the information injection modules. The formula can be expressed as follows:  
Figure 7:9  
where \(F_{i}\) is used as \(B_{i}\) in Equation (13).