A SAR image target detection method based on a full-space coding attention module

By introducing a full-space coding attention module and a multi-task learning method, the problem of noise interference in SAR images is solved, achieving high-precision and fast target detection results.

CN115147731BActive Publication Date: 2026-02-03BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210901110.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2026-02-03
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively overcome the effects of SAR image quality and noise, resulting in low target detection accuracy, especially in complex backgrounds where false detections and missed detections are common.

Method used

We employ the Full Space Encoding Attention Module (ESEAB), which enhances feature extraction and object detection capabilities through deformable convolution and multi-task learning, combined with multi-scale feature fusion and decoupled detection branches.

Benefits of technology

It improves the accuracy and anti-interference ability of SAR image target detection, significantly enhances detection precision and speed, and reduces the impact of noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115147731B_ABST
    Figure CN115147731B_ABST
Patent Text Reader

Abstract

The application discloses a SAR image target detection method based on a full-space coding attention module, so as to improve the detection performance of a target detection network on a SAR image, and has the following steps: (1) a full-space coding attention module is designed to relieve the interference of noise according to the characteristic that a SAR image has more noise, attention is extracted in a full-space dimension, information loss is effectively reduced, and the feature extraction capability of the model is improved; (2) deformable convolution is introduced, a learnable offset is added, the sensitivity of the model to rotation and size is reduced, and the detection effect of the model is improved; (3) a double-head detection network is used in the detection head part, so that the regression task and the classification task are decoupled, and the detection effect of the network can be improved; and the application can effectively improve the detection performance and effect of the network on targets in the near sea, the far sea and the land in a SAR image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a SAR image target detection method based on a full-space coded attention module, belonging to the interdisciplinary field of aerospace and computer vision information processing. Background Technology

[0002] Synthetic Aperture Radar (SAR) is a detection method that uses active microwaves, offering all-weather, all-day imaging capabilities and high resolution. Unaffected by lighting or weather conditions, it is widely used in military reconnaissance, marine resource monitoring, and geographic environment exploration, becoming a crucial tool for Earth observation. However, automating target identification and detection within SAR images remains a key challenge. Compared to conventional optical imaging, speckle noise makes SAR images appear cluttered and noisy, obscuring target features and making target type identification difficult with the naked eye. Fortunately, with the maturity and development of satellite technology, an increasing number of SAR target detection datasets for sea and land surfaces have become available, providing data support for deep learning.

[0003] Previously, target detection in SAR images relied primarily on traditional algorithms, which often depended on prior knowledge, thus limiting their application scenarios. Traditional algorithms first required manual feature extraction from the image and then representing these features using mathematical models. Commonly used traditional SAR image detection methods include Constant False Alarm Rate (CFAR) detectors and manual feature extraction. The former requires building complex statistical models and incurs significant computational costs, while the latter is only applicable to specific scenarios and has poor generalization capabilities. A relatively successful application is utilizing the circular shape of oil tanks and employing Hough transform for circle detection to identify oil tank targets.

[0004] With continuous breakthroughs in deep learning and iterative advancements in computing hardware, deep learning algorithms have been gradually applied to target detection in SAR images. Deep learning algorithms do not require scene differentiation in SAR image target detection, can adapt to different scenes, and achieve high accuracy and low latency. CNN networks have significant advantages in feature extraction, no longer relying on manual feature extraction; they can automatically extract the features of the target through autonomous "learning," exhibiting excellent generalization ability. The two-stage Faster R-CNN detection network achieves 79% accuracy on the SSDD ship dataset; the single-stage YOLO series target detection networks offer faster speeds for SAR image target detection; and the FCOS network based on an anchor-free design further improves the localization accuracy of target detection.

[0005] Traditional algorithms, relying on manually extracted features, can only detect objects with simple shapes and suffer from low accuracy. For general deep learning algorithms, SAR images are subject to significant speckle noise, resulting in noisy images that negatively impact target detection and thus generally poor performance. Recently emerging attention mechanisms allow neural networks to prioritize feature extraction, reducing the impact of speckle noise and focusing the network's attention on the target object, leading to more targeted feature extraction and improved network performance. Therefore, this invention combines the characteristics of neural networks and SAR images, modifying the neural network structure based on the characteristics of SAR images to propose a single-stage, anchor-free convolutional neural network target detection method for SAR images based on an attention mechanism. Summary of the Invention

