A real-time infrared small target detection method based on linear global scanning network

By combining the linear global scanning network of LGSNet with spatial scanning GRU and channel attention branches, the problems of the contradiction between computational cost and real-time performance and the low efficiency of spatial dependency modeling in infrared small target detection are solved, thus achieving efficient infrared small target detection.

CN121788809BActive Publication Date: 2026-05-12NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF POSTS & TELECOMM
Filing Date
2026-03-09
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing infrared small target detection methods suffer from a trade-off between computational complexity and real-time performance, and their spatial dependency modeling is inefficient, making it difficult to achieve efficient infrared small target detection on embedded hardware platforms.

Method used

A linear global scan network (LGSNet) based on recurrent neural networks is adopted. By combining the linear global scan module (LGS Block) and the linear context aggregator (LCA) with the spatial scan GRU unit and the channel attention branch, a lightweight network is constructed to capture global dependencies and reduce computational complexity.

Benefits of technology

It improves the accuracy and robustness of infrared small target detection, reduces system inference overhead, achieves real-time response speed, and is suitable for embedded hardware platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121788809B_ABST
    Figure CN121788809B_ABST
Patent Text Reader

Abstract

The application discloses a real-time infrared small target detection method based on a linear global scanning network. In view of the high calculation complexity and poor real-time performance of the existing model, a U-Net-like lightweight architecture is constructed, which takes into account the detection accuracy and inference speed. In the encoding stage, shallow local textures are extracted through Stem and ResBlock, and a linear global scanning (LGS) module is introduced in the deep layer. The core of the LGS module utilizes a spatial scanning GRU to capture anisotropic long-distance semantic dependence with linear complexity. At the end of the encoding, the LGS module is reused by a linear context aggregator (LCA), and the features are enhanced by combining channel reweighting. In the decoding stage, the semantics are aligned through a PlainBlock, the up-sampled features are fused through a StandardFusion module, and the cascade convolution is used for refinement. Finally, an Inception module is used to generate high-precision prediction results combined with deep supervision. The application has small calculation overhead and high detection accuracy, and is suitable for high-frame-rate real-time infrared monitoring scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and infrared image processing, specifically relating to a real-time infrared small target detection method based on a linear global scanning network (LGSNet). Background Technology

[0002] Infrared small target detection is widely used in various scenarios, and compared with general object detection, it has some unique characteristics. Due to the long imaging distance, infrared targets are usually small, ranging from one pixel to tens of pixels, and lack color, texture, and structural information. In addition, complex background clutter (such as thick clouds, ocean reflections, and ground buildings) can easily obscure small targets, making accurate detection extremely challenging.

[0003] Existing deep learning methods have performed well in addressing these challenges, significantly improving detection accuracy and reducing false positive rates due to their powerful feature representation capabilities. Currently, mainstream solutions often employ a hybrid architecture based on convolutional neural networks (CNNs) and visual transformers (ViTs). CNNs utilize their inductive bias to extract local features, while ViTs capture long-range dependencies and global contextual information through self-attention mechanisms. This combination enhances the model's ability to detect small objects in complex scenes to some extent.

[0004] However, this type of hybrid architecture still faces two pressing technical challenges in practical applications:

[0005] First, there is a conflict between computational complexity and real-time performance. The computational complexity of ViT's self-attention mechanism increases quadratically with image resolution (…). In infrared small target detection, high-resolution images are typically required to cover a wider field of view, which makes it difficult for Transformer-based models to meet the real-time detection requirements on embedded or resource-constrained hardware platforms.

[0006] Second, there's the efficiency issue of spatial dependency modeling. While pure attention mechanisms offer a global perspective, they lack specificity for the anisotropic structural features of infrared targets. In contrast, recurrent neural networks (such as GRU) perform exceptionally well in sequence modeling, possessing efficient linear computational characteristics (…). However, how to effectively map it to the spatial dimension of a two-dimensional image and complement the CNN feature extraction process remains a challenging problem that has not yet been fully explored in the field of infrared small target detection.

[0007] Currently, how to construct a lightweight network that can take into account both global long-range modeling capabilities and linear computational complexity, while effectively enhancing the performance of small target detection, remains an open technical challenge in the field of infrared small target detection. Summary of the Invention

[0008] To address the aforementioned issues, this invention discloses a real-time infrared small target detection method based on a linear global scanning network. By introducing a linear scanning mechanism based on a recurrent neural network to replace the traditional self-attention mechanism, and utilizing a linear global scanning module (LGSBlock) containing spatial scanning GRU units and a linear context aggregator (LCA), the method significantly reduces system inference overhead and hardware resource consumption while effectively enhancing the salience of weak infrared targets in complex backgrounds, ultimately improving the accuracy, robustness, and real-time response speed of the detection task.

[0009] To achieve the above objectives, the technical solution of the present invention is as follows:

[0010] A real-time infrared small target detection method based on a linear global scanning network, the specific steps of which are as follows:

[0011] S1. Acquire the infrared image to be detected.

[0012] S2. The Stem module preprocesses the image to be detected, performing channel expansion while maintaining the original spatial resolution.

