# Multiscale YOLOv5-AFAM-Based Infrared Dim-Small-Target Detection
## 1 Introduction  
Infrared detection has the advantages of all-weather, high stealth, and strong anti-interference [1; 2; 3; 4]. It can realize infrared dim-small-target detection under poor lighting. Therefore, infrared dim-small-target detection has important application significance in infrared surveillance systems, precise guidance systems, and aerospace. The Society of Photo-Optical Instrumentation Engineers (SPIE) defines small targets as targets that account for less than 0.15% of the image [5]. The challenges and difficulties of infrared vehicle dim-small-target detection can be summarized in three aspects. First, due to the low pixel resolution and long imaging distance of the infrared image used in this article, the size of vehicle targets in the image is small, and the details of features such as edges and textures are blurred, making it difficult to extract target features. Second, infrared images have the problem of low signal-to-noise ratio under complex background conditions, making it difficult to distinguish targets from the background. Therefore, the accuracy of target detection is easily affected by environmental factors. Finally, compared to visible light images, the intra-class feature changes of infrared vehicle targets are significant (due to grayscale flipping and scale changes), while the inter-class feature differences are small. Infrared dim-small-target detection algorithms can be divided into two categories [6]: traditional detection algorithms based on the separation of target object and background, and deep learning detection algorithm based on feature extraction. In terms of traditional methods, [PERSON] et al. [7] used local contrast difference to detect small targets, but the algorithm is not suitable for detecting dim targets, and it takes a long time to calculate the contrast. Moreover, [PERSON] et al. [8] used a method based on the human visual system to analyze the logarithmic spectrum of the dataset to extract the spectral residual of the image in the spectral domain, but the algorithm could not suppress the background clutter well. Traditional detection algorithms rely on manual feature extraction, and these methods have defects in generalization ability in different scenarios. Recently, deep learning methods have significantly improved the generalization ability of data-driven fuzzy small-target detection [9; 10; 11]. The algorithms based on deep learning can be divided into two categories: two-stage [12; 13; 14; 15] and one-stage [16; 17; 18]. In terms of the two-stage algorithm, fast RCNN [13] trains the entire network in a multi-task way, and faster RCNN [14] optimizes the generation method of candidate boxes to improve the detection speed. The accuracy of the two-stage algorithm performs well, but there are some shortcomings in the detection speed, and it is difficult to achieve real-time computing on a platform with weak computing power. With respect to the one-stage algorithm, YOLO Series [19; 20; 21; 22; 23; 24] can realize the regression of candidate boxes and classification of categories. The use of the attention mechanism in deep learning has improved the detection results. Moreover, [PERSON] et al. [25] proposed to add an improved attention mechanism SE module to YOLOv5 to improve the feature extraction ability and detection efficiency of the algorithm. SSD [26] adopts multiscale feature extraction to adapt to the detection of multi-size targets. The one-stage method has an advantage in detection speed while obtaining high accuracy. Training a target detection model requires appropriate datasets. Previous infrared datasets were captured at a relatively close distance, resulting in larger pixel scales of the targets in the images, which are not conducive to training models to detect small targets. Additionally, existing infrared image datasets primarily cover urban and rural scenes, neglecting farmland, mountains, ports, and Gobi scenes, which fail to meet the target detection requirements under different background conditions.