[0006] The problem solved by this invention is to overcome the influence of SAR image quality and noise, and to provide a SAR image target detection method based on a full-space coded attention module, which has the advantages of high detection accuracy and strong anti-interference ability for targets in land SAR images.

[0007] Non-local attention modules are computationally intensive and generally have limited noise filtering capabilities, making them unsuitable for detecting noisy SAR images. Local attention modules, on the other hand, suffer from information loss. For example, the SE attention mechanism compresses two-dimensional feature map information into a one-dimensional space, losing most of the location-related information in the feature map.

[0008] The Entire Spatial Encoding Attention Block (ESEAB) of this invention introduces deformable convolution into the target detection network for SAR images and embeds full-space positional information into channel attention. Unlike conventional channel attention, which transforms features into a single feature vector through simple global pooling, the attention module in ESEAB decomposes multi-dimensional spatial feature information into multiple one-dimensional features for encoding. When processing two-dimensional image information, this module aggregates features along two spatial directions respectively. In this way, long-term dependencies can be captured in one spatial direction while retaining precise positional information in the other, achieving full-space feature encoding. The generated feature maps are then encoded into a pair of direction-aware and position-sensitive attention maps, which can be complementaryly applied to the input feature map to enhance the representation of the object of interest.

[0009] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: a SAR image target detection method based on a full-space coding attention module, comprising the following steps:

[0010] Step 1: Preprocess the target detection dataset of the SAR image to obtain the annotation information of the target detection dataset, and divide the target detection dataset into training set and test set;

[0011] Step 2: The full-space encoding attention module is embedded as a whole into the backbone network of the deep object detection neural network for feature extraction, resulting in a deep object detection neural network with the full-space encoding attention module. The feature channels are weighted and encoded in different spatial directions to enhance the backbone network's feature extraction capability for the image to be detected. A pyramid structure is then used to perform multi-scale feature fusion on the feature map extracted by the deep object detection neural network with the full-space encoding attention module, resulting in a fused multi-scale feature map, which improves the detection accuracy of the detection network.

[0012] Step 3: During the training phase, the fused multi-scale feature map is fed into two detection branches for regression and classification tasks respectively. These two separate detection branches allow for direct prediction and decoupling of the classification and regression tasks, improving the detection performance and training efficiency of the deep object detection neural network. The first detection branch predicts the object category at each pixel location in the multi-scale feature map, obtaining the category to which the object belongs at that pixel location. The second detection branch predicts the confidence score and candidate box position parameters at each pixel location in the multi-scale feature map, obtaining the confidence score of the object's category and the candidate box position parameters for that pixel location. Finally, the network predicts the category and location of the objects contained in the training set images input to the network.

[0013] Step 4: Input the predicted target categories and locations in the training set along with the labeled information of the training set into the loss function to calculate the current loss value of each loss term. Combine the historical loss values ​​and dynamically adjust the weight of the loss term based on the variance and mean. The final loss value is obtained by comprehensive weighting.

[0014] Step 5: Backpropagate the obtained final loss value to update the network parameters of the deep object detection neural network with the full space encoding attention module. Based on the set maximum number of iterations, learning rate and backpropagation algorithm, train repeatedly until the parameters of the deep object detection neural network with the full space encoding attention module converge, and obtain the finally trained detection model.

[0015] Step 6: Test the trained detection model on the SAR image test dataset, output the visualized test results, and the average accuracy (mAP) detection index before and after adding the attention module.

[0016] Furthermore, in step 2, the full-space encoding attention module is composed of a deformable convolutional layer, two convolutional layers, a pooling layer, two activation layers, a feature concatenation layer, and a feature separation layer stacked together. The deformable convolutional layer has a 3×3 kernel size, and the convolutional layers have kernel sizes of 3×3 and 1×1. The pooling layer performs average pooling in both the height and width directions of the features. The activation functions of the activation layer are ReLU and Sigmoid. The concatenation layer concatenates the features obtained from the pooling layer and then feeds them into the convolutional layer. The separation layer separates the features obtained from the convolutional layer, and the separated features are then fed into a second convolutional layer. The output feature dimension is equal to the input feature dimension and is used as a weight to perform a dot product operation with the input feature, increasing the weight of useful information to obtain the final output feature. The full-space encoding attention module can encode feature maps in different directions, realize the optimal selection of channel information, and maximize the utilization of relevant information.

