A SAR image airplane target detection method based on improved YOLOv5

By improving the data augmentation, anchor box optimization, feature fusion, and attention mechanism of the YOLOv5 model, the problems of missed detection and false detection in aircraft target detection in SAR images were solved, and higher detection accuracy was achieved.

CN116630798BActive Publication Date: 2026-02-10SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310553214.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-16
Publication Date
2026-02-10
Estimated Expiration
2043-05-16

AI Technical Summary

Technical Problem

Existing SAR image aircraft target detection models are prone to missed detections and false detections in complex backgrounds, resulting in insufficient detection accuracy.

Method used

The YOLOv5 model is improved by using Mosaic data augmentation, K-means clustering to optimize anchor boxes, introducing a coordinate attention mechanism, designing SPD-CA convolutional blocks, an FFP feature fusion pyramid network, and a global attention mechanism to enhance object detection accuracy.

Benefits of technology

It effectively avoids missed detections and false detections in complex backgrounds, and improves the accuracy and precision of aircraft target detection in SAR images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116630798B_ABST
    Figure CN116630798B_ABST
Patent Text Reader

Abstract

The application discloses a SAR image airplane target detection method based on an improved YOLOv5, and relates to the field of image target detection. A SAR image dataset containing airplane targets is collected and obtained, image data labeling is performed, and the dataset is divided into a training set and a test set; an improved YOLOv5 model is built to build a new detection model, including an input layer, a backbone network, a Neck network and a Head network; training parameters are set to train the detection model, performance testing is performed, and evaluation indexes such as accuracy and recall rate are used to evaluate the target detection effect of the model. The application can improve the bottleneck that the traditional SAR airplane target detection algorithm is prone to missing detection and false detection of airplanes in a complex background, and the generated airplane target detection algorithm combines the use of an introduced attention mechanism to strengthen the attention to target position information, a feature fusion method and a global information attention method. The backbone network, neck structure and output detection head of the improved YOLOv5 detection model are used for feature fusion of airplane targets, so that the airplane target detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image target detection, and in particular to a method for aircraft target detection in SAR images based on an improved YOLOv5. Background Technology

[0002] Synthetic Aperture Radar (SAR) is an active microwave imaging sensor with all-weather, day-and-night imaging capabilities. Since its inception in the 1950s, SAR has been widely used in both military and civilian fields due to its unique imaging mechanism. In the civilian sector, SAR plays a significant role in mineral resource exploration, disaster detection and prevention, terrain surveying and mapping, and agriculture and forestry. In the military sector, SAR imagery is of paramount importance in battlefield situational awareness, typical target identification and precise guidance, and static and dynamic measurement of the scattering characteristics of stealth targets. Due to the unique performance of SAR, SAR image target interpretation technology has received considerable attention from various countries. Aircraft, as an important type of target, are crucial; in the civilian sector, aircraft detection contributes to effective airport management; in the military sector, obtaining information on the number and distribution of aircraft is of great value. Therefore, the accurate detection and identification of aircraft targets using SAR imagery is a hot research topic and of significant importance.

[0003] In recent years, with the development of deep neural networks, object detection models have been divided into one-stage and two-stage detection models. Two-stage detection models first generate a large number of candidate regions in the image, then extract features from these regions using a convolutional neural network, and finally identify the object category and location. Commonly used two-stage object detection models include R-CNN, Fast R-CNN, and Faster R-CNN. While candidate region-based two-stage object detection algorithms have high accuracy, their detection efficiency is low. Single-stage object detection methods, on the other hand, do not need to generate candidate regions; they directly extract features from the input image and then predict the object's category and location information. Commonly used single-stage object detection models include SSD and YOLO.

[0004] Single-stage detection models are significantly faster than two-stage detection models. However, while single-stage detection models offer faster detection speeds, their accuracy falls short of expectations, and they are prone to false detections and missed detections in complex backgrounds. Therefore, improving detection models to further enhance the accuracy of aircraft target detection in SAR images is of great significance.

[0005] Therefore, those skilled in the art are dedicated to developing a method for detecting aircraft targets in SAR images based on an improved YOLOv5, which can minimize missed detections and false detections, and enable accurate detection of aircraft targets in complex backgrounds. Summary of the Invention