[0013] S3. Construct an encoder to extract multi-scale features from the image. Specifically, this includes using ResBlock to extract shallow local texture features in the shallow stage, and using several cascaded LGS Stages to extract global semantic features in the deep stage.

[0014] S4. Model deep features using the linear global scan module LGS Block, and use spatially scanned GRU units to achieve linear computational complexity. Capture global dependencies that are anisotropic.

[0015] S5. Receive the output features at the deepest bottleneck of the encoder using the linear context aggregator (LCA), input the features to the spatial scanning GRU unit and the channel attention branch respectively, and fuse the output of the spatial scanning GRU unit and the output of the channel attention branch to obtain aggregated features.

[0016] S6. Construct a decoder to perform feature recovery and fusion. Use the StandardFusion module to perform channel splicing and fusion of upsampled features and same-scale skip connection features processed by PlainBlock units, and use cascaded convolutional layers to refine the features.

[0017] S7. Utilize the multi-branch Inception prediction head to generate pixel-level prediction results, and combine a deep supervision strategy with the Soft-IoU loss function to train the model, outputting infrared small target detection results.

[0018] Furthermore, in step S1, acquiring the infrared image to be detected and performing preprocessing includes the following: Normalizing the original single-channel grayscale image using the following formula: ,in The original infrared image to be detected. and These are the mean and standard deviation obtained from the corresponding infrared datasets, respectively. The image is after normalization. During the training phase, a random cropping strategy with probabilistic features for positive samples is used. The probability-forced sampling includes the region containing the target, and performs horizontal / vertical flipping and... to Random rotation enhancement.

[0019] Furthermore, in step S2, the Stem module preprocessing includes the following sub-steps:

[0020] S201, Channel Initialization: The input single-frame infrared image is fed into the Stem module composed of ResBlocks. This module expands the number of feature map channels from 1 to 16 through the residual structure while maintaining the original spatial resolution.

[0021] S202, Local Residual Enhancement: Initial local features are extracted using cascaded convolutional layers. The calculation formula is as follows:

[0022] ;

[0023] in, The LeakyReLU activation function is used. For batch normalization, For the The input mapping after convolutional alignment preserves the pixel features of the original image through residual connections.

[0024] Furthermore, in step S3, constructing the encoder for extracting multi-scale features of the image includes the following sub-steps:

[0025] S301, encoder hierarchical cascade architecture: starting from the Stem module, it includes a ResBlock stage and multiple cascaded LGS stages, and gradually reduces the spatial resolution and expands the number of channels through downsampling operations.

[0026] S302, Shallow Texture Feature Extraction: This stage uses the Stem module and a ResBlock stage to capture the shallow physical features and local background texture of small infrared targets. The ResBlock structure is used to process the features, and residual mapping is used to enhance the local physical feature response of the small infrared targets.

[0027] S303, Deep Global Semantic Modeling: This stage uses multiple cascaded LGS Stages to process features. Within each Stage, long-distance spatial dependencies are established through LGS Blocks to enhance the global semantic expression capability in complex contexts.

[0028] Furthermore, in step S4, the linear global scanning module LGS Block extracts long-distance spatial dependencies from the input features, including the following sub-steps:

[0029] S401, Feature Preprocessing and Splitting: Input Features First pass Convolution performs channel interaction, and then through Depth convolution extracts local physical cues, which are then activated by SiLU and split into scan branches along the channel dimension. and gated branches The calculation formula is as follows:

[0030] ;

[0031] S402, Execute the spatial scan GRU unit (SPGRU) logic: Input the scan branch features into the spatial scan GRU unit, and obtain the global context features through orthogonal bidirectional recursive scanning in the horizontal and vertical directions.

[0032] S403, Gated Modulation and Triple Residual Connection: Utilizing Gated Branches Modulation global context features The modulated features are obtained. ,in The modulated high-dimensional features are channel-compressed through the output projection layer and then randomly deactivated with a probability of 0.1 using a Dropout layer to obtain the scan-enhanced features. Simultaneously, the original input features are... Input to parallel local enhancement branch Perform channel-by-channel execution Depthwise convolution, batch normalization, and SiLU activation are used to enhance the local neighborhood spatial response without introducing cross-channel mixing. Finally, the scanned enhanced features, parallel local enhanced features, and original input features are summed using three residuals to obtain the output feature Yout. The relevant formula is:

[0033] ;

[0034] in, For linear projection, This indicates a random dropout operation.

[0035] Furthermore, in step S402, the execution of the spatial scan GRU unit (SPGRU) logic includes the following sub-steps:

[0036] S4021, Parallel Serialization: Receive scan branch Reconstructing a one-dimensional sequence stream from a three-dimensional feature map. This includes a horizontal sequence stream. Merge the height dimension and the batch dimension B, where Batch size of image samples processed by a single input model; vertical sequence stream Similarly, it can be generated through a transpose operation.

[0037] S4022, Orthogonal Bidirectional Scanning and Spatial Reconstruction: Using a bidirectional GRU with half the number of nodes and channels, respectively... and Perform a recursive scan, allowing each pixel to accumulate anisotropic context from the entire row or column. Taking the horizontal direction as an example, the... Position output features The formula is as follows:

