Infrared small target detection method based on selective state space model and related device
By using selective state space model to capture long-distance dependencies in infrared small object detection, and combining cross-scale feature interaction and dual attention mechanism, the problems of information loss and high computational complexity in the existing technology are solved, achieving higher detection accuracy and performance.
Patent Information
- Application Number
- CN202510234217.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing infrared small object detection methods have problems such as information loss, gradient disappearance and high computational complexity when dealing with complex backgrounds and noise interference, resulting in low detection accuracy.
The infrared small object detection method based on the selective state space model is adopted. By capturing long-distance dependencies in the image, combining cross-scale feature interaction and dual attention mechanism, the interaction and fusion of features are enhanced and the detection accuracy is improved.
Effectively capture the global and local characteristics of small targets, enhance adaptability to complex backgrounds, and improve the accuracy and performance of infrared small target detection.
Smart Images

Figure CN120163956A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of infrared small target detection, and particularly relates to an infrared small target detection method and related device based on a selective state space model. Background Art
[0002] Infrared small target detection is an important computer vision task, which is widely used in military warning, missile guidance, maritime rescue, UAV monitoring and other scenarios. It is specifically for accurately detecting objects with small area, low contrast and unclear target features in infrared images. Its core task is to separate extremely small targets from complex backgrounds. These targets usually only occupy a small number of pixels and have a weak difference from the background.
[0003] Since small targets only occupy a small number of pixels in infrared images, and usually the background is complex and the noise interference is large, this makes the detection task extremely challenging. In addition, infrared small targets lack obvious edge features, the target contrast is low, and the difference from the background is weak, which further increases the detection difficulty.
[0004] However, current infrared small target detection methods based on Convolutional Neural Network (CNN) and Transformer both have some deficiencies. The former has limitations in feature extraction, that is, the convolutional neural network CNN is prone to losing important features when processing small targets. Especially in deep networks, the size of the feature map gradually shrinks, which may lead to the loss of small target information. While the latter, Transformer usually requires large computing resources and memory. Especially when processing high-resolution images, the computational complexity increases significantly, limiting the possibility of its real-time application. And although Transformer performs well in global context modeling, it may be insufficient in capturing local features of small targets, affecting the detection accuracy. Summary of the Invention
[0005] The present invention aims to provide an infrared small target detection method and related device based on a selective state space model. By adopting the selective state space model to capture long-range dependencies in the image, adopting a cross-scale feature interaction strategy to enhance the interaction and fusion of multi-scale features, and using a dual attention mechanism to further focus on key feature regions, the target detection accuracy is improved.
[0006] To achieve the above object, the present invention is implemented by the following technical solutions:
[0007] In a first aspect, the present invention provides an infrared small target detection method based on a selective state space model, including:
[0008] Obtain the infrared image to be measured;
[0009] Preprocess the infrared image to be measured to obtain a standard infrared image;
[0010] Input the standard infrared image into a pre-trained infrared small target detection model to obtain the detected infrared small targets;
[0011] Among them, the method for obtaining the pre-trained infrared small target detection model includes:
[0012] Obtain a historical infrared image sample set, where the historical infrared image sample set contains historical infrared images and corresponding labels;
[0013] Preprocess each historical infrared image in the historical infrared image sample set to obtain a standard historical sample set;
[0014] Input the standard historical sample set into a pre-constructed infrared small target detection model to obtain a trained infrared small target detection model, where the infrared small target detection model extracts features based on the Selective State Space Model Mamba and performs feature fusion and enhancement through cross-scale feature interaction and dual attention mechanisms.
[0015] Optionally, the pre-constructed infrared small target detection model includes an encoder, a cross-scale feature interaction module, an attention module, and a decoder connected in sequence;
[0016] The encoder includes multiple encoder layers connected in sequence, and each encoder layer includes a depthwise separable convolutional layer with residual connection and the Selective State Space Model Mamba, where each encoder layer constitutes a multi-scale feature space;
[0017] The cross-scale feature interaction module includes multiple feature fusion units, and each feature fusion unit is connected to the encoder layers of the corresponding level and adjacent levels;
[0018] The attention module includes multiple dual attention residual blocks, and each dual attention residual block is connected to the feature fusion unit of the corresponding level;
[0019] The decoder includes multiple decoder layers connected in sequence, and each decoder layer is connected to the dual attention residual block of the corresponding level. Each decoder layer includes a depthwise separable convolutional layer with residual connection and the Selective State Space Model Mamba.
[0020] Optionally, the preprocessing of the infrared image to be measured to obtain a standard infrared image includes:
[0021] Input the infrared image to be measured \(X\) into the initial convolutional layer to adjust the number of channels of the infrared image to obtain a standard infrared image \(F1\), where \(X\in R\) H×W×C , \(F1\in R\) H×W×16, where H is the height of the image, W is the width of the image, C is the number of image channels, and R is the infrared image set.
[0022] Optionally, inputting the standard infrared image into a pre-trained infrared small target detection model to obtain the detected infrared small target includes:
[0023] Performing multi-layer feature extraction on the input standard infrared image through an encoder to obtain feature maps of different scales;
[0024] Performing cross-level feature fusion on the feature maps of different scales through a cross-scale feature interaction module to obtain a fused feature map;
[0025] Performing multiple attention weightings on the fused feature map through an attention module to obtain an enhanced feature map fused with channel attention weights and spatial attention weights;
[0026] Performing upsampling on the weighted fused feature map through a decoder to generate a detection result map of the infrared small target.
[0027] Optionally, the input image of the first encoder layer is the standard infrared image F1, and the input images of other encoder layers are the output images of the previous encoder layer;
[0028] The performing multi-layer feature extraction on the input standard infrared image through an encoder to obtain feature maps of different scales includes:
[0029] Performing depthwise separable convolution processing on the input image through the depthwise separable convolution layer in each encoder layer to obtain a convolution output containing local features ;
[0030] Normalizing the convolved features to obtain normalized features ;
[0031] Processing the normalized features through the selective state space model Mamba in the corresponding encoder layer to generate an enhanced feature output ;
[0032] Normalizing the enhanced feature output and converting the normalized enhanced feature output into the output dimension through linear projection to obtain the output out;
[0033] Adding the output out to the convolution output to obtain the outputs of different scales of each encoder layer.
[0034] Optionally, the performing cross-level feature fusion on the feature maps of different scales through a cross-scale feature interaction module to obtain a fused feature map includes:
[0035] Upsample the deep features from the next encoder and adjust the number of channels according to the spatial resolution and the number of channels of the shallow features from the corresponding encoder layer;
[0036] Weightedly fuse the shallow features and the adjusted deep features according to the learned weights, and perform non-linear processing through the ReLU activation function to obtain the fused feature map.
[0037] Optionally, the enhanced feature map that fuses the channel attention weight and the spatial attention weight is obtained by performing multiple attention weightings on the fused feature map through the attention module, including:
[0038] Extract the channel dimension features of the fused feature map, calculate the attention weight of each channel, and generate the channel attention map;
[0039] Extract the spatial dimension features of the channel attention map, calculate the spatial attention weight, and generate the channel spatial attention map;
[0040] Perform a residual connection between the channel spatial attention map and the input features, and perform non-linear processing through the ReLU activation function to output the enhanced feature map.
[0041] Optionally, the input image of the first decoder layer is the concatenated output image of the corresponding layer's dual attention residual block and the last encoder layer, and the input image of each other decoder layer is the concatenated output image of the corresponding layer's dual attention residual block and the previous decoder layer;
[0042] The upsampling of the weighted fusion feature map by the decoder to generate the detection result map of the infrared small target includes:
[0043] Perform upsampling on the received concatenated output image through the depthwise separable convolutional layer and the selective state space model Mamba in each decoder layer to obtain a feature map with the same resolution as the standard infrared image;
[0044] Perform a convolution operation on the upsampled feature map through the output layer of the decoder to generate a single-channel output image, where the gray value of each pixel in the single-channel output image represents the probability distribution of the pixel belonging to the infrared small target. If the pixel gray value is greater than 0, it means the pixel belongs to the target, and if the pixel gray value is 0, it means the pixel belongs to the background.
[0045] In a second aspect, the present invention provides an infrared small target detection system based on a selective state space model, including:
[0046] A module for obtaining data to be measured: used to obtain the infrared image to be measured;
[0047] Data preprocessing module: used to preprocess the infrared image to be measured to obtain a standard infrared image;
[0048] Detection result acquisition module: used to input the standard infrared image into a pre-trained infrared small target detection model to obtain the detected infrared small targets;
[0049] Among them, the acquisition method of the pre-trained infrared small target detection model includes:
[0050] Obtain a historical infrared image sample set, where the historical infrared image sample set contains historical infrared images and corresponding labels;
[0051] Preprocess each infrared image in the historical infrared image set to obtain a standard historical sample set;
[0052] Input the standard historical sample set into a pre-constructed infrared small target detection model to obtain a trained infrared small target detection model, where the infrared small target detection model extracts features based on the selective state space model Mamba, and performs feature fusion and enhancement through cross-scale feature interaction and dual attention mechanism.
[0053] In a third aspect, the present invention provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the infrared small target detection method based on the selective state space as described in any step of the first aspect.
[0054] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: Traditional convolutional neural networks may encounter problems such as information loss or vanishing gradients when capturing long-distance features. However, Mamba can capture longer spatial dependency information by modeling spatio-temporal dynamic features. By using the selective state space model Mamba to capture long-range dependencies in infrared images, the perception ability of targets under complex backgrounds is enhanced. Moreover, by introducing a cross-scale feature interaction module and a dual attention mechanism, the sensitivity of the network to small targets and the adaptability to complex backgrounds are further enhanced, improving the accuracy of infrared small target detection; The cross-scale feature interaction module fuses shallow high-resolution features and deep low-resolution features through adaptive weight learning, effectively enhancing the interaction and fusion of features at different scales; In the design of the attention module, through the synergistic effect of channel attention and spatial attention, the importance of each feature channel and spatial position can be automatically adjusted, thus focusing more on the target area, suppressing background noise interference. After the weighted fusion of the dual attention mechanism, the expression ability of the feature map is further optimized, ensuring that precise details within the target area are retained while avoiding interference from redundant information; In the decoder part, features at different levels are gradually fused, ensuring that the network can restore to the resolution of the original image and retain detailed feature information, optimizing the operations of feature extraction and target image reconstruction, and improving the performance of the detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 FIG. shows a flowchart of an infrared small target detection method based on a selective state space model in an embodiment of the present invention;
[0056] Figure 2 FIG. shows a schematic structural diagram of an infrared small target detection model in an embodiment of the present invention;
[0057] Figure 3 FIG. shows a schematic diagram of a frame of infrared small target image in the IRSTD-1k dataset in an embodiment of the present invention;
[0058] Figure 4 FIG. shows the use of Method1 in an embodiment of the present invention for Figure 3 FIG. shows a schematic diagram of the detection result of detecting the shown image;
[0059] Figure 5 FIG. shows the use of Method2 in an embodiment of the present invention for Figure 3 FIG. shows a schematic diagram of the detection result of detecting the shown image;
[0060] Figure 6 FIG. shows the use of the infrared small target detection model of the present invention in an embodiment of the present invention for Figure 3 FIG. shows a schematic diagram of the detection result of detecting the shown image. Specific Embodiment
[0061] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention and cannot be used to limit the protection scope of the present invention.
[0062] Embodiment 1
[0063] As Figure 1 shown, this embodiment provides an infrared small target detection method based on a selective state space model, including:
[0064] Obtain the infrared image to be measured;
[0065] Preprocess the infrared image to be measured to obtain a standard infrared image;
[0066] Input the standard infrared image into a pre-trained infrared small target detection model to obtain the detected infrared small target;
[0067] Among them, the acquisition method of the pre-trained infrared small target detection model includes:
[0068] Obtain a historical infrared image sample set, where the historical infrared image sample set contains historical infrared images and corresponding labels;
[0069] Preprocess each infrared image in the historical infrared image set to obtain a standard historical sample set;
[0070] Input the standard historical sample set into a pre-constructed infrared small target detection model to obtain a trained infrared small target detection model, where the infrared small target detection model performs feature extraction based on the selective state space model Mamba and performs feature fusion and enhancement through cross-scale feature interaction and dual attention mechanisms.
[0071] By introducing the selective state space model Mamba, the long-range dependence relationship in the small target image can be effectively captured, the interaction of features at different scales can be strengthened through the cross-scale feature interaction module, and the dual attention residual module is used to make the network focus on the key feature regions, enhancing the perception of the detection model for small targets, ensuring the extraction of both the global features and local features of small targets, optimizing feature fusion and information transmission, and improving the detection performance of infrared small targets.
[0072] Embodiment 2
[0073] On the basis of Embodiment 1, this embodiment also makes the following design.
[0074] The infrared small target detection method based on the selective state space model is specifically divided into the following steps:
[0075] Step 1: Obtain an infrared image \(X\in\mathbb{R}\) H×W×C , and input \(X\) into an initial convolutional layer. The convolutional layer uses a \(1\times1\) convolutional kernel to convert the number of channels of the input feature map from 3 to 16. The main purpose of this convolutional layer is to adjust the number of channels without changing the spatial dimensions (width and height) of the feature map, which is suitable for feature processing at the initial stage of the network. The output feature map \(F_1\in\mathbb{R}\) after passing through this convolutional layer H×W×16 .
[0076] Step 2: As Figure 2 shown, each layer of the encoder combines depthwise separable convolution and the selective state space model Mamba to form a depthwise separable Mamba module for feature extraction. Combining the lightweight characteristics of depthwise separable convolution with the Mamba's selective state space modeling ability enables long-range spatial dependency modeling while reducing computational complexity, accurately capturing weak features of small targets. The combination of the two can express features more comprehensively. The specific implementation is as follows: First, perform depthwise separable convolution on the input \(F_1\) to obtain , then perform layer normalization on it to obtain , and then use the Mamba model to process the normalized features. The calculation formula is as follows:
[0077] ,
[0078] where \(skip\_scale\) is a trainable parameter used to adjust the weight of the residual connection.
[0079] Then, perform layer normalization on the output of the Mamba model again, convert the features to the output dimension through linear projection, and finally add the processed output \(out\) to the original convolutional output to form the final output, as shown in the following formula:
[0080] ,
[0081] Through layer normalization and residual connection, the stability and convergence speed of the network are improved, ensuring the performance of the model in complex scenarios. The use of the Mamba model enhances the feature expression ability and can better capture the subtle features of small targets. A multi-scale feature space is formed through five levels of downsampling encoder layers, forming a five-level pyramid architecture, and the number of channels is set to \([16, 32, 64, 128, 256]\). Among them, the number of channels of the small target image processed by the first four levels of downsampling encoder layers changes from 16 to 128 channels, and the number of channels of the small target image processed by the last level of encoder layer changes from 128 to 256 channels.
[0082] Step S2.1: Depthwise Separable Convolution (DSC) consists of depthwise convolution and pointwise convolution. Depthwise convolution is used to extract spatial features, and pointwise convolution is used to extract channel features. Depthwise separable convolution performs grouped convolution in the feature dimension, performs independent depthwise convolution for each channel, and aggregates all channels using a 1x1 convolution before output.
[0083] Step S2.2: The Mamba model itself has linear complexity and effectively captures long-range dependencies through a selective state space mechanism, thereby reducing the number of parameters and the amount of computation. The Mamba model is composed of two branches. The first branch is mainly composed of a linear layer and a SiLU activation function. The second branch is mainly composed of a linear layer, depthwise convolution, a SiLU activation function, a Selective State Space Model (S-SSM), and Layer Norm. Finally, the two branches are merged by element-wise multiplication for output. Assuming the input feature is X ∈ R H×W×C , and its process is shown in the following formula:
[0084] ,
[0085] ,
[0086] ,
[0087] where X1 represents the output of the input feature X passing through the first branch of the SSM, X2 represents the output of the input feature X passing through the second branch of the SSM, LN represents the layer normalization operation, SiLU is the activation function, DWConv represents depthwise convolution, Linear represents the linear layer, represents element-wise product.
[0088] Step 3: To capture the detailed features of the target, a cross-scale feature interaction module is introduced to adaptively weight and fuse the outputs of adjacent encoders, making the fusion of shallow and deep features more balanced, effectively suppressing noise and redundant information, and being able to effectively strengthen the interaction between high-resolution features in the shallow layer and low-resolution features in the deep layer, enabling the network to more accurately identify the details of the target in the multi-scale feature space and enhancing the attention to small targets. The specific implementation is as follows:
[0089] Step S3.1: Assume that the input is the shallow feature map x1 from the output of the current layer encoder layer and the deep feature map x2 from the output of the next layer encoder layer. First, perform channel matching, adjust the number of channels of x2 through a 1×1 convolution layer, and perform upsampling to make its number of channels the same as that of x1 and keep the same shape.
[0090] Step S3.2: By setting learnable weight parameters and using the Softmax function for normalization to ensure that the sum of weights is 1. This guarantees that there will be no unreasonable weight distribution in the weighted sum of shallow and deep features. The operation is shown in the following formula:
[0091] ,
[0092] where weight is the set weighting parameter, and the normalized_weights are obtained through normalization processing.
[0093] Step S3.3: By using the normalized weights, the shallow feature x1 and the deep feature x2 are weighted and fused. That is, x1 and x2 are summed according to their respective weights to form the fused feature. The operation is shown in the following formula:
[0094] ,
[0095] where,[[]]END]] represents the multi-scale feature,[[]]END]] and represent the weight parameters with initial values of 0.6 and 0.4, respectively, which are used to control the weighting ratio of the shallow feature x1 and the deep feature x2.
[0096] Step S3.4: Apply the ReLU activation function to perform non-linear processing on the fused feature to enhance the expression ability of the model. The shallow feature provides fine spatial information, while the deep feature provides rich semantic information. The interaction between the two enhances the network's perception ability of multi-scale small targets.
[0097] Step 4: In the design of the attention module, through the collaborative action of channel attention and spatial attention in each layer of the dual attention residual block, the importance of each feature channel and spatial position can be automatically adjusted, so as to focus more on the target area and suppress the interference of background noise. This attention mechanism further optimizes the expression ability of the feature map through weighted fusion, ensures that the precise details in the target area are retained, and at the same time avoids the interference of redundant information. The specific implementation method is as follows:
[0098] Channel attention branch: First, perform pooling operations on the feature map through average pooling and max pooling respectively to obtain two feature maps of size B×C×1×1, and process them through the fully connected layers fc1 and fc2, and finally combine the results of the two. The operation is shown in the following formula:
[0099] ,
[0100] ,
[0101] Among them, avg_pool is the average pooling operation, avg_out is the output of average pooling, max_out is the output of max pooling, max_pool is the max pooling operation, and ReLU is the activation function.
[0102] Attention weight generation: That is, add the outputs of average pooling and max pooling, and calculate the attention weights through the sigmoid activation function. The operation is shown in the following formula:
[0103] .
[0104] Step S4.2: Spatial attention branch: The role of the spatial attention module is to adjust the spatial region of the feature map according to the importance of spatial positions. First, extract spatial information by calculating the average value and maximum value of the feature map in the channel dimension. Then, concatenate the average value and the maximum value in the channel dimension, and use a 1×1 convolutional layer to process the concatenated features to extract spatial attention features. The size of the convolutional kernel can be 3 or 7 to adapt to different spatial ranges. Next, convert the convolutional result into attention weights through the sigmoid activation function to ensure that the weight range is between 0 and 1. Finally, return the calculated attention weights for weighting the input feature map.
[0105] By combining channel attention and spatial attention, the dual attention residual module can adaptively adjust the importance of features in the channel and spatial dimensions respectively. This attention mechanism can highlight the useful target regions in the image, while suppressing irrelevant background information and enhancing the perception ability of the target. Through the residual connection, the model can maintain the flow of information, prevent the vanishing gradient, and accelerate the training process.
[0106] First, for residual learning, perform two convolutional operations on the input x to enhance its feature representation ability. After each convolutional operation, Batch Normalization and ReLU activation are performed to enhance the non-linear characteristics of the features. These operations are represented by the following formulas:
[0107] ,
[0108] ,
[0109] Among them, conv1 is the first convolutional operation, using a 3x3 convolutional kernel, aiming to extract local features in the input feature map. conv2 is the second convolutional operation, also using a 3x3 convolutional kernel, to further process the feature map from conv1. bn represents the Batch Normalization operation. These two convolutional operations work together to provide high-quality feature inputs for the subsequent attention mechanism and residual connection.
[0110] Secondly, apply channel attention: perform channel weighting on the convolutional result to calculate the channel attention weights , generate a weight map, and then perform element-wise multiplication with the original convolutional result along the channel dimension. The operation is as shown in the following formula:
[0111] ,
[0112] ,
[0113] Then, apply spatial attention: apply it to the feature map after channel attention processing to generate spatial attention weights , and weight the input feature map with the spatial attention weights. The operation is as shown in the following formula:
[0114] ,
[0115] ,
[0116] Finally, perform residual connection: the feature map weighted by channel attention and spatial attention is added to the initial input x, and then the ReLU activation function is applied. The operation is as shown in the following formula:
[0117] .
[0118] Step 5: As Figure 2 shown, each layer of the decoder uses the same structure as each layer of the encoder to ensure the coordination between the two. The target detail reconstruction is achieved through cross-layer feature reuse. The last layer of the encoder layer processes the deepest features and is connected to the first layer of the decoder layer. Then, the shallow features and deep features are fused through skip connections. Finally, the convolutional operation is applied to the feature map processed by the decoder through the output layer to generate the final object detection result. The specific approach is as follows:
[0119] Step S5.1: Each layer of the decoder receives the feature maps from the corresponding layer of the encoder and concatenates them with the upsampled feature maps from the previous decoder layer. This concatenation operation helps to combine feature information at different levels, thus retaining richer context information. That is, the input to the decoder includes: the feature maps from the corresponding dual-attention residual blocks of the attention module and the upsampled feature maps from the previous decoder layer. The concatenated feature maps are processed by a depthwise separable Mamba module, and the processed feature maps are upsampled to the same resolution as the next layer's feature maps to ensure the consistency and coherence of the decoder output feature maps.
[0120] Step S5.2: The finally generated feature maps are sent to the prediction layer. In the prediction layer, after convolution processing of the feature maps, a final single-channel output image is generated. This output image represents the result of object detection, where the grayscale value of each pixel represents the probability distribution of the pixel belonging to the object. If a pixel belongs to the object, its grayscale value will be greater than 0, indicating the detected object; conversely, if the grayscale value is 0, it means the pixel is the background. In this way, the infrared small target detection result can be obtained.
[0121] The example of the present invention uses outdoor UAV images obtained from the IRSTD-1k infrared image dataset. The IRSTD-Ik dataset provides 1001 real infrared images with various target shapes, different target sizes, and rich clutter backgrounds, and this background has accurate pixel-level annotations. The dataset is divided into two folders, where IRSTD1k_Img stores the real images and IRSTD1k_Label stores the label masks. As Figure 3is the real object position map of the infrared image of the dataset IRSTD-1k, corresponding to the infrared image X. The asymmetric contextual modulation model (Asymmetric Contextual Modulation, ACM), the network based on the attention-guided context and context pyramid module (Attention-Guided PyramidContext Network, AGPCNet), the network using the nested U-Net structure (U-Net in U-Net Network, UIU-Net), the dense nested attention network (Dense Nested Attention Network, DNANet), the infrared small target detection network based on shape reconstruction (Shape Matters for Infrared Small Target Detection, ISNet), the attention local contrast network (Attentional Local Contrast Network, ALCNet) and the present invention are respectively used to detect the target of the infrared image of the embodiment IRSTD-1k, and the target accuracy is shown in Table 1.
[0122] Table 1 Comparison of infrared small target detection accuracy
[0123] Object detection method ACM AGPCNet UIU-Net DNANet ISNet ALCNet The present invention Object detection accuracy rate / % 90.58 90.91 91.43 92.07 92.46 89.69 93.54
[0124] As can be seen from Table 1, the target detection accuracy of the present invention is as high as 93.54%, which is obviously better than several other methods. Assuming that the method of using the ordinary Mamba model as the encoder-decoder part of the present invention is Method 1, and the method of removing the cross-scale feature interaction module and the dual attention residual module is Method 2, the IRSTD-1k infrared image is subjected to target detection by Method 1 and Method 2 respectively. The target detection rate of Method 1 is 91.15%, and the target detection accuracy of Method 2 is 92.37%. The target detection rate of the present invention is 2.39% and 1.17% higher than that of Method 1 and Method 2 respectively. Figure 4 , Figure 5 and Figure 6 It can be seen that the target detection effect of the present invention is obviously better than that of Method 1 and Method 2.
[0125] Example 3
[0126] This embodiment provides an infrared small target detection system based on a selective state space model, including:
[0127] Test data acquisition module: used to acquire the infrared image to be tested;
[0128] Data preprocessing module: used to preprocess the infrared image to be measured to obtain a standard infrared image;
[0129] Detection result acquisition module: used to input the standard infrared image into a pre-trained infrared small target detection model to obtain the detected infrared small targets;
[0130] Among them, the acquisition method of the pre-trained infrared small target detection model includes:
[0131] Obtain a historical infrared image sample set, where the historical infrared image sample set contains historical infrared images and corresponding labels;
[0132] Preprocess each infrared image in the historical infrared image set to obtain a standard historical sample set;
[0133] Input the standard historical sample set into a pre-constructed infrared small target detection model to obtain a trained infrared small target detection model, where the infrared small target detection model extracts features based on the selective state space model Mamba, and performs feature fusion and enhancement through cross-scale feature interaction and dual attention mechanisms.
[0134] Embodiment 4
[0135] This embodiment provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the infrared small target detection method based on the selective state space as described in any step of Embodiment 2.
[0136] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0137] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the process Figure 1 one process or multiple processes and / or blocksFigure 1 a device for the functions specified in one or more boxes.
[0138] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 a box or more boxes.
[0139] These computer program instructions may also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 a box or more boxes.
[0140] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit of the present invention and the scope protected by the claims. These all fall within the protection scope of the present invention.
Claims
1. A method for detecting small infrared targets based on a selective state space model, characterized in that: include: Acquire the infrared image to be tested; Preprocessing the infrared image to be measured to obtain a standard infrared image; Inputting the standard infrared image into a pre-trained infrared small target detection model to obtain a detected infrared small target; The method for obtaining the pre-trained infrared small target detection model includes: Acquire a historical infrared image sample set, wherein the historical infrared image sample set includes historical infrared images and corresponding labels; Preprocessing each historical infrared image in the historical infrared image sample set to obtain a standard historical sample set; The standard historical sample set is input into a pre-built infrared small target detection model to obtain a trained infrared small target detection model, wherein the infrared small target detection model performs feature extraction based on the selective state space model Mamba, and performs feature fusion and enhancement through cross-scale feature interaction and dual attention mechanism.
2. The infrared small target detection method based on the selective state space model according to claim 1 is characterized in that: The pre-built infrared small target detection model includes an encoder, a cross-scale feature interaction module, an attention module and a decoder connected in sequence; The encoder comprises a plurality of encoder layers connected in sequence, each encoder layer comprises a residually connected depth-separable convolutional layer and a selective state space model Mamba, wherein each encoder layer constitutes a multi-scale feature space; The cross-scale feature interaction module includes multiple layers of feature fusion units, each layer of feature fusion units is respectively connected to the encoder layers of the corresponding level and the adjacent levels; The attention module includes multiple layers of dual attention residual blocks, each layer of dual attention residual blocks is respectively connected to the feature fusion units of the corresponding level; The decoder includes multiple layers of decoder layers connected in sequence, each decoder layer is respectively connected to the dual attention residual blocks of the corresponding level, and each decoder layer includes a residually connected depth separable convolution layer and a selective state space model Mamba.
3. The infrared small target detection method based on the selective state space model according to claim 1 is characterized in that: The preprocessing of the infrared image to be measured to obtain a standard infrared image includes: The infrared image X to be tested is input into the initial convolution layer, and the number of channels of the infrared image is adjusted to obtain a standard infrared image F1, where X∈R H×W×C , F1∈R H×W×16 , H is the image height, W is the image width, C is the number of image channels, and R is the infrared image set.
4. The infrared small target detection method based on the selective state space model according to claim 2 is characterized in that: The step of inputting the standard infrared image into a pre-trained infrared small target detection model to obtain a detected infrared small target comprises: The encoder performs multi-layer feature extraction on the input standard infrared image to obtain feature maps of different scales; The cross-scale feature interaction module is used to perform cross-level feature fusion on feature maps of different scales to obtain a fused feature map. The fused feature map is multi-weighted by the attention module to obtain an enhanced feature map that combines channel attention weights and spatial attention weights. The weighted fusion feature map is upsampled through the decoder to generate the detection result map of infrared small targets.
5. The infrared small target detection method based on the selective state space model according to claim 4 is characterized in that: The input image of the first encoder layer is the standard infrared image F1, and the input images of the other encoder layers are the output images of the previous encoder layer; The encoder performs multi-layer feature extraction on the input standard infrared image to obtain feature maps of different scales, including: The input image is processed by the depth-separable convolution layer in each encoder layer to obtain the convolution output containing local features. ; For the convolutional features Perform layer normalization to obtain normalized features ; The normalized features are processed by the selective state space model Mamba in the corresponding encoder layer. Processing to generate enhanced feature output ; Enhanced feature output Perform layer normalization and transform the normalized enhanced feature output into output dimension through linear projection to obtain output out; Convolve the output out with the output The outputs of different scales of each encoder layer are added together.
6. The infrared small target detection method based on the selective state space model according to claim 4 is characterized in that: The cross-level feature fusion of feature maps of different scales is performed through the cross-scale feature interaction module to obtain a fused feature map, including: Upsample and adjust the number of channels of the deep features from the next encoder according to the spatial resolution and number of channels of the shallow features from the corresponding encoder layer; The shallow features and the adjusted deep features are weightedly fused according to the learned weights, and nonlinear processing is performed through the ReLU activation function to obtain the fused feature map.
7. The infrared small target detection method based on the selective state space model according to claim 6 is characterized in that: The fused feature map is subjected to multiple attention weighting by the attention module to obtain an enhanced feature map that combines the channel attention weight and the spatial attention weight, including: Perform channel dimension feature extraction on the fused feature map, calculate the attention weight of each channel, and generate a channel attention map; Extract spatial dimension features of the channel attention map, calculate the spatial attention weight, and generate the channel spatial attention map; The channel space attention map is residually connected to the input feature, and nonlinear processing is performed through the ReLU activation function to output the enhanced feature map.
8. The infrared small target detection method based on the selective state space model according to claim 4 is characterized in that: The input image of the first decoder layer is the concatenated output image of the corresponding layer of dual attention residual block and the last encoder layer, and the input image of the other decoder layers is the concatenated output image of the corresponding layer of dual attention residual block and the previous decoder layer; The method of upsampling the weighted fusion feature map through the decoder to generate a detection result map of the infrared small target includes: The received spliced output image is upsampled sequentially through the depth-separable convolutional layer and the selective state-space model Mamba in each decoder layer to obtain a feature map with the same resolution as the standard infrared image; The upsampled feature map is convolved through the output layer of the decoder to generate a single-channel output image, wherein the grayscale value of each pixel in the single-channel output image represents the probability distribution of the pixel belonging to the infrared small target. If the pixel grayscale value is greater than 0, it indicates that the pixel belongs to the target; if the pixel grayscale value is 0, it indicates that the pixel belongs to the background.
9. An infrared small target detection system based on a selective state space model, characterized in that: include: Test data acquisition module: used to acquire the infrared image to be tested; Data preprocessing module: used to preprocess the infrared image to be measured to obtain a standard infrared image; Detection result acquisition module: used for inputting the standard infrared image into a pre-trained infrared small target detection model to obtain the detected infrared small target; The method for obtaining the pre-trained infrared small target detection model includes: Acquire a historical infrared image sample set, wherein the historical infrared image sample set includes historical infrared images and corresponding labels; Preprocessing each infrared image in the historical infrared image set to obtain a standard historical sample set; The standard historical sample set is input into a pre-built infrared small target detection model to obtain a trained infrared small target detection model, wherein the infrared small target detection model performs feature extraction based on the selective state space model Mamba, and performs feature fusion and enhancement through cross-scale feature interaction and dual attention mechanism.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the infrared small target detection method based on the selective state space model as described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Early warning and storage method, system and equipment based on infrared video monitoring and medium
CN120529036A
Infrared small target detection method and system based on Mamba2
CN120823432A
An infrared small target detection method and system based on Mamba2
CN120823432B
Depth calculation method, depth map construction method and related equipment
CN121437592A
Infrared target detection method and device based on dual-channel feature fusion
CN122024167A