[0006] In view of the above-mentioned deficiencies of the prior art, the technical problem to be solved by the present invention is to avoid missed detection and false detection, and to accurately detect aircraft targets in complex backgrounds.

[0007] To achieve the above objectives, this invention provides a SAR image aircraft target detection method based on an improved YOLOv5 algorithm. The improved YOLOv5 target detection algorithm is obtained by modifying the YOLOv5 algorithm, and includes the following steps:

[0008] Step 1: In the input layer, the Mosaic data augmentation method is used to preprocess the input image, and the K-means clustering algorithm is used to optimize the anchor frame for the aircraft target size.

[0009] Step 2: The feature map from Step 1 is input into the improved backbone network. The improved backbone network refers to the introduction of a coordinate attention mechanism (CA) into the backbone network and the replacement of the strided convolution used by the backbone network for image downsampling with SPD-CA convolutional blocks.

[0010] Step 3: The image feature maps of different scales obtained in Step 2 are input into the Neck part of the improved YOLOv5 network. The designed FFP feature fusion pyramid network structure is used to improve the Neck structure of the target detection algorithm YOLOv5 to achieve adaptive feature fusion.

[0011] Step 4: Tensor data of different scales obtained in step 3 are input into the prediction layer of the improved YOLOv5 network. A global attention mechanism (GAM) is added before the prediction layer to capture global information and reduce inaccurate target localization.

[0012] Furthermore, in step 1, the Mosaic data augmentation method uses random scaling, random cropping, and random arrangement of images to stitch together the images, preprocessing the input image and improving the detection effect of small targets.

[0013] Furthermore, in step 1, the K-means clustering algorithm is used to optimize the anchor boxes for the aircraft target size in the dataset. By performing cluster analysis on the data, the matching degree between the prior boxes and the target boxes is improved, adaptive anchor box calculation is performed, and all initial anchor box sizes are changed for each detection head.

[0014] Furthermore, in step 2, the 3*3 convolutional blocks with a stride of 2 used for downsampling in the backbone network of the YOLOv5 model are replaced with the designed SPD-CA convolutional blocks, completely replacing the convolutional stride and pooling layers. The SPD layer is a spatial-to-depth connection layer, which extracts a value from every pixel in the image, similar to neighbor-to-neighbor downsampling, and divides the feature map into four sub-feature maps, as shown below:

[0015] f 0,0 =X[0:S:2,0:S:2],f 1,0 =X[1:S:2,0:S:2],

[0016] f 0,1 =X[0:S:2,1:S:2],f 1,1 =X[1:S:2,1:S:2]

[0017] S is the image size. Then, these sub-feature maps are connected together along the channel dimension. While downsampling the feature maps, all information in the channel dimension is preserved, avoiding non-discriminatory loss of information. After the SPD layer, a coordinate attention mechanism layer CA is introduced to enhance attention to the target point and perceive the position information of the aircraft target. Finally, a single-step convolutional layer is added to change the number of channels using the learning parameters.

[0018] Furthermore, in step 3, the image feature map obtained in step 2 is input from the back end of the backbone network into the Neck part of the improved YOLOv5 network. The Neck structure is changed from the original simple bidirectional feature pyramid structure of PANet to the designed FFP feature fusion pyramid structure. The Neck introduces a bottom-up path enhancement structure on the basis of the feature pyramid network, refines the image feature matrix output by the backbone network to realize the bidirectional feature pyramid, and absorbs the ideas of BiFPN and ASFF structures. A skip connection branch is added between the backbone network and the bottom-up feature fusion path, that is, an extra edge is added between the input node and the output node at the same level, so that more features can be fused at the same level. At the same time, the ASFF feature fusion structure is added to the bidirectional feature transmission path to realize the cross-fusion of features between different levels.

[0019] Furthermore, in step 4, feature map data at different scales are input into the prediction layer of the improved YOLOv5 network. A global attention mechanism is integrated at the back end of the Neck part, i.e. before the prediction layer, so that the model combines target features at different scales and retains the target feature information after feature fusion.

