SAR (Synthetic Aperture Radar) target detection method based on lightweight and priori constraint self-attention
By lightweighting the RT-DETR model and improving the prior constrained self-attention, the problem of high computational complexity in SAR image target detection is solved, and efficient target detection effect is achieved.
Patent Information
- Application Number
- CN202510834933.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-10-10
AI Technical Summary
Existing SAR image target detection methods have high computational complexity and large number of parameters, and are particularly inefficient when dealing with high-resolution SAR images. In addition, traditional methods are sensitive to noise and environmental changes, making it difficult to achieve accurate target detection.
A SAR target detection method based on lightweight and prior constrained self-attention is adopted. By improving the RT-DETR model, a lightweight multi-scale feature fusion module and a priori constrained self-attention mechanism are introduced to reduce the number of model parameters and computational complexity, and improve the detection performance.
It effectively reduces the number of parameters and computational complexity of the SAR target detection model, while improving the detection performance. It solves the performance bottleneck problem caused by the homogeneity of query features in the RT-DETR model and achieves more efficient target detection.
Smart Images

Figure CN120762022A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of radar target detection, and in particular relates to a SAR target detection method based on lightweight and prior constrained self-attention. Background Art
[0002] Synthetic Aperture Radar (SAR) technology, with its all-weather, all-time imaging capabilities, has been widely used in military reconnaissance, disaster monitoring, environmental protection, and other fields. While SAR imagery offers significant advantages for target detection in complex weather conditions, target detection in SAR images also faces significant challenges due to the high noise content, low image contrast, and imaging methods. Traditional target detection methods for SAR images have yielded unsatisfactory results. Achieving more accurate target detection in SAR images is not only a research hotspot in academia but also a pressing need in practical applications.
[0003] Traditional SAR image target detection algorithms can be roughly divided into two categories: feature engineering-based methods and model-based algorithms. (1) Feature engineering-based methods: Traditional SAR target detection usually relies on manually designed features, such as edge detection, texture analysis, gray-level co-occurrence matrix, etc. These methods require manual feature extraction based on the geometric shape, texture characteristics and imaging background of the target object, and then use classifiers (such as support vector machines, random forests, etc.) to make target judgments. Although these methods can achieve good results in some specific scenarios, they are usually sensitive to noise and environmental changes, and their performance is often insufficient when facing complex targets. (2) Model-based algorithms: With the development of statistical learning and machine learning technologies, model-based algorithms have gradually become mainstream. This type of method usually detects targets in images by establishing mathematical models or hypotheses of targets. For example, algorithms based on the Markov Random Field model can extract targets by maximizing the contrast between the target area and the background area.
[0004] In recent years, deep learning techniques, particularly convolutional neural networks (CNNs) and Transformers, have achieved significant breakthroughs in the field of object detection. The Detection Transformer (DETR) family of models has garnered widespread attention due to their superior ability to capture global information. DETR models do not rely on the traditional non-maximum suppression (NMS) operation. Compared to CNNs, Transformers can effectively handle complex image scenes and achieve superior performance in object detection tasks. However, a key challenge facing DETR models in practical applications is their high computational complexity, particularly when working with high-resolution SAR imagery. The Real-Time Detection Transformer (RT-DETR) model is a leading advancement in the DETR family of models. It improves upon the classic DETR model and aims to address its efficiency challenges in real-time detection scenarios. However, the improved RT-DETR model still suffers from a large number of parameters and high computational complexity, and its object detection performance remains to be further improved. Summary of the Invention
[0005] In order to solve the above problems existing in the prior art, the present invention provides a SAR target detection method based on lightweight and prior constrained self-attention.
[0006] The technical problem to be solved by the present invention is achieved through the following technical solutions:
[0007] The present invention provides a SAR target detection method based on lightweight and prior-constrained self-attention, comprising:
[0008] Acquire a SAR image, and perform slicing processing on the SAR image to obtain a SAR image slice to be detected;
[0009] Inputting the SAR image slice to be detected into a pre-trained SAR target detection model to obtain preliminary target detection results; the SAR target detection model is a SAR target detection network that is based on the RT-DETR model with lightweight improvements and prior constrained self-attention; the prior constrained self-attention is applied to the Decoder layer of the RT-DETR model to guide the generation of attention weights of the current Decoder layer based on the detection results output by the previous Decoder layer;
[0010] The preliminary target detection result is subjected to score threshold judgment to obtain a final target detection result.
[0011] Optionally, the SAR target detection model comprises a feature extraction module, a feature fusion module, a Decoder module and a result prediction module.
[0012] The feature extraction module is configured to extract features of different scales of the SAR image slice to be detected based on a MobileViTv3 model.
[0013] The feature fusion module is configured to perform feature fusion on the features of different scales based on a lightweight improved multi-scale feature fusion submodule to obtain fused features of different scales; the lightweight improved multi-scale feature fusion submodule is obtained by simplifying the structure of a feature fusion module of an RT-DETR model and introducing a spatial and channel reconstruction convolution module.
[0014] The Decoder module is configured to sequentially pass the fused features of different scales through a plurality of Decoder layers to obtain corresponding query features of each layer; the Decoder layers are Decoder layers of the RT-DETR model, and the prior constraint self-attention is applied in part of the Decoder layers.
[0015] The result prediction module is configured to obtain a preliminary target detection result according to the query features by using a class detection head and a position detection head.
[0016] Optionally, the features of different scales comprise first scale features, second scale features and third scale features.
[0017] The feature fusion module comprises a horizontal connection submodule, an attention-based intra-scale feature interaction submodule and a multi-scale feature fusion submodule.
[0018] The horizontal connection submodule comprises a first convolution structure, a second convolution structure and a third convolution structure; the first convolution structure, the second convolution structure and the third convolution structure each comprise a convolution layer and a batch normalization layer, and the convolution layer is connected to the batch normalization layer.
[0019] The multi-scale feature fusion submodule comprises a first horizontal connection convolution unit, a second horizontal connection convolution unit, a first residual feature fusion module, a second residual feature fusion module, a first down-sampling convolution unit, a second down-sampling convolution unit, a third residual feature fusion module and a fourth residual feature fusion module; the first residual feature fusion module to the fourth residual feature fusion module are residual feature fusion modules based on spatial and channel reconstruction convolution; the lightweight improvement is a lightweight improvement of the residual feature fusion modules.
[0020] The first-scale feature enters the first convolution structure, the second-scale feature enters the second convolution structure, and the third-scale feature enters the third convolution structure. The output of the third convolution structure is connected to the attention-based intra-scale feature interaction submodule;
[0021] The output of the attention-based intra-scale feature interaction submodule is connected to the first horizontal connection convolution unit and the fourth residual feature fusion module;
[0022] The output of the first horizontally connected convolution unit and the output of the second convolution structure are both connected to the first residual feature fusion module, the output of the first residual feature fusion module is respectively connected to the second horizontally connected convolution unit and the third residual feature fusion module, the output of the first convolution structure and the output of the second horizontally connected convolution unit are both connected to the second residual feature fusion module, the second residual feature fusion module outputs a first-scale fusion feature, and the first-scale fusion feature enters the first downsampling convolution unit and the decoder module respectively;
[0023] The output of the first downsampling convolution unit is connected to the third residual feature fusion module, the third residual feature fusion module outputs the second-scale fusion feature, and the second-scale fusion feature enters the second downsampling convolution unit and the Decoder module respectively. The output of the second downsampling convolution unit is connected to the fourth residual feature fusion module, the fourth residual feature fusion module outputs the third-scale fusion feature, and the third-scale fusion feature enters the Decoder module.
[0024] Optionally, the first residual feature fusion module, the second residual feature fusion module, the third residual feature fusion module and the fourth residual feature fusion module have the same structure, and all include: a simplified feature fusion module and a spatial and channel reconstruction convolution module;
[0025] The simplified feature fusion module includes a first feature extraction convolution submodule, a second feature extraction convolution submodule and a third feature extraction convolution submodule;
[0026] The spatial and channel reconstruction convolution module includes a spatial reconstruction unit and a channel reconstruction unit;
[0027] In the simplified feature fusion module, the two input features enter the first feature extraction convolution submodule and the second feature extraction convolution submodule respectively after being spliced in the channel dimension, the output of the first feature extraction convolution submodule is connected to the third feature extraction convolution submodule, and the output of the third feature extraction convolution submodule and the output of the second feature extraction convolution submodule are added element by element to obtain the output of the simplified feature fusion module;
[0028] The output of the simplified feature fusion module and the two input features are added element by element to obtain a new feature map, and the new feature map passes through the spatial reconstruction unit and the channel reconstruction unit in sequence. The output of the channel reconstruction unit and the output of the simplified feature fusion module are added element by element and then output; the spatial reconstruction unit is used to perform spatial reconstruction on the new feature map to obtain a spatially reconstructed feature map; the channel reconstruction unit is used to perform channel reconstruction on the spatially reconstructed feature map to obtain a channel reconstructed feature map.
[0029] Optionally, the space reconstruction unit includes: an information amount calculation subunit, a gating subunit, a first multiplication subunit, a second multiplication subunit and a reconstruction subunit;
[0030] The information amount calculation subunit is used to calculate the numerical information richness of the new feature map;
[0031] The gating subunit is configured to obtain an enhanced digitized information richness and a suppressed digitized information richness according to the digitized information richness;
[0032] The first multiplication subunit is configured to perform element-by-element multiplication of the enhanced numerical information richness and the new feature map to obtain a first feature map, wherein the first feature map is equally divided into a first feature submap and a second feature submap according to a channel dimension;
[0033] The second multiplication subunit is configured to perform element-by-element multiplication of the suppressed numeralized information richness and the new feature map to obtain a second feature map, wherein the second feature map is equally divided into a third feature submap and a fourth feature submap according to a channel dimension;
[0034] The reconstruction subunit is used to perform element-by-element addition of the first feature subgraph and the fourth feature subgraph to obtain a first reconstructed feature graph, perform element-by-element addition of the second feature subgraph and the third feature subgraph to obtain a second reconstructed feature graph, and splice the first reconstructed feature graph and the second reconstructed feature graph in the channel dimension to obtain a spatial reconstructed feature graph as the output of the spatial reconstruction unit.
[0035] Optionally, the channel reconstruction unit includes: a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a fifth convolution module and an average pooling layer;
[0036] The spatial reconstruction feature map is equally divided in the channel dimension to obtain a fifth feature submap and a sixth feature submap;
[0037] The fifth feature subgraph enters the first convolution module, and outputs of the first convolution module are element-wise added after passing through the third convolution module and the fourth convolution module respectively to obtain a seventh feature subgraph;
[0038] The sixth feature subgraph enters the second convolution module, and an output of the second convolution module is connected to the fifth convolution module; and an output of the fifth convolution module and the output of the second convolution module are spliced in a channel dimension to obtain an eighth feature subgraph;
[0039] The seventh feature subgraph and the eighth feature subgraph are spliced in the channel dimension to obtain a ninth feature subgraph; and the ninth feature subgraph is processed by the average pooling layer and the Softmax function, and then is element-wise multiplied with the ninth feature subgraph; the result of the element-wise multiplication is equally divided in the channel dimension, and then the feature maps obtained by the equally division are element-wise added to obtain a channel reconstruction feature map as an output of the channel reconstruction unit.
[0040] Optionally, the Decoder module comprises a second transverse connection module, an initial query acquisition module, a first Decoder layer, a second Decoder layer, a third Decoder layer, a fourth Decoder layer, a fifth Decoder layer and a sixth Decoder layer.
[0041] The second transverse connection module is configured to convert the input first scale fusion feature, the second scale fusion feature and the third scale fusion feature into a feature vector sequence.
[0042] The initial query acquisition module is configured to acquire an initial query feature according to the feature vector sequence.
[0043] The first Decoder layer, the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer and the sixth Decoder layer are sequentially connected; an input of the first Decoder layer is the initial query feature acquired by the initial query acquisition module and the feature vector sequence; inputs of the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer and the sixth Decoder layer are all outputs of a previous Decoder layer and the feature vector sequence; a standard self-attention mechanism is adopted in the first Decoder layer to capture global dependency relationship; and a prior constraint self-attention mechanism is adopted in the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer and the sixth Decoder layer to capture global dependency relationship.
[0044] The query features output by the first Decoder layer, the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer enter the result prediction module.
[0045] Optionally, the adopting of a priori constrained self-attention mechanism to capture global dependencies includes:
[0046] Calculate a first relationship matrix and a second relationship matrix based on the detection results corresponding to the query features output by the previous decoder layer; the detection results include category detection results and position detection results;
[0047] The calculation formula of the first relationship matrix is:
[0048]
[0049] Among them, R l (i, j) is the element in the i-th row and j-th column of the first relationship matrix, s i is the maximum confidence of the category detection result corresponding to the i-th query feature, s j is the maximum confidence of the category detection result corresponding to the j-th query feature;
[0050] The calculation formula of the second relationship matrix is:
[0051] R b (m,n)=IoU(b m ,b n );
[0052] Among them, R b (m,n) is the element in the mth row and nth column of the second relationship matrix, b m is the position detection result corresponding to the mth query feature, b n is the position detection result corresponding to the n-th query feature, IoU(b m ,b n ) represents the calculation of b m and b n The intersection and union ratio of
[0053] Calculating a priori weights using a multilayer perceptron according to the first relationship matrix and the second relationship matrix;
[0054] The standard attention weight is calculated using the standard self-attention mechanism based on the position encoding information corresponding to the query feature output by the previous Decoder layer and the query feature output by the previous Decoder layer.
[0055] The attention weight of the prior constraint is calculated based on the prior weight and the standard attention weight; the calculation formula of the attention weight of the prior constraint is:
[0056]
[0057] Among them, N represents the number of queries in the query features output by the previous Decoder layer, Represents the prior weight matrix W s The weight value of the p-th row and q-th column in pq Represents the weight value of the pth row and qth column in the standard attention weight matrix W, A pq The weight value of the p-th row and q-th column in the attention weight matrix A representing the prior constraint;
[0058] The value vector corresponding to the query feature output by the previous Decoder layer is weighted according to the attention weight of the prior constraint, so as to output the query feature according to the weighted result.
[0059] The present invention proposes a SAR target detection method based on lightweight and prior constrained self-attention. The method performs target detection based on a SAR target detection model to obtain a preliminary target detection result, and then performs score threshold judgment on the preliminary target detection result to obtain a final target detection result. The SAR target detection model is a SAR image target detection network that is improved by lightweight and prior constrained self-attention based on the RT-DETR model. The network effectively reduces the number of parameters and the amount of computation of the SAR target detection model. At the same time, by introducing the prior constrained self-attention mechanism, the model performance bottleneck problem caused by the homogeneity of query features extracted in the decoder part of the RT-DETR model is solved, thereby reducing the number of parameters and the amount of computation of the SAR target detection model while improving the detection performance of the SAR target detection model.
[0060] The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 1 is a flow chart of a SAR target detection method based on lightweight and prior-constrained self-attention provided by an embodiment of the present invention;
[0062] Figure 2 1 is a flow chart of constructing a SAR target detection model in a SAR target detection method based on lightweight and prior constrained self-attention provided by an embodiment of the present invention;
[0063] Figure 31 is a schematic diagram of the architecture of a SAR target detection model in a SAR target detection method based on lightweight and prior constrained self-attention provided by an embodiment of the present invention;
[0064] Figure 4 1 is a schematic diagram of the architecture of MobileViTv3 Block_1 in the feature extraction module of the SAR target detection model in an embodiment of the present invention;
[0065] Figure 5 Schematic diagram of the architecture of the residual feature fusion module SC-ResFusion based on spatial channel reconstruction convolution in an embodiment of the present invention;
[0066] Figure 6 Schematic diagram of the architecture of the prior constrained self-attention mechanism PGSA in an embodiment of the present invention;
[0067] Figure 7 This is an example of some images of the SAR-aircraft1.0 dataset used in the embodiments of the present invention. DETAILED DESCRIPTION
[0068] The present invention will be further described in detail below with reference to specific examples, but the embodiments of the present invention are not limited thereto.
[0069] In order to overcome the large number of parameters and computational complexity of the RT-DERT model and solve the model performance bottleneck caused by the homogeneity of query features extracted in the decoder part of the RT-DETR model, thereby reducing the number of parameters and computational complexity while further improving the detection performance of the target detection model, an embodiment of the present invention provides a SAR target detection method based on lightweight and prior constrained self-attention.
[0070] The following is a detailed description of the SAR target detection method based on lightweight and prior constrained self-attention provided by an embodiment of the present invention. Figure 1 , the method comprises the following steps:
[0071] S10: Acquire a SAR image, and perform slicing processing on the SAR image to obtain a SAR image slice to be detected.
[0072] Specifically, a SAR image containing a target is acquired, and the SAR image is sliced to obtain a SAR image slice to be detected, and the SAR image slice to be detected is input into a SAR target detection model for target detection.
[0073] S20: Input the SAR image slice to be detected into the pre-trained SAR target detection model to obtain preliminary target detection results.
[0074] The SAR target detection model is a SAR image target detection network based on the RT-DETR model, which has been lightweighted and improved with prior constrained self-attention. Prior constrained self-attention is applied to the decoder layer of the RT-DETR model to guide the generation of attention weights in the current decoder layer based on the detection results output by the previous decoder layer.
[0075] The construction process of SAR target detection model can be found in Figure 2 ,include:
[0076] S201 , performing slicing processing on a number of sample SAR images containing targets, and constructing a training set based on the obtained SAR image slices.
[0077] In this embodiment, the sample SAR image can be obtained by data acquisition or from an existing SAR image dataset.
[0078] Here, since the targets to be detected in SAR images are generally small, in order to facilitate subsequent detection and unify the sample size, all sample SAR images are sliced separately.
[0079] In one embodiment, S201 may include the following steps:
[0080] S2011: Use a sliding window to perform sliding processing on the sample SAR image, and intercept the corresponding area of the sample SAR image with the window size to obtain a SAR image slice.
[0081] The setting of the sliding window size and step size needs to take into account the following two factors: first, the sliding window size should be larger than the target size to avoid incomplete targets due to slicing; second, the setting of the step size should take into account that the slices should be as differentiated as possible and all data should be utilized as much as possible.
[0082] S2012: constructing a training set based on the obtained SAR image slices and preprocessing the training set.
[0083] Specifically, the SAR image slices obtained in step S2011 are divided into a training set and a test set according to a certain ratio or other method. The training set is used to train the SAR target detection model, and the test set is used to verify the performance of the trained SAR target detection model. Each SAR image slice in the training set is a training sample, and the target location and target category are both labeled.
[0084] Here, the training set is preprocessed, including normalizing the intensity of the SAR image slices. For specific processing methods, please refer to the relevant existing technology and will not be described in detail in the present invention.
[0085] In an optional embodiment of the present application, for example, when detecting an aircraft target, taking the SAR-aircraft1.0 dataset as an example, the dataset contains 4368 SAR images containing aircraft targets, and is randomly divided into preliminary training sample SAR images and test sample SAR images according to an 8:2 ratio. A sliding window size of 512*512 and a slice overlap rate of 30% are set, and the training sample SAR images and the test sample SAR images are respectively subjected to slice processing to obtain a final training set and a test set, wherein the training set has 16944 SAR image slices, and the test set has 3165 SAR image slices.
[0086] S202, constructing a SAR target detection model based on lightweight and prior constraint self-attention.
[0087] The SAR target detection model is a SAR target detection network improved based on a RT-DETR model and prior constraint self-attention. Referring to FIG. 2, the SAR target detection model includes a feature extraction module, a feature fusion module, a Decoder module, and a result prediction module. Figure 3
[0088] Specifically, the feature extraction module is configured to extract features of different scales of a to-be-detected SAR image slice based on a MobileViTv3 model; the feature fusion module is configured to perform feature fusion on the features of different scales based on a lightweight improved multi-scale feature fusion submodule to obtain fused features of different scales; the lightweight multi-scale feature fusion submodule is a submodule obtained by simplifying the structure of a feature fusion module of the RT-DETR model and introducing a spatial and channel reconstruction convolution module; the Decoder module is configured to obtain query features corresponding to each layer by sequentially passing the fused features of different scales through multiple Decoder layers; the Decoder layer is a Decoder layer of the RT-DETR model, and the prior constraint self-attention is applied in part of the Decoder layers; and the result prediction module is configured to obtain a preliminary target detection result by using a class detection head and a position detection head according to the query features.
[0089] Next, the parts of the SAR target detection model are described in detail.
[0090] 1. Feature extraction module
[0091] Specifically, after the to-be-detected SAR image slice is input into the feature extraction module, the feature extraction module extracts features of three different scales of the to-be-detected SAR image slice and outputs the features to the feature fusion module for subsequent target detection.
[0092] In this embodiment, the feature extraction module can be implemented based on the original MobileViTv3 model through channel number scaling and block depth reconfiguration. The original MobileViTv3 model is the benchmark architecture described in "MobileViTv3: Mobile-Friendly Vision Transformer with Simple and Effective Fusion of Local, Global and Input Features".
[0093] like Figure 3 As shown, the feature extraction module is composed of a first convolution structure conv1, a first feature extraction structure Layer_1, a second feature extraction structure Layer_2, a third feature extraction structure Layer_3, a fourth feature extraction structure Layer_4, and a fifth feature extraction structure Layer_5, which are connected in sequence.
[0094] Among them, the first convolution structure conv1 includes a convolution module, which includes a convolution layer, a batch normalization layer (BN) and an activation function layer connected in sequence.
[0095] The first feature extraction structure, Layer_1, includes an inverted residual feature extraction module, which includes a sequentially connected dilated convolution module, a deep feature extraction module, and a linear compression module. The dilated convolution module includes a sequentially connected convolution layer, a batch normalization layer, and an activation function layer. The deep feature extraction module includes a sequentially connected grouped convolution layer, a batch normalization layer, and an activation function layer. The linear compression module includes a sequentially connected convolution layer and a batch normalization layer.
[0096] The second feature extraction structure Layer_2 includes three inverse residual feature extraction modules.
[0097] The third feature extraction structure Layer_3 includes a sequentially connected inverse residual feature extraction module and a MobileViTv3 Block_1 structure. Among them, the MobileViTv3 Block_1 structure, see Figure 4As shown, the first feature extraction structure Layer_1 includes a residual feature extraction module and a MobileViTv3 Block_1 structure. The MobileViTv3 Block_1 structure includes a local feature extraction module, a global feature extraction module and a local-global feature fusion module; the local feature extraction module includes a group convolution module and a convolution layer; the group convolution module includes a group convolution layer, a batch normalization layer and an activation function layer connected in sequence; the global feature extraction module includes a space-channel transformation layer, two Transformer modules, a layer normalization layer and a space-channel recovery layer; the local-global feature fusion module includes a convolution layer and a batch normalization layer connected in sequence.
[0098] The fourth feature extraction structure Layer_4 includes a reverse residual feature extraction module and a MobileViTv3 Block_2 structure. The MobileViTv3 Block_2 structure includes a local feature extraction module, a global feature extraction module and a local-global feature fusion module; the global feature extraction module includes a space-channel transformation layer, four Transformer modules, a layer normalization layer and a space-channel recovery layer.
[0099] The fifth feature extraction structure Layer_5 includes a reverse residual feature extraction module and a MobileViTv3 Block_3 structure. The MobileViTv3 Block_3 structure includes a local feature extraction module, a global feature extraction module and a local-global feature fusion module; the global feature extraction module includes a space-channel transformation layer, three Transformer modules, a layer normalization layer and a space-channel recovery layer.
[0100] In an implementation manner, assuming that the size of the input SAR image slice to be detected is HxWx3, H represents the image height, and W represents the image width, the functions of the feature extraction modules are described in detail as follows.
[0101] Specifically, the first convolution structure conv1 includes a convolution module D1. The convolution module D1 includes a convolution layer C1, a batch normalization layer B1 and an activation function layer S1 connected in sequence. For example, the convolution kernel window size of the convolution layer C1 is 3x3, the sliding step is 2, the padding attribute is 1, the input channel number is 3, the output channel number is 24, the batch normalization layer B1 performs standardization processing on the received feature map in the channel dimension, and the activation function layer S1 uses the Silu function as the activation function.
[0102] The input SAR image slice is outputted 24 feature maps with a size of 24x24x24 after passing through the first convolution structure conv1. As output, the output of the first convolutional structure conv1 is taken as the input of the first feature extraction structure Layer_1.
[0103] Specifically, the first feature extraction structure Layer_1 includes an inverse residual feature extraction module IR1. The inverse residual feature extraction module IR1 includes an expansion convolution module ED1, a deep feature extraction module DD1 and a linear compression module LD1 connected in sequence. The expansion convolution module ED1 includes a convolution layer C2, a batch normalization layer B2 for normalizing the received feature map in the channel dimension, and an activation function layer S2 using the Silu function connected in sequence; here, the convolution kernel window size of the convolution layer C2 is 1x1, the sliding step is 1, the padding attribute is 0, the input channel number is 24, and the output channel number is 36. The deep feature extraction module DD1 includes a group convolution layer GC1, a batch normalization layer B3 for normalizing the input feature map in the channel dimension, and an activation function layer S3 using the Silu function connected in sequence; wherein the convolution kernel window size of the group convolution layer GC1 is 3x3, the sliding step is 1, the padding attribute is 1, the input channel number is 36, and the output channel number is 36. The linear compression module LD1 includes a convolution layer C3 with a convolution kernel window size of 1x1, a sliding step of 1, a padding attribute of 0, an input channel number of 36, and an output channel number of 48, and a batch normalization layer B4 for normalizing the input feature map in the channel dimension.
[0104] The feature map output by the first convolutional structure conv1 is taken as the input of the first feature extraction structure Layer_1, which is input into the inverse residual feature extraction module IR1 and sequentially passes through the expansion convolution module ED1, the deep feature extraction module DD1 and the linear compression module LD1, and finally 48 feature maps with a size of As the output of the first feature extraction structure Layer_1, the output of the first feature extraction structure Layer_1 is taken as the input of the second feature extraction structure Layer_2.
[0105] Specifically, the second feature extraction structure Layer_2 includes an inverse residual feature extraction module IR2, an inverse residual feature extraction module IR3, an inverse residual feature extraction module IR4, an element-wise addition module AD1, and an element-wise addition module AD2. The inverse residual feature extraction module IR2 includes an extended convolution module ED2, a deep feature extraction module DD2, and a linear compression module LD2 connected in sequence. The extended convolution module ED2 includes a convolution layer C4 with a convolution kernel window size of 1x1, a sliding step of 1, a padding attribute of 0, an input channel number of 48, and an output channel number of 72, a batch normalization layer B5 for standardizing input feature maps in the channel dimension, and an activation function layer S4 using a Silu function. The deep feature extraction module DD2 includes a grouped convolution layer GC2 with a convolution kernel window size of 3x3, a sliding step of 2, a padding attribute of 1, 72 groups, an input channel number of 72, and an output channel number of 72, a batch normalization layer B6 for standardizing input feature maps in the channel dimension, and an activation function layer S5 using a Silu function. The linear compression module LD2 includes a convolution layer C5 with a convolution kernel window size of 1x1, a sliding step of 1, a padding attribute of 0, an input channel number of 72, and an output channel number of 96, and a batch normalization layer B7 for standardizing input feature maps in the channel dimension.
[0106] The inverse residual feature extraction module IR3 and the inverse residual feature extraction module IR4 have the same structure, and only the detailed structure of the inverse residual feature extraction module IR3 is introduced here. The inverse residual feature extraction module IR3 includes an extended convolution module ED3, a deep feature extraction module DD3, and a linear compression module LD3. The extended convolution module ED3 includes a convolution layer C6 with a convolution kernel window size of 1x1, a sliding step of 1, a padding attribute of 0, an input channel number of 96, and an output channel number of 144, a batch normalization layer B8 for standardizing input feature maps in the channel dimension, and an activation function layer S6 using a Silu function. The deep feature extraction module DD3 includes a grouped convolution layer GC3 with a convolution kernel window size of 3x3, a sliding step of 1, a padding attribute of 1, 144 groups, an input channel number of 144, and an output channel number of 144, a batch normalization layer B9 for standardizing input feature maps in the channel dimension, and an activation function layer S7 using a Silu function. The linear compression module LD3 includes a convolution layer C7 with a convolution kernel window size of 1x1, a sliding step of 1, a padding attribute of 0, an input channel number of 144, and an output channel number of 96, and a batch normalization layer B 10 .
[0107] The output of the first feature extraction structure Layer_1 is used as the input of the second feature extraction structure Layer_2, and is input to the inverse residual feature extraction module IR2. The output of the inverse residual feature extraction module IR2 is used as the input of the inverse residual feature extraction module IR3. The input of the inverse residual feature extraction module IR3 and the output of the inverse residual feature extraction module IR3 are used as the input of the element-by-element addition module AD1. The output of the element-by-element addition module AD1 is used as the input of the inverse residual feature extraction module IR4. The input of the inverse residual feature extraction module IR4 and the output of the inverse residual feature extraction module IR4 are used as the input of the element-by-element addition module AD2. Finally, the element-by-element addition module AD2 outputs 96 elements of size Feature map of size As the output of the second feature extraction structure Layer_2, the output serves as the input of the third feature extraction structure Layer_3.
[0108] Specifically, the third feature extraction structure Layer_3 includes: an inverted residual feature extraction module IR5 and a MobileViTv3Block_1 structure. Here, the structure of the inverted residual feature extraction module IR5 is similar to that of the inverted residual feature extraction module IR2, including a sequentially connected dilated convolution module ED5, a deep feature extraction module DD5, and a linear compression module LD5. The convolution kernel window size, sliding step size, and padding attribute of the convolution layers in the dilated convolution module ED5, the deep feature extraction module DD5, and the linear compression module LD5 are the same as the corresponding convolution layer parameters in the dilated convolution module ED2, the deep feature extraction module DD2, and the linear compression module LD2 in the inverted residual feature extraction module IR2, respectively. The difference is that the convolution layer in the dilated convolution module ED5 has 96 input channels and 144 output channels, the grouped convolution layer in the deep feature extraction module DD5 has 144 input and output channels, divided into 144 groups, and the convolution layer in the linear compression module LD5 has 144 input channels and 192 output channels.
[0109] Among them, see Figure 4As shown, the MobileViTv3 Block_1 structure includes: a local feature extraction module LF1, a global feature extraction module GF1, and a local-global feature fusion module FG1. Among them, the local feature extraction module LF1 includes a grouped convolution module GD1 and a convolution layer C8 with a convolution kernel window size of 1×1, a sliding step size of 1, a padding attribute of 0, 192 input channels, and 96 output channels. The grouped convolution module GD1 is connected to the convolution layer C8; here, the grouped convolution module GD1 includes a convolution kernel window size of 3×3, a sliding step size of 1, a padding attribute of 1, divided into 192 groups, and a grouped convolution layer GC4 with 192 input and output channels, and a batch normalization layer B that normalizes the input feature map according to the channel dimension. 11 And an activation function layer S8 using Silu function, the group convolution layer GC4, the batch normalization layer B 11 and activation function layer S8. The global feature extraction module GF1 includes: a spatial-channel transformation layer SCT, a Transformer module TFM1, a Transformer module TFM2, a layer normalization layer LN1 that jointly normalizes all channels of a single sample, and a spatial-channel restoration layer FD1. The spatial-channel transformation layer SCT converts local image blocks into a vector sequence using a sliding window of 2×2 size and a stride of 2. The spatial-channel restoration layer FD1 reconstructs the vector sequence into a spatial feature map, which is the inverse of SCT. The Transformer modules TFM1 and TFM2 are identical, and only the detailed structure of the Transformer module TFM1 is described here. The Transformer module TFM1 includes a standard self-attention structure SA1 and a feedforward network module FFN1. Among them, SA1 includes a layer normalization layer LN2, a linear layer L1 with input and output channels of 96 and 288 respectively, and a linear layer L2 with input and output channels of 96 respectively; the feedforward network module FFN1 includes a layer normalization layer LN3, a convolution layer C9 with a convolution kernel size of 1×1, a step size of 1, and input and output channels of 96 and 144 respectively, an activation function layer S9 using Silu function, and a convolution layer C with a convolution kernel size of 1×1, a step size of 1, and input and output channels of 144 and 96 respectively. 10 The local-global feature fusion module FG1 includes a convolution layer C with a convolution kernel size of 1×1, a stride of 1, and 192 input and output channels. 11 and a batch normalization layer B 12 , the convolutional layer C 11 Connect the batch normalization layer B 12 .
[0110] Here, the input of the third feature extraction structure Layer_3 is taken as the input of the inverse residual feature extraction module IR5, the output of the inverse residual feature extraction module IR5 is taken as the input of the MobileViTv3 Block_1 structure, the input of the MobileViTv3 Block_1 structure is taken as the input of the local feature extraction module LF1, the output of the local feature extraction module LF1 is taken as the input of the global feature extraction module GF1, the input of the global feature extraction module GF1 sequentially passes through the space-channel transformation layer SCT, the Transformer module TMF1, the Transformer module TMF2, the layer normalization layer LN1 and the space-channel restoration layer FD1 to obtain the output, the output of the global feature extraction module GF1 and the output of the local feature extraction module LF1 are spliced in the channel dimension to obtain the input of the local-global feature fusion module FG1, the output of the local-global feature fusion module FG1 and the input of the MobileViTv3 Block_1 structure are added element by element to obtain 192 feature maps with a size of As the output of the third feature extraction structure Layer_3, the output is taken as the input of Layer_4. Among them, the input of the Transformer module TMF1 sequentially passes through the standard self-attention structure SA1 and the feedforward network module FFN1, here, the output of the standard self-attention structure SA1 and the input of the standard self-attention structure SA1 are added element by element and input to the feedforward network module FFN1, the input of the feedforward network module FFN1 and the output of the feedforward network module FFN1 are added element by element to obtain the final output. Among them, the standard self-attention structure SA1 performs standard self-attention operation, that is, the input passes through the layer normalization layer LN2 and the linear layer L1 to obtain and V i 1 , i = 1, 2, …, 96, and calculate the preliminary self-attention result: The result is input to the linear layer L2 to obtain the preliminary result of SA1, where d is the channel dimension divided by the number of self-attention heads, and the number of self-attention heads in this embodiment is 8.
[0111] Specifically, the fourth feature extraction structure Layer_4 includes an inverted residual feature extraction module IR6 and a MobileViTv3Block_2 structure. The inverted residual feature extraction module IR6 has a similar structure to the inverted residual feature extraction module IR2, including an extended convolution module ED6, a deep feature extraction module DD6, and a linear compression module LD6. Among them, the convolution kernel window size, sliding step size, and padding attribute of the convolution layer in the extended convolution module ED6, the deep feature extraction module DD6, and the linear compression module LD6 are respectively the same as the corresponding convolution layer parameters in the extended convolution module ED2, the deep feature extraction module DD2, and the linear compression module LD2 in the inverted residual feature extraction module IR2. The difference is that the number of input channels of the convolution layer in the extended convolution module ED6 is 192, and the number of output channels is 288. The number of input and output channels of the grouped convolution layer in the deep feature extraction module DD6 is both 288, divided into 288 groups. The number of input and output channels of the convolution layer in the linear compression module LD6 is both 288.
[0112] The structure of MobileViTv3 Block_2 is similar to that of MobileViTv3 Block_1, consisting of a local feature extraction module LF2, a global feature extraction module GF2, and a local-global feature fusion module FG2. The local feature extraction module LF2 is similar to the local feature extraction module LF1, consisting of a grouped convolution module and a convolution layer. Parameters such as the convolution kernel size are identical. The only difference is that the grouped convolution module has 288 input and output channels and 288 groups, while the convolution layer has 288 input channels and 144 output channels. The global feature extraction module GF2 is similar to the global feature extraction module GF1, differing only in that it includes four identical Transformer modules: TFM3, TFM4, TFM5, and TFM6. Among them, the structure of the Transformer module TFM3 is similar to that of the Transformer module TFM1. The only difference is that the number of input and output channels of the first linear layer in the self-attention structure of the Transformer module TFM3 is 144 and 432 respectively, and the number of input and output channels of the second linear layer is 144 respectively. The number of input and output channels of the first convolutional layer in the feedforward network module of the Transformer module TFM3 is 144 and 208 respectively, and the number of input and output channels of the second convolutional layer is 208 and 144 respectively.
[0113] The output of the third feature extraction structure Layer_3 is used as the input of the fourth feature extraction structure Layer_4, and is input to the inverse residual feature extraction module IR6. The output of the inverse residual feature extraction module IR6 is used as the input of the MobileViTv3 Block_2 structure. The 288 sizes of MobileViTv3 Block_2 are output. Feature map of size As the output of the fourth feature extraction structure Layer_4. Here, the processing flow inside the MobileViTv3Block_2 structure is similar to that of the MobileViTv3 Block_1 structure, and will not be repeated here.
[0114] Specifically, the fifth feature extraction structure Layer_5 includes an inverted residual feature extraction module IR7 and a MobileViTv3Block_3 structure. The structure of the inverted residual feature extraction module IR7 is similar to that of the inverted residual feature extraction module IR2, and includes an extended convolution module ED7, a deep feature extraction module DD7, and a linear compression module LD7. Among them, the difference between the extended convolution module ED7, the deep feature extraction module DD7, and the linear compression module LD7 and the corresponding extended convolution module ED2, the deep feature extraction module DD2, and the linear compression module LD2 is that the number of input and output channels of the convolution layer in the extended convolution module ED7 is 288 and 432 respectively, the number of input and output channels and the number of groups of the grouped convolution layer in the deep feature extraction module DD7 are both 432, and the number of input and output channels of the convolution layer in the linear compression module LD7 are 432 and 384 respectively.
[0115] The structure of MobileViTv3 Block_3 is similar to that of MobileViTv3 Block_1, and includes the local feature extraction module LF3, the global feature extraction module GF3, and the local-global feature fusion module FG3. The local feature extraction module LF3 is similar to the local feature extraction module LF1, differing only in that the number of input and output channels and the number of groups in the grouped convolution module of the local feature extraction module LF3 are both 384, and the number of input and output channels of the convolution layer is 384 and 192, respectively. The structure of the global feature extraction module GF3 is similar to that of the global feature extraction module GF1. The only difference is that the global feature extraction module GF3 contains three identical Transformer modules TFM7, TFM8 and TFM9. The structure of the Transformer module TFM7 is similar to that of the Transformer module TFM1. The difference is that the number of input and output channels of the first linear layer in the self-attention structure of the Transformer module TFM7 is 192 and 576 respectively, and the number of input and output channels of the second linear layer is both 192. The number of input and output channels of the first convolutional layer in the feedforward network module of the Transformer module TFM7 is 192 and 288 respectively, and the number of input and output channels of the second convolutional layer is 288 and 192 respectively.
[0116] Here, the output of the fourth feature extraction structure Layer_4 is used as the input of the fifth feature extraction structure Layer_5, and is input to the inverse residual feature extraction module IR7. The output of the inverse residual feature extraction module IR7 is used as the input of the MobileViTv3Block_3 structure. The 384 sizes of the output of the MobileViTv3 Block_3 structure are Feature map of size As the output of the fifth feature extraction structure Layer_5. Here, the processing flow inside the MobileViTv3Block_3 structure is similar to that of the MobileViTv3 Block_1 structure, and will not be repeated here.
[0117] Here, the feature extraction module extracts features at different scales from the input SAR image slice to be detected as output. These features at different scales specifically include first-scale features F1, second-scale features F2, and third-scale features F3. Here, the first-scale features F1, second-scale features F2, and third-scale features F3 are extracted and output by the third feature extraction structure Layer_3, the fourth feature extraction structure Layer_4, and the fifth feature extraction structure Layer_5, respectively.
[0118] 2. Feature fusion module
[0119] In this embodiment, the feature fusion module is constructed based on the top-down-bottom-up PA-Net structure, the Transformer structure and the lightweight residual feature fusion module SC-ResFusion (SCConv Residual Feature Fusion Module) based on spatial channel reconstruction convolution.
[0120] For details, see Figure 3 and Figure 5 As shown in the figure, the feature fusion module includes a lateral connection submodule, an attention-based intra-scale feature interaction submodule AIFI (Attention-based Intra-scale Feature Interaction), and a multi-scale feature fusion submodule (MSFF). The multi-scale feature fusion submodule is built based on the PA-Net structure and SC-ResFusion.
[0121] The horizontal connection submodule includes a first convolutional structure LC1, a second convolutional structure LC2, and a third convolutional structure LC3. Each of the first convolutional structure LC1, the second convolutional structure LC2, and the third convolutional structure LC3 contains a convolutional layer and a batch normalization layer, which is connected to the batch normalization layer. The convolution kernel size of the convolutional layer in the first convolutional structure LC1, the second convolutional structure LC2, and the third convolutional structure LC3 is 1×1, the stride is 1, and the number of output channels is 256. The only difference is that the number of input channels of the convolutional layer in the first convolutional structure LC1, the second convolutional structure LC2, and the third convolutional structure LC3 is 192, 288, and 384, respectively. The batch normalization layers in the first convolutional structure LC1, the second convolutional structure LC2, and the third convolutional structure LC3 are exactly the same.
[0122] The attention-based intra-scale feature interaction submodule (AIFI) is an instantiation of the standard Transformer encoding layer. It includes a standard self-attention layer for computing the global dependencies of the input sequence and a feedforward network layer for implementing nonlinear transformations of features. The calculation methods of the standard self-attention layer and the feedforward network layer have been introduced in the MobileViTv3 Block_1 structure in the feature extraction module and will not be repeated here.
[0123] The multi-scale feature fusion submodule (MSFF) includes: a first horizontally connected convolution unit LCC1, a second horizontally connected convolution unit LCC2, a first residual feature fusion module SC-ResFusion_1, a second residual feature fusion module SC-ResFusion_2, a first downsampling convolution unit DPC1, a second downsampling convolution unit DPC2, a third residual feature fusion module SC-ResFusion_3 and a fourth residual feature fusion module SC-ResFusion_4. Among them, SC-ResFusion_1 to SC-ResFusion_4 are all residual feature fusion modules based on spatial channel reconstruction convolution. Here, the lightweight improvement is a lightweight improvement of the residual feature fusion module. Figure 3 In the figure, SC-ResFusion_1 to SC-ResFusion_4 are abbreviated as SCR1 to SCR4 respectively.
[0124] Specifically, the first horizontally connected convolution unit LCC1 includes a sequentially connected convolution layer with a convolution kernel size of 1×1, a stride of 1, and an input and output channel number of 256, a batch normalization layer, and an activation function layer using the Silu function. The first downsampling convolution unit DPC1 includes a sequentially connected convolution layer with a convolution kernel size of 3×3, a stride of 2, a padding attribute of 1, an input and output channel number of 256, a batch normalization layer, and an activation function layer using the Silu function. Here, the second horizontally connected convolution unit LCC2 has the same structure as the first horizontally connected convolution unit LCC1, and the second downsampling convolution unit DPC2 has the same structure as the first downsampling convolution unit DPC1, which will not be repeated here.
[0125] In this embodiment, the first-scale feature F1 enters the first convolutional structure LC1, the second-scale feature F2 enters the second convolutional structure LC2, and the third-scale feature F3 enters the third convolutional structure LC3. The output of the third convolutional structure is connected to the attention-based intra-scale feature interaction submodule (AIFI). Specifically, the first convolutional structure LC1, the second convolutional structure LC2, and the third convolutional structure LC3 unify the channel size of the feature map to 256, and their outputs are recorded as P1, P2, and P3′, respectively.
[0126] The output of the attention-based intra-scale feature interaction submodule (AIFI) is connected to the first horizontal convolution unit LCC1 and the fourth residual feature fusion module SC-ResFusion_4. Specifically, P3′ is serialized and used as the input of the AIFI module. The output of the AIFI module is reconstructed to a size of The feature maps P3, P1, P2 and P3 are used as the input of the multi-scale feature fusion submodule (MSFF).
[0127] The output of the first horizontally connected convolution unit LCC1 and the output of the second convolution structure LC2 are both connected to the first residual feature fusion module SC-ResFusion_1. The output of the first residual feature fusion module SC-ResFusion_1 is respectively connected to the second horizontally connected convolution unit LCC2 and the third residual feature fusion module SC-ResFusion_3. The output of the first convolution structure LC1 and the output of the second horizontally connected convolution unit LCC2 are both connected to the second residual feature fusion module SC-ResFusion_2. The second residual feature fusion module SC-ResFusion_2 outputs the first scale fusion feature P1″′, which enters the first downsampling convolution unit DPC1 and the Decoder module respectively. Here, after the first horizontally connected convolution unit LCC1 and the second horizontally connected convolution unit LCC2, a bilinear interpolation operation will be performed to change the width and height of the output feature map to twice the original feature map, so as to achieve the upsampling effect.
[0128] The output of the first downsampling convolution unit DPC1 is connected to the third residual feature fusion module SC-ResFusion_3, and the third residual feature fusion module SC-ResFusion_3 outputs the second-scale fusion feature P2″′. The second-scale fusion feature P2″′ enters the second downsampling convolution unit DPC2 and the Decoder module respectively. The output of the second downsampling convolution unit DPC2 is connected to the fourth residual feature fusion module SC-ResFusion_4, and the fourth residual feature fusion module SC-ResFusion_4 outputs the third-scale fusion feature P3″′. The third-scale fusion feature P3″′ enters the Decoder module.
[0129] Among them, the structures of the first residual feature fusion module SC-ResFusion_1, the second residual feature fusion module SC-ResFusion_2, the third residual feature fusion module SC-ResFusion_3 and the fourth residual feature fusion module SC-ResFusion_4 are the same, see Figure 5 As shown, these residual feature fusion modules all include a simplified feature fusion module and a spatial and channel reconstruction convolution module. The simplified feature fusion module includes a first feature extraction convolution submodule, a second feature extraction convolution submodule, and a third feature extraction convolution submodule. The spatial and channel reconstruction convolution module includes a spatial reconstruction unit and a channel reconstruction unit.
[0130] Here, the first residual feature fusion module SC-ResFusion_1 is used as an example for detailed description. The first residual feature fusion module SC-ResFusion_1 includes a simplified feature fusion module SPF and a spatial and channel reconstruction convolution module SCConv. The simplified feature fusion module SPF includes a first feature extraction convolution submodule CBS1, a second feature extraction convolution submodule CBS2, and a third feature extraction convolution submodule CBS3. The first and second feature extraction convolution submodules CBS1 and CBS2 have the same structure, consisting of a sequentially connected convolution layer with a 1×1 convolution kernel size, a stride of 1, and 512 and 256 input and output channels, respectively, a batch normalization layer, and a Silu activation function layer. The third feature extraction convolution submodule CBS3 differs from the first feature extraction convolution submodule CBS1 only in that the convolution kernel size of the convolution layer in CBS3 is 3×3, and the number of input and output channels is 256. The spatial and channel reconstruction convolution module SCConv includes the spatial reconstruction unit (SRU) and the channel reconstruction unit (CRU). SRU and CRU are connected sequentially. For details, see Figure 5 .
[0131] Specifically, the structure of SC-ResFusion_1 is as follows Figure 5 As shown, in the simplified feature fusion module SPF, the two input features enter the first feature extraction convolution submodule CBS1 and the second feature extraction convolution submodule CBS2 respectively after being spliced in the channel dimension. The output of the first feature extraction convolution submodule CBS1 is connected to the third feature extraction convolution submodule CBS3. The output of the third feature extraction convolution submodule CBS3 and the output of the second feature extraction convolution submodule CBS2 are added element by element to obtain the output of the simplified feature fusion module SPF. The output of the simplified feature fusion module SPF is added element by element to the two input features to obtain a new feature map. The new feature map passes through the SRU and CRU in sequence. The output of the CRU is added element by element to the output of the simplified feature fusion module SPF and then output. Among them, the SRU is used to spatially reconstruct the new feature map to obtain a spatially reconstructed feature map, and the CRU is used to perform channel reconstruction on the spatially reconstructed feature map to obtain a channel reconstructed feature map.
[0132] Among them, see Figure 5 As shown, the spatial reconstruction unit (SRU) includes: an information calculation subunit CI, a gating subunit, a first multiplication subunit, a second multiplication subunit and a reconstruction subunit.
[0133] In this embodiment, the information calculation subunit (CI) is specifically used to calculate the numerical information richness of the new feature map. Here, the new feature map is the input of the spatial reconstruction unit SRU.
[0134] Specifically, the information calculation subunit (CI) operates by calculating the information richness representation using group normalization and quantifying the information richness using the information richness representation and the Sigmoid activation function. Specifically, the information calculation subunit (CI) uses a scaling factor in group normalization with a grouping number of 16 to evaluate the information content of different feature maps. The specific method of group normalization is: Where X represents the input feature map, μ is the mean of the feature map, σ is the standard deviation of the feature map, ε is a very small constant used to ensure stability, γ and β are trainable variables, γ is a scaling factor, and the size of γ can represent the degree of variation between pixels, that is, the richness of the information. The richness of the information is then quantified as follows:
[0135] W s =Sigmoid(W γ GN(X));
[0136] in, C represents the number of channels, γ j represents the jth element of the scaling factor, GN(·) represents the group normalization operation, and W s Indicates the richness of information after digitization. s That is, it is the output of the information calculation subunit CI, and Sigmoid(·) is the Sigmoid activation function.
[0137] In this embodiment, the gate control subunit is specifically used to calculate the information richness W of the digitized information. s The information richness of the quantification is enhanced and the information richness of the quantification is suppressed.
[0138] Specifically, according to the numerical information richness W s , using the gated subunit we can get:
[0139]
[0140] in, To enhance the information richness of numerical data, The gating subunit is used to separate the information-rich features from the original feature map, while increasing the weight of these features and suppressing the weak related information, thus achieving the effect of enhancing key information and suppressing weak related information.
[0141] In this embodiment, the first multiplication subunit is specifically used to enhance the digitized information richness After element-by-element multiplication with the new feature map, the first feature map X1 is obtained. The first feature map X1 is divided into the first feature sub-map X11 and the second feature sub-map X12 according to the channel dimension. The second multiplication sub-unit is specifically used to convert the suppressed numerical information richness After element-by-element multiplication with the new feature map, a second feature map X2 is obtained. The second feature map X2 is equally divided into a third feature submap X21 and a fourth feature submap X22 according to the channel dimension. The reconstruction subunit is specifically used to perform element-by-element addition of the first feature submap X11 and the fourth feature submap X22 to obtain a first reconstructed feature map, perform element-by-element addition of the second feature submap X12 and the third feature submap X21 to obtain a second reconstructed feature map, and splice the first reconstructed feature map and the second reconstructed feature map in the channel dimension to obtain a spatial reconstructed feature map as the output of the spatial reconstruction unit SRU.
[0142] It is understandable that the feature map X is respectively and Element-by-element multiplication yields a feature map X1 with high information content and a feature map X2 with low information content. By performing element-by-element addition of the first feature submap X11 and the fourth feature submap X22, and the second feature submap X12 and the third feature submap X21, information interaction between features in different branches is enhanced, avoiding feature rigidity caused by single gating. The spatial reconstruction unit (SRU) achieves the effect of enhancing key information and reducing feature redundancy in weakly correlated information with extremely low overhead in terms of the number of parameters to be learned.
[0143] In this embodiment, see Figure 5 As shown, the channel reconstruction unit (CRU) includes: a first convolution module SQR1, a second convolution module SQR2, a third convolution module GWC, a fourth convolution module PWC1, a fifth convolution module PWC2, and an average pooling layer AvgPool. Among them, the first convolution module SQR1 and the second convolution module SQR2 are the same, both including a convolution layer with a convolution kernel size of 1×1, a stride of 1, and input and output channels of 128 and 64 respectively. The third convolution module GWC includes a grouped convolution layer with a convolution kernel size of 3×3, a stride of 1, a padding attribute of 1, a group number of 2, and input and output channels of 64 and 256 respectively. The fourth convolution module PWC1 includes a convolution layer with a convolution kernel size of 1×1, a stride of 1, and input and output channels of 64 and 256 respectively. The fifth convolution module PWC2 includes a convolution layer with a convolution kernel size of 1×1, a stride of 1, and 64 and 192 input and output channels respectively; the average pooling layer AvgPool will change the feature map size to 1×1.
[0144] Specifically, the spatially reconstructed feature map is equally split along the channel dimension to obtain the fifth feature submap Y1 and the sixth feature submap Y2. The fifth feature submap Y1 enters the first convolution module SQR1. The output of the first convolution module SQR1 passes through the third convolution module GWC and the fourth convolution module PWC1, and then is element-wise added to obtain the seventh feature submap. The sixth feature submap Y2 enters the second convolution module SQR2. The output of the second convolution module SQR2 is connected to the fifth convolution module PWC2. The output of the fifth convolution module PWC2 and the output of the second convolution module SQR2 are spliced along the channel dimension to obtain the eighth feature submap. The seventh feature subgraph and the eighth feature subgraph are concatenated in the channel dimension to obtain a ninth feature subgraph. The ninth feature subgraph passes through the average pooling layer AvgPool and then through the Softmax function and is multiplied element-by-element with the ninth feature subgraph. The result of the element-by-element multiplication is equally split in the channel dimension to obtain Z1 and Z2. The feature maps Z1 and Z2 obtained by the equal split are added element-by-element to obtain a channel reconstruction feature map as the output of the channel reconstruction unit CRU.
[0145] Here, the first convolution module SQR1 and the second convolution module SQR2 are used to compress the number of channels of the feature map in order to reduce the subsequent computational overhead and reduce the redundancy of inter-channel features to a certain extent. Afterwards, the third convolution module GWC and the fourth convolution module PWC1 are used to further explore deep features with a smaller computational overhead, and then the fifth convolution module PWC2 is used to restore the number of channels. Then, by splicing the feature maps and performing average pooling and Softmax activation functions, the importance weights of different channels can be obtained. The weights are used to guide the feature map to enhance the information of the key channels and reduce the redundancy of weak related information. Finally, in order to restore the number of channels of the feature map, channel separation and feature map addition operations are performed.
[0146] 3. Decoder module and result prediction module
[0147] In this embodiment, see Figure 3 and Figure 6 As shown, the structure of the decoder module is similar to that of the original decoder module in the original RT-DETR. The decoder module includes: a second lateral connection module, an initial query module GDI, a first decoder layer, a second decoder layer, a third decoder layer, a fourth decoder layer, a fifth decoder layer, and a sixth decoder layer. Here, the first to sixth decoder layers share the same position coding layer. The first to sixth decoder layers correspond to Figure 3Decoder Layer 1~Decoder Layer 6.
[0148] Here, the second horizontal connection module is specifically used to convert the input first-scale fusion feature P1″′, second-scale fusion feature P2″′ and third-scale fusion feature P3″′ into a feature vector sequence M1. The initial query acquisition module GDI is specifically used to obtain the initial query feature according to the feature vector sequence M1.
[0149] The first, second, third, fourth, fifth, and sixth Decoder layers are connected sequentially. The first Decoder layer receives the initial query features and feature vector sequence M1 obtained by the initial query module GDI. The second, third, fourth, fifth, and sixth Decoder layers receive the output of the previous Decoder layer and feature vector sequence M1. A standard self-attention mechanism is used in the first Decoder layer to capture global dependencies, while a priori constrained self-attention mechanism is used in the second, third, fourth, fifth, and sixth Decoder layers. Specifically, the second, third, fourth, fifth, and sixth Decoder layers receive the query features, the corresponding detection results, and feature vector sequence M1 output by the previous Decoder layer.
[0150] The query features output by the first Decoder layer, the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer enter the result prediction module.
[0151] Specifically, the second horizontal connection module includes three horizontal connection convolution structures. The three horizontal connection convolution structures each include a convolution layer with a convolution kernel size of 1×1, a stride of 1, and 256 input and output channels, and a batch normalization layer, which is connected to the batch normalization layer.
[0152] Here, the first-scale fusion feature P1″′, the second-scale fusion feature P2″′, and the third-scale fusion feature P3″′ are respectively used as the input of the three horizontally connected convolution structures. The outputs of the three horizontally connected convolution structures are flattened to obtain vector sequences. The three vector sequences are spliced in the dimension of the sequence length to obtain 256 vector sequences of length The feature vector sequence M1 is used as the output of the second lateral connection module.
[0153] The Decoder module also includes a GNQ module for obtaining noisy queries. GNQ's input is real-world target information. In this embodiment, the real-world target information is noisy using the noise-adding method used in RT-DETR to obtain the noisy location and category information of the real-world target. This operation follows existing techniques and will not be further described here. It should be understood that GNQ is only used during the model training phase and is not included in actual applications.
[0154] Specifically, the initial query module GDI is obtained, which includes a linear structure, a category detection head, and a position detection head. The linear structure includes a linear layer with 256 input and output channels and a layer normalization layer, and the linear layer is connected to the layer normalization layer. The category detection head includes a linear layer with 256 input channels and the number of output channels equal to the number of detected target categories. The position detection head includes an MLP structure; the MLP structure specifically includes two linear layers with 256 input and output channels, a linear layer with 256 and 4 input and output channels respectively, and an activation function layer using the ReLU function.
[0155] Here, the feature vector sequence M1 is used as the input for obtaining the initial query module GDI. The initial target position information is first obtained based on the feature map size information of P1″′, P2″′ and P3″′ before serialization. The feature vector sequence M1 is used as the input of the linear structure. The output of the linear structure is used as the input of the category detection head and the position detection head. The index of the TopK feature vectors with the highest confidence is obtained according to the output result of the category detection head. K feature vectors are obtained from the output of the linear structure according to the index. These K feature vectors are spliced with the feature vectors obtained according to the position information and category information of the real target after noise addition, and used as the initial value of the query feature in the subsequent first Decoder layer.
[0156] Specifically, the first Decoder layer ( Figure 3Decoder Layer 1 in the figure includes a standard self-attention mechanism, a deformable cross-attention mechanism, a feedforward neural network (FFN), and three layer normalization layers with the same structure. Furthermore, corresponding to the first decoder layer, the result prediction module includes a category detection head and a position detection head. The second, third, fourth, fifth, and sixth decoder layers have the same structure, each including a prior-guided self-attention mechanism (PGSA), a deformable cross-attention mechanism, a feedforward neural network (FFN), and three layer normalization layers with the same structure. Furthermore, the result prediction module also includes a corresponding category detection head and a position detection head. Here, all category detection heads have the same structure as the category detection head in the initial query module GDI, and all position detection heads have the same structure as the position detection head in the initial query module GDI, so they will not be repeated here.
[0157] Specifically, the position encoding layer consists of a linear layer with 4 input channels and 512 output channels, a linear layer with 512 input channels and 256 output channels, and an activation function layer using the ReLU function. This position encoding layer is responsible for encoding the position information of the previous decoder layer or the initial position information for use by the current decoder layer. The use of position encoding here is the same as that in the original RT-DETR and will not be repeated here.
[0158] The output of the initial query module GDI and the feature vector sequence M1 are used as inputs to the first Decoder layer. The output of the initial query module GDI is also used as input to the standard self-attention mechanism in the first Decoder layer. The structure and calculation method of the standard self-attention mechanism are the same as those in the MobileViTv3 Block_1 structure, so they are not further described. The output of the standard self-attention mechanism, after passing through the first normalization layer, and the feature vector sequence M1 are used as inputs to the deformable crisscross attention mechanism in the first Decoder layer. This deformable crisscross attention mechanism comprises a preprocessing structure VP, a sampling structure SO, an attention weight structure AW, and an information mixing structure OP. The preprocessing structure VP includes a linear layer with 256 input and output channels. The sampling structure SO includes a linear layer with 256 and 192 input and output channels, respectively. The attention weight structure AW includes a linear layer with 256 and 96 input and output channels, respectively. The structure of the information mixing structure OP is the same as that of the preprocessing structure VP. The feature vector sequence M1 serves as the input of the preprocessing structure VP, and the output of the standard self-attention mechanism (Self-Attention) serves as the input of both the sampling structure SO and the attention weight structure AW. The coordinates of the sampling points on the output of the preprocessing structure VP are obtained according to the output of the sampling structure SO, and the weights of the weighted summation of the above sampling points are obtained according to the output of AW. The weighted summation result is obtained by combining the output of SO, VP and the output of the attention weight structure AW. This result serves as the input of the information mixing structure OP, and the output of the information mixing structure OP serves as the output of the deformable cross attention mechanism. The input and output of the deformable cross attention mechanism are added element by element, and the output of the second normalization layer is used as the input of the feedforward neural network (FFN) in the first Decoder layer. The feedforward neural network (FFN) includes a linear layer with input and output channels of 256 and 1024 respectively, an activation function layer using Relu, and a linear layer with input and output channels of 1024 and 256 respectively. The input and output of the feedforward neural network (FFN) are summed element by element and then passed through the third normalization layer. The result O1 is used as the output of the first Decoder layer, that is, the query feature O1 of the output of the first Decoder layer.
[0159] The detection result of the first Decoder layer is obtained by inputting the query feature O1 it outputs into the corresponding category detection head and position detection head in the result prediction module. The position result is obtained by updating the output of the position detection head based on the initial position obtained by the initial query module GDI. This position result will be used as the initial position of the next Decoder layer.
[0160] Here, the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer have the same structure. The only difference from the first Decoder layer is that the first Decoder layer uses a standard self-attention mechanism to capture global dependencies, while the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer all use a priori constrained self-attention mechanism to capture global dependencies.
[0161] For details, see Figure 6 As shown in the figure, the prior constrained self-attention mechanism (PGSA) consists of a query relevance calculation module (QAM), a lightweight multilayer perceptron (MLP) for encoding the QAM results, and four linear layers with 256 input and output channels. Here, the query relevance calculation module (QAM) is used to calculate the relevance of query features based on the prediction results. The MLP consists of a linear layer with 1 and 16 input and output channels, respectively, an activation function layer using the ReLU function, and a linear layer with 16 and 8 input and output channels, respectively, connected in sequence.
[0162] Specifically, the Prior Constrained Self-Attention (PGSA) mechanism is used to capture global dependencies, including:
[0163] (1) According to the detection results corresponding to the query features output by the previous Decoder layer, the first relationship matrix R is calculated l and the second relationship matrix R b The detection result includes the category detection result and the position detection result. Among them, the first relationship matrix R l The calculation formula is:
[0164]
[0165] Among them, R l (i, j) is the element in the i-th row and j-th column of the first relationship matrix, s i is the maximum confidence of the category detection result corresponding to the i-th query feature, s j is the maximum confidence of the category detection result corresponding to the j-th query feature;
[0166] The calculation formula of the second relationship matrix is:
[0167] R b (m,n)=IoU(b m ,b n );
[0168] Among them, Rb (m,n) is the element of the mth row and the nth column of the second relation matrix, b m is the position detection result corresponding to the mth query feature, b n is the position detection result corresponding to the nth query feature, IoU(b m ,b n ) represents the intersection over union of b m and b n .
[0169] Specifically, the prior constraint self-attention mechanism PGSA in the second Decoder layer is described as an example. Here, the query features O1 and O1 corresponding to the detection results and the feature vector sequence M1 output by the first Decoder layer are input to the second Decoder layer. The detection result corresponding to O1, that is, the prediction result of the query feature O1, is input to the query relevance calculation module QAM, and the query relevance calculation module QAM calculates two relation matrices R l and R b .
[0170] (2) According to the first relation matrix R l and the second relation matrix R b , the prior weight is calculated by using a multi-layer perception.
[0171] Specifically, the first relation matrix R l and the second relation matrix R b are input to a lightweight multi-layer perception (MLP), and the prior weight is calculated. The calculation formula of the prior weight is:
[0172] W s =sigmoid(MLP(R l ·R b ));
[0173] Wherein, MLP represents the lightweight multi-layer perception MLP, and sigmoid represents processing using the Sigmoid activation function.
[0174] (3) According to the position encoding information corresponding to the query feature output by the previous Decoder layer and the query feature output by the previous Decoder layer, the standard attention weight is calculated by using the standard self-attention mechanism.
[0175] Specifically, the query feature O1 output by the first Decoder layer is input to Q, K, and V through three linear layers, respectively. Then, based on the standard self-attention mechanism, the standard attention weight W is calculated. The operation mode of the standard self-attention mechanism is not described here.
[0176] (4) The attention weight of the prior constraint is calculated based on the prior weight and the standard attention weight; the calculation formula of the attention weight of the prior constraint is:
[0177]
[0178] Among them, N represents the number of queries in the query features output by the previous Decoder layer, Represents the prior weight matrix W s The weight value of the p-th row and q-th column in pq Represents the weight value of the pth row and qth column in the standard attention weight matrix W, A pq The weight value of the p-th row and q-th column in the attention weight matrix A representing the prior constraint.
[0179] (5) The value vector corresponding to the query feature output by the previous Decoder layer is weighted according to the attention weight of the prior constraint, so as to output the query feature according to the weighted result. Here, the Decoder layer outputs the query feature according to the weighted value vector.
[0180] Specifically, according to the prior constraint attention weight A pq A weighted calculation A·V is performed on the value vector V corresponding to the query feature O1 output by the previous Decoder layer. The result of the weighted calculation is then input into the fourth linear layer to obtain the output of the prior constrained self-attention mechanism (PGSA).
[0181] Based on the above steps, we can construct a SAR target detection model. Here, the SAR target detection model is used to output preliminary target detection results based on the input SAR image slice to be detected. Specifically, the preliminary target detection results output by the SAR target detection model are obtained based on the query features output by the last decoder layer, the sixth decoder layer, using the corresponding category detection head and position detection head in the result prediction module.
[0182] S203: Use the training set to train the SAR target detection model to obtain a trained SAR target detection model.
[0183] Specifically, this SAR target detection model is used to detect targets in SAR images and determine their categories. During the training process of the SAR target detection model using the training set, the classification loss function and regression loss function used in the original RT-DETR model are used to constrain the model training process. Positive and negative samples are selected using Hungarian matching, and the cost matrix of Hungarian matching is also calculated by calculating the classification loss and regression loss. This Hungarian matching is consistent with the Hungarian matching used in the original RT-DETR model and is not further described here.
[0184] In this embodiment, when the SAR target detection model is trained using the training set, the training is terminated when the loss value of the loss function reaches a convergence state, thereby obtaining a trained SAR target detection model.
[0185] S30: Perform score threshold judgment on the preliminary target detection result to obtain the final target detection result.
[0186] Specifically, the preliminary target detection results include category detection results and position detection results. The category detection results are the confidence levels that the detection boxes corresponding to each position detection result belong to each category. The preliminary detection results output by the SAR target detection model obtained in step S20 are filtered according to a pre-set confidence threshold. Detection boxes whose maximum confidence levels are lower than the threshold are filtered out to obtain the final target detection results. The target detection results include the target category.
[0187] The present invention proposes a SAR target detection method based on lightweight and prior constrained self-attention. The method performs target detection based on a SAR target detection model to obtain a preliminary target detection result, and then performs score threshold judgment on the preliminary target detection result to obtain a final target detection result. The SAR target detection model is a SAR image target detection network that is improved by lightweight and prior constrained self-attention based on the RT-DETR model. The feature fusion module in the SAR target detection model introduces a spatial and channel reconstruction convolution module on the basis of the feature fusion module of the lightweight improved RT-DETR model. By synchronously optimizing the spatial correlation and inter-channel dependency of the feature graph, feature redundancy is reduced and feature representation capability is enhanced. At the same time, a cross-layer connection structure is embedded, feature reuse is strengthened, and gradient propagation efficiency is guaranteed. While reducing the number of parameters and computational complexity of the SAR target detection model, the detection performance of the SAR target detection model is improved. In addition, by introducing the prior constrained self-attention mechanism in the SAR target detection model, the model performance bottleneck problem caused by the homogeneity of query features extracted in the decoder part of the RT-DETR model is solved, and the detection performance of the model is further improved.
[0188] In an optional embodiment of the present invention, in order to further verify the effectiveness of the SAR target detection model based on lightweight improvement and prior constrained self-attention proposed in the present invention, this example is tested on the SAR-aircraft1.0 dataset, see Figure 7 , which are examples of some images of the SAR-aircraft1.0 dataset used in this embodiment.
[0189] Table 1 gives the detection performance indicators, model parameter quantity and calculation amount of the method of the present application and several comparison methods on the SAR-aircraft 1.0 dataset. The comparison methods include: Deformable-DETR, a target detection algorithm based on Transformer; YOLOv8, a target detection algorithm based on CNN; MSFTA-Net, a lightweight SAR image target detection method based on multi-scale feature perception and Transformer auxiliary attention generation (from the patent "SAR target detection method based on multi-scale perception and Transformer auxiliary attention generation").
[0190] Pre in Table 1 represents the average precision, that is, the average value of the proportion of real targets in the detected target frame of each category. Rec represents the recall rate, that is, the average value of the proportion of each category that is correctly detected. F1-score represents the harmonic mean, which is a systematic index that unifies the precision Pre and the recall rate Rec. mAP@0.5 represents the average AP value of all categories when the IoU threshold is set to 0.5.
[0191] From the results in Table 1, it can be seen that the method of the present application is superior to the comparison methods in F1-score and mAP@0.5 performance indicators, and the parameter quantity is reduced by 63% compared to the original RT-DETR, and the calculation amount is reduced by 56% compared to the original RT-DETR. Therefore, the method of the present application can further improve the detection and recognition performance of the target while reducing the parameter quantity and calculation amount of the SAR target detection model.
[0192] Table 1 Comparison of target detection performance of different detection networks on SAR-aircraft 1.0 dataset
[0193] Pre Rec F1-score mAP@0.5 Parameter quantity Computational Amount RT-DETR 0.829 0.870 0.849 0.867 42.7M 89.7G Deformable-DETR 0.803 0.822 0.812 0.858 39.8M 103.3G YOLOv8s 0.881 0.783 0.829 0.877 11.1M 28.5G MSFTA-Net 0.888 0.835 0.861 0.888 8.9M 30.6G The method proposed by the present invention 0.872 0.854 0.863 0.893 15.9M 39.4G
[0194] The present invention proposes a SAR target detection method based on lightweight and prior constrained self-attention. The method performs target detection based on a SAR target detection model to obtain a preliminary target detection result, and then performs score threshold judgment on the preliminary target detection result to obtain a final target detection result. The SAR target detection model is a SAR image target detection network that is improved by lightweight and prior constrained self-attention based on the RT-DETR model. The feature fusion module in the SAR target detection model introduces a spatial and channel reconstruction convolution module on the basis of the feature fusion module of the lightweight improved RT-DETR model. By synchronously optimizing the spatial correlation and inter-channel dependency of the feature graph, feature redundancy is reduced and feature representation capability is enhanced. At the same time, a cross-layer connection structure is embedded, feature reuse is strengthened, and gradient propagation efficiency is guaranteed. While reducing the number of parameters and computational complexity of the SAR target detection model, the detection performance of the SAR target detection model is improved. In addition, by introducing the prior constrained self-attention mechanism in the SAR target detection model, the model performance bottleneck problem caused by the homogeneity of query features extracted in the decoder part of the RT-DETR model is solved, and the detection performance of the model is further improved.
[0195] It should be noted that the terms "first," "second," and the like are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with certain aspects of the present invention.
[0196] In the description of this specification, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described can be combined in any suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification.
[0197] Although the present application has been described in connection with certain embodiments, persons skilled in the art will understand and appreciate that many modifications can be made to the described embodiments and these modifications can be made without departing from the scope of the application in its broader aspects. In the claims, the word "comprising" does not exclude other elements or steps, and the indefinite articles "a" or "an" do not exclude a plurality, and the
[0198] The above description is further detailed in connection with specific preferred embodiments of the application, and it is not to be construed that the specific implementation of the application is limited to these descriptions. For those skilled in the art, without departing from the concept of the application, a number of simple deductions or substitutions can be made, and all of these should be considered as falling within the scope of protection of the application.
Claims
1. A SAR target detection method based on lightweight and prior-constrained self-attention, characterized in that: include: Acquire a SAR image, and perform slicing processing on the SAR image to obtain a SAR image slice to be detected; Inputting the SAR image slice to be detected into a pre-trained SAR target detection model to obtain a preliminary target detection result; The SAR target detection model is a SAR target detection network that is improved by lightweighting and prior constrained self-attention based on the RT-DETR model; the prior constrained self-attention is applied to the Decoder layer of the RT-DETR model to guide the generation of attention weights of the current Decoder layer based on the detection results output by the previous Decoder layer; A score threshold is determined for the preliminary target detection result to obtain a final target detection result.
2. The SAR target detection method based on lightweight and prior-constrained self-attention according to claim 1, characterized in that The SAR target detection model includes: a feature extraction module, a feature fusion module, a decoder module and a result prediction module; The feature extraction module is used to extract features of different scales of the SAR image slice to be detected based on the MobileViTv3 model; The feature fusion module is used to fuse the features of different scales based on the lightweight improved multi-scale feature fusion submodule to obtain fused features of different scales; the lightweight multi-scale feature fusion submodule is a module obtained by simplifying the structure of the feature fusion module of the RT-DETR model and introducing the spatial and channel reconstruction convolution module; The decoder module is used to sequentially pass the fusion features of different scales through multiple decoder layers to obtain query features corresponding to each layer; the decoder layer is the decoder layer of the RT-DETR model, and the prior constrained self-attention is applied in some of the decoder layers; The result prediction module is used to obtain preliminary target detection results based on the query features using a category detection head and a position detection head.
3. The SAR target detection method based on lightweight and prior constrained self-attention according to claim 2, characterized in that The features of different scales include: first scale features, second scale features and third scale features; The feature fusion module includes a lateral connection submodule, an attention-based intra-scale feature interaction submodule, and a multi-scale feature fusion submodule; The lateral connection submodule includes a first convolution structure, a second convolution structure, and a third convolution structure; the first convolution structure, the second convolution structure, and the third convolution structure each include a convolution layer and a batch normalization layer, and the convolution layer is connected to the batch normalization layer; The multi-scale feature fusion submodule includes a first horizontal connection convolution unit, a second horizontal connection convolution unit, a first residual feature fusion module, a second residual feature fusion module, a first downsampling convolution unit, a second downsampling convolution unit, a third residual feature fusion module and a fourth residual feature fusion module; the first residual feature fusion module to the fourth residual feature fusion module are all residual feature fusion modules based on spatial channel reconstruction convolution; the lightweight improvement is a lightweight improvement of the residual feature fusion module; The first-scale feature enters the first convolution structure, the second-scale feature enters the second convolution structure, and the third-scale feature enters the third convolution structure. The output of the third convolution structure is connected to the attention-based intra-scale feature interaction submodule; The output of the attention-based intra-scale feature interaction submodule is connected to the first horizontal connection convolution unit and the fourth residual feature fusion module; The output of the first horizontally connected convolution unit and the output of the second convolution structure are both connected to the first residual feature fusion module, the output of the first residual feature fusion module is respectively connected to the second horizontally connected convolution unit and the third residual feature fusion module, the output of the first convolution structure and the output of the second horizontally connected convolution unit are both connected to the second residual feature fusion module, the second residual feature fusion module outputs a first-scale fusion feature, and the first-scale fusion feature enters the first downsampling convolution unit and the decoder module respectively; The output of the first downsampling convolution unit is connected to the third residual feature fusion module, the third residual feature fusion module outputs the second-scale fusion feature, and the second-scale fusion feature enters the second downsampling convolution unit and the Decoder module respectively. The output of the second downsampling convolution unit is connected to the fourth residual feature fusion module, the fourth residual feature fusion module outputs the third-scale fusion feature, and the third-scale fusion feature enters the Decoder module.
4. The SAR target detection method based on lightweight and prior-constrained self-attention according to claim 3, characterized in that The first residual feature fusion module, the second residual feature fusion module, the third residual feature fusion module and the fourth residual feature fusion module have the same structure, and all include: a simplified feature fusion module and a spatial and channel reconstruction convolution module; The simplified feature fusion module includes a first feature extraction convolution submodule, a second feature extraction convolution submodule and a third feature extraction convolution submodule; The spatial and channel reconstruction convolution module includes a spatial reconstruction unit and a channel reconstruction unit; In the simplified feature fusion module, the two input features enter the first feature extraction convolution submodule and the second feature extraction convolution submodule respectively after being spliced in the channel dimension, the output of the first feature extraction convolution submodule is connected to the third feature extraction convolution submodule, and the output of the third feature extraction convolution submodule and the output of the second feature extraction convolution submodule are added element by element to obtain the output of the simplified feature fusion module; The output of the simplified feature fusion module and the two input features are added element by element to obtain a new feature map, and the new feature map passes through the spatial reconstruction unit and the channel reconstruction unit in sequence. The output of the channel reconstruction unit and the output of the simplified feature fusion module are added element by element and then output; the spatial reconstruction unit is used to perform spatial reconstruction on the new feature map to obtain a spatially reconstructed feature map; the channel reconstruction unit is used to perform channel reconstruction on the spatially reconstructed feature map to obtain a channel reconstructed feature map.
5. The SAR target detection method based on lightweight and prior constrained self-attention according to claim 4, characterized in that The spatial reconstruction unit includes: an information amount calculation subunit, a gate control subunit, a first multiplication subunit, a second multiplication subunit and a reconstruction subunit; The information amount calculation subunit is used to calculate the numerical information richness of the new feature map; The gating subunit is configured to obtain an enhanced digitized information richness and a suppressed digitized information richness according to the digitized information richness; The first multiplication subunit is configured to perform element-by-element multiplication of the enhanced numerical information richness and the new feature map to obtain a first feature map, wherein the first feature map is equally divided into a first feature submap and a second feature submap according to a channel dimension; The second multiplication subunit is configured to perform element-by-element multiplication of the suppressed numeralized information richness and the new feature map to obtain a second feature map, wherein the second feature map is equally divided into a third feature submap and a fourth feature submap according to a channel dimension; The reconstruction subunit is used to perform element-by-element addition of the first feature subgraph and the fourth feature subgraph to obtain a first reconstructed feature graph, perform element-by-element addition of the second feature subgraph and the third feature subgraph to obtain a second reconstructed feature graph, and splice the first reconstructed feature graph and the second reconstructed feature graph in the channel dimension to obtain a spatial reconstructed feature graph as the output of the spatial reconstruction unit.
6. The SAR target detection method based on lightweight and prior-constrained self-attention according to claim 4, characterized in that The channel reconstruction unit includes: a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a fifth convolution module and an average pooling layer; The spatial reconstruction feature map is equally divided in the channel dimension to obtain a fifth feature submap and a sixth feature submap; The fifth feature subgraph enters the first convolution module, and the output of the first convolution module passes through the third convolution module and the fourth convolution module respectively, and then is added element by element to obtain a seventh feature subgraph; The sixth feature subgraph enters the second convolution module, the output of the second convolution module is connected to the fifth convolution module, and the output of the fifth convolution module and the output of the second convolution module are concatenated in the channel dimension to obtain an eighth feature subgraph; The seventh feature subgraph and the eighth feature subgraph are concatenated in the channel dimension to obtain a ninth feature subgraph. The ninth feature subgraph passes through the average pooling layer and then through the Softmax function and is then multiplied element-wise with the ninth feature subgraph. After the result of the element-by-element multiplication is split equally in the channel dimension, the feature graphs obtained by the equal split are added element-by-element to obtain a channel reconstruction feature graph as the output of the channel reconstruction unit.
7. The SAR target detection method based on lightweight and prior constrained self-attention according to claim 3, characterized in that The decoder module includes: a second lateral connection module, an initial query acquisition module, a first decoder layer, a second decoder layer, a third decoder layer, a fourth decoder layer, a fifth decoder layer, and a sixth decoder layer; The second lateral connection module is used to convert the input first-scale fusion features, the second-scale fusion features, and the third-scale fusion features into a feature vector sequence; The initial query acquisition module is used to acquire initial query features according to the feature vector sequence; The first Decoder layer, the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer are connected in sequence. The input of the first Decoder layer is the initial query feature obtained by the initial query module and the feature vector sequence; the input of the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer are all the output of the previous Decoder layer and the feature vector sequence; the first Decoder layer adopts a standard self-attention mechanism to capture global dependencies, and the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer all adopt a priori constrained self-attention mechanism to capture global dependencies; The query features output by the first Decoder layer, the second Decoder layer, the third Decoder layer, the fourth Decoder layer, the fifth Decoder layer, and the sixth Decoder layer enter the result prediction module.
8. The SAR target detection method based on lightweight and prior constrained self-attention according to claim 7, characterized in that: The use of prior constrained self-attention to capture global dependencies includes: Calculate a first relationship matrix and a second relationship matrix based on the detection results corresponding to the query features output by the previous decoder layer; the detection results include category detection results and position detection results; The calculation formula of the first relationship matrix is: Among them, R l (i, j) is the element in the i-th row and j-th column of the first relationship matrix, s i is the maximum confidence of the category detection result corresponding to the i-th query feature, s j is the maximum confidence of the category detection result corresponding to the j-th query feature; The calculation formula of the second relationship matrix is: R b (m,n)=IoU(b m ,b n ); Among them, R b (m,n) is the element in the mth row and nth column of the second relationship matrix, b m is the position detection result corresponding to the mth query feature, b n is the position detection result corresponding to the n-th query feature, IoU(b m ,b n ) represents the calculation of b m and b n The intersection and union ratio of Calculating a priori weights using a multilayer perceptron according to the first relationship matrix and the second relationship matrix; The standard attention weight is calculated using the standard self-attention mechanism based on the position encoding information corresponding to the query feature output by the previous Decoder layer and the query feature output by the previous Decoder layer. The attention weight of the prior constraint is calculated based on the prior weight and the standard attention weight; the calculation formula of the attention weight of the prior constraint is: Among them, N represents the number of queries in the query features output by the previous Decoder layer, Represents the prior weight matrix W s The weight value of the p-th row and q-th column in pq Represents the weight value of the pth row and qth column in the standard attention weight matrix W, A pq The weight value of the p-th row and q-th column in the attention weight matrix A representing the prior constraint; The value vector corresponding to the query feature output by the previous Decoder layer is weighted according to the attention weight of the prior constraint, so as to output the query feature according to the weighted result.