[0017] Furthermore, the backbone network is composed of multiple convolutional layers, multiple normalization layers, and multiple activation layers stacked together; the convolutional kernel size of the convolutional layers is 3×3, 5×5, or 7×7, the batch normalization layer is BN or GN, and the activation function of the activation layer is ReLU or SiLU; a full-space encoded attention module is used to replace some convolutional layers. This deep convolutional network should contain N stages, and N is not less than 4. Its input is an image, and its output is N feature maps corresponding to the image.

[0018] Furthermore, in step 3, the first branch is a classification branch, which contains three convolutional layers for predicting the confidence of the detection box, and the tensor dimension of its output is the number of categories of the detected target; the second branch is a regression branch, which contains three convolutional layers for predicting the relevant parameters of the detection box.

[0019] Furthermore, in step 4, the loss function is... total for:

[0020] loss total =α1·loss cls +α2·loss obj +α3·loss IoU

[0021] Where loss cls Represents classification loss, loss obj This represents the confidence loss. IoU This represents the loss for the predicted bounding box position.

[0022] α1, α2, and α3 are weighting factors, and satisfy α1 + α2 + α3 = 1. Standard deviation Where c i loss totalThe magnitude of each loss, loss total The variance of each loss value in the data. loss total The mean of each loss value.

[0023] Compared with existing technologies, the advantages of this invention are: the structural design of this anchorless single-stage target detection network based on a full-space encoded attention module is scientific and reasonable, incorporating cutting-edge detection attention mechanisms, deformable convolution, and multi-task learning. Addressing the problems of background clutter, high noise levels, and unclear targets in SAR images, it can learn more useful information from SAR images. It also demonstrates good target object detection performance in SAR images, with the following advantages:

[0024] (1) The present invention can extract the features of the target object more effectively through the attention mechanism, suppress the intensity of the background in the feature map, and alleviate the noise interference caused by the characteristics of SAR images. The attention mechanism added to the network structure, namely the full-space coding attention module, encodes the feature map from different directions, realizes the optimization of channel information, increases the weight of channels containing rich information and reduces the interference of useless information.

[0025] (2) In this invention, deformable convolution is used to replace ordinary convolutional layers in the ESEAB module. Deformable convolution is applied to the detection of targets in SAR images. Compared with ordinary convolution, deformable convolution introduces a learnable offset in the receptive field, so that the convolution region can always cover the shape of the object, reducing the impact of target movement, size scaling and rotation on detection, and further improving the detection effect.

[0026] (3) When predicting the location and category of the target, the present invention adopts a direct prediction and separate decoupling method, which can significantly improve the detection speed of the network compared with the two-stage detection network. Compared with the detection network that uses the same detection head to decouple the prediction of location information and category information, the present invention has a faster convergence speed and higher detection accuracy.

[0027] (4) When combining and weighting multiple loss values ​​to obtain the final total loss value, this invention adopts a multi-task learning strategy based on observation-based dynamic weight adjustment, replacing the traditional method of manually setting weights. Based on the variance and mean of the historical loss values ​​of each loss, the training stability of each loss item can be determined, and the proportion of that loss item in the total loss item can be adjusted according to the stability, thereby achieving better training results. Attached Figure Description

[0028] Figure 1 This is a structural diagram of the ESEAB attention module of the present invention;

[0029] Figure 2 This is a feature extraction network module diagram in the overall network framework diagram of this invention;

[0030] Figure 3 This is a schematic diagram of the training and testing process of the network in this invention;

[0031] Figure 4 This is a structural diagram of the feature extraction network used in this invention;

[0032] Figure 5 The diagram shows the detection results of the deep target detection neural network before and after adding ESEAB on the SSDD dataset for offshore and nearshore SAR images. In the diagram, a, c, and e represent the detection results of the deep target detection neural network without the addition of the full-space coding attention module, while b, d, and f represent the detection results of the detection network with the addition of the full-space coding attention module.

[0033] Figure 6 This diagram illustrates the target detection capabilities of a deep target detection neural network before and after the addition of ESEAB in land SAR image target detection, where a represents the target without ESEAB and b represents the target with ESEAB. Detailed Implementation