[0020] Furthermore, it also includes the following steps: obtaining a labeled image dataset based on the acquired SAR image aircraft target dataset.

[0021] Furthermore, the image dataset is divided into a training set and a test set, with 75% used as the training set and 25% used as the test set.

[0022] Furthermore, it also includes the following steps: setting training parameters, training the detection model using the training set to obtain the trained model and weight file, and evaluating the performance of the trained model using the test set and evaluation metrics such as precision, recall, and F1 score.

[0023] Furthermore, the training parameters include: epoch of 100, lr of 0.01, momentum of 0.937, and batch size of 8; the loss function is constrained by regression localization loss and confidence loss, and the objective function is optimized using stochastic gradient descent (SGD). The improved target detection algorithm YOLOv5 is evaluated by saving the best-performing weight parameters of the model in a file during training, and then testing the aircraft targets on the test set after loading.

[0024] In a preferred embodiment of the present invention, when inputting an aircraft target image into the YOLOv5 model backbone network for downsampling feature extraction, the strided convolution used for downsampling causes non-discriminatory loss of information, and the detection network does not pay sufficient attention to the position of the aircraft target. Therefore, it is necessary to strengthen the network's attention to the aircraft target, reduce missed detections, and further improve the detection effect. The present invention improves the backbone network by introducing a coordinate attention mechanism (CA) into the backbone network. An SPD-CA convolutional block is designed and adopted to replace the strided convolution used by the backbone network for image downsampling, thus focusing more on the aircraft target's position information. In the YOLOv5 model backbone network, the 3*3 convolutional kernel with a stride of 2 used for downsampling is replaced with the designed SPD-CA convolutional block, completely replacing the convolution stride and pooling layers. The SPD layer is a spatial-to-depth connection layer. Specifically, it extracts a value from every pixel in the image, similar to neighbor-to-neighbor downsampling, dividing the feature map into four sub-feature maps, and then connecting these sub-feature maps along the channel dimension. The improved SPD-CA module includes an SPD layer. The principle is that a large amount of redundant pixel information exists during downsampling; by replacing cross-convolution and pooling, the model can still learn features well. SPD divides the image feature map into four sub-feature maps and connects them along the channel dimension, effectively preserving all information in the channel dimension while downsampling and mapping the features. Then, an efficient coordinate attention mechanism layer (CA) is added, encoding channel relationships and long-term dependencies through precise positional information, increasing and improving the interest points of the aircraft target in specific positional directions. Finally, a convolutional layer is connected to facilitate changing the number of channels. This avoids the non-discriminatory loss of feature information during backbone downsampling; strengthens attention to target points, and better perceives the positional information of the aircraft target; this module design ensures excellent preservation of channel information, allowing for further feature fusion in subsequent structures.

[0025] For the multi-scale image feature maps obtained after inputting images into the backbone network of the YOLOv5 detection model, the image features of aircraft targets do not undergo good feature fusion across different levels. This causes the network to lose some information during transmission and cannot effectively learn multi-scale features, resulting in a loss of detection accuracy. This invention designs a novel Neck structure FFP feature fusion pyramid network to improve and replace the original simple bidirectional feature pyramid structure of YOLOv5's PANet. The multi-scale image feature maps obtained from the back end of the backbone network are input into the Neck part of the improved YOLOv5 network. The Neck introduces a bottom-up path enhancement structure on the basis of the feature pyramid network, refines the image feature matrix output by the backbone network to achieve a bidirectional feature pyramid, and incorporates the ideas of BiFPN and ASFF structures. A skip connection branch is added between the backbone network and the bottom-up feature fusion path, i.e., an extra edge is added between input and output nodes at the same level, enabling the fusion of more features at the same level. Simultaneously, an ASFF feature fusion structure is added to the bidirectional feature transmission path to achieve cross-fusion of features at different levels. This enables the detection model to integrate more effective features at the same level and to cross-integrate features from different levels; achieving multi-scale, high-level adaptive feature fusion.

