## 3 Methodology
### Dynamic Head  
Within the feature maps produced by the Feature Pyramid Network (FPN), deep feature maps of low resolution hold advanced semantic data, yet there is a risk of losing minor object details in the downsampling phase. On the other hand, high-resolution shallow feature maps preserve the spatial location and detail information of small objects but fail to capture complex semantic information. They also exhibit lower robustness and are more susceptible to local variations such as noise and lighting changes. Additionally, differences in imaging angles and specific task variances can result in various characteristics and constraints on targets, complicating the detection of smaller objects. The dynamic detection head, as depicted in Figure 4, tackles these issues by harmonizing and merging diverse attention processes across various levels of feature layers, spatial locations, and output pathways. This technique allows the model to focus dynamically on data pertinent  
Figure 3: Schematic diagram of the OAAM.  
to scale-space activities, thus effectively identifying the importance of semantic strata and the spatial specifics of the target. This technique markedly improves the ability of the detection head to represent features for targets across various scales while reducing computational load.  
Given that a feature tensor \(\mathcal{F}\in R^{L\times S\times C}\) symbolizes the scale levels of the feature map, the dynamic detection head can be depicted as follows [38]:  
\[W(\mathcal{F})=\pi_{C}(\pi_{S}(\pi_{L}(\mathcal{F})\cdot\mathcal{F})\cdot \mathcal{F})\cdot\mathcal{F} \tag{6}\]  
where \(\pi_{L}(\cdot)\), \(\pi_{S}(\cdot)\), and \(\pi_{C}(\cdot)\) represent the three distinct functions of attention mechanisms utilized in the \(L\), \(S\), and \(C\) dimensions, respectively. The scale-aware attention mechanism \(\pi_{L}(\cdot)\), attuned to scale, dynamically calculates the weights for feature maps across 242 various scales to facilitate dynamic feature merging.  
\[\pi_{L}(\mathcal{F})\cdot\mathcal{F}=\sigma\Bigg{(}f\Bigg{(}\frac{1}{SC}\sum _{S,C}\mathcal{F}\Bigg{)}\Bigg{)}\cdot\mathcal{F} \tag{7}\]  
where \(f(\cdot)\) is a point-wise convolution operation. The spatial-aware attention mechanism \(\pi_{S}(\cdot)\) employs an attention module to focus on spatial regions that consistently exhibit differences across feature levels of different scales. In particular, the process begins with employing deformable convolutions [39] to develop an attention mechanism for infrequent features, followed by the aggregation of features at various levels within identical spatial points.  
\[\pi_{S}(\mathcal{F})\cdot\mathcal{F}=\frac{1}{L}\sum_{l=1}^{L}\sum_{k=1}^{K} \omega_{l,k}\cdot\mathcal{F}(l;p_{k}+\Delta p_{k};c)\cdot\Delta m_{k} \tag{8}\]  
\(K\) represents the number of spatial sparse samples, \(\Delta p_{k}\) denotes the spatial offset parameters learned within the network, and \(\Delta m_{k}\) refers to the scale factor parameters learned at the spatial locations (\(p_{k}+\Delta p_{k}\)) of the input feature layer. The task-aware attention mechanism \(\pi_{C}(.)\) adjusts channel activation dynamically to accommodate various detection activities.  
\[\pi_{C}(\mathcal{F})\cdot\mathcal{F}=\text{max}\Big{(}\alpha^{1}(\mathcal{F}) \cdot\mathcal{F}_{C}+\beta^{1}(\mathcal{F}),\alpha^{2}(\mathcal{F})\cdot \mathcal{F}_{C}+\beta^{2}(\mathcal{F})\Big{)} \tag{9}\]