## 2 Materials and Methods
### YOLOv11-OAM Architecture Overview
#### 2.4.2 Detect_ASFF Module  
Detect_ASFF [35; 36], the core detection head of YOLOv11-OAM, plays a crucial role in improving multi-scale detection accuracy. It integrates the fifth-generation Adaptive Spatial Feature Fusion (ASFFv5) mechanism with Distribution Focal Loss (DFL), specifically designed to address challenges in UAV orchard imagery such as large target-scale variation and canopy overlap. By dynamically aggregating features across large, medium, and small detection branches, ASFF enhances the model's ability to distinguish fine-grained categories and densely overlapping instances. Unlike conventional approaches (e.g., fixed-weight fusion in FPNs), Detect_ASFF leverages pixel-level spatial attention and channel-adaptive weighting to achieve flexible, data-driven multi-scale fusion. As shown in Figure 6, the proposed Detect_ASFF achieves adaptive spatial fusion compared with the traditional feature pyramid network (FPN). Feature maps from three scales are first aligned spatially using convolution, max pooling, or nearest-neighbor upsampling to ensure resolution consistency. Lightweight convolutional blocks then compute attention maps for each scale, which are concatenated and normalized via softmax to produce pixel-wise adaptive fusion weights. This design ensures fine-grained, context-aware feature blending, improving cross-scale semantic consistency and enhancing robustness for small or occluded targets. Mathematically, the fused feature map at spatial location \((x,y)\) or scale l is computed as  
\[\mathrm{F}_{fused}^{(l)}(x,y)=\sum_{i=0}^{2}\partial_{i}^{(l)}(x,y)\cdot F_{i} ^{aligned}(x,y) \tag{1}\]  
subject to  
\[\sum_{i=0}^{2}\partial_{i}^{(l)}(x,y)=1\quad\partial_{i}^{(l)}(x,y)\geq 0 \tag{2}\]  
where \(F_{i}^{aligned}(x,y)\) is the spatially aligned feature map at scale \(i\), and \(\partial_{i}^{(l)}(x,y)\) are the normalized adaptive fusion weights. After pixel-wise fusion, the resulting feature map is processed by a convolutional layer to adjust its channel dimensions for classification and regression tasks. The regression branch employs Distribution Focal Loss (DFL), which models bounding box coordinates as discrete probability distributions instead of scalar values. This formulation enables more accurate and continuous spatial localization through probabilistic expectation, enhancing precision for small or overlapping objects. The forward pass of the Detect_ASFF module begins by fusing multi-scale features from three detection layers using ASFF. The fused output is processed by convolutional layers for simultaneous classification and bounding box regression. The regression branch  
Figure 6: Comparison of feature fusion structures. (**a**) The traditional feature pyramid network (FPN) uses top-down fixed fusion. (**b**) The proposed Detect_ASFF adopts adaptive spatial fusion to enhance multi-scale feature alignment and detection performance. employs Distribution Focal Loss (DFL) to model localization uncertainty before decoding the output into bounding box coordinates. Final predictions consist of concatenated bounding boxes and corresponding class probabilities for training and inference. To enhance the precision of bounding box regression, the Distribution Focal Loss (DFL) models each coordinate as a discrete probability distribution over \(C\) predefined bins. The network predicts the probability \(P*\) of the coordinate falling into the \(i\)-\(th\) bin, where \(i=0,1,\ldots,C-1\). \[\hat{x}=\sum_{i=0}^{C-1}P_{i}\cdot x_{i} \tag{3}\]  
where \(x_{i}\) is the coordinate value corresponding to bin \(i\). The DFL is formulated as  
\[\text{DFL}(p,p^{*})=-\lambda(1-P^{*})^{\gamma}\log(P) \tag{4}\]  
where \(p\) is the predicted probability for the ground-truth bin, \(P^{*}\) is the one-hot encoded ground-truth label, \(\lambda\) is a scaling factor, and \(\gamma\) is the focusing factor.