[0026] Inaccurate target localization often occurs when detection models predict aircraft targets, necessitating enhanced attention to the information in the prediction output to reduce false detections and false positives. This invention inputs feature map data at different scales into the prediction layer of an improved YOLOv5 network, integrating a global attention mechanism (GAM) at the back end of the Neck section, before the prediction layer. Adding the GAM after the feature fusion structure, before the three output detection layers, reduces network information reduction and amplifies global dimensional interactive features. It studies the attention weights across channels, spatial width, and spatial height in the aircraft target detection network, preserving information to amplify the ability to perform "global" cross-dimensional interactions, capturing important features in these three dimensions. This allows the model to better integrate target features at different scales, retain more target feature information after feature fusion, better capture global information, and reduce inaccurate target localization.

[0027] Compared with the prior art, the present invention has the following obvious substantive features and significant advantages:

[0028] This invention first employs K-means clustering to optimize aircraft target bounding boxes, reducing the probability of false positives and false negatives. Next, a novel downsampling convolutional module is designed in the backbone network by introducing a coordinate attention mechanism, enabling more effective learning of target location features. Then, the feature fusion method is improved in the neck network structure by designing a feature fusion pyramid structure to enhance multi-scale learning and feature information fusion. Finally, a global attention mechanism is added at the end of the network model, allowing the network to acquire more global and contextual information, thus improving aircraft target location detection. Therefore, this invention has the advantage of effectively avoiding false positives and false negatives of aircraft targets in complex backgrounds, and compared with existing technologies, it can better improve the accuracy of aircraft target detection in SAR images, ensuring accurate aircraft detection.

[0029] The following will further explain the concept, specific structure, and technical effects of the present invention in conjunction with the accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Attached Figure Description

[0030] Figure 1 This is a flowchart illustrating the overall process of a preferred embodiment of the present invention;

[0031] Figure 2 This is a schematic diagram of the SPD-CA module of the improved YOLOv5 backbone network according to a preferred embodiment of the present invention;

[0032] Figure 3 This is a structural diagram of the coordinate attention mechanism (CA) of a preferred embodiment of the present invention;

[0033] Figure 4 This is a schematic diagram of the improved YOLOv5 Neck network structure according to a preferred embodiment of the present invention;

[0034] Figure 5 This is a structural diagram of the Global Attention Mechanism (GAM) of a preferred embodiment of the present invention;

[0035] Figure 6 This is an overall structural diagram of an improved YOLOv5 detection model according to a preferred embodiment of the present invention;

[0036] Figure 7 This is a scatter plot of data set size according to a preferred embodiment of the present invention;

[0037] Figure 8 This is a PR curve diagram of the training results of a preferred embodiment of the present invention;

[0038] Figure 9 This is a loss curve of the training result of a preferred embodiment of the present invention;

[0039] Figure 10This is a visualization of the detection results of a preferred embodiment of the present invention. Detailed Implementation

[0040] The following description, with reference to the accompanying drawings, illustrates several preferred embodiments of the present invention to make its technical content clearer and easier to understand. The present invention can be embodied in many different forms, and the scope of protection of the present invention is not limited to the embodiments mentioned herein.

[0041] In the accompanying drawings, components with the same structure are indicated by the same numerical designation, and components with similar structures or functions are indicated by similar numerical designations. The dimensions and thicknesses of each component shown in the drawings are arbitrary, and the present invention does not limit the dimensions and thicknesses of each component. To make the illustrations clearer, the thickness of some components has been appropriately exaggerated in the drawings.

[0042] The technical problem to be solved by the present invention is to provide a SAR image ship target detection method based on improved YOLOv5, which can minimize missed detections and false detections, and enable accurate detection of aircraft targets in complex backgrounds.

[0043] The technical solution adopted by this invention to solve its technical problem is: to provide an aircraft target detection algorithm for SAR images based on an improved YOLOv5, comprising the following steps:

[0044] Based on the obtained SAR image aircraft target dataset, a labeled image dataset is obtained, which is divided into a training set and a test set, with 75% used as the training set and 25% as the test set.

[0045] The object detection algorithm YOLOv5 is improved to obtain the improved object detection algorithm YOLOv5, which specifically includes:

