Infrared small target detection method based on global mean contrast space attention
The infrared small target detection method based on global mean contrast spatial attention solves the problems of small target size and low background contrast in infrared small target detection, achieving high-precision and robust detection, and is suitable for real-time detection in the field of civilian security.
Patent Information
- Application Number
- CN202211398750.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-11-09
AI Technical Summary
In infrared small target detection, the small size of the target and the low visual contrast of the background cause traditional methods to rely on prior assumptions, resulting in instability and low robustness. Although machine learning methods have made improvements, they still need to improve their adaptability to complex scenes and detection accuracy.
We design an infrared small target detection method based on global mean contrast spatial attention. We employ a detection network that learns global contrast and combines it with a spatial attention module that uses global mean contrast. Through feature extraction, fusion, and loss function optimization, we achieve accurate detection of infrared small targets.
It improves the accuracy and robustness of infrared small target detection, and is suitable for real-time detection in the field of civilian security. It can effectively detect weak targets and issue security warnings.
Smart Images

Figure CN115527098B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of small target detection, and particularly relates to an infrared small target detection method based on global mean contrast space attention. BACKGROUND
[0002] Infrared small target detection plays a very important role in public safety and other fields. However, due to the small size of the target in the infrared image, usually less than or equal to 10x10 pixels, it leads to unclear target contour and texture features, and at the same time, the low visual contrast between the target and the background, these factors all bring difficulties to small target detection. This has aroused the research interest of a large number of researchers, and different small target detection technologies have emerged in an endless stream. For infrared small target detection technology, it can be divided into two different technical branches. The first branch is based on traditional non-machine learning detection methods, and the second branch is based on machine learning framework detection methods.
[0003] Traditional methods are mainly based on manually designed features under prior assumptions for small target detection. Among these traditional methods, some local contrast-based methods can be widely seen. For example, local contrast measure (LCM), and some improved methods such as Improved LCM, multi-scale block contrast method (MPCM). They detect the target by the premise that the target gray value is greater than the background gray value. In addition, there are also some matrix decomposition detection algorithms. For example, the patch-image model of Gao et al. and the patch-tensor model of Dai et al. These methods completely rely on the strong assumption that the target image conforms to the sparse matrix distribution, while the background image is a low-rank matrix, and then the small target is detected by matrix. These traditional detection methods can usually obtain good target detection results in specific scenes. However, they are too dependent on manually designed features under prior assumptions, often leading to unstable detection results and low robustness to some real scenes. In addition, the manually designed features for different scenes not only have high cost, but also usually limit the adaptability to complex scenes.
[0004] With the development of traditional methods, neural networks in machine learning have become a branch of infrared small target detection, overcoming the shortcomings of traditional methods and receiving more and more attention. In the past few years, many algorithms have been developed. For example, Wang et al. proposed the MD vs. FA-cGAN model, which balances the missed detection rate and false alarm rate of small targets through a generative adversarial network (GAN). Dai et al. proposed ALCNet, which designs an end-to-end detection method with model-driven and data-driven strategies, which can solve the problem of lack of inherent characteristics of small targets. In order to better highlight small targets, in addition to the top-down global context feedback, ACMNet also supplements a bottom-up mechanism with point channel attention to exchange high-level semantics and low-level semantics. In order to prevent the disappearance of infrared small targets in convolution, Li et al. proposed DNANet. This network can well integrate and make full use of the background information of small targets through repeated fusion and enhancement. MAPNet proposed by Wang et al. designs an axial attention to highlight the features of small targets while suppressing the background. The multi-scale block branch structure fuses coarse-grained and fine-grained features from different semantic scales. Qi et al. proposed a network composed of Transformer and CNN (FTC-Net). In the CNN branch, U-Net is used to obtain the low-level local details of small targets, the Transformer branch uses hierarchical self-attention to learn long-term context dependencies, and a feature fusion module (FFM) is designed to fuse local features and global features. SUMMARY
[0005] To solve the above technical problems, the present application provides an infrared small target detection method based on global mean contrast spatial attention.
[0006] The technical scheme adopted by the present application is as follows: an infrared small target detection method based on global mean contrast spatial attention, the specific steps are as follows:
[0007] S1, design a detection network based on global contrast learning;
[0008] S2, further propose a spatial attention module based on global mean contrast for the detection network designed in step S1;
[0009] S3, use the feature extraction module of the detection network in step S1 to extract the primary features of the infrared small target;
[0010] S4, use the feature fusion module of the detection network in step S1 to perform multi-level fusion on the infrared small target features extracted in step S3;
[0011] S5, target prediction, error loss calculation, and iterative optimization of target detection results are performed on the output features of step S4 by defining and decoupling the detection head design through a loss function.
[0012] Further, in step S1, the following is specifically implemented:
[0013] A detection network framework based on global contrast learning is designed, and the main structural components include:
[0014] (1) an infrared image feature extraction module;
[0015] The module includes one Focus-Conv sub-module and one double-channel feature extraction sub-module.
[0016] The double-channel feature extraction sub-module includes a Conv-CSP component and an SAG-Conv component.
[0017] (2) an infrared image feature fusion module;
[0018] The module includes three feature fusion channels. The first channel is the output feature of the terminal SAGG component in the feature extraction module, the second channel is the output feature of the terminal CSPG component in the feature extraction module, and the third channel is the output of the terminal CSPG component in the fusion module after upsampling.
[0019] The third feature fusion channel includes two groups of Conv-SKConv sub-modules, one SPP sub-module, and one Conv-CSP sub-module. The output of the first group of Conv-SKConv sub-modules and the output of the SPP sub-module are connected through an upsampling fusion channel. The fusion output of the two sub-modules is the feature input of the Conv-CSP sub-module. The internal structure of the SPP sub-module consists of three different scale image feature channels, forming a three-level feature pyramid processing mode.
[0020] (3) an infrared small target detection module;
[0021] The module includes two groups of Conv-SKConv sub-modules and a small target detection head based on the YOLOV technology framework. The detection head after parameter training finally completes the detection, classification, and positioning of the infrared small target.
[0022] Further, in step S2, the following is specifically implemented:
[0023] In the SAG block, a simple and efficient preprocessing optimization global mean contrast is used:
[0024]
[0025] X cdenotes an infrared channel image, (i, j) denotes pixel coordinates, H and W denote the height and width of image X c , respectively, L c denotes a pixel-level enhancement or suppression weight factor of image X c .
[0026] The pixel values less than 0 in image X c are set to 0 to ensure that the weight L c is not negative.
[0027] wherein, in order to make L c more accurate to gather to the area where the small target is located, a 1x1 convolution branch is designed to optimize the global features, and a 3x3 convolution branch is designed to obtain the local information of image X c , and finally the global information and the local information of the two branches are effectively fused together through the constructed fully connected multilayer perception, and the spatial pixel-level attention map att(X) of the current input image X is generated. The spatial attention of the channel image is expressed as:
[0028]
[0029] The feature map of the small target of interest is obtained through . Wherein, Y denotes the result obtained after the current input image X and the generated spatial pixel-level attention map att(X) are subjected to re-weighting modulation processing, denotes splicing, denotes performing Hadamard product, MLP denotes a fully connected multilayer perception, Conv denotes a convolution layer operation, L c denotes a pixel-level enhancement or suppression weight factor of image X c .
[0030] Further, in the step S3, the following is specifically as follows:
[0031] In feature extraction, the original image is first preprocessed and input into the Focus module for slicing, and in the case that there is no obvious information loss, the calculation amount is reduced and the calculation speed is accelerated. After the Focus module, the image is further input in parallel to two feature extraction branches.
[0032] Wherein, one branch contains a series of CSPG components, each component is composed of a convolution layer and a CSP layer; the other branch contains a series of SAGG components, each component is composed of three SAG layers and two convolution layers alternately.
[0033] Through the residual design of the CSPG component, the branch perceives the feature information of the small target and the surrounding local background.
[0034] Through the two branches, the global feature X g and the local feature X l of the small target in the infrared image are obtained, which can be expressed as:
[0035]
[0036] wherein, CSP represents a CSP layer, Conv represents a convolution layer operation, and SAG represents the proposed spatial attention mechanism layer.
[0037] Further, in the step S4, the following is specifically performed:
[0038] In the feature fusion, the features X g and X l are first spliced together and then processed through two SKConvG components, each of which has two SKConv layers, effectively fusing the two features, constructing an effective global context, and reducing possible context loss.
[0039] After effective fusion, the SPP structure is used to enrich the expression ability of the feature map to prevent possible loss of the infrared small target. Then, after upsampling, the feature map is spliced with the output of the first SKConvG component.
[0040] wherein, the feature X f is obtained through an additional CSP module and an upsampling operation. After X l , X g and X f are connected, another SKConvG component is designed to fuse the three features, thereby realizing the final output of the backbone network. The fusion scheme proposed for the three features is expressed as follows:
[0041]
[0042]
[0043] wherein, X o represents feature information, SPP represents a standard spatial pyramid pooling module, represents that it is a plurality of SKConvG components connected in series, and SKConv represents a selective kernel convolution layer.
[0044] Further, in the step S5, the following is specifically performed:
[0045] Two branches are adopted to respectively calculate a classification error loss value (Loss cls ), a regression error loss value (Loss iou ) and a target error loss value (Lossobj ).
[0046] wherein one branch is specially used for calculating the target category error loss value. The feature information (X o ) is first passed through two convolutional layers, and then passed through a layer of convolution for classification prediction; another branch is used for calculating the regression error loss value and the target error loss value. After two convolutional layers, one convolution is used for target prediction, and another convolution is used for regression value prediction. At the same time, Loss cls and Loss obj are calculated by a cross-entropy loss function, and Loss iou is calculated by an IoU loss function. The total loss function Loss total is defined as follows:
[0047] Loss total = λ × Loss iou + Loss cls + Loss obj (6)
[0048] wherein λ represents a hyperparameter, Loss iou represents the calculated IoU error loss value of the infrared small target position and the calibrated position, and Loss iou = 1-iou 2 , wherein iou represents the IoU of the detection target outer frame and the calibrated outer frame; Loss obj,cls = - [y·log(p) + (1-y)·log(1-p)], Loss obj,cls represents the calculated infrared small target detection result confidence error loss value and infrared small target classification result error loss value, y represents the label of the infrared small target training sample, and 1 represents a target and 0 represents a non-target, and p represents the prediction probability of the model on the infrared small target.
[0049] The method of the present application first designs a detection network based on global contrast learning, proposes a spatial attention module based on global mean contrast, uses the feature extraction module of the detection network to extract features of the infrared small target, uses the feature fusion module for multi-level fusion, and through the loss function definition and decoupling detection head design, the output features are used for target prediction, error loss calculation, and iterative optimization of the target detection result, so as to finally achieve the purpose of effectively detecting the infrared small target. The method of the present application makes the infrared small target detection more accurate and robust, can effectively detect the infrared images collected by the medium wave infrared sensor in the air-to-surface and air-to-ground detection, detect the weak and small targets appearing in the target space, and is the premise of accurately issuing a safety warning. It can be applied to the field of civil security, such as detecting the unmanned aerial vehicle flying in violation of regulations, airport airspace bird detection and driving away, etc. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 This is a flowchart of an infrared small target detection method based on global mean contrast spatial attention according to the present invention.
[0051] Figure 2 This is a diagram of the infrared small target detection network structure designed in an embodiment of the present invention.
[0052] Figure 3 This is a diagram of the global average contrast attention mechanism proposed in this embodiment of the invention.
[0053] Figure 4 This is a visualization of the SAG spatial attention mechanism in an embodiment of the present invention.
[0054] Figure 5 These are PR curves on two datasets in an embodiment of the present invention.
[0055] Figure 6 These are visualizations of the detection bounding boxes in two real-world scenarios in an embodiment of the present invention. Detailed Implementation
[0056] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0057] like Figure 1 The flowchart of the infrared small target detection method based on global mean contrast spatial attention of the present invention is shown below. The specific steps are as follows:
[0058] S1. First, design a detection network based on global contrast learning;
[0059] S2. Based on the detection network designed in step S1, a spatial attention module based on global mean comparison is further proposed.
[0060] S3. Use the feature extraction module of the detection network in step S1 to perform primary feature extraction on infrared small targets;
[0061] S4. Use the feature fusion module of the detection network in step S1 to perform multi-level fusion of the infrared small target features extracted in step S3;
[0062] S5. By defining the loss function and decoupling the detection head design, target prediction, error loss calculation, and iterative optimization of the target detection results are performed on the output features of step S4.
[0063] In this embodiment, step S1 specifically includes the following:
[0064] Design a detection network framework based on global contrast learning, the complete structure of which is as follows: Figure 2 As shown, the main structural components include:
[0065] (1) Infrared image feature extraction module;
[0066] It includes one Focus-Conv sub-module and one double-channel feature extraction sub-module.
[0067] The double-channel feature extraction sub-module includes a Conv-CSP component and an SAG-Conv component.
[0068] (2) Infrared image feature fusion module;
[0069] The module includes three feature fusion channels. The first channel is the output feature of the terminal SAGG component in the feature extraction module, the second channel is the output feature of the terminal CSPG component in the feature extraction module, and the third channel is the output of the terminal CSPG component in the fusion module and the feature result after up-sampling.
[0070] The third feature fusion channel includes two groups of Conv-SKConv sub-modules, one group of SPP sub-modules, and one group of Conv-CSP sub-modules. The output of the first group of Conv-SKConv sub-modules and the output of the SPP sub-modules are connected through an up-sampling (Upsampled) fusion channel; the fusion output of the two sub-modules is the feature input of this group of Conv-CSP sub-modules; the internal structure of the SPP sub-module consists of three image feature channels of different scales, forming a three-level feature pyramid processing mode.
[0071] (3) Infrared small target detection module;
[0072] The module includes two groups of Conv-SKConv sub-modules and a small target detection head based on the YOLOV technology framework. The detection head trained by parameters finally completes the detection, classification, and positioning of the infrared small target.
[0073] In this embodiment, the step S2 is specifically as follows:
[0074] Traditional local contrast measurement (LCM) usually only uses direct local contrast features to detect infrared small targets, has little learning ability, and often has low robustness. In the SANet model of this embodiment, considering the importance of infrared pixel contrast and the expected learning ability of feature detection, a spatial attention module (SAG) with global mean contrast is specially designed, as shown in Figure 3 .
[0075] In infrared images, LCM is typically used to enhance targets and suppress background noise based on local contrast. To obtain global features of small targets, a simple and efficient preprocessing optimization for Global Average Contrast (GAC) is employed in the SAG module:
[0076]
[0077] Among them, X c This represents the infrared channel image, where (i,j) represents the pixel coordinates, H and W represent the height and width of the image X, respectively, and L... c Represents image X c The pixel-level enhancement or suppression weight factor.
[0078] In this embodiment, image X is... c Pixel values less than 0 are set to 0 to ensure that the weight L c It is not a negative value.
[0079] Among them, in order to make L c To more accurately focus on the region where small targets are located, a 1×1 convolutional branch is designed to optimize global features, while a 3×3 convolutional branch is designed to obtain image X. c The local information is then used to effectively fuse the global and local information from the two branches through a fully connected multilayer perceptron, generating a spatial pixel-level attention map att(X) for the current input image X. The spatial attention for the channel image is represented as:
[0080]
[0081] pass The feature map of the small target of interest is obtained. Here, Y represents the result obtained after further weighted modulation processing of the current input image X and the generated spatial pixel-level attention map att(X). Indicates splicing, This indicates the execution of the Hadamard product, MLP represents a fully connected multilayer perceptron, Conv represents the convolutional layer operation, and L... c Represents image X c The pixel-level enhancement or suppression weight factor.
[0082] In this embodiment, step S3 specifically includes the following:
[0083] like Figure 2 As shown, in feature extraction, the original image is first preprocessed and then input into the Focus module for slicing. This reduces computation and speeds up the process without significant information loss. After the Focus module, the image is further input in parallel into two feature extraction branches.
[0084] One branch contains a series of CSPG (Cross Stage Partial Group) components, each of which is composed of a convolution layer and a CSP layer. Through the residual design of the CSPG component, the branch perceives the feature information of small targets and the surrounding local background.
[0085] Similarly, the other branch contains a series of SAGG components, which are composed of three SAG layers and two convolution layers in an alternating manner.
[0086] Through the two branches, the global feature X g and the local feature X l of the small target in the infrared image can be obtained, which can be expressed as:
[0087]
[0088] where CSP represents a CSP layer, Conv represents a convolution layer operation, and SAG represents the proposed spatial attention mechanism layer.
[0089] In this embodiment, in step S4, the following is specifically performed:
[0090] In feature fusion, the features X g and X l are first spliced together and then processed through two SKConvG (Selective kernel convolution Group) components, each of which has two SKConv layers, which can effectively fuse the two features and then construct an effective global context to reduce possible context loss.
[0091] After effective fusion, the SPP structure is used to enrich the expression ability of the feature map to prevent possible loss of the infrared small target. Then, after upsampling, the feature map is spliced with the output of the first SKConvG component.
[0092] where the feature X f is obtained through an additional CSPG component and an upsampling operation. After X l , X g and X f are connected, another additional SKConvG component is designed to fuse the three features, thereby realizing the final output of the backbone network. The fusion scheme proposed for the three features is expressed as follows:
[0093]
[0094]
[0095] wherein X o represents feature information, SPP represents a standard spatial pyramid pooling module, represents that it is a plurality of SKConvG components in series (only one SKConvG component is drawn in Figure 1 ), and SKConv represents a selective kernel convolution layer (SKConv, Selective Kernel Convolution).
[0096] In the embodiment, the step S5 is specifically as follows:
[0097] Two branches are used to calculate classification error loss value (Loss cls ), regression error loss value (Loss iou ) and target error loss value (Loss obj ).
[0098] wherein one branch is specially used to calculate target category error loss value. First, the feature information (X o ) is input into two convolution layers, and then a layer of convolution is used for classification prediction; another branch is used to calculate regression error loss value and target error loss value. After two convolution layers, one convolution is used for target prediction, and another convolution is used for regression value prediction. At the same time, Loss cls and Loss obj are calculated through a cross-entropy loss function, and Loss iou is calculated through an IoU loss function. The total loss function Loss total is defined as follows:
[0099] Loss total = λ × Loss iou + Loss cls + Loss obj (6)
[0100] wherein λ represents a hyperparameter, Loss iou represents the calculated intersection over union error loss value of the infrared small target position and the calibrated position, and Loss iou = 1-iou 2 , iou represents the intersection over union of the detection target outer frame and the calibrated outer frame; Loss obj,cls = -[y·log(p) + (1-y)·log(1-p)], Loss obj,clsThe y represents the label of the infrared small target training sample, and 1 represents a target, 0 represents a non-target, and p represents the prediction probability of the model on the infrared small target.
[0101] The present application is further described below taking the infrared small target data sets SIRST and ITSDT as examples.
[0102] The SIRST (Single frame infrared small target) data set is composed of 427 pictures, each of which is an infrared small target image in a real scene, and is divided into training, verification and test sets in a ratio of 8:1:1. The ITSDT (A dataset for infrared time-sensitive target detection and tracking for air-ground application) data set is composed of 87 real scene sequences, a total of 21750 infrared small target images, and the training, verification and test set ratio is 5:2:3.
[0103] (1) Initialization of the experiment:
[0104] Before the infrared image is input, the picture is first converted into an RGB three-channel image, the image size is converted to 640x640 pixels, and then the image pixel value is normalized before being input into the model for infrared small target detection. In this embodiment, the Adam optimizer is used and trained for 400 epochs on SIRST and 20 epochs on ITSDT. In addition, the initial learning rate is 0.001 on SIRST and 0.005 on ITSDT, which is decayed at a rate of 8% per epoch and reset to the initial learning rate every 100 epochs.
[0105] (2) Feature extraction stage:
[0106] After the image preprocessing input model, the Focus module is first used. It performs slicing operation on the picture, specifically taking a value every other pixel in a picture, changing the original RGB three-channel mode to 12 channels, and concentrating H and W information into the channel space, and then obtaining the final speed-up effect through convolution operation without information loss. The feature map obtained is then respectively passed through the CSP and SAG branches, and the local feature X l and the global feature X g of the small target are extracted according to the steps of formula (3). Among them, the attention visualization of the SAG branch is as shown in Figure 4As shown, it is clear that the attention mechanism designed in this embodiment can accurately pay attention to the area where the small target is located.
[0107] (3) Feature fusion stage:
[0108] Get the local feature X of the small target l and the global feature X g After that, as shown in Figure 2 , the two features are spliced together and then passed through two SKConvG components. SKConvG belongs to branch attention, which can focus on more effective feature extraction branches and effectively fuse the two features, then build an effective global context, thereby reducing the possible loss of context. After passing through two SKConvG components, the output of the first SKConvG component is obtained and the output of the second is After the feature is passed through an SPP module, different size (size 5, 9, 13) max pooling layers are used to pool respectively, and then filled and spliced. After a convolution layer fusion, SPP enriches the expression ability of the feature map to prevent the possible loss of the infrared small target. After that, the output feature is upsampled and spliced with the feature , and then a CSPG component is used, followed by upsampling to obtain the fused feature X f , as shown in equation (4). Finally, equation (5) is used to splice X l , X g , and X f , and then pass through an SKConvG component for effective feature fusion to obtain the feature information X o output by the backbone network.
[0109] (4) Decoupling detection head and loss function:
[0110] In this embodiment, two branches are used as detection heads to detect small targets. One branch mainly predicts the category of small targets and calculates the category loss. This branch first uses two convolution layers to perform feature extraction operations on the current input feature information X o , and then uses a convolution layer to predict the category of small targets. The other branch mainly predicts the bounding box of small targets and whether small targets exist. This branch also uses two convolution layers to extract the information of X o , and then uses a convolution to predict the bounding box of small targets, and another convolution to predict whether small targets exist. Finally, equation (6) is used to calculate the loss, and the model is effectively learned through backpropagation gradient descent, and finally the result of effectively detecting infrared small targets is achieved.
[0111] To verify the effectiveness of the present application in infrared small target detection, training was performed on two public datasets SIRST and ITSDT. At the same time, the present application was compared with some advanced models (ACMNet, AGPCNet, DNANet, RISTDNet), as shown in Table 1:
[0112] Table 1
[0113]
[0114] Table 1 is a comparison of the indicators of each model on the SIRST dataset, λ = 5. It can be seen that, in addition to precision, the present application is significantly better than other infrared small target detection networks in mAP 50 , recall rate, and F1 indicators. For example, in terms of mAP 50 , recall rate, and F1 indicators, the present application respectively obtains 3.95%, 15.21%, and 0.09 improvements on the second best indicators. In terms of precision, the present application has no advantage, and the reason is that the present application pays more attention to the performance balance of precision and recall rate. Because in the real environment of small targets with threats, high missed detection rate may cause serious potential security risks.
[0115] As shown in Table 2, on the ITSDT dataset, the comparison of indicators of each model, λ = 5. It can be found that the present application is always better than the indicators of other models in all indicators. In all indicators, the present application respectively obtains 0.21%, 0.50%, 2.89%, and 0.03 improvements on the second best indicators.
[0116] Table 2
[0117]
[0118] As Figure 5 shown, in order to evaluate the comprehensive performance of the detection model, two PR curve graphs were drawn. By comparison, it can be easily observed that on SIRST and ITSDT, the PR curve of the present application is always higher than the other five curves. This also means that the present application has the best comprehensive performance on the two infrared small target datasets.
[0119] As Figure 6 shown, the detailed detection results of two groups of real scenes of 6 different models were visually displayed on SIRST. It can be observed that in these two scenes, the present application does not appear to be missed detection, which is difficult for other models to do.
[0120] As shown in Table 3, on the ITSDT dataset, the ablation experiment of the present application can observe two obvious conclusions: (1) the performance indicators of the present application are very sensitive to λ. (2) SAG, CSP, SKConv, SPP modules have different degrees of positive impact on performance. For example, only when λ = 5, mAP 50 can reach the highest, and the SAG module can increase mAP 50 from 76.26% to the highest 88.47%, which is greater than the performance improvement of other modules. This also fully illustrates the effectiveness of the present application for small target detection.
[0121] Table 3
[0122]
[0123] Although the specific embodiments of the present application are described above in order to facilitate the understanding of the present application by those skilled in the art, it should be clear that the present application is not limited to the scope of the specific embodiments. For those skilled in the art, all the inventions using the concept of the present application are within the scope of protection as long as various changes are within the spirit and scope of the present application defined and determined by the appended claims.
Claims
1. An infrared small target detection method based on global mean contrast spatial attention, the specific steps of which are as follows: S1. First, design a detection network based on global contrast learning; S2. A spatial attention module based on global mean comparison is further proposed for the detection network designed in step S1. S3. Use the feature extraction module of the detection network in step S1 to perform primary feature extraction on infrared small targets; S4. Use the feature fusion module of the detection network in step S1 to perform multi-level fusion of the infrared small target features extracted in step S3; S5. By defining the loss function and decoupling the detection head design, target prediction, error loss calculation, and iterative optimization of the target detection results are performed on the output features of step S4. In step S2, the specific details are as follows: A simple and efficient preprocessing method is used in the SAG block to optimize the global mean comparison: (1); in, Represents the infrared channel image. Represents pixel coordinates, and Representing images respectively Height and width, Representing an image The weighting factor for pixel-level enhancement or suppression; Image Pixel values less than 0 are set to 0 to ensure weighting. Not negative; Among them, in order to make To more accurately focus on the area where the small target is located, design a 1 A 1-level convolutional branch is used to optimize global features, while a 3-level branch is designed. 3 convolution branches to obtain the image The local information is then used to effectively fuse the global and local information from the two branches through a fully connected multilayer perceptron, generating the current input image. Spatial pixel-level attention map Spatial attention to the channel image is represented as: (2); pass The feature map of the small target of interest is obtained; among them, Indicates the current input image With the generated spatial pixel-level attention map The result obtained after further weighted modulation processing. Indicates splicing, This indicates the execution of the Hadamard product; MLP represents a fully connected multilayer perceptron. This represents the convolutional layer operation. Representing an image The pixel-level enhancement or suppression weight factor.
2. The infrared small target detection method based on global mean contrast spatial attention according to claim 1, characterized in that, In step S1, the specific details are as follows: Design a detection network framework based on global contrast learning, the main structural components of which include: (1) Infrared image feature extraction module; It includes one Focus-Conv submodule and one dual-path feature extraction submodule; The dual-path feature extraction submodule includes one Conv-CSP component and another SAG-Conv component. (2) Infrared image feature fusion module; This module includes three feature fusion pathways: the first pathway is the output feature of the SAGG component at the end of the feature extraction module, the second pathway is the output feature of the CSPG component at the end of the feature extraction module, and the third pathway is the feature result output by the CSPG component at the end of this fusion module and after upsampling. The third feature fusion pathway includes two sets of Conv-SKConv submodules, one set of SPP submodules, and one set of Conv-CSP submodules. The outputs of the first set of Conv-SKConv submodules and the outputs of the SPP submodules are upsampled and then fused together. The fused outputs of these two submodules are the feature inputs of the Conv-CSP submodules. The internal structure of the SPP submodule consists of a three-level feature pyramid processing mode composed of three image feature channels at different scales. (3) Infrared small target detection module; This module includes two Conv-SKConv sub-modules and a small target detection head designed based on the YOLOV technology framework; the detection head, after parameter training, finally completes the detection, classification and localization of infrared small targets.
3. The infrared small target detection method based on global mean contrast spatial attention according to claim 1, characterized in that, In step S3, the specific details are as follows: In feature extraction, the original image is first preprocessed and then input into the Focus module for slicing. This reduces the amount of computation and speeds up the computation without significant information loss. After the Focus module, the image is further input into two feature extraction branches in parallel. One branch contains a series of CSPG components, each consisting of a convolutional layer and a CSP layer; the other branch contains a series of SAGG components, each consisting of alternating three SAG layers and two convolutional layers. Through the residual design of the CSPG component, this branch is able to perceive the feature information of small targets and the surrounding local background; These two branches are used to obtain global features of small targets from infrared images. and local features The two are represented as: (3); in, Represent a layer, This represents the convolutional layer operation, while This indicates the proposed spatial attention mechanism layer.
4. The infrared small target detection method based on global mean contrast spatial attention according to claim 1, characterized in that, In step S4, the specific details are as follows: In feature fusion, features and First, they are concatenated together and then processed through two SKConvG components. Each component has two SKConv layers, which effectively fuses the two features to build an effective global context and reduce possible context loss. After effective fusion, the SPP structure is used to enrich the expressive power of the feature map to prevent the possible loss of small infrared targets; then, after upsampling, the feature map is concatenated with the output of the first SKConvG component. Features are obtained through an additional CSP module and an upsampling operation. ; after connecting , and Then, another SKConvG component is designed to fuse these three characteristics, thereby realizing the final output of the backbone network; the fusion scheme proposed for these three characteristics is expressed by the following expression: (4); (5); in, Representing feature information, This represents a standard spatial pyramid pooling module. This indicates that it is a series of multiple SKConvG components, and SKConv represents a selective kernel convolutional layer.
5. The infrared small target detection method based on global mean contrast spatial attention according to claim 1, characterized in that, In step S5, the specific details are as follows: The classification error loss is calculated using two branches. Regression error loss value and target error loss value ; One branch is specifically used to calculate the target class error loss value; firstly, the feature information is... The system uses two convolutional layers, followed by a single convolutional layer for classification prediction; another branch calculates the regression error loss and the target error loss. After the two convolutional layers, one convolution is used for target prediction, and another for regression prediction. Simultaneously, the cross-entropy loss function is used to calculate... and Calculated using the IoU loss function The overall loss function The definition is as follows: (6); in, Indicates hyperparameters, This represents the cross-union ratio (CUB) error loss value between the calculated infrared small target position and the calibrated position, and , This represents the intersection-over-union ratio (IoU) between the outer bounding box of the detected target and the calibrated outer bounding box. , denoted as the calculated confidence error loss value for infrared small target detection results and the error loss value for infrared small target classification results, y represents the label of the infrared small target training sample, where 1 represents a target and 0 represents a non-target, and p represents the model's prediction probability for the infrared small target.