[0034] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0035] Global pooling is commonly used for channel attention to globally encode spatial information, but it compresses global spatial information into a single channel descriptor, making it difficult to preserve positional information, which is crucial for acquiring spatial structure in visual tasks. To encourage attention modules to capture remote interactions spatially using precise positional information, this invention proposes a Fully Spatial Encoding Attention Module (ESEAB module), where the attention component decomposes global pooling. The ESEAB module uses two 1D average pooling operations to capture attention features in the horizontal and vertical directions. Compared to previous attention methods on lightweight networks, the ESEAB module offers the following advantages: First, it captures not only cross-channel information but also orientation and positional awareness, helping the model to more accurately locate and identify targets of interest; the ESEAB attention module increases the network's robustness, reducing noise interference on targets, and deformable convolutions can increase the accuracy of target detection; second, the ESEAB module is flexible and lightweight, making it easier to integrate into networks.

[0036] In attention mechanisms, global pooling is often used to encode spatial information globally, compressing this global information into a single channel. This process makes it difficult to preserve positional information, which is crucial for detection tasks. Therefore, to avoid the destruction of two-dimensional positional information by global pooling, it is decomposed into one-dimensional encoding operations in the horizontal and vertical directions.

[0037] The full-space encoding attention module is used when given input X = [x1, x2, ..., x...] c ]∈R C×H×W Next, the input features are first processed by a deformable convolution with a 3×3 kernel, without changing the dimensionality of the input features. Then, the input is fed into the attention module, which uses pooling kernels to encode each channel in two spatial ranges (H,1) and (1,W) along the horizontal and vertical directions, respectively. The formula for the c-th channel in the (H,1) and (1,W) directions is as follows:

[0038]

[0039]

[0040] in This refers to encoding the c-th channel in the horizontal direction. This refers to encoding the c-th channel in the vertical direction. The two transformations described above extract features along two spatial directions, generating a pair of direction-aware feature maps. The generated features in the two directions are concatenated and then subjected to an F1 (1×1 convolution) operation to obtain f∈R. C / r×(H+W) .Right now:

[0041] f=δ(F1[z h ,z w ])

[0042] Where [·,·] represents feature concatenation operation, δ() represents non-linear activation function, and r is the channel reduction rate, which can reduce the overall computational cost. Then, f is separated into f... h ∈R C / r×H and f w ∈R C / r×W Each is passed through a 1×1 convolution F h and F w f h and f w Transform it into a tensor with the same number of channels as the input X:

[0043] g h =Sigmod(F h (f h ))

[0044] gw =Sigmod(F w (f w ))

[0045] Assume the output tensor is Y = [y1, y2, ..., y]. c ]∈R C×H×W The final output, expanded into attention weights, is as follows:

[0046]

[0047] Where y c (i,j) represents the tensor value at position (i,j) of the c-th output channel. c (i,j) represents the tensor value of the c-th input channel at position (i,j). For the encoded attention. Figure 1 This is a schematic diagram of the ESEAB attention module. First, the input is passed through a deformable convolutional network. Then, the resulting feature maps are pooled in the horizontal and vertical directions and concatenated. Next, channel convolution is performed to obtain the attention weights in the two directions. Finally, the attention weights are multiplied by the input feature map to obtain the output feature map.

[0048] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Figure 3 As shown, the steps are as follows:

[0049] Step 1: Preprocess the target detection dataset of SAR images. To test the effectiveness of the SAR depth target detection neural network for detecting targets at sea and on land, the target detection dataset includes the SSDD ship detection dataset and the HRS0.5 land oil tank detection dataset, both imaged using SAR principles. Data processing is performed on both datasets. The training set is subjected to image enhancement changes in fixed-size batches to obtain the dataset's annotation information, and then divided into training and test sets.

[0050] Step 2: The full-space encoding attention module is embedded as a whole into the backbone network of the deep object detection neural network for feature extraction, resulting in a deep neural network with the full-space encoding attention module. The feature channels are weighted and encoded in different spatial directions to enhance the backbone network's feature extraction capability for the image to be detected. The deep small feature map is upsampled and concatenated with the shallow large feature map. The upsampling and concatenation process is repeated once more, that is, the feature maps of three different scales are fused. The feature maps of different levels are fully utilized to obtain the fused multi-scale feature map, thereby improving the detection accuracy of the detection network.