[0046] (1) Mosaic data augmentation is used in the input layer to preprocess the input image, and K-means clustering algorithm is used to optimize the anchor frame for the target size of the aircraft.

[0047] (2) Input the feature map of step (1) into the improved backbone network. The improved backbone network refers to the introduction of the coordinate attention mechanism (CA) in the backbone network. An SPD-CA convolution block was designed and adopted to replace the strided convolution used by the backbone network to downsample the image, and to pay more attention to the target position information of the aircraft.

[0048] (3) Input the image feature maps of different scales obtained in step (2) into the Neck part of the improved YOLOv5 network, and improve the Neck structure of the target detection algorithm YOLOv5 by adopting the designed FFP feature fusion pyramid network structure to realize multi-scale, high-level adaptive feature fusion.

[0049] (4) The tensor data of different scales obtained in step (3) are input into the prediction layer of the improved YOLOv5 network. A global attention mechanism (GAM) is added before the prediction layer to better capture global information and reduce inaccurate target localization.

[0050] Set training parameters, train the new detection model using the training set, obtain the trained model and weight file, and evaluate the performance of the trained model using the test set and evaluation metrics such as precision, recall, and F1 score.

[0051] Furthermore, the specific method of step (1) is as follows:

[0052] The Mosaic data augmentation method employs multiple images, randomly scaled, cropped, and arranged to stitch together, preprocessing the input image to improve the detection effect of small targets. K-means clustering algorithm is used to optimize the anchor boxes based on the aircraft target size in the dataset. Cluster analysis of the data improves the matching degree between prior boxes and target boxes. Adaptive anchor box calculation is performed, changing all initial anchor box sizes for each of the three detector heads to (33, 33), (42, 51), (52, 43), (95, 72), (81, 94), (114, 88), (92, 122), (154, 160), and (277, 273).

[0053] Furthermore, the specific method for step (2) is as follows:

[0054] In the backbone network of the YOLOv5 model, the 3*3 convolutional blocks with a stride of 2 used for downsampling are replaced with the designed SPD-CA convolutional blocks, completely replacing the convolutional stride and pooling layers. The SPD layer is a spatial-to-depth connection layer that extracts a value from every pixel in the image, similar to neighbor-to-neighbor downsampling, dividing the feature map into four sub-feature maps, as shown below (S is the image size):

[0055] f 0,0 =X[0:S:2,0:S:2],f 1,0 =X[1:S:2,0:S:2],

[0056] f 0,1 =X[0:S:2,1:S:2],f 1,1 =X[1:S:2,1:S:2]

[0057] These sub-feature maps are then concatenated along the channel dimension. This process downsamples the feature maps while preserving all information along the channel dimension, avoiding non-discriminatory information loss. A coordinate attention mechanism layer (CA) is introduced after the SPD layer to enhance attention to the target point and better perceive the positional information of the aircraft target. Finally, a single-stride convolutional layer is added to change the number of channels used in the learning parameters.

[0058] Furthermore, the specific method for step (3) is as follows:

[0059] The multi-scale image feature map obtained in step (2) is input from the back end of the backbone network into the Neck part of the improved YOLOv5 network. The Neck structure is changed from the original simple bidirectional feature pyramid structure of PANet to the designed FFP feature fusion pyramid structure. The Neck introduces a bottom-up path enhancement structure on the basis of the feature pyramid network, refines the image feature matrix output by the backbone network to realize the bidirectional feature pyramid, and absorbs the ideas of BiFPN and ASFF structures. A skip connection branch is added between the backbone network and the bottom-up feature fusion path, that is, an extra edge is added between the input node and the output node at the same level, so that more features can be fused at the same level. At the same time, the ASFF feature fusion structure is added to the bidirectional feature transmission path to realize the cross-fusion of features between different levels.

[0060] Furthermore, the specific method for step (4) is as follows:

[0061] The feature map data of different scales obtained in step (3) are input into the prediction layer of the improved YOLOv5 network. A global attention mechanism is integrated at the back end of the Neck part, i.e. before the prediction layer, so that the model can better combine the target features at different scales and retain more target feature information after feature fusion.