[0038] ;

[0039] in, This represents the concatenation operation of features along the channel dimension. This indicates a forward-gated cyclic scanning operation, which receives the current spatial position. Input features and the preceding hidden state passed from the left adjacent position. To accumulate positive sequence context; This indicates a reverse-gated cyclic scan operation, which receives the current feature. And the subsequent hidden state passed from the adjacent position on the right. To accumulate reverse sequence context.

[0040] S4023, Channel splicing and fusion: Outputting horizontal orthogonal scans Orthogonal scanning output The splicing is performed along the channel dimension.

[0041] S4024, Linear Mapping and Restoration: The number of channels is restored using a linear fusion layer, and the global context features are obtained after processing with an activation function. The relevant formulas are as follows: ;

[0042] Or to put it another way:

[0043] ;

[0044] in, Indicates a linear fusion layer. This represents the complete computational operation of a Spatial Scanning GRU cell. The input scan branch features.

[0045] Furthermore, in step S5, a linear context aggregator (LCA) is constructed to enhance features at deep bottlenecks, including the following sub-steps:

[0046] S501, Linear Spatial Branch: Reuse the Spatial Scan GRU unit (SPGRU) described in step S402. Input bottleneck characteristics. Subsequently, SPGRU performs orthogonal bidirectional recursive scans in both the horizontal and vertical directions, achieving linear complexity. The following steps establish the full receptive field and output spatial augmentation features. Its computational logic follows the serialization and mapping process of steps S4021 to S4024.

[0047] S502, Channel Attention Branch: Global average pooling is used to compress the spatial dimension, resulting in a statistical vector describing the global background and target distribution. After that, The data is fed into a multilayer perceptron (MLP) and first passed through... Convolution compresses channels to extract cross-channel correlations and reduce the number of parameters. After ReLU activation, it is then... Convolution is used to increase the dimensionality back to the original number of channels, and the Sigmoid function is used for normalization to generate an adaptive channel weight map. .

[0048] S503, Two-Dimensional Collaborative Fusion and Residual Output: Summing the spatial branch output with the channel-weighted features and feeding it into... Feature smoothing is achieved by fusing convolutional layers, and aggregated features are generated through residual connections. This effectively prevents gradient vanishing in deep networks and preserves the original bottleneck information. The calculation formula is as follows:

[0049] ;

[0050] in, This represents the spatial scan operation in the linear spatial branch, which reuses the aforementioned... Computational logic, This represents element-wise multiplication. This indicates a fused convolutional layer.

[0051] Furthermore, in step S6, the decoder is constructed to perform feature recovery and fusion, including the following sub-steps:

[0052] S601, Upsampling and Cross-Scale Feature Alignment: Aligning features generated from the previous layer decoder... It utilizes bilinear interpolation to expand its spatial resolution to match the features at the current scale. Consistency is achieved, resulting in upsampled features with more global semantics. Then, features corresponding to the scale are extracted from the encoder. To address the semantic gap caused by inconsistent feature distributions between encoders and decoders, a method is used... PlainBlock pairs consisting of convolutional, batch normalized (BN), and ReLU activation layers. Perform linear projection to generate alignment features The relevant formula is:

[0053] ; ;

[0054] in, This parameter represents the target spatial size parameter for the interpolation upsampling operation. This parameter limits the depth features... Spatial resolution is forcibly increased to match the alignment features The dimensions are completely consistent, thus meeting the dimensional alignment requirements for subsequent channel splicing.

[0055] S602, Multi-path Feature Fusion and Cascaded Refinement: This involves fusing and refining the upsampled decoded features... The aligned encoded features are concatenated along the channel dimension to obtain the fused feature tensor. .

[0056] ;

[0057] in, This represents the concatenation operation of features along the channel dimension. The total number of channels in the concatenated feature tensor is the sum of the number of channels of the two input features.

[0058] The spliced ​​features Two sets of cascaded components are fed into StandardFusion. Convolutional layers perform noise reduction and detail reconstruction; each convolutional layer contains... Convolution, batch normalization, and ReLU activation function are used to ultimately output the fused features at this scale. :

[0059] ;

[0060] S603, Iterative Recovery: Repeat the processes S601 and S602 above. In each iteration, the decoder can fuse the low-level texture details from the encoder, and finally output a feature map with rich edge information and strong semantic response at the original image scale, providing accurate feature support for subsequent pixel-level classification tasks.

[0061] Furthermore, in step S7, the results are generated using a multi-branch Inception prediction head and deep supervision, including the following sub-steps:

[0062] S701, Feature Reconstruction Based on Multi-Branch Inception Structure: At the end of the main prediction path, decoded features... The data is fed into a multi-branch prediction head. This prediction head uses the InceptionDWConv2d structure to capture target cues of different shapes in parallel, and then the outputs of each branch are added and fused together. The aggregation formula is expressed as:

[0063] ;

[0064] in, and These are horizontal and vertical strip convolutions, used to adapt to the anisotropic target shape caused by motion blur.