[0051] The deep object detection neural network structure of the full-space encoding attention module is as follows: Figure 1 As shown:

[0052] The input feature vector of the ESEAB structure has dimensions H×W×C. First, it undergoes a deformable convolution with a kernel size of 3x3 and a stride of 1, resulting in a feature map of size H×W×C. Next, average pooling is performed on the feature map obtained after deformable convolution in both the horizontal and vertical directions, yielding feature vectors of dimensions H×1×C after horizontal average pooling and 1×W×C after vertical average pooling. These two vectors are concatenated to obtain a vector of size 1×(W+H)×C. This vector is then subjected to a dotted convolution, maintaining the same number of channels, resulting in a weight vector of size 1×(W+H)×C. This weight vector is further split into weight vectors of dimensions H×1×C and 1×W×C, respectively. Finally, these weight vectors are multiplied at corresponding positions with the feature map obtained after deformable convolution, resulting in an output feature of size H×W×C.

[0053] The backbone network structure of the deep object detection neural network with ESEAB structure is as follows:

[0054] The parameters of the convolutional bottleneck network structure with ESEAB architecture include the number of input channels M, the number of output channels O, the hidden layer amplification factor R, and the activation function F. The front part of the convolutional bottleneck network consists of a backbone and side branches: the backbone contains one 1x1 convolution, two 3x3 convolutions, and two activation layers. When the stride is greater than 1, an additional 3x3 grouped convolution is included as an intermediate layer convolution with L = 2M channels. The first 1x1 convolution has C1 = M × R channels and a stride of 1; the first 3x3 convolution has C2 = C1 = M × R channels and a stride of 1; the second 3x3 convolution has C3 = 0 channels and a stride of 1. The side branch contains a convolutional layer with a kernel size of 1x1, a stride of S, 0 output feature map channels, and a ReLU activation function. The tensors output from the main branch and the side branch are added together at their corresponding positions and then input into the second half of the bottleneck structure. The second half of the bottleneck structure consists of ESEAB attention modules. The input and input features of the ESEAB attention modules are of the same size, and the number of output channels is R.

[0055] The backbone network of a deep object detection neural network for feature extraction mainly consists of five stages, such as... Figure 4 As shown:

[0056] Stage 1 mainly consists of two structures. The first structure adjusts the pixel position information of the input image (which is B×C×W×H) without loss of information, to achieve lossless downsampling and obtain a tensor of size B×4C×W / 2×H / 2. The second structure feeds the tensor into a 5×5 convolutional layer with a stride of 2 and 64 output channels, performs batch normalization, and finally outputs it through the SiLU activation function, resulting in a final output with 64 channels.

[0057] Phase 2 includes a convolutional bottleneck network structure with an ESEAB structure. The bottleneck structure has 64 input channels, a convolution stride of 2, a hidden layer expansion factor of 3, an activation function of SiLU, and 128 output channels.

[0058] Phase 3 includes three convolutional bottleneck network structures with ESEAB structure. The number of input channels of the bottleneck structure is 128, 128 and 256, the convolution stride is 2, 1 and 1, the hidden layer expansion factor is 3, the activation function is SiLU, and the number of output channels is 256.

[0059] The structure of stage 4 is similar to that of stage 3. It also includes three convolutional bottleneck network structures with ESEAB structure. The number of input channels of the bottleneck structure is 256, 256 and 512, the convolution stride is 2, 1 and 1, the hidden layer expansion factor is 3, the activation function is SiLU, and the number of output channels is 512.

[0060] Stage 5 includes a convolutional bottleneck network structure with an ESEAB architecture. Before being fed into the bottleneck structure, the feature vector is subjected to max pooling operations with kernel sizes of 1×1, 5×5, 9×9, and 13×13, respectively, and the results are concatenated to obtain a tensor with 2048 channels. This tensor is then passed through a convolution with a kernel size of 1×1 and a stride of 1, resulting in an output of 512 channels. The resulting tensor is then fed into a convolutional bottleneck network structure with an ESEAB architecture. The bottleneck structure has 512 input channels, a stride of 2, a hidden layer augmentation factor of 3, an activation function of SiLU, and an output of 1024 channels, yielding the final feature vector.