[0062] Furthermore, the training parameters include: epoch of 100, lr of 0.01, momentum of 0.937, and batch size of 8; the loss function is constrained by regression localization loss and confidence loss, and the objective function is optimized using stochastic gradient descent (SGD). The best-performing weight parameters of the model are saved in a file during training. The improved target detection algorithm YOLOv5 is evaluated, and after loading, it is tested on aircraft targets on the test set.

[0063] The embodiments of the present invention relate to an aircraft target detection method for SAR images based on an improved YOLOv5, such as... Figure 1The diagram shows the overall process of this invention, which includes the following steps: collecting and acquiring a SAR image dataset containing aircraft targets, annotating the image data, and dividing it into a training set and a test set at a ratio of 75% and 25%; improving the YOLOv5 model and building a new detection model, which includes an input layer, a backbone network, a Neck network, and a Head network; setting the training parameters and training the new detection model, performing performance testing on the model, and using evaluation metrics such as precision and recall to assess the model's target detection performance.

[0064] This implementation method addresses the bottleneck of traditional SAR aircraft target detection algorithms, which are prone to missing or falsely detecting aircraft in complex environments. The resulting aircraft target detection algorithm combines methods that introduce attention mechanisms to enhance focus on target location information, feature fusion, and global information focus. Its core is to improve the YOLOv5 detection model's backbone network, neck structure, and output detection head to perform aircraft target feature fusion, thereby further enhancing aircraft target detection accuracy. The specific steps are as follows:

[0065] Step 1: First, Mosaic data augmentation is performed on the acquired aircraft target image dataset, which improves the small target detection capability to a certain extent. Then, the unsupervised clustering algorithm K-means is used to cluster the aircraft target sizes in the dataset to obtain nine anchor boxes, and the sample distance metric is IOU distance, and adaptive anchor box adjustment is performed.

[0066] Step two, the main function of the backbone network is to extract features, such as... Figure 2 The design presents an SPD-CA module to replace the convolutional blocks used by the backbone network for image downsampling, thereby improving the backbone network and effectively avoiding the loss of image information during downsampling. Furthermore, a coordinate attention mechanism is introduced to strengthen the attention points of the target and reduce clutter attention points. The improved SPD-CA module includes an SPD layer. The principle is that a large amount of redundant pixel information exists during downsampling; by replacing cross-convolution and pooling, the model can still learn features well. SPD divides the image feature map into four sub-feature maps and connects them together along the channel dimension, effectively preserving all information in the channel dimension while downsampling and mapping the features. Then, an efficient coordinate attention mechanism layer CA is added. Figure 3 As shown, channel relationships and long-term dependencies are encoded using precise location information, increasing and improving the points of interest for aircraft targets in specific location directions; finally, a convolutional layer is connected to facilitate changing the number of channels. This module design ensures that channel information is well preserved, and more feature information can be fused in subsequent structures.

[0067] Step three: After feature extraction via the backbone network, the use of high-level and low-level features is crucial for improving the model's object detection performance. The Neck network structure primarily performs feature fusion to enhance information propagation. The original YOLOv5 model uses PANET (e.g., ...) in its feature fusion structure. Figure 4 (a))'s simple bidirectional feature fusion improves the overall use and fusion of features, but it loses some information during transmission and fails to learn specific features for fusion. Therefore, this invention draws on the BiFPN feature fusion structure (such as...) Figure 4 (b) and ASFF adaptive feature fusion structure (e.g.) Figure 4 (c) Two approaches are used: adding skip connection branches between the backbone network and the bottom-up feature fusion path, and incorporating an ASFF feature fusion structure into the bidirectional feature transmission path. The final Neck feature fusion structure is as follows: Figure 4 As shown in (d), fusion at the same level is achieved. More special Conquest Furthermore, it integrates features from different levels.

[0068] Step four: After the feature fusion structure, i.e. before the three output detection layers, add a global attention mechanism, such as... Figure 5 As shown, the global attention mechanism can reduce network information reduction and amplify global dimensional interactive features, thus studying the attention weights across channels, spatial width, and spatial height in aircraft target detection networks. Heavy, retain Information, with its ability to amplify "global" cross-dimensional interactions, can capture key features of these three dimensions.

