## 3 Methodology
### HA-PANet Structure  
The Path Aggregation Network (PANet) structure [23] in YOLOv7 has limitations when dealing with object detection in tower crane operating scenarios. The PANet is developed without adequately addressing the semantic information disparity between features from non-adjacent layers. The top-down fusion of high-level and low-level features may result in semantic information loss due to substantial differences in object scales during multi-scale feature extraction. Additionally, bottom-level features often require more detailed information due to suboptimal fusion methods during bottom-up integration. As a result, the existing PANet experiences insufficient feature fusion, semantic information degradation, and detailed information loss during object detection, ultimately compromising detection accuracy and robustness.  
For the detection algorithm in this paper, the HA-PANet structure is proposed by improving the PANet structure with the AFPN idea in the YOLOv7 neck network structure.  
The HA-PANet structure asymptotically fuses effective feature maps from the backbone network with neighboring feature layers in a deeper-to-shallower order to reduce computational demands. The HA-PANet structure accomplishes the asymptotic fusion between the feature maps of various scales through the ASEF strategy. The HA-PANet structure accomplishes the progressive fusion between different scales of feature maps through the ASEF strategy. It retains the feature information of each effective feature layer as much as possible during feature fusion and extraction processes. The specific processing strategy of each progressive fusion branch is determined by the dimensions of the feature layers and the number of channels engaged in that branch's fusion, i.e., the ASEF-1 module, ASEF-2 module, and ASFF-3 module, which have slight differences in their internal structures. The structure of the HA-PANet is shown in Figure 6.  
Figure 5: ECA-CBAM structure.  
The proposed HA-PANet aims to further improve the detection of small objects. Unlike the original AFPN, the HA-PANet performs progressive feature fusion only on the modified P2, P3, and P4 branches of the backbone network, thereby reducing the number of fusion steps and minimizing additional computational and memory costs. In contrast to the AFPN, which performs multiple feature fusion operations across different levels, the HA-PANet groups P2 with P3 and P3 with P4, conducting a single fusion operation between each pair. This progressive enhancement process enables the low-level detailed features and high-level semantic features to complement each other, effectively balancing the representation of fine-grained details and high-level semantics.  
Moreover, the HA-PANet incorporates ideas from ASFF, where the model introduces the P2 branch with higher spatial resolution. This branch is fused with higher-level features using a weighted aggregation, which prevents the loss of low-level details and mitigates the excessive abstraction of high-level semantics. As a result, the fusion of low-level and high-level features becomes more precise, further narrowing the semantic gap between them. Compared to other hierarchical feature fusion strategies, the HA-PANet better preserves the low-level feature details without allowing them to be overshadowed by higher-level features while also placing greater emphasis on small object detection. Consequently, the HA-PANet demonstrates superior performance, particularly in the detection of small objects, within the framework of multi-scale object detection.