[0061] Step 3: After obtaining the fused image feature map, it is decoupled through two detection branches to obtain the predicted target type and the predicted target bounding box location information and confidence score. The target bounding box location information and confidence score are predicted by the regression branch, while the target type is predicted by the classification branch. This separates the classification task and the regression task, as follows: Figure 2 As shown, Figure 2The detection branch on the right side of the image is divided into two branches: the upper branch performs a classification task to predict the type of the target, and the lower branch performs a regression task to predict the location information and confidence of the target box.

[0062] Step 4: Substitute the obtained predicted target type, predicted box position and confidence level with the ground truth value in the annotation file into the loss function to calculate the loss value under the current network parameters;

[0063] During training, a multi-task loss function is used. The classification task and the regression task are separated by decoupling, and prediction and loss calculation are performed separately. The losses of the two tasks are then summed to obtain the total loss. Gradient backpropagation is then performed based on the total loss to update the network parameters in the direction of reducing the loss.

[0064] Because SAR images contain a lot of noise, a variant of focal loss is added to the BCE loss function for training to avoid the imbalance between positive and negative samples. This allows the network to learn more useful information. The BCE loss function can be rewritten as follows:

[0065]

[0066] Where p i and The values ​​are used as the predicted value and the ground truth value, where i represents the pixel position index in the final output predicted value, N is the number of targets, and α and β are hyperparameters chosen as α=2 and β=3.

[0067] The main task of the classification decoupling branch is to classify the target at the current location, predicting which class the target belongs to among known targets. This is achieved using the BCEWithLogits loss function, which is derived from the BCE loss function. Compared to the BCE loss function, the BCEWithLogits loss function first applies a sigmoid function to adjust the predicted values ​​to the range (0,1). BCEWithLogits can be represented by the BCE loss function as follows:

[0068] loss BCEWithLongits =loss BCE (Sigmoid(pred),target)

[0069] Where Sigmoid represents the Sigmoid activation function, pred represents the predicted probability of each class of the target output by the network, and target represents the class to which it belongs under the annotation information, i.e., the ground truth.

[0070] After obtaining the target classification cls_pred predicted by the decoupled branch, a loss function is performed with the ground truth cls_target. cls The calculation yielded:

[0071] loss cls =loss BCEWithLogits (cls_pred,cls_target)

[0072] Where cls_pred represents the probability of the target belonging to each class as output by the network, and cls_target represents the class to which the target belongs under the label.

[0073] The decoupled branch of the regression task obtains the coordinate range of whether an object is included and the target's coordinate range. The loss is then calculated based on the predicted target inclusion result. obj The calculation, and the loss cls Similarly, the BCEWithLogits loss function is used for calculation, and the loss is calculated between the predicted value obj_pred and the true value obj_target. obj The calculation yielded:

[0074] loss obj =loss BCEWithLogits (obj_pred,obj_target)

[0075] The loss can be calculated based on the target's coordinate range obtained from the decoupling of the regression branch. IoU The loss function used in the calculation is GIoU. The Intersection over Union (IoU) loss function is widely used in the loss calculation of bounding boxes in object detection. The difference is as follows:

[0076] Given two distinct rectangular regions A and B, where A represents the predicted target location information and B represents the ground truth, the IoU (Intersection over Union) between A and B is calculated using the following formula:

[0077]

[0078] Since IoU cannot reflect the alignment between A and B, GIoU was developed. GIoU calculation requires, based on IoU, obtaining the smallest rectangle C that encloses A and B, and then subtracting the ratio of the area of ​​C that does not cover A and B to the area of ​​C itself from IoU(A,B).

[0079]

[0080] loss IoU =GIoU(A,B)

[0081] Total loss totalIt can be represented as:

[0082] loss total =α1·loss cl s+α2·loss obj +α3·loss IoU