[0069] This invention uses an improved YOLOv5 detection model to detect aircraft targets in SAR images. Figure 6 To improve the overall network structure of the model, the final improved model has the advantage of effectively avoiding false detections and missed detections of aircraft targets in complex backgrounds, and has improved the accuracy of aircraft target detection in SAR images compared with the original YOLOv5 detection model.

[0070] In the actual implementation of this invention, the model training platform is the Ubuntu operating system, the experimental model uses the PyTorch 2.0.0 framework, and the training environment is an Nvidia 4090Ti (24GB VRAM) GPU. The dataset selected is the acquired SAR image aircraft dataset, of which 2225 images are used as the training set and 741 images are used as the test set. Figure 7 This is a scatter heatmap of the detected aircraft target sizes in the dataset. The horizontal axis represents the width ratio and the vertical axis represents the height ratio. The points in the graph, from light to dark, represent increasingly concentrated target sizes, indicating that most aircraft targets are relatively small.

[0071] The training parameters were set as follows: 100 training epochs, step size of 8, and initial learning rate of 0.01. The improved model was trained using the training set, and then evaluated using the test set and evaluation metrics. The improved object detection algorithm YOLOv5 was evaluated using the following metrics: Precision (P); Recall (R); and F1 score (the harmonic mean of precision and recall, a comprehensive indicator for object detection). Figure 8 This is a PR curve diagram of the actual training results of this invention; Figure 9 This is a loss curve graph of the training results of an actual case of the present invention.

[0072] Where TP represents the number of correctly detected targets, FN represents the number of missed targets, and FP represents the number of false detections. The specific formula is as follows:

[0073]

[0074]

[0075]

[0076] Method type Precision Recall F1 score YOLOv5 0.950 0.956 0.952 Improved YOLOv5 0.970 0.975 0.972

[0077] Table 1

[0078] Experimental Results Analysis: As shown in Table 1, the improved target detection model achieves a 2% improvement in detection accuracy compared to the original YOLOv5. Given a already high basic detection accuracy, it can further enhance aircraft target detection performance. Table 2 presents the ablation comparison experiment of the improved module, verifying the effectiveness of the hybrid use of the improved module for aircraft target detection. The visualization results of the SAR image aircraft target detection performance are shown below. Figure 10 As shown.

[0079] FFP SPDCA GAM Precision Recall F1 score × × × 0.950 0.956 0.952 √ × × 0.961 0.963 0.962 √ √ × 0.965 0.974 0.969 √ √ √ 0.970 0.975 0.972

[0080] Table 2

[0081] This invention improves upon the YOLOv5 detection algorithm, specifically by employing K-means clustering to optimize aircraft target bounding boxes. A new downsampling convolutional module is designed in the backbone network by introducing a coordinate attention mechanism. The feature fusion method is then improved in the neck network structure. Finally, a global attention mechanism is added to emphasize global information. Experiments show that the improved model has certain advantages over YOLOv5 and other target detection algorithms, possessing high application value and providing technical support for aircraft target detection in SAR images.

