An infrared small target detection method based on heterogeneous multi-domain enhancement and Gaussian decay loss
By improving the heterogeneous multi-domain enhancement module and Gaussian decay loss function of the YOLOv8 model, the problems of insufficient feature extraction and high false negative rate in aerial infrared small target detection are solved, achieving high-precision real-time detection, which is suitable for infrared small target detection under complex background and low light conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUXI UNIV
- Filing Date
- 2026-05-28
- Publication Date
- 2026-07-14
AI Technical Summary
Traditional YOLOv8 models suffer from insufficient feature extraction capabilities and high false negative rates in aerial infrared small target detection, especially in complex backgrounds and low-light conditions, making it difficult to achieve high-precision real-time detection.
The heterogeneous multi-domain enhancement module HME-C2f and the Gaussian SOD-IoU loss function are adopted to improve the feature extraction capability through the heterogeneous multi-domain enhancement module and to improve the YOLOv8 model by optimizing the loss function through adaptive penalty weights.
It significantly improves the detection accuracy and real-time performance of small infrared targets in aerial photography, reduces the false negative rate, and is suitable for the detection of small infrared targets in complex backgrounds and low-light conditions such as border security and UAV remote sensing reconnaissance.
Smart Images

Figure CN122391809A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and digital image processing technology, specifically relating to an infrared small target detection method based on heterogeneous multi-domain enhancement and Gaussian attenuation loss. Background Technology
[0002] Aerial infrared small target detection is an important research direction in the field of computer vision, with wide applications in military reconnaissance, border patrol, disaster relief, and other areas. However, due to the long imaging distance, complex and varied backgrounds, and the lack of color and texture information in infrared images, small targets often appear as low-contrast spots of only a few pixels in size, which poses a great challenge to target detection.
[0003] The traditional YOLOv8 model, as the mainstream real-time object detection algorithm, performs excellently in visible light image detection tasks. However, it suffers from two major bottlenecks in aerial infrared small target detection tasks: First, the standard C2f module uses a homogeneous channel processing method, making it easy for the weak features of small targets to be submerged by background noise during multiple downsampling and feature transformations in deep networks, resulting in insufficient feature extraction capabilities. Second, existing loss functions apply the same penalty weights to targets of different scales, meaning that small targets contribute far less to the loss backpropagation than large targets, leading to a high false negative rate for small targets. Furthermore, existing linear truncation scale compensation methods are non-differentiable at the threshold, causing abrupt gradient changes during training and affecting the model's convergence stability.
[0004] Therefore, there is an urgent need to develop a method that can effectively improve the detection accuracy of small targets in aerial infrared photography while ensuring real-time performance. Summary of the Invention
[0005] Purpose of the Invention: The technical problem to be solved by this invention is to address the shortcomings of existing technologies by providing an infrared small target detection method based on heterogeneous multi-domain enhancement and Gaussian attenuation loss. This method focuses on the specific technical direction of infrared small target detection in aerial photography scenarios and is widely applicable to various practical application scenarios that require high-precision, real-time identification and positioning of infrared small targets under conditions of long distance, complex backgrounds, low light, or no light, such as border intelligent security, UAV remote sensing reconnaissance, forest fire monitoring, high-altitude inspection of power facilities, maritime emergency search and rescue, low-altitude airspace control, urban nighttime security, and military reconnaissance and early warning.
[0006] The method includes the following steps:
[0007] Step 1, construct the YOLOv8-HME object detection model, including the following steps:
[0008] Step 1-1: Construct the Backbone network;
[0009] Steps 1-2: Construct the Neck feature fusion network;
[0010] Steps 1-3: Construct the Head detection head;
[0011] Step 2: Establish the HFE-Block heterogeneous feature enhancement module;
[0012] Step 3: Establish the HME-C2f heterogeneous multi-domain enhancement module;
[0013] Step 4: Establish the GaussianSOD-IoU Gaussian attenuation scale adaptive loss function;
[0014] Step 5: Perform model training and inference.
[0015] In step 1-1, the third feature layer P3, the fourth feature layer P4, and the fifth feature layer P5 of the backbone network are deployed with the heterogeneous multi-domain enhancement module HME-C2f. The P3 layer is deployed 6 times, the P4 layer is deployed 6 times, and the P5 layer is deployed 3 times. The P5 layer is connected to the fast spatial pyramid pooling module SPPF module. Through multi-scale pooling, deep features are aggregated to improve the global context information capture capability and adapt to the extraction requirements of weak features of small targets in aerial infrared photography.
[0016] In steps 1-2, the Neck feature fusion network employs a feature pyramid network and a path aggregation network. The structure enables the full fusion of shallow detail features and deep semantic features. At the same time, it introduces a cross-layer fusion path from P2 to P3 and P4 layers. Through 1×1 convolution dimensionality reduction, the high-resolution detail features of P2 layer are matched with the deep feature channels. The fusion is carried out by element-wise addition to supplement the detail information lost by small targets in downsampling and improve the detection accuracy.
[0017] In steps 1-3, the Head detection head maintains three-scale detection: P3 (80×80 small target), P4 (40×40 medium target), and P5 (20×20 large target). The output layer uses a convolutional layer to output bounding box coordinates, confidence score, and class probability, and introduces a confidence score threshold filtering mechanism.
[0018] Step 2 includes:
[0019] Step 2-1, lossless downsampling: The input feature F1 is processed by the spatial-to-depth convolution module SPDConv for lossless downsampling. The spatial-to-depth transformation S2D converts the 2×2 spatial block into 4 channels to achieve lossless downsampling and avoid the loss of small target features. Then, the spatial features are extracted and the background noise is suppressed by 3×3 convolution.
[0020] Step 2-2, Multi-branch fusion: Perform multi-branch fusion processing on the downsampled features. The downsampled features are divided into full-kernel enhancement branch features X_ok (50% of channels) and identity branch features X_id (50% of channels). X_ok is enhanced by the full-kernel module OmniKernel, and X_id is mapped to the identity. The full-kernel enhancement branch features and the identity branch features are concatenated and then fused by 1×1 convolution. The number of channels is adjusted to be consistent with F1, and the output F_HFE of the HFE-Block heterogeneous feature enhancement module is obtained.
[0021] Steps 2-3, The module integrates a large kernel receptive field and a frequency domain attention mechanism. The output calculation process specifically includes: using 1×27, 27×1, 27×27, and 1×1 depthwise separable convolutions to capture the spatial global context, obtaining the spatial domain large kernel branch output F_large; performing a Fast Fourier Transform (FFT) on the input features, and sequentially calculating the frequency domain channel attention. Spatial channel attention And frequency domain guided modulation F_FGM;
[0022] Original input Adding element by element, after The activation function and 1×1 convolution are obtained Module output .
[0023] In step 3, the HME-C2f heterogeneous multi-domain enhancement module adopts an asymmetric split design of 25% and 75% channels. The 75% channels are subjected to identity mapping to reduce computational redundancy and retain the original features, while the 25% channels enter the HFE-Block heterogeneous feature enhancement module to achieve in-depth mining of small target features.
[0024] Step 3 specifically includes the following steps:
[0025] Step 3-1, Channel Splitting: The input feature X satisfies X∈R^(H×W×C_in), where H represents the feature map height, W represents the feature map width, and C_in represents the number of input channels. The input feature X is reduced in dimensionality by 1×1 convolution to obtain feature Z. The number of channels reduced in dimensionality is C=C_out×e, where C_out represents the number of output channels, and e=0.5 is the channel scaling factor. Feature Z is split along the channel dimension into the first split feature F1 and the second split feature F2, where F1 occupies 25% of the channels and F2 occupies 75% of the channels; achieving the design goal of deep enhancement of a small number of channels and efficient preservation of a large number of channels;
[0026] Step 3-2, Heterogeneous Processing: F1 enters the HFE-Block heterogeneous feature enhancement module to perform spatial and frequency domain deep feature enhancement, obtaining the enhanced first shunt feature. Suppress background noise; F2 is used for identity mapping to obtain the enhanced second shunt feature. F2 simultaneously extracts features through n bottleneck modules (P3 and P4 layers n=3, P5 layer n=2) to obtain the first bottleneck B1, the second bottleneck B2, ..., the nth bottleneck Bn, where B0=F2; and complements F1'.
[0027] Step 3-3, Feature Aggregation: Channel concatenation is performed, followed by 1×1 convolution to adjust the number of channels to C_out, yielding the final output of the HME-C2f module. Integrating multi-branch features enhances expressive power.
[0028] Step 4 includes:
[0029] Step 4-1: Calculate the Gaussian decay weight based on the normalized area s of the predicted bounding box. :
[0030] ,
[0031] in =0.5 is the maximum weighting coefficient. Here, exp is the gradient of the Gaussian decay function, which is the control parameter for the decay rate. This achieves global smoothness and differentiability, eliminating gradient abrupt changes; for small objectives, β tends to 0.5 (maximum penalty), and for large objectives, it tends to 0 (reduced penalty).
[0032] Step 4-2, Calculate the geometric constraint penalty: Calculate the intersection-over-union (IoU) ratio between the predicted bounding box and the ground truth bounding box. The aspect ratio penalty is:
[0033] ,
[0034] Where v represents the aspect ratio penalty term, π represents pi, w^gt represents the ground truth box width, h^gt represents the ground truth box height, w^pred represents the predicted box width, and h^pred represents the predicted box height.
[0035] coefficient Center distance penalty ρ is the distance between the centers, e is the natural constant, and c is the length of the diagonal of the minimum bounding rectangle; It is the minimum value;
[0036] ,
[0037] in, The coordinates of the top-left corner of the true bounding box; The coordinates of the bottom right corner of the true bounding box; , The coordinates of the top-left corner of the prediction box; The coordinates of the bottom right corner of the prediction box;
[0038] Step 4-3: Calculate the final loss.
[0039] In step 4-3, the final loss is calculated using the following formula:
[0040] ,
[0041] in: The loss value is the Gaussian decay scale adaptive cross-union ratio loss function; The maximum weighting coefficient; The weights are Gaussian decay weights based on the normalized area s of the predicted bounding box; This is the aspect ratio penalty coefficient;
[0042] Decompose the loss function into basic bias terms. Scale-adaptive IoU term and distance terms To achieve adaptive penalty for targets at different scales:
[0043] ,
[0044] in, ;
[0045] As s approaches 0, β approaches , Tend to 1, The value tends to 1, applying maximum penalty to the IoU and positional deviation of small targets, thereby improving the detection accuracy of small targets;
[0046] When s approaches ∞, β approaches 0, w_IoU approaches 0.5, and w_dist approaches 1.5. The IoU weight is adaptively reduced, and the optimization focus is shifted to center point alignment to ensure the performance of large target detection.
[0047] Step 5 includes:
[0048] Step 5-1, Training Phase: Train the model using the above dataset, to... The bounding box regression loss is combined with the cross-entropy loss as the class loss, and the following is adopted: The optimizer employs an adaptive learning rate strategy, combined with data augmentation techniques such as random flipping and pruning, to periodically evaluate metrics such as mAP@0.5 and AP_small using a validation set, and adjusts parameters to their optimal values.
[0049] Step 5-2, Inference Stage: Preprocess the aerial infrared image to be detected (adjust to 640×640, normalize), input the trained model, perform feature extraction, fusion and detection head recognition, output the predicted bounding box information, and obtain the final detection result after non-maximum suppression filtering.
[0050] The present invention also provides an electronic device, including a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the method.
[0051] The present invention also provides a storage medium storing a computer program or instructions that, when the computer program or instructions are run on a computer, execute the steps of the method described.
[0052] Beneficial effects: 1. The HME-C2f heterogeneous multi-domain enhancement module proposed in this invention adopts a 25% and 75% asymmetric channel splitting design, which takes into account both feature extraction effect and computational efficiency. Through the HFE-Block sub-module, it deeply mines the weak features of small targets from both spatial and frequency domains, effectively solving the technical problem that small target features are easily submerged by background noise and the feature extraction capability is insufficient due to the homogeneous channel processing of traditional C2f modules. It significantly improves the model's feature capture capability for aerial infrared small targets.
[0053] 2. The GaussianSOD-IoU scale-adaptive loss function designed in this invention is based on a smooth Gaussian distribution decay function. It maps the normalized area of the predicted box to dynamic penalty weights, realizing adaptive penalty for targets of different scales. This effectively solves the problems of insufficient penalty for small targets and high false negative rate for small targets in existing loss functions. At the same time, this loss function is globally smooth and differentiable, completely avoiding the gradient mutation phenomenon caused by the linear truncation method, improving the convergence stability during model training, and ensuring the stability of model detection accuracy.
[0054] 3. The YOLOv8-HME model of this invention maintains its lightweight characteristics. While ensuring a significant improvement in detection accuracy, it also takes into account real-time inference capabilities. It can meet the real-time detection needs of real-world deployment scenarios such as UAV reconnaissance, border security, and forest fire prevention. It can be implemented in engineering without complex hardware support, and has strong practicality and industrialization value.
[0055] 4. Excellent Quantitative Performance: Significant Improvement in Detection Accuracy and Generalization Ability. This invention underwent rigorous quantitative comparison experiments on multiple datasets, achieving extremely significant performance gains. Experimental data shows that compared to the baseline model YOLOv8n on a self-built extended infrared dataset, the method of this invention significantly improved mAP@0.5 and mAP@0.5:0.95 by 4.1% and 3.7%, respectively; on the authoritative public dataset IRSTD-1K, the method of this invention achieved substantial leaps of 5.7% and 4.6%. These specific figures fully demonstrate that this invention maintains excellent detection accuracy and strong model generalization ability when facing infrared images with different scenes and distributions. Attached Figure Description
[0056] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.
[0057] Figure 1 This is a flowchart of the present invention.
[0058] Figure 2 This is a schematic diagram of the original infrared small target image of the present invention.
[0059] Figure 3 This is a schematic diagram of the image after feature enhancement of the heterogeneous multi-domain enhanced C2f module HME-C2f of the present invention.
[0060] Figure 4 The Gaussian SOD-IoU curve is shown as the Gaussian attenuation scale adaptive cross-union ratio loss function of this invention.
[0061] Figure 5 This is a schematic diagram of the multi-scale feature fusion structure of the present invention.
[0062] Figure 6 This is a schematic diagram illustrating the infrared small target detection effect of the present invention. Detailed Implementation
[0063] This invention provides an infrared small target detection method based on heterogeneous multi-domain enhancement and Gaussian attenuation loss. The English explanation of this method is as follows:
[0064] HME-C2f: Heterogeneous Multi-domain Enhanced C2f module;
[0065] HFE-Block: Heterogeneous Feature Enhancement Block;
[0066] SPDConv: Space-to-DepthConvolution;
[0067] SPPF: Spatial Pyramid Pooling Fast;
[0068] FPN / PAN: Feature Pyramid Network / Path Aggregation Network;
[0069] IoU: Intersection over Union;
[0070] mAP: mean Average Precision.
[0071] The method includes:
[0072] Step 1: Construct the YOLOv8-HME object detection model. This model is an improvement on the original YOLOv8n model, implemented through the following steps:
[0073] (101) Construction of the Backbone Network: Based on the original YOLOv8n Backbone, all standard C2f modules in layers P3, P4, and P5 were replaced with HME-C2f heterogeneous multi-domain enhancement modules. Layer P3 was deployed 6 times, layer P4 6 times, and layer P5 3 times. This number of deployments was experimentally verified to maximize the mining of weak features of small targets while ensuring computational efficiency. The SPPF module was retained after layer P5 to aggregate deep features through multi-scale pooling, thereby improving the ability to capture global contextual information. Layers P3, P4, and P5 correspond to 80×80, 40×40, and 20×20 feature maps, respectively, and are responsible for capturing features of small, medium, and large targets. The HME-C2f module was deployed to strengthen the features of small targets and prevent them from being submerged by background noise.
[0074] (102) Constructing a Neck feature fusion network: adopting a bidirectional feature fusion structure of FPN and PAN to achieve full fusion of shallow detail features and deep semantic features. At the same time, a cross-layer fusion path from P2 layer to P3 layer and P4 layer is introduced. The high-resolution detail features of P2 layer are matched with the deep feature channels through 1×1 convolution dimensionality reduction. The element-wise addition method is used to fuse the features, supplement the detail information lost by small targets in downsampling, and improve the detection accuracy.
[0075] (103) Constructing the Head Detection Head: Maintaining the three-scale detection design, the P3 layer corresponds to 80×80 branches to detect small targets, the P4 layer to 40×40 branches to detect medium targets, and the P5 layer to 20×20 branches to detect large targets. The output layer adopts a convolutional layer to output bounding box coordinates, confidence and class probability. A confidence threshold filtering mechanism is introduced to reduce the subsequent computation and ensure the real-time detection requirements.
[0076] Step 2: Implement the HME-C2f heterogeneous multi-domain enhancement module. This module adopts an asymmetric current split design with 25% and 75% of the channels. The specific steps are as follows:
[0077] (201) Channel splitting: Input characteristics The feature Z is obtained by 1×1 convolution dimensionality reduction, and the number of channels in the dimensionality reduction is [not specified]. (0.5 is the channel scaling factor), and then Z is split along the channel dimension into F1 (25% channel) and F2 (75% channel) to achieve the design goal of enhancing the depth of a small number of channels and efficiently retaining a large number of channels.
[0078] (202) Heterogeneous processing: F1 enters HFE-Block to enhance spatial and frequency domain deep features and suppress background noise; F2 performs identity mapping and simultaneously refines features through n Bottleneck modules (P3 and P4 layers n=3, P5 layer n=2), complementing the enhanced features of F1.
[0079] (203) Feature aggregation: The channels of F1' after F1 processing, F2' after F2 identity mapping and all Bottleneck outputs are concatenated, and then the number of channels is adjusted to C_out by 1×1 convolution to obtain the final output of HME-C2f module, which integrates multi-branch features to improve expressive ability.
[0080] Step 3: Implement the HFE-Block heterogeneous feature enhancement module. The specific steps are as follows:
[0081] (301) Lossless downsampling: SPDConv is used to process F1. The 2×2 spatial block is converted into 4 channels through spatial-to-depth transformation (S2D) to achieve lossless downsampling and avoid loss of small target features. Then, spatial features are extracted and background noise is suppressed by 3×3 convolution.
[0082] (302) Multi-branch fusion: The downsampled features are divided into X_ok (50% of the channels) and X_id (50% of the channels). X_ok is enhanced by the OmniKernel module, and X_id is mapped by identity. The two are concatenated and fused by 1×1 convolution. The number of channels is adjusted to be consistent with F1 to obtain F_HFE.
[0083] (303) OmniKernel module implementation: Use 1×27, 27×1, 27×27 and 1×1 depthwise separable convolutions to capture the spatial global context to obtain F_large; perform FFT transformation on the input features, suppress low-frequency background and enhance high-frequency features of small targets through FCA, SCA and FGM; add the original input, F_large and frequency domain attention output element by element, and obtain the OmniKernel output Y_OK after ReLU activation and 1×1 convolution.
[0084] Step 4: Implement the GaussianSOD-IoU adaptive loss function with Gaussian decay scale. The specific steps are as follows:
[0085] (401) Calculate the Gaussian decay weights: Based on the normalized area s of the predicted bounding box, calculate:
[0086] ,
[0087] (0.5 is the maximum weight coefficient, and 30 is the decay rate control parameter), its gradient This achieves global smoothness and differentiability, eliminating abrupt gradient changes. For small objectives, β→0.5 (maximum penalty), and for large objectives, β→0 (reduced penalty).
[0088] (402) Calculate the geometric constraint penalty: Calculate the IoU between the predicted bounding box and the ground truth bounding box, and the aspect ratio penalty:
[0089] ,
[0090] coefficient: Center distance penalty (ρ is the distance between the centers, and c is the length of the diagonal of the minimum bounding rectangle).
[0091] (403) Calculate the final loss:
[0092] ,
[0093] It is decomposed into a basic bias term, a scale-adaptive IoU term, and a distance term to achieve adaptive penalty for targets at different scales.
[0094] Step 5: Perform model training and inference. The specific steps are as follows:
[0095] (501) Training phase: The model is trained using the above dataset, with The bounding box regression loss is combined with the cross-entropy loss as the class loss, and the following is adopted: The optimizer employs an adaptive learning rate strategy, combined with data augmentation techniques such as random flipping and pruning, to periodically evaluate metrics such as mAP@0.5 and AP_small using a validation set, and adjusts parameters to their optimal values.
[0096] (502) Inference stage: The aerial infrared image to be detected is preprocessed (adjusted to 640×640, normalized), input into the trained model, and after feature extraction, fusion and detection head recognition, the predicted box information is output. After non-maximum suppression filtering, the final detection result is obtained.
[0097] Experimental verification shows that, compared with the original YOLOv8n model, the YOLOv8-HME model of this invention significantly improves the mAP@0.5 index, with a particularly outstanding improvement in AP for small targets. It effectively reduces the false negative and false positive rates, while maintaining a lightweight design and inference speed that meets real-time detection requirements, making it suitable for various practical application scenarios. The parameters set in this embodiment are preferred schemes; those skilled in the art can adjust them according to actual scenarios. All methods conforming to the technical concept of this invention are included within the scope of protection.
[0098] The data in the accompanying figures will be explained in detail.
[0099] like Figure 1 As shown, the overall process of the method of the present invention is as follows: input image → feature extraction → frequency domain modulation → splicing and fusion → target inference. The logic is clear and easy to implement in engineering.
[0100] like Figure 2 and Figure 3 As shown in the comparison, the small target has low contrast with the background in the original infrared image and is difficult to distinguish; after enhancement by the HME-C2f module, the features of the small target are significantly highlighted and the background noise is effectively suppressed.
[0101] like Figure 4 As shown, the weights of GaussianSOD-IoU decrease smoothly as the target area increases, with the highest weights in small target regions and a steady decrease in weights in large target regions, without any gradient abrupt changes.
[0102] Figure 5 This is a schematic diagram of the multi-scale feature fusion structure of the present invention. It adopts a bidirectional fusion architecture of FPN and PAN. On the basis of the multi-scale features of the backbone network P2 to P5, a cross-layer fusion path from P2 to P3 and P4 is added to supplement the detailed information of small targets and provide enhanced multi-scale features for the detection head.
[0103] like Figure 6 As shown, the method of the present invention can accurately detect extremely small infrared targets that occupy only 3 to 5 pixels, with a false negative rate far lower than that of the original YOLOv8n model.
[0104] Key parameters that have a significant impact on the final result:
[0105] Channel splitting ratio of HME-C2f module: This invention adopts 25% and 75% as the optimal ratio. If the ratio of enhanced channels is increased, the feature enhancement effect will be improved, but the amount of computation will increase significantly. If the ratio of enhanced channels is decreased, the amount of computation will be reduced, but the feature enhancement effect of small targets will be insufficient.
[0106] GaussianSOD-IoU parameters and σ: σ=30 is the optimal value for aerial infrared scenes, and can be fine-tuned according to the target scale distribution of different scenes. The maximum penalty intensity is controlled by σ, and the decay rate is controlled by σ.
[0107] The optimal deployment times for the HME-C2f module are: 6 times for layer P3, 6 times for layer P4, and 3 times for layer P5. As the core layer for small target feature extraction, the number of deployments of layer P3 has the greatest impact on the accuracy of small target detection.
[0108] Possible alternatives:
[0109] The channel offloading ratio can be adjusted within the range of 20% to 30% and 70% to 80% to adapt to hardware platforms with different computing power.
[0110] The kernel size in the OmniKernel module can be adjusted according to the target size, such as 1×15 or 15×1 convolutions, which are suitable for detecting smaller targets.
[0111] The Gaussian decay function can be replaced by other smooth, monotonically decreasing functions, such as the exponential decay function, but the Gaussian function has the best smoothness and differentiability.
[0112] The impact of channel splitting ratio on detection performance: Experiments were conducted using three channel splitting ratios: 10% and 90%, 25% and 75%, and 50% and 50%. The results showed that: at 10% and 90%, the AP of small targets only improved by 2.1%, while the computational load increased by 5%; at 25% and 75%, the AP of small targets improved by 8.7%, while the computational load increased by 12%; at 50% and 50%, the AP of small targets improved by 9.2%, but the computational load increased by 35%, and the inference speed decreased by 28%, which could not meet the real-time requirements.
[0113] Loss function comparison experiment: The original CIoU loss, the linearly truncated SOD-IoU loss, and the Gaussian SOD-IoU loss of the present invention were used for training respectively. The results show that the small target AP of the original CIoU loss is 32.5%; the small target AP of the linearly truncated SOD-IoU loss is 37.2%, but three gradient abrupt changes occurred during training, and the model convergence is unstable; the small target AP of the Gaussian SOD-IoU loss of the present invention is 41.3%, and the convergence is stable during training with no gradient abrupt changes.
[0114] This invention provides an infrared small target detection method based on heterogeneous multi-domain enhancement and Gaussian attenuation loss. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A method for detecting small infrared targets based on heterogeneous multi-domain enhancement and Gaussian attenuation loss, characterized in that, Includes the following steps: Step 1, construct the YOLOv8-HME object detection model, including the following steps: Step 1-1: Construct the Backbone network; Steps 1-2: Construct the Neck feature fusion network; Steps 1-3: Construct the Head detection head; Step 2: Establish the HFE-Block heterogeneous feature enhancement module; Step 3: Establish the HME-C2f heterogeneous multi-domain enhancement module; Step 4: Establish the GaussianSOD-IoU Gaussian attenuation scale adaptive loss function; Step 5: Perform model training and inference.
2. The method according to claim 1, characterized in that, In step 1-1, the heterogeneous multi-domain enhancement module HME-C2f is deployed in the third feature layer P3, the fourth feature layer P4, and the fifth feature layer P5 of the backbone network. The P3 layer is deployed 6 times, the P4 layer is deployed 6 times, and the P5 layer is deployed 3 times. The P5 layer is connected to the fast spatial pyramid pooling module SPPF. In steps 1-2, the Neck feature fusion network employs a feature pyramid network and a path aggregation network. The structure fully integrates shallow detail features with deep semantic features. At the same time, it introduces a cross-layer fusion path from P2 to P3 and P4 layers. It uses 1×1 convolution dimensionality reduction to match the high-resolution detail features of P2 layer with the deep feature channels and uses element-wise addition to fuse them, supplementing the detail information lost by small targets in downsampling. In steps 1-3, the Head detection head maintains three-scale detection at P3, P4, and P5. The output layer uses a convolutional layer to output bounding box coordinates, confidence scores, and class probabilities, and introduces a confidence threshold filtering mechanism.
3. The method according to claim 2, characterized in that, Step 2 includes: Step 2-1, lossless downsampling: The input feature F1 is processed by the spatial-to-depth convolution module SPDConv for lossless downsampling. The spatial block is converted into 4 channels by the spatial-to-depth transformation S2D to achieve lossless downsampling. Then, the spatial features are extracted and the background noise is suppressed by 3×3 convolution. Step 2-2, Multi-branch fusion: Perform multi-branch fusion processing on the downsampled features. The downsampled features are divided into full-kernel enhancement branch features X_ok and identity branch features X_id. X_ok is enhanced by the full-kernel module OmniKernel, and X_id is mapped to the identity. The full-kernel enhancement branch features and the identity branch features are concatenated and then fused by 1×1 convolution. The number of channels is adjusted to be consistent with F1, and the output F_HFE of the HFE-Block heterogeneous feature enhancement module is obtained. Steps 2-3, The module integrates a large kernel receptive field and a frequency domain attention mechanism. The output calculation process specifically includes: using 1×27, 27×1, 27×27, and 1×1 depthwise separable convolutions to capture the spatial global context, obtaining the spatial domain large kernel branch output F_large; performing a Fast Fourier Transform (FFT) on the input features, and sequentially calculating the frequency domain channel attention. Spatial channel attention And frequency domain guided modulation F_FGM; Original input Adding element by element, after The activation function and 1×1 convolution are obtained Module output .
4. The method according to claim 3, characterized in that, In step 3, the HME-C2f heterogeneous multi-domain enhancement module adopts an asymmetric split design with 25% and 75% of the channels. The 75% of the channels are subjected to identity mapping to reduce computational redundancy and retain the original features, while the 25% of the channels enter the HFE-Block heterogeneous feature enhancement module.
5. The method according to claim 4, characterized in that, Step 3 specifically includes the following steps: Step 3-1, Channel splitting: Input feature X satisfies X∈R^(H×W×C_in), where H represents the feature map height, W represents the feature map width, and C_in represents the number of input channels. Input feature X is reduced in dimensionality by 1×1 convolution to obtain feature Z. The number of dimensionality-reduced channels C=C_out×e, where C_out represents the number of output channels and e is the channel scaling factor. Feature Z is split along the channel dimension into the first split feature F1 and the second split feature F2, where F1 occupies 25% of the channels and F2 occupies 75% of the channels. Step 3-2, Heterogeneous Processing: F1 enters the HFE-Block heterogeneous feature enhancement module to perform spatial and frequency domain deep feature enhancement, obtaining the enhanced first shunt feature. ; F2 is used for identity mapping to obtain the enhanced second shunt feature. F2 simultaneously passes through n bottleneck modules to extract features, resulting in the first bottleneck B1, the second bottleneck B2, ..., the nth bottleneck Bn, where B0 = F2; Step 3-3, Feature Aggregation: Channel concatenation is performed, followed by 1×1 convolution to adjust the number of channels to C_out, yielding the final output of the HME-C2f module. .
6. The method according to claim 5, characterized in that, Step 4 includes: Step 4-1: Calculate the Gaussian decay weight based on the normalized area s of the predicted bounding box. : , in The maximum weighting coefficient, Here, exp is the gradient of the Gaussian decay function, which is the control parameter for the decay rate. ; Step 4-2, Calculate the geometric constraint penalty: Calculate the intersection-over-union (IoU) ratio between the predicted bounding box and the ground truth bounding box. The aspect ratio penalty is: , Where v represents the aspect ratio penalty term, π represents pi, w^gt represents the ground truth box width, h^gt represents the ground truth box height, w^pred represents the predicted box width, and h^pred represents the predicted box height. coefficient Center distance penalty ρ is the distance between the centers, e is the natural constant, and c is the length of the diagonal of the minimum bounding rectangle; It is the minimum value; , in, The coordinates of the top-left corner of the true bounding box; The coordinates of the bottom right corner of the true bounding box; , The coordinates of the top-left corner of the prediction box; The coordinates of the bottom right corner of the prediction box; Step 4-3: Calculate the final loss.
7. The method according to claim 6, characterized in that, In step 4-3, the final loss is calculated using the following formula: , in: The loss value is the Gaussian decay scale adaptive cross-union ratio loss function; The maximum weighting coefficient; The weights are Gaussian decay weights based on the normalized area s of the predicted bounding box; This is the aspect ratio penalty coefficient; Decompose the loss function into basic bias terms. Scale-adaptive IoU term and distance terms To achieve adaptive penalty for targets at different scales: , in, .
8. The method according to claim 7, characterized in that, Step 5 includes: Step 5-1, Training Phase: Train the model using the dataset, in order to The bounding box regression loss is combined with the cross-entropy loss as the class loss, and the following approach is adopted. The optimizer employs an adaptive learning rate strategy, combined with data augmentation techniques, to periodically evaluate metrics using a validation set and adjust parameters to their optimal state. Step 5-2, Inference Stage: The aerial infrared image to be detected is preprocessed. The trained model is input, and after feature extraction, fusion, and detection head recognition, the predicted bounding box information is output. After non-maximum suppression filtering, the final detection result is obtained.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, It stores a computer program or instructions that, when run on a computer, perform the steps of the method as described in any one of claims 1 to 8.