[0083] Where loss cls Represents classification loss, loss obj This represents the confidence loss. IoU This represents the loss for predicting the bounding box position. α1, α2, and α3 are weighting factors, satisfying α1 + α2 + α3 = 1. The weight of each factor is determined by the current loss value and the previous loss values. The relative standard deviation is... c is the ratio of the variance of the historical loss values ​​of the current term to the average historical loss value. i Regardless of the magnitude of the loss value, the loss magnitude and loss weight are decoupled. When the variance of a certain loss value is large, it indicates that the term is unstable, so its weight is increased. Conversely, when the variance of a certain loss value is small, it proves that the term is basically stable, so a smaller weight is assigned. Normalizing the relative deviation yields the loss weight for that term.

[0084] Step 5: Backpropagate the obtained loss value to update the network parameters of the deep detection neural network with the full space encoding attention module. Based on the set maximum number of iterations, learning rate and backpropagation algorithm, train repeatedly until the target detection network parameters with the full space encoding attention module converge, and obtain the final detection model.

[0085] Step 6: Input the prepared SAR image test set into the network to test the detection network, obtain the network's detection results, obtain various detection indicators, and overlay them on the original image for visualization.

[0086] This invention utilizes the SSDD dataset, a ship dataset for SAR image detection published in 2017. This dataset contains 1160 images, approximately 500×400 pixels in size, with varying resolutions and shooting methods. The annotation files are in VOC format, collectively referring to ships as "ships" and including their location information. Each image contains a different number of ships of varying sizes and shooting environments, including nearshore and offshore, and is widely used in SAR target detection. To test its target detection performance against complex land backgrounds, oil tank targets in the HRSD0.5 high-resolution SAR image dataset were manually annotated and processed in the same way.

[0087] In this embodiment of the invention, data augmentation operations are used before the training set is fed into the network: operations such as color change, random flipping, rotation, and Mosaic data augmentation are performed on the images. Mosaic data augmentation involves randomly selecting four images from the dataset, randomly resizing these four images to generate a new image, placing these four images at the four corners of the newly generated image, and correspondingly transforming and attaching the original annotation information to the new image.

[0088] The images fed into the network were all set to 416×416 pixels, with a batch size of 32. Training was performed using two 2080Ti GPUs for a total of 250 epochs. The learning strategy used was stochastic gradient descent (SGD) with a weight decay coefficient of 0.0005 and a momentum coefficient of 0.9. The learning rate update strategy was cosine annealing with warm-up, gradually increasing the learning rate from 0 to a maximum of 0.001 in the first 5 epochs, and then decaying according to a cosine function. No data augmentation was performed in the last 20 epochs. The number of detection classes was set to 1, and the non-maximum suppression threshold was 0.6.

[0089] Experimental results show that the mAP of the deep object detection neural network with added ESEAB is 3.2 percentage points higher than that without added ESEAB, reaching 60.3, indicating that the addition of the attention mechanism can significantly improve the network performance. Figure 5 The results of ship target detection before and after adding the ESEAB module are presented in both open and near-shore waters. Figure 5 In the data, 'a' and 'c' represent the detection results for near-shore areas where the ESEAB module was not included. Figure 5 b and d in the figure represent the detection results after adding the ESEAB module. It can be seen that in near-shore conditions, the network without the attention mechanism exhibits false detections and false negatives. Figure 5 In the diagram, 'e' represents the detection result in the open ocean without the ESEAB module, and 'f' represents the detection effect in the open ocean with the ESEAB module. It was found that there is land noise in the nearshore area, which is quite noisy, so the network without the ESEAB module is prone to false detection.

[0090] Because the background of SAR images of land targets is more complex than that of SAR images of marine targets, a dataset of oil tank detection from SAR images was used for training, and the detection performance before and after adding the ESEAB module was compared. Figure 6As can be seen from the image on the left (a), the false detection phenomenon is very obvious during the detection process, mistakenly identifying the background as the target object. Therefore, the network with the ESEAB module added has a much lower false detection rate in the complex background of land (b), indicating that the addition of the ESEAB module in this invention enables the network to extract more useful information and reduce the interference of surrounding noise.

[0091] Therefore, the addition of the deep target detection neural network with ESEAB proposed in this invention can significantly improve the detection performance of near-shore, offshore, and land targets, and can be easily inserted into other network structures.

[0092] It should be emphasized that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention shall still fall within the scope of the technical solution of the present invention.

Claims

