# Infrared Multi-Scale Small-Target Detection Algorithm Based on Feature Pyramid Network
## 2 Materials and Methods
### Dual Attention Fusion Module  
The area of infrared small targets contains only a few pixels, and as the network deepens, the targets are likely to be lost in deeper networks. Shallow networks capture detailed information about small objects, such as their location, size, and edges. However, they lack a deep understanding of small objects. Deep networks capture various semantic information about small targets, but may lose the details of these small targets. Feature representation is extremely challenging when the final feature map lacks information from the different network stages. Therefore, knowing how to integrate shallow features and deep features is crucial for accurately detecting infrared small targets. Previous studies have shown that the fusion of spatial attention and channel attention [31] can highlight the optimal semantic feature regions and reduce the computational complexity [32]. This fusion enables the retention and extraction of the original features of small targets in deep networks [33].  
In order to enhance detection effects and improve detection accuracy, this paper introduces a dual attention fusion module, referred to as a DAF module. The module structure is shown in Figure 4. The module can not only extract the deep semantic information of the small target but also fuse detailed information, such as the location of the small target. It can also solve the problems of information redundancy and inadequate feature fusion.  
The low-level features \(Z\) and high-level features \(Y\prime\) represent different semantic information. The high-level features \(Y\prime\) are obtained from \(Y\) in Figure 1 after two rounds of upsampling operations. The low-level features contain the location information of multiple small targets, and the spatial attention mechanism module can be used to process the local location information. The high-level features can utilize the channel attention mechanism module to process channel semantic information, prioritizing the semantic expression of different channels. The low-level features and high-level features are incorporated together and fused with the low-level features constrained by spatial attention and the high-level features constrained by channel attention, respectively, as shown in Equation (7):  
\[DAF(Z,Y^{\prime})=(Z+f(Y))\bigotimes PA(Z)\bigodot CA\big{(}f(Y^{\prime})\big{)} \tag{7}\]  
where \(PA(.)\) and \(CA(.)\) represent the spatial and channel attention constraints, \(f(.)\) represents the convolution operation, and \(\bigotimes\) and \(\bigodot\) represent the corresponding multiplication operations of the element and vector tensors, respectively.  
During upsampling, the DAF module fuses low-level and deep-level semantic information of \(1/4\) and \(1/2\) spatial sizes respectively. They are all preceded by a bilinear interpolation operation. Finally, the segmentation network of fused features was used to predict the final detection result of infrared small targets.  
Aiming at the characteristics of class imbalance and weak texture differences between infrared small targets and the infrared image background, the target detection network needs to comprehensively consider spatial and channel features, as well as cross-layer feature fusion. This implies that the network should not only capture the target features within a single image layer but also focus on the information transfer and fusion between different layers to improve the identification and localization of small infrared targets. This  
Figure 4: The DAF module.  
mechanism of cross-layer feature fusion is helpful for resolving the contrast between the target and the background in the infrared image, enhancing the accuracy and robustness of target detection.