## 3 Methodology
### Iterative Attentional Feature Fusion  
In practical applications, targets may appear at different scales due to various perspectives, imaging distances, or camera system parameters [30]. The integration of features across multiple scales improves the model's versatility for targets varying in size by amalgamating outputs from diverse levels and leveraging both overarching contextual and specific local details. The Feature Pyramid Network (FPN) [31] and Path Aggregation Network (PAN) [32] are currently widely adopted in models that generate pyramid-shaped multi-scale features by integrating adjacent layers in the backbone network. This fusion method combines deep abstract semantic features with shallow high-resolution features, increasing the feature representation of different scales. Conversely, conventional fusion techniques in the FPN-PAN typically entail merging or incorporating neighboring layers post the enhancement of low-resolution features and then executing conventional convolution to align with the output channels. The issue with this streamlined fusion method lies in the equal weighting of the merged feature maps, in contrast to the dominance of large-scale background elements over smaller target features in dense background noise [33; 34]. To address this issue, we introduce Iterative Attentional Feature Fusion (iAFF) in the network neck to fuse semantically and scale-inconsistent features, as shown in Figure 2. More precisely, it employs a multi-scale channel attention mechanism (MS-CAM) to tackle the issue of minor target characteristics being eclipsed in the amalgamation of cross-scale attention features. The MS-CAM has the capability to highlight both large targets distributed worldwide and small targets distributed locally, by consolidating contextual data across multiple scales in the channel dimension, aiding the network in identifying and recognizing objects with significant scale differences. The formula for calculating the channel weights of the global feature context in the MS-CAM is as follows:  
\[w=\sigma(g(X))=\sigma(\mathcal{B}(W_{2}\delta(\mathcal{B}(W_{1}(\mathbb{G}(X)) )))) \tag{1}\]  
where \(g(X)\in\mathbb{R}^{C}\) represents the global feature context, and \(\mathbb{G}(X)\) represents global average pooling in the spatial dimension. \(\delta\) represents the ReLU activation function, \(\mathcal{B}\) represents the batch normalization layer (BN), and \(\sigma\) represents the Sigmoid activation function. The specific implementation method is through two fully connected layers combined with activation functions, where \(W_{1}\in\mathbb{R}^{\frac{C}{r}\times C}\) represents the channel dimension reduction layer, \(W_{2}\in\mathbb{R}^{C\times\frac{C}{r}}\) represents the channel dimension expansion layer, and \(r\) is a parameter for channel reduction. The MS-CAM integrates localized contextual data into the overall contextual data of the attention module, facilitating a mechanism for feature attention across different scales. The system employs point-wise convolution (PWConv) [35] for consolidating local contextual data, utilizing the interplay between points and channels at every spatial point. The formula to compute the weight of the local context channel is outlined as follows:  
\[L(X)=\mathcal{B}(PWConv_{2}(\delta(\mathcal{B}(PWConv_{1}(X))))) \tag{2}\]  
The convolution kernel sizes of \(PWConv_{1}\) and \(PWConv_{2}\) are \(C/r\times C\times 1\times 1\) and \(C\times C/r\times 1\times 1\), respectively. The shape of \(L(x)\) mirrors that of the input features, enabling it to maintain and accentuate specific details in the basic features. Considering the overall context channel data \(g(X)\) and the specific local context channel details \(L(x)\), the enhanced attributes achieved by the MS-CAM are outlined below:  
\[X^{\prime}=X\otimes M(X)=X\otimes\sigma(L(X)\oplus g(X)) \tag{3}\]where \(M(X)\in\mathbb{R}^{C\times H\times W}\) denotes the attention weights determined by the MS-CAM.