1. A SAR image target detection method based on a full-space coded attention module, characterized in that: Includes the following steps: Step 1: Preprocess the target detection dataset of the SAR image to obtain the annotation information of the target detection dataset, and divide the target detection dataset into training set and test set; Step 2: The full-space encoding attention module is embedded as a whole into the backbone network of the deep object detection neural network for feature extraction, resulting in a deep object detection neural network with the full-space encoding attention module. The feature channels are weighted and encoded in different spatial directions to enhance the backbone network's feature extraction capability for the image to be detected. A pyramid structure is then used to perform multi-scale feature fusion on the feature map extracted by the deep object detection neural network with the full-space encoding attention module, resulting in a fused multi-scale feature map, which improves the detection accuracy of the detection network. Step 3: During the training phase, the fused multi-scale feature maps are fed into two detection branches for prediction of regression and classification tasks. The two detection branches for different tasks allow for direct prediction and decoupling of classification and regression tasks, thereby improving the detection effect and training efficiency of the deep object detection neural network. The first detection branch predicts the target category at each pixel location in the multi-scale feature map, thus obtaining the category to which the target belongs at that pixel location; The second detection branch predicts the confidence score and candidate box position parameters at each pixel location in the multi-scale feature map, obtaining the confidence score of the target's category at that pixel location and the candidate box position parameters of the target at that pixel location; finally, it predicts the category and location of the target contained in the training set image input to the network. Step 4: Input the predicted target categories and locations in the training set along with the labeled information of the training set into the loss function to calculate the current loss value of each loss term. Combine the historical loss values ​​and dynamically adjust the weight of the loss term based on the variance and mean. The final loss value is obtained by comprehensive weighting. Step 5: Backpropagate the obtained final loss value to update the network parameters of the deep object detection neural network with the full space encoding attention module. Based on the set maximum number of iterations, learning rate and backpropagation algorithm, train repeatedly until the parameters of the deep object detection neural network with the full space encoding attention module converge, and obtain the finally trained detection model. Step 6: Test the trained detection model on the SAR image test dataset, output the test results after visualization, and the average accuracy mAP detection index before and after adding the attention module. In step 2, the full-space encoding attention module is composed of a deformable convolutional layer, two convolutional layers, a pooling layer, two activation layers, a feature concatenation layer, and a feature separation layer stacked together. The kernel size of all deformable convolutional layers is 3×3, and the kernel sizes of the convolutional layers are 3×3 and 1×1. The pooling layer performs average pooling in the height and width directions of the features respectively. The activation functions of the activation layer are ReLU and Sigmoid. The concatenation layer concatenates the features obtained from the pooling layer and then feeds them into the convolutional layer. The separation layer separates the features obtained from the convolutional layer. The separated features are then fed into the second convolutional layer. The output feature dimension is equal to that of the input feature and is used as a weight to perform a dot product operation with the input feature to increase the weight of useful information and obtain the final output feature. The full-space encoding attention module can encode feature maps in different directions, optimize channel information, and maximize the use of relevant information.

2. The SAR image target detection method based on a full-space coded attention module according to claim 1, characterized in that: The backbone network consists of multiple convolutional layers, multiple normalization layers, and multiple activation layers stacked together. The kernel size of the convolutional layers is 3×3, 5×5, or 7×7, the batch normalization layer is BN or GN, and the activation function of the activation layer is ReLU or SiLU. A full-space encoded attention module replaces some of the convolutional layers. This deep convolutional network should contain N stages, and N is not less than 4. Its input is an image, and its output is the feature map corresponding to the image.

3. The SAR image target detection method based on a full-space coded attention module according to claim 1, characterized in that: In step 3, the first branch is a classification branch, which contains three convolutional layers for predicting the confidence of the detection box, and the output tensor dimension is the number of categories of the detected target; the second branch is a regression branch, which contains three convolutional layers for predicting the relevant parameters of the detection box.

4. The SAR image target detection method based on a full-space coded attention module according to claim 1, characterized in that: In step 4, the total loss function for: in Represents classification loss, Indicates confidence loss. This represents the loss for the predicted bounding box position. , , As a weighting factor, and satisfying , ; in for The magnitude of each loss, for The variance of each loss value in the data. for The mean of each loss value.

Citation Information

Patent Citations

  • Attention mechanism-based SAR image target detection method and test platform

    CN112101189A

  • SAR ship detection method based on quaternary feature pyramid network

    CN113705331A