[0082] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A method for aircraft target detection in SAR images based on improved YOLOv5, characterized in that, The YOLOv5 object detection algorithm is improved to obtain the improved YOLOv5 object detection algorithm, which includes the following steps: Step 1: In the input layer, the Mosaic data augmentation method is used to preprocess the input image, and the K-means clustering algorithm is used to optimize the anchor frame for the aircraft target size. Step 2: The feature map from Step 1 is input into the improved backbone network. The improved backbone network refers to the introduction of a coordinate attention mechanism (CA) into the backbone network and the replacement of the strided convolution used by the backbone network for image downsampling with SPD-CA convolutional blocks. Step 3: The image feature maps of different scales obtained in Step 2 are input into the Neck part of the improved YOLOv5 network. The designed FFP feature fusion pyramid network structure is used to improve the Neck structure of the target detection algorithm YOLOv5 to achieve adaptive feature fusion. Step 4: Tensor data of different scales obtained in step 3 are input into the prediction layer of the improved YOLOv5 network. A global attention mechanism (GAM) is added before the prediction layer to capture global information and reduce inaccurate target localization. In step 2, the 3D model used for downsampling is applied to the backbone network of the YOLOv5 model. The convolutional blocks with 3 kernels and a stride of 2 are replaced with the designed SPD-CA convolutional blocks, completely replacing the convolutional stride and pooling layers. The SPD layer is a spatial-to-depth connection layer that extracts a value from every pixel in the image, similar to neighbor-to-neighbor downsampling, dividing the feature map into four sub-feature maps, as shown below: S represents the image size. These sub-feature maps are then concatenated along the channel dimension. While downsampling the feature maps, all information along the channel dimension is preserved, avoiding non-discriminatory information loss. A coordinate attention mechanism layer (CA) is introduced after the SPD layer to enhance attention to target points and perceive the aircraft's position information. Finally, a single-stride convolutional layer is added to change the number of channels used in the learning parameters. In step 3, the image feature map obtained in step 2 is input from the back end of the backbone network into the Neck part of the improved YOLOv5 network. The Neck structure is changed from the original simple bidirectional feature pyramid structure of PANet to the designed FFP feature fusion pyramid structure. The Neck introduces a bottom-up path enhancement structure on the basis of the feature pyramid network, refines the image feature matrix output by the backbone network to realize the bidirectional feature pyramid, and absorbs the ideas of BiFPN and ASFF structures. A skip connection branch is added between the backbone network and the bottom-up feature fusion path, that is, an extra edge is added between the input node and the output node at the same level, which can fuse more features at the same level. At the same time, the ASFF feature fusion structure is added to the bidirectional feature transmission path to realize the cross-fusion of features between different levels.

2. The SAR image aircraft target detection method based on improved YOLOv5 as described in claim 1, characterized in that, In step 1, the Mosaic data augmentation method uses random scaling, random cropping, and random arrangement of images to stitch them together, preprocessing the input image and improving the detection effect of small targets.

3. The SAR image aircraft target detection method based on improved YOLOv5 as described in claim 1, characterized in that, In step 1, the K-means clustering algorithm is used to optimize the anchor boxes for the aircraft target size in the dataset. By performing cluster analysis on the data, the matching degree between the prior boxes and the target boxes is improved. Adaptive anchor box calculation is performed, and all initial anchor box sizes are changed for each detection head.

4. The SAR image aircraft target detection method based on improved YOLOv5 as described in claim 1, characterized in that, In step 4, feature map data at different scales are input into the prediction layer of the improved YOLOv5 network. A global attention mechanism is integrated at the back end of the Neck part, i.e. before the prediction layer, so that the model combines target features at different scales and retains the target feature information after feature fusion.

5. The SAR image aircraft target detection method based on improved YOLOv5 as described in claim 1, characterized in that, It also includes the following steps: Based on the acquired SAR image aircraft target dataset, a labeled image dataset is obtained.

6. The SAR image aircraft target detection method based on improved YOLOv5 as described in claim 5, characterized in that, The image dataset is divided into a training set and a test set, with 75% used as the training set and 25% used as the test set.

7. The SAR image aircraft target detection method based on improved YOLOv5 as described in claim 1, characterized in that, It also includes the following steps: Set training parameters, train the detection model using the training set, obtain the trained model and weight file, and evaluate the performance of the trained model using the test set and evaluation metrics such as precision, recall, and F1 score.

8. The SAR image aircraft target detection method based on improved YOLOv5 as described in claim 7, characterized in that, The training parameters include: epoch of 100, lr of 0.01, momentum of 0.937, and batch size of 8. The loss function is constrained by regression localization loss and confidence loss. The objective function is optimized using stochastic gradient descent (SGD). The improved target detection algorithm YOLOv5 is evaluated by saving the best-performing weight parameters of the model in a file during training. After loading, the algorithm is tested on aircraft targets on the test set.

Citation Information

Patent Citations

  • Efficient SAR image ship target detection method based on codec

    CN113657252A

  • SAR (Synthetic Aperture Radar) image ship detection method based on improved Center Net network

    CN116071664A