[0065] Features after aggregation via Convolutional layers reduce the number of channels from Compressed to the number of categories ( (and activated by the Sigmoid function) to generate the final predicted probability map. .

[0066] S702, Multi-scale Deep Supervision Prediction Flow Construction: To accelerate model convergence and improve training performance, a deep supervision mechanism is introduced during the training phase. This involves constructing prediction flows from the decoder's intermediate layers... Introduce the supervisory branch (ds_out). Utilize The convolutional layer compresses the feature map channels at each scale to 1, generating a low-resolution initial prediction. Then, bilinear interpolation is used to... The generated low-resolution image is restored to the same scale as the input image. During the training phase, the model returns a prediction set containing the main path output and three depth supervision outputs: During the testing phase, only output... To reduce inference overhead.

[0067] S703, Soft-IoU loss function for imbalanced samples: (The...) Soft-IoU score at each scale The definition is as follows:

[0068] ;

[0069] in, As a truth mask, The model represents the first time. The predicted probability map generated on each scale output branch represents the predicted probability that the corresponding spatial location belongs to an infrared small target. Total loss function. It consists of a weighted loss across four scales, calculated using the following formula:

[0070] ;

[0071] in, Weighting coefficients to balance the contributions of each scale.

[0072] The beneficial effects of this invention are as follows:

[0073] The proposed method employs a lightweight linear global scan network: a hierarchical dynamic multi-scale CNN-SPGRU hybrid architecture is introduced in the encoder section, which greatly enhances the model's feature extraction capability for small infrared targets. Specifically, the hybrid architecture adaptively captures subtle textures and local contrast details in infrared images using residual convolutions in the shallow layers, while injecting rich global contextual information into the features using cascaded linear global scan (LGS) modules in the deeper layers. This hybrid backbone utilizes spatial scan GRU units to... The linear computational complexity enables effective modeling of long-range dependencies across the entire image, solving the false alarm problem caused by limited receptive field for small infrared targets in complex backgrounds. On the other hand, this invention further improves the feature fusion process by introducing an innovative spatial-channel collaborative gating fusion mechanism (LCA) at the bottleneck layer. This mechanism reuses the heterogeneous advantages of the spatial scanning GRU unit and the channel attention branch, using linear spatial scanning to recover the spatial dependencies lost due to multiple downsampling, and using channel attention to redistribute the target feature weights. Through dynamic arbitration, it achieves adaptive fusion of long-range spatial information and channel feature information, ensuring that the decoder has robust semantic representation in the initialization stage. Ultimately, it effectively improves the accuracy and robustness of small infrared target detection in low signal-to-noise ratio and complex interference scenarios. Attached Figure Description

[0074] Figure 1 This is an overall framework diagram of the real-time infrared small target detection network based on the Linear Global Scan Network (LGSNet) according to an embodiment of the present invention.

[0075] Figure 2 This is a schematic diagram of the Stem module for preprocessing the image to be detected in an embodiment of the present invention.

[0076] Figure 3 This is a schematic diagram of the structure of the LGS Stage used for deep semantic modeling in an embodiment of the present invention.

[0077] Figure 4 This is a schematic diagram of the linear global scanning module LGS Block included in the LGS Stage in an embodiment of the present invention.

[0078] Figure 5 This is a schematic diagram of the structure of the Spatial Scan GRU (SPGRU) unit used to capture globally dependent data in the LGS Block in an embodiment of the present invention.

[0079] Figure 6 This is a schematic diagram of the linear context aggregator (LCA) used to enhance the features at the deepest bottleneck of the encoder in an embodiment of the present invention.

[0080] Figure 7 This is a schematic diagram of the PlainBlock structure used for aligning codec semantics in an embodiment of the present invention.

[0081] Figure 8 This is a schematic diagram of the StandardFusion structure used for feature fusion and smoothing in an embodiment of the present invention.

[0082] Figure 9This is a schematic diagram of the structure of the multi-branch Inception prediction head used to generate the main prediction result at the end of the main prediction path in an embodiment of the present invention. Detailed Implementation

[0083] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.

[0084] As shown in the figure, the real-time infrared small target detection method based on a linear global scanning network (LGSNet) described in this invention has the following overall network framework: Figure 1 As shown, the specific steps are as follows:

[0085] S1. Obtain the infrared image to be detected. Taking the IRSTD-1k dataset as an example, the pixel size of the original input image is set to... .

[0086] S2. The Stem module performs preprocessing on the image to be detected, such as... Figure 2 As shown, channel expansion is performed while maintaining the original spatial resolution. The specific details are as follows:

[0087] S201, Channel Initialization: The input single-frame infrared image is sent to the Stem module composed of ResBlocks. This module maintains... Under the premise of the original spatial resolution, the number of feature map channels is expanded from 1 to 16 through residual structure.

[0088] S202, Local Residual Enhancement: Initial local features are extracted using cascaded convolutional layers. The calculation formula is as follows:

[0089] ;

[0090] in, The LeakyReLU activation function is used. For batch normalization, For the The input mapping after convolutional alignment preserves the pixel features of the original image through residual connections, and the output size is [size missing]. .

[0091] S3. Based on the initial features obtained in step S2, construct a hierarchical encoder to extract multi-scale features of the image.

[0092] S301, Encoder Hierarchical Cascade Architecture: The constructed encoder adopts a hierarchical cascade structure, functionally divided into a shallow texture extraction stage and a deep global semantic modeling stage. Multi-scale feature extraction is achieved through continuous downsampling operations. A max-pooling layer with a stride of 2 halves the spatial resolution of the feature map before entering each stage. Within each stage, different feature extraction modules are configured according to task requirements, and the number of feature channels within the stage is adjusted as needed by the task. Figure 1 As shown.

[0093] S302, Shallow Texture Feature Extraction: The Stem module and a ResBlock stage are used to capture the shallow physical features and local background texture of small infrared targets. First, the Stem module output described in step S2... The initial feature tensor. Then, in the first stage, pooling is performed to obtain... After scaling, ResBlock is used to extract local features using residual mapping and expand the channels to 32, resulting in a final output size of [size missing]. Shallow feature map.

[0094] S303, Deep Global Semantic Modeling (LGS Stage): The shallow feature map is sequentially fed into three cascaded LGS stages. Taking the first-stage LGS stage as an example, it receives the downsampled... Tensors, first through a channel matching layer ( Convolution and batch normalization align the channels to 64, producing... The feature is then incorporated into two cascaded LGS Blocks within the Stage. Deep semantic associations are established through the linear scanning mechanism described in subsequent step S4. After passing through the remaining two cascaded LGS Stages, the encoder finally outputs a size of [size missing] at the deepest level. Bottleneck characteristics, such as Figure 3 As shown.

[0095] S4. Feature modeling is performed using the linear global scan module LGS Block and its spatial scan units, such as... Figure 4 As shown.

[0096] S401, Feature Preprocessing and Splitting: Taking the first LGS Block as an example. Input features ( First, through a The convolutional layer performs channel expansion, increasing the dimension from 64 to 256. Then, it utilizes... Depthwise convolution extracts local cues, which are then activated by SiLU and split into scan branches along the channel dimension. and gated branches Both branch dimensions are .

[0097] S402, Execute the Space Scan GRU (SPGRU) Logic:

[0098] This step receives the scan branch. Full graph dependencies are captured through orthogonal sequence scanning. For example... Figure 5 As shown, the specific implementation steps are as follows:

[0099] S4021, Parallel Serialization: Converts serialization of size... The three-dimensional feature map is reconstructed into a one-dimensional sequence stream. Among them, the horizontal sequence stream... Merge the height dimension and the batch dimension B, where The batch size of image samples processed by the single input model is formed. 128 sequences of length 128; vertical sequence stream Similarly, it can be generated through a transpose operation.

[0100] S4022, Orthogonal Bidirectional Scanning and Spatial Reconstruction: Using a bidirectional GRU with half the number of nodes and channels, respectively... and A recursive scan is performed. Then, each part is reconstructed, transforming the one-dimensional sequence stream into a three-dimensional feature map, resulting in the horizontal scan output. and vertical scan output For horizontal scan output Due to bidirectional stitching (64-dimensional left + 64-dimensional right), the number of channels remains at 128; vertical scan output Similarly.

[0101] S4023, Channel splicing and fusion: Outputting horizontal orthogonal scans Orthogonal scanning output The data is stitched together along the channel dimension to generate a size of [size missing]. The feature tensor.

[0102] S4024, Linear Mapping and Reconstruction: A linear fusion layer is used to map 256 channels back to 128, and the global context features are obtained after processing by an activation function. Its size is The relevant formulas are as follows: ;

[0103] Or to put it another way:

[0104] ;

[0105] S403, Gated Modulation and Triple Residual Connection: Utilizing Gated Branches Modulation global context features The modulated features are: The tensor size remains unchanged. The modulated high-dimensional features are channel-compressed through an output projection layer, restoring the original input dimension of 64 from 128 dimensions. Subsequently, a Dropout layer is used to randomly deactivate the model with a probability of 0.1, suppressing overfitting and improving the model's generalization performance. Simultaneously, the original input features... Input to parallel local enhancement branch Perform channel-by-channel execution Depthwise convolution, batch normalization, and SiLU activation are used to enhance the local neighborhood spatial response without introducing cross-channel mixing. Finally, the scanned enhanced features, parallel local enhanced features, and original input features are summed using three residuals, resulting in an output size of [size missing]. Enhanced feature tensor The relevant formula is:

[0106] ;

[0107] in, For linear projection, Drop represents the random deactivation (Dropout) operation.

[0108] S5. Construct a linear context aggregator (LCA), such as Figure 6 As shown, the feature at the deepest bottleneck of the encoder ( Global enhancement is performed at the scale level, and through the synergistic effect of spatial and channel dimensions, the long-range perceptual semantics of small targets lost due to continuous downsampling are restored. The specific details are as follows:

[0109] S501, Linear Spatial Branch: Reuse the Spatial Scan GRU unit (SPGRU) described in step S402. Input bottleneck characteristics. ( After that, SPGRU performs orthogonal bidirectional recursive scans in the horizontal and vertical directions, achieving linear complexity. A full-image receptive field is then established. This process effectively recovers fragmented relationships in the feature map and outputs spatially enhanced features. Its computational logic follows the serialization and mapping process from steps S4021 to S4024 to ensure that deep semantics have anisotropic contextual clues.

[0110] S502, Channel Attention Branch: Utilizing global average pooling to... Spatial dimension compression yields statistical vectors describing the global background and target distribution. After that, The data is fed into a multilayer perceptron (MLP) and first passed through... Convolution compresses the channels from 128 to 32 to extract cross-channel correlations and reduce the number of parameters. After ReLU activation, it is then... Convolution is performed to increase the dimensionality back to 128, and an adaptive channel weight map is generated by normalization using the Sigmoid function. ( ).

[0111] S503, Two-Dimensional Collaborative Fusion and Residual Output: Summing the spatial branch output with the channel-weighted features and feeding it into... Feature smoothing is achieved by fusing convolutional layers, and aggregated features are generated through residual connections. This effectively prevents gradient vanishing in deep networks and preserves the original bottleneck information. The calculation formula is as follows:

[0112] ;

[0113] in, This represents the spatial scan operation in the linear spatial branch, which reuses the aforementioned... Computational logic, This represents element-wise multiplication. This indicates a fused convolutional layer.

[0114] S6. Construct the decoder to perform feature recovery and fusion. As shown in Figure 1, the decoder adopts a symmetrical structure and performs progressive spatial resolution recovery through four cascaded StandardFusion modules, gradually restoring deep abstract semantics. The final output size is... Strong semantic information. The specific content is as follows:

[0115] S601, Upsampling and Cross-Scale Feature Alignment: To align features from... Scale restored to Taking the scaling process as an example, firstly, the aggregated features generated from step S5 are... (size is) By using bilinear interpolation, the spatial resolution is doubled, resulting in upsampled features with preliminary global semantics. The dimensions are ( Next, features corresponding to the scale are extracted from the encoder; here, these are the output features of the second-stage LGS stage. (size is) To address the semantic gap caused by inconsistent feature distributions between codecs, a method is used... PlainBlock pairs consisting of convolutional, batch normalized (BN), and ReLU activation layers. Perform linear projection to expand the number of channels from 64 to 128 to generate alignment features. The structure of PlainBlock is as follows: Figure 7 As shown.

[0116] S602, Multi-path Feature Fusion and Cascaded Refinement: This involves fusing and refining the upsampled decoded features... Aligned encoded features Perform a concatenation operation along the channel dimension, resulting in a fused feature tensor. Size evolution to .

[0117] Then Two sets of cascaded components are fed into StandardFusion. Convolutional layers, such as Figure 8 As shown. Each convolutional set contains " The structure is as follows: The first convolutional layer reduces the dimensionality of the concatenated high-dimensional features, decreasing the number of channels from 256 to 64. This significant channel compression forces the model to filter out redundant background information during the fusion process and extract the most discriminative target response. The core function of the second convolutional layer is to further smooth and reconstruct the compressed feature map in the spatial domain. This effectively eliminates artifacts and holes caused by upsampling interpolation, ultimately outputting refined decoded features with strong semantic consistency. The calculation process can be summarized as follows:

[0118] ;

[0119] in, Indicates upsampling, This indicates channel splicing.

[0120] S603, Iterative Recovery: Repeat the above S601 and S602 processes, and the decoder then sequentially passes through... , , The three iterations of StandardFusion. In each iteration, the decoder fuses the underlying texture details from the encoder, ultimately... The output feature map at the scale has rich edge information and strong semantic response, providing accurate feature support for subsequent pixel-level classification tasks.

[0121] S7. Utilizing a multi-branch Inception prediction head and deep supervision for result generation, the enhanced features output by the decoder are transformed into pixel-level prediction probability maps. A multi-scale supervision strategy is then employed to accelerate model convergence and optimize the target boundary. Details are as follows:

[0122] S701, Feature Reconstruction Based on Multi-Branch Inception Structure: At the end of the main prediction path, decoded features... The data is fed into a multi-branch prediction head. This prediction head uses the InceptionDWConv2d structure to capture target cues of different shapes in parallel, and then the outputs of each branch are added and fused together. The aggregation formula is expressed as:

[0123] ;

[0124] in, and The multi-branch Inception prediction head uses horizontal and vertical strip convolutions to adapt to the anisotropic target shapes caused by motion blur. Figure 9 As shown.

[0125] Features after aggregation via Convolutional layers reduce the number of channels from Compressed to the number of categories ( (and activated by the Sigmoid function) to generate the final predicted probability map. Its size is .

[0126] S702, Construction of Multi-Scale Deep Supervision Prediction Flow: To accelerate model convergence and improve model training performance, a deep supervision mechanism is introduced during the training phase. The multi-scale deep supervision branch is illustrated as a dashed line in the overall network structure, as shown below. Figure 1 As shown. From the decoder intermediate layer respectively. Introduce the supervisory branch (ds_out). Utilize The convolutional layer compresses the feature map channels at each scale to 1, generating a low-resolution initial prediction. Then, bilinear interpolation is used to... The generated low-resolution image is restored to be identical to the input image. Scale. During the training phase, the model returns a set of predictions containing the main path output and the outputs of the three deep supervision paths: During the testing phase, only output... To reduce inference overhead.

[0127] S703, Soft-IoU loss function for imbalanced samples: (The...) Soft-IoU score at each scale The definition is as follows:

[0128] ;

[0129] in, As a truth mask, The model represents the first time. The predicted probability map generated on each scale output branch represents the predicted probability that the corresponding spatial location belongs to an infrared small target. Total loss function. It consists of a weighted loss across four scales, calculated using the following formula:

[0130] ;

[0131] in, Weighting coefficients to balance the contributions of each scale.

[0132] This multi-scale loss forces the encoder and decoder to maintain sensitivity to the target region under different receptive fields, significantly improving the detection accuracy of small infrared targets in complex backgrounds.

[0133] This invention significantly enhances the model's ability to represent weak targets by introducing a hierarchical dynamic multi-scale CNN-SPGRU hybrid backbone and a linear context aggregation module (LCA). Compared to traditional self-attention models, this embodiment achieves a high mIoU in tests on the IRSTD-1k dataset. The detection rate Pd reached The false alarm rate Fa is only Furthermore, this model uses very few parameters, only 4.37M. The inference speed for large-sized images reached 202.2 images per second, achieving significant advantages in terms of low computational overhead and high detection accuracy.

[0134] This invention also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. It should be noted that when the processor executes the computer program, it corresponds to the specific steps of the method provided in this invention, possessing the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in this invention.

[0135] This invention also proposes a computer-readable storage medium storing a computer program. It should be noted that when the computer program is executed by a processor, it corresponds to the specific steps of the method provided in this invention, possessing the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in this invention.

[0136] It should be noted that the above content merely illustrates the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. For those skilled in the art, various improvements and modifications can be made without departing from the principle of the present invention, and all such improvements and modifications fall within the scope of protection of the claims of the present invention.

Claims

1. A real-time infrared small target detection method based on a linear global scanning network, characterized in that, include: S1. Acquire the infrared image to be detected; S2. The Stem module is used to preprocess the image to be detected, performing channel expansion while maintaining the original spatial resolution. S3. Construct an encoder to extract multi-scale features of the image. In the shallow stage, ResBlock is used to extract shallow local textures, and in the deep stage, several cascaded LGS Stages are used to process the features to enhance global semantic expression. The construction of the encoder for extracting multi-scale features of the image includes the following sub-steps: S301, Encoder hierarchical cascade architecture: The Stem module is used as the starting layer of the encoder. The encoder includes at least one shallow feature extraction stage and multiple cascaded deep feature extraction stages. The feature map spatial resolution is reduced and the number of channels is expanded step by step through downsampling operations to form a multi-scale feature representation. S302, Shallow texture feature extraction: In the shallow stage of the encoder, the input features are processed using the Stem module and at least one ResBlock to capture the shallow physical features and local background texture of infrared small targets, and the local feature response is enhanced by residual mapping. S303, Deep Global Semantic Modeling: In the deep stage of the encoder, multiple cascaded linear global scanning stages (LGS Stages) are used to process features. Within each LGS Stage, long-distance spatial dependencies are established through linear global scanning modules (LGS Blocks) to enhance the global semantic expression capability in complex backgrounds. S4. The deep features are modeled using the Linear Global Scanning (LGS) Block, which uses spatially scanned GRU units with linear computational complexity. Capture long-range spatial dependencies of anisotropy; S5. Receive the output features at the deepest bottleneck of the encoder using the linear context aggregator (LCA), input the features to the spatial scanning GRU unit and the channel attention branch respectively, and fuse the output of the spatial scanning GRU unit and the output of the channel attention branch to obtain aggregated features. S6. Construct a decoder to perform feature recovery and fusion. Use the StandardFusion module to perform channel splicing and fusion of upsampled features and same-scale skip connection features processed by PlainBlock units, and use cascaded convolutional layers to refine the features. S7. Utilize the multi-branch Inception prediction head to generate pixel-level prediction results, and combine a deep supervision strategy with the Soft-IoU loss function to train the model, outputting infrared small target detection results.

2. The method according to claim 1, characterized in that, In step S2, the preprocessing of the infrared image to be detected by the Stem module includes the following sub-steps: S201, Channel Initialization: The input single-channel infrared image is mapped to a multi-channel feature space through at least one layer of convolution operation to expand the channel dimension while keeping the original spatial resolution unchanged; S202, Local Residual Enhancement: Local feature enhancement processing is performed on the features after channel expansion. The processing includes convolution operation, normalization operation and nonlinear activation. The enhanced features are fused with the input features through residual connection to retain pixel-level salient information and improve the initial representation ability of small targets.

3. The method according to claim 1, characterized in that, In step S4, the linear global scanning module LGSBlock models the long-distance spatial dependencies of the input features, including the following sub-steps: S401, Feature Preprocessing and Splitting: Preprocessing the input features... After preprocessing, it is split into scan branches along the channel dimension. and gated branches ; S402, Spatial Scan Feature Extraction: The scanning branch Xscan is input into the spatial scan GRU unit. Through orthogonal bidirectional recursive scanning in the horizontal and vertical directions, global context features containing long-distance spatial dependencies are obtained. ; S403, Gated Modulation and Triple Residual Connection: Utilizing Gated Branches For the global context features Gated modulation is performed to obtain modulated features. These modulated features are then channel-compressed via the output projection layer and subjected to random deactivation. Simultaneously, the original input features are... The input is fed into a parallel local enhancement branch to enhance the local neighborhood spatial response; finally, the original input features, local enhancement features, and modulated global features are summed using the three residuals to obtain the output features of the LGS Block.

4. The method according to claim 3, characterized in that, In step S402, the processing logic of the spatial scanning GRU unit includes the following sub-steps: S4021, Parallel Serialization: Receive input features and reshape them into horizontal one-dimensional sequence streams and vertical one-dimensional sequence streams respectively; wherein, the horizontal one-dimensional sequence stream is generated by merging the height dimension and the batch dimension, and the vertical one-dimensional sequence stream is generated by transpose operation; S4022, Orthogonal bidirectional scanning and spatial reconstruction: The horizontal and vertical bidirectional GRUs are used to extract features from the horizontal and vertical sequence streams respectively, and the output features covering long-distance dependencies in the horizontal and vertical directions are then reconstructed to transform the one-dimensional sequence stream into a three-dimensional feature map. S4023, Channel splicing and fusion: The horizontal scan output and the vertical scan output are spliced ​​together in the channel dimension to form a fused bidirectional contextual feature; S4024, Linear Mapping and Activation: A linear layer is used to map the concatenated features back to the original channel dimension, and the output is processed by the SiLU activation function.

5. The method according to claim 4, characterized in that, In step S5, a linear context aggregator (LCA) is constructed at the deepest bottleneck of the encoder to enhance the features, including the following sub-steps: S501, Linear Spatial Branch: Input the bottleneck layer input features into the spatial scanning GRU unit described in step S402, achieving linear complexity. The entire receptive field is established and spatial augmentation features are output. The computational logic follows the serialization and mapping process from steps S4021 to S4024. S502, Channel Attention Branch: Adaptive global average pooling is performed on the input features of the bottleneck layer to obtain a statistical vector describing the global background and target distribution. The statistical vector is then fed into the channel attention generation network, which generates an adaptive channel weight map through a sequence structure that includes channel compression, nonlinear activation and channel restoration. S503, Two-Dimensional Collaborative Fusion and Residual Output: The linear spatial branch output is fused with the input features weighted by the channel weight map, and the features are smoothed through a fusion convolutional layer. Finally, the aggregated context-enhanced features are added to the original input features through residual connections.

6. The method according to claim 1, characterized in that, In step S6, the decoder is constructed to perform feature recovery and fusion, including the following sub-steps: S601, Upsampling and Cross-Scale Feature Alignment: Upsample the features from the previous layer decoder to make their spatial resolution consistent with the encoder features at the current scale; at the same time, extract the features of the corresponding scale in the encoder and process the encoder features through the PlainBlock unit to align the semantic distribution between the encoder and decoder. S602, Multi-path feature fusion and cascaded refinement: The upsampled decoded features and the aligned encoder features are concatenated along the channel dimension to obtain fused features. The fused features are then input into a fusion module containing at least two layers of cascaded convolutions to perform noise suppression and spatial detail reconstruction on the features, and output the decoded features at the current scale. S603, Iterative Recovery: Repeat the upsampling, feature alignment and fusion refinement process to gradually restore the spatial resolution of the feature map. Finally, output a feature map with both detailed information and high-level semantic information at the original scale of the input image for subsequent pixel-level prediction.

7. The method according to claim 1, characterized in that, In step S7, the detection results are generated using a multi-branch prediction structure combined with a deep supervision strategy, including the following sub-steps: S701, Multi-branch prediction head construction: The features output by the decoder at the highest resolution are input into the multi-branch Inception module, which includes multiple parallel feature extraction branches to capture different spatial morphology and orientation features respectively. After fusing the outputs of each branch, a pixel-level prediction probability map is generated through a channel compression layer and activation function. S702, Multi-scale Deep Supervision Prediction: During the training phase, auxiliary prediction branches are derived from multiple intermediate scale features of the decoder, corresponding intermediate prediction results are generated for each scale feature, and the intermediate prediction results are uniformly mapped to the same spatial scale as the input image, and participate in model training together with the main prediction results. S703. Loss Function Optimization: The Soft-IoU loss function based on regional overlap is used to jointly supervise the main prediction result and each auxiliary prediction result. By setting weighting coefficients for prediction results at different scales, a multi-scale weighted loss function is constructed to alleviate the sample imbalance problem and improve the detection accuracy of infrared small targets.

8. An electronic device, characterized in that, It includes a memory and a processor, wherein the processor implements the method as described in any one of claims 1 to 7 when executing a computer program stored in the memory.