A directed target detection method to improve SAR ship target detection accuracy
By adding a small object detection layer and EMA attention mechanism to the YOLOv5 model, combined with angle classification and circular smooth label processing, the problem of low detection accuracy of ship small objects in SAR images is solved, significantly improving the detection accuracy and recall rate.
Patent Information
- Application Number
- CN202411345547.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The detection accuracy of small targets of ships in SAR images is low, which is easy to be confused with land buildings. The existing algorithms are insufficient in fusion of multi-level features, resulting in more missed detections.
Add a small object detection layer and EMA attention mechanism in the YOLOv5 model, and convert the angle information into angle classification, and use circular smooth labels and window functions for angle prediction processing to enhance the model's detection ability of small objects.
It improves the accuracy and recall rate of SAR ship target detection, improves the model's detection performance on small targets, and achieves better detection results.
Smart Images

Figure CN118861190B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of synthetic aperture radar target detection, and in particular to a directional target detection method for improving SAR ship target detection accuracy. Background Art
[0002] In the current large data volume environment, deep learning technology has been rapidly developed, among which the end-to-end target detector represented by the YOLO series is more widely used in SAR image detection. It directly obtains more target information from the original image through layer-by-layer learning and autonomous feature extraction capabilities, and has good robustness in dealing with complex scene problems. YOLOv5 is a relatively mature and stable model in the current YOLO series, with high accuracy and fast inference speed, which can meet the needs of SAR image target detection. Therefore, the present invention is improved based on the YOLOv5 model.
[0003] SAR images are different from optical images. Their special imaging principle makes the edges of smaller targets in ships blurred, the imaging area is limited, and the detailed information is difficult to capture. The model is difficult to obtain effective feature representation of the target area. In near-shore scenes, it is easy to be confused with land buildings, resulting in poor detection results. Most existing algorithms do not fully utilize the information of small-sized targets, and there is still room for improvement in the fusion of multi-level features. There are still many cases of missed detection of small ship targets in any direction. Therefore, improving the accuracy of ship target detection in SAR images is of great research significance. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a directional target detection method for improving the accuracy of SAR ship target detection in view of the defects involved in the background technology.
[0005] In order to achieve the above object, the present invention provides the following technical solution: a directed target detection method for improving the accuracy of SAR ship target detection, the specific steps comprising:
[0006] Step 1: Obtain the RSDD-SAR dataset, select all SAR images and target coordinate information, angle information and category labels in the RSDD-SAR dataset, and construct a training sample set and a test sample set;
[0007] Step 2: Build a YOLOv5 target detection model. The YOLOv5 target detection model includes a backbone network, a neck network, and a detection head. Add a small target detection layer to the neck network, introduce the EMA attention mechanism, and add a detection head to obtain an improved YOLOv5 target detection model.
[0008] Step 3: Input the training sample set into the improved YOLOv5 target detection model for training to obtain the model training weights;
[0009] Step 4: Input the test sample set into the trained YOLOv5 target detection model to obtain the corresponding target detection results;
[0010] Step 5. When introducing the angle information into the YOLOv5 target detection model, the angle prediction is converted into angle classification in the directional detection part, a circular smooth label is used, and the predicted angle and the true angle are smoothed by a window function to measure the angle distance, thereby realizing angle prediction and calculating the angle loss.
[0011] Preferably, the training sample set and the test sample set are constructed in a ratio of 5:2.
[0012] Preferably, the backbone network is composed of CSP-Darknet53, which is used to extract rich feature information, and CSP is used to improve the detection performance and speed of the model. The neck network is composed of FPN and PAN structures, and the model's detection ability for targets of different scales is improved through multi-level feature fusion. Since most ship targets in SAR images are small in area, the three sets of feature layers of the original model cannot well extract the shallow features of small ship targets. Therefore, the small target detection layer is added to the neck structure to extract the feature map information of 160*160 pixels and obtain the lower-level information of the SAR image to solve the problem of small target information loss in high-level features. A new set of smaller anchor frames are set up for detection of the newly added detection layer, with sizes of 4*5 pixels, 8*10 pixels and 22*18 pixels, so as to enrich the model's perception range of small targets and extract shallower convolution features to capture the detailed information of small ship targets. The EMA attention mechanism introduced at the 160*160 pixels, 80*80 pixels, 40*40 pixels and 20*20 pixels feature maps is to capture the relationship between each pixel of the image and the surrounding pixels, and highlight the semantic and structural information of the entire image.
[0013] Preferably, the small target detection layer network includes an F_1 input layer, an F_2 input layer, an F_3 input layer, and an F_4 input layer, and each output layer includes an Out_1 layer, an Out_2 layer, an Out_3 layer, and an Out_4 layer, wherein:
[0014] The F_1 input layer, F_2 input layer, F_3 input layer, and F_4 input layer are feature maps of 160*160 pixels, 80*80 pixels, 40*40 pixels, and 20*20 pixels in the YOLOv5 model backbone network respectively;
[0015] The Out_1 layer is obtained by concatenating the F_1 input layer and the upsampled F_2 input layer, and passing through the C3 and EMA_1 modules;
[0016] The Out_2 layer is obtained by concatenating the output of the EMA_1 module with the F_2 input layer after convolution Conv, and then passing through the C3 and EMA_2 modules;
[0017] The Out_3 layer is obtained by concatenating the output of the EMA_2 module with the F_3 input layer after convolution Conv, and then passing through the C3 and EMA_3 modules;
[0018] The Out_4 layer is obtained by concatenating the output of the EMA_3 module with the F_4 input layer after convolution Conv, and then passing through the C3 and EMA_4 modules;
[0019] At the detection head, after extracting feature information from the 160*160 feature map, the content of Out_1 is transmitted to the detection head for detection;
[0020] Among them, C3 is the process of dividing the input feature map into two parts and performing convolution and normalization respectively, and then merging the processed feature maps together.
[0021] Preferably, the window function in step 5 is a Gaussian function.
[0022] Preferably, the angle classification loss in step 5 is calculated as follows:
[0023] Use the binary cross entropy loss function to calculate the class probability loss , confidence loss and angle class loss , use CIoU Loss to calculate the bounding box loss , the total network loss is .
[0024] Preferably, the circle smooth label expression is:
[0025] ;
[0026] in, is the actual angle of the current rotation box, yes 180 degrees of angle value, is the radius of the Gaussian window function.
[0027] The present invention has the following advantages:
[0028] The directional target detection method for improving the SAR ship target detection accuracy disclosed in the present invention verifies and evaluates the performance improvement effect of the improved module by adopting the ablation experimental analysis method. It refers to the average accuracy when the intersection-and-union ratio threshold is set to 0.5. P refers to the proportion of all positive samples predicted by the classifier to be actually positive, that is, the accuracy. R refers to the proportion of samples that are actually positive that are predicted by the classifier to be positive, that is, the recall. The average accuracy of adding only the small target detection layer has been improved, proving that it has a certain effect on the detection of small targets; when only EMA is added, the detection result is greatly reduced; the present invention combines the two methods and makes full use of the advantages of both, and can combine P, R and The improvements were 0.9%, 4.1% and 6% respectively, achieving better detection results.
[0029] In the comparative experiment, the detection results of adding EMA attention mechanism only at three detection layers and adding EMA mechanism at four detection layers were compared. The results are improved by 10.3%, 5.2% and 10.5% respectively, with better results. Secondly, the detection accuracy of the current advanced detection models of rotated targets, Rotated FCOS, Oriented RCNN, BBAVectors and the ES-YOLOv5 model of the present invention on the test set is compared. The accuracy and recall of Rotated FCOS are slightly higher than those of the other two methods, but the average accuracy is slightly lower. The detection accuracy of the Oriented RCNN and BBAVectors models are relatively close, but both are lower than the ES-YOLOv5 model, which are 4.4%, 2.3% and 1.8% higher than these three models respectively. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a schematic diagram of the model after adding a small target detection layer and an EMA attention mechanism in the present invention. DETAILED DESCRIPTION
[0031] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] This embodiment provides a directed target detection method for improving the accuracy of SAR ship target detection. To address the practical problem that conventional feature extraction methods cannot accurately learn the features of small ship targets in SAR images, based on the relatively mature YOLOv5 algorithm, a small target detection layer is added to the neck of the network, an EMA attention mechanism is introduced, and angle prediction is converted into angle classification in the directed detection part. The circular smoothing label method is used to smooth the angle to make the angle prediction more accurate.
[0033] Step 1: Obtain the RSDD-SAR dataset, select all SAR images in the RSDD-SAR dataset as well as target coordinate information, angle information, and category labels, and construct a training sample set and a test sample set in a ratio of 5:2;
[0034] Step 2: Build the YOLOv5 target detection model, which is mainly composed of three parts: backbone network, neck network and detection head. Add a small target detection layer to the neck network, introduce the EMA attention mechanism, and add a detection head.
[0035] Step 3: Input the training set into the improved YOLOv5 target detection model for training to obtain the model training weights;
[0036] Step 4: Input the test set into the trained YOLOv5 target detection model to obtain the corresponding target detection results;
[0037] Furthermore, in step 1, the RSDD-SAR dataset contains 10,263 ship targets. The ship targets have arbitrary rotation directions and are relatively evenly distributed in the angle range of -90° to 90°. There are almost no large targets, the proportion of medium targets is 40.04%, and the proportion of small targets is more significant, accounting for 59.88%.
[0038] Furthermore, in step 2, the backbone network of the original model is composed of CSP-Darknet53, which is used to extract rich feature information, and CSP is used to improve the detection performance and speed of the model. The neck network is composed of FPN and PAN structures, and the model's detection ability for targets of different scales is improved through multi-level feature fusion. The three detection heads in the head network are used to implement detection tasks, including classification and positioning. Since most ship targets in SAR images are small in area, the three feature layers of the original model cannot well extract the shallow features of small ship targets. Therefore, a small target detection layer is added to the neck structure to extract the feature map information of 160*160 pixels and obtain the lower-level information of the SAR image to solve the problem of small target information loss in high-level features. In addition, a new set of smaller anchor frames is set up for the detection of the newly added detection layer, with sizes of 4*5 pixels, 8*10 pixels and 22*18 pixels, so as to enrich the model's perception range of small targets, extract shallower convolution features, and capture the detailed information of small ship targets. The EMA attention mechanism introduced at the 160*160 pixel, 80*80 pixel, 40*40 pixel, and 20*20 pixel feature maps is to capture the relationship between each pixel of the image and the surrounding pixels, and highlight the semantic and structural information of the entire image. Figure 1As shown, the YOLOv5 target detection model includes an F_1 input layer, an F_2 input layer, an F_3 input layer, and an F_4 input layer, and the output layer of the YOLOv5 target detection model includes an Out_1 layer, an Out_2 layer, an Out_3 layer, and an Out_4 layer, wherein the F_1 input layer, the F_2 input layer, the F_3 input layer, and the F_4 input layer are feature maps of 160*160 pixels, 80*80 pixels, 40*40 pixels, and 20*20 pixels extracted from the YOLOv5 model backbone network, respectively; the small target detection layer is input through the F_1 input layer and the F_2 input layer, and the output of the small target detection layer is through the Out_1 layer;
[0039] The Out_1 layer is obtained by concatenating F_1 with upsampled F_2, and then passing through the C3 and EMA mechanisms; the Out_2 layer is obtained by concatenating the output of EMA_1 with F_2 after convolution, and then passing through the C3 and EMA mechanisms; the Out_3 layer is obtained by concatenating the output of EMA_2 with F_3 after convolution, and then passing through the C3 and EMA mechanisms; the Out_4 layer is obtained by concatenating the output of EMA_3 with F_4 after convolution, and then passing through the C3 and EMA mechanisms. Among them, C3 divides the input feature map into two parts and performs convolution and normalization respectively, and then merges the processed feature maps together; at the detection head, after extracting feature information from the 160*160 pixel feature map, the content of Out_1 is transmitted to the detection layer for detection.
[0040] Furthermore, when the angle information is introduced into the network model, a circular smooth label method is used, and the discreteness is set to 1, that is, 1 degree is one category, and there are 180 categories in total. The Gaussian function is set as the window function to smooth the predicted angle and the true angle to measure the angle distance. The closer to the true angle, the higher the weight corresponding to the category, thereby achieving a more robust angle prediction. The circular smooth label expression is:
[0041] ;
[0042] in, is the actual angle of the current rotation box, yes 180 degrees of angle value, is the radius of the Gaussian window function.
[0043] Since this embodiment decouples the rotation bounding box information into two parts: angle category information and bounding box parameter information, the network model loss needs to add angle classification loss. Use the binary cross entropy loss function to calculate the category probability loss , confidence loss and angle class loss , use CIoU Loss to calculate the bounding box loss , the total network loss is .
[0044] Furthermore, in step 3, the ES-YOLOv5 network model involved was experimentally verified using the Ubuntu 18.04 system as the experimental platform, and the GPU model used was NVIDIA GeForce RTX 2080. The deep learning framework for network training was Pytorch1.8.1, and the Adam optimizer was used. The initial learning rate was set to 0.001, and the learning rate was decayed at a linear learning rate, and the weight decay was set to 0.0005. The ratio of the positive and negative sample weights for calculating the angle classification loss was set to 1.0, and the weight of the angle classification loss was 0.1. The main evaluation indicators adopted were accuracy (P), recall (R), and average precision (AP). As a comprehensive evaluation index, it is used to evaluate the effect of ship detection. The average accuracy when the intersection-and-union threshold is set to 0.5.
[0045] In order to verify and evaluate the performance improvement effect of the improved module, two methods, ablation experiment analysis and comparative test analysis, were used. Table 1 is the result of the ablation experiment analysis, showing the comparison of the detection effect of the original YOLOv5 network, the network with only a small target detection layer added, the network with only an EMA attention mechanism added, the network without the CSL method added, and the improved network designed in this embodiment.
[0046] Table 1 Ablation experiment analysis
[0047]
[0048] Note:" " indicates adding corresponding content, blank indicates not adding, and bold part indicates the best result.
[0049] Table 1 shows that the average precision of adding only the small target detection layer is improved, which proves that it has a certain effect on the detection of small targets; when only EMA is added, the detection results are greatly reduced, which may be that the attention mechanism mistakenly ignores important features or strengthens useless features, thereby weakening the model performance; when the traditional angle classification is used instead of the CSL angle classification method, the detection results are also less ideal; the present invention combines the three methods and makes full use of their advantages to combine P, R and The improvements were 0.9%, 4.1% and 6% respectively, achieving better detection results.
[0050] In the comparative test, the detection results of adding EMA attention mechanism only at three detection layers and adding EMA mechanism at four detection layers are compared, as shown in Table 2. The network with EMA modules added only at the positions of 80*80, 40*40 and 20*20 feature layers and no EMA attention module at the 160*160 feature layer is denoted as A; the improved network ES-YOLOv5 proposed in the present invention is denoted as B. As can be seen from Table 2, the detection results of P, R and The results are better with increases of 10.3%, 5.2% and 10.5% respectively.
[0051] Table 2 Network A and B test results
[0052]
[0053] Under the condition of ensuring the same algorithm training data set, the ES-YOLOv5 model is compared with the current advanced rotation target detection models Rotated FCOS, Oriented RCNN, and BBAVectors. The results are shown in Table 3 below.
[0054] Table 3 Experimental results of different algorithms on RSDD-SAR dataset
[0055]
[0056] The accuracy and recall of Rotated FCOS are slightly higher than those of the other two methods, but the average accuracy is slightly lower. The detection accuracy of Oriented RCNN and BBAVectors models is close, but both are lower than that of ES-YOLOv5 model. The results are 4.4%, 2.3% and 1.8% higher than those of the three models, respectively. This result proves the rationality and superiority of the model designed in this embodiment.
[0057] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A directed target detection method for improving SAR ship target detection accuracy, characterized by: The specific steps include: Step 1: Obtain the RSDD-SAR dataset, select all SAR images and target coordinate information, angle information and category labels in the RSDD-SAR dataset, and construct a training sample set and a test sample set; Step 2: Build a YOLOv5 target detection model. The YOLOv5 target detection model includes a backbone network, a neck network, and a detection head. Add a small target detection layer to the neck network, introduce the EMA attention mechanism, and add a detection head to obtain an improved YOLOv5 target detection model. The backbone network is composed of CSP-Darknet53, the neck network is composed of FPN and PAN structures, and the small target detection layer is added in the neck network to extract the feature map information of 160*160 pixels and obtain the lower-level information of the SAR image; a set of anchor frames are set for the detection of the newly added small target detection layer to capture the detailed information of the small target of the ship, and then the EMA attention mechanism is introduced at the feature maps of 160*160 pixels, 80*80 pixels, 40*40 pixels and 20*20 pixels; The YOLOv5 target detection model includes F_1 input layer, F_2 input layer, F_3 input layer, and F_4 input layer. The output layer of the YOLOv5 target detection model includes Out_1 layer, Out_2 layer, Out_3 layer, and Out_4 layer, where: The F_1 input layer, F_2 input layer, F_3 input layer, and F_4 input layer are feature maps of 160*160 pixels, 80*80 pixels, 40*40 pixels, and 20*20 pixels in the YOLOv5 model backbone network respectively; The small target detection layer is input through the F_1 input layer and the F_2 input layer, and the output of the small target detection layer is through the Out_1 layer; The Out_1 layer is obtained by concatenating the F_1 input layer and the upsampled F_2 input layer, and passing through the C3 and EMA_1 modules; The Out_2 layer is obtained by concatenating the output of the EMA_1 module with the F_2 input layer after convolution Conv, and then passing through the C3 and EMA_2 modules; The Out_3 layer is obtained by concatenating the output of the EMA_2 module with the F_3 input layer after convolution Conv, and then passing through the C3 and EMA_3 modules; The Out_4 layer is obtained by concatenating the output of the EMA_3 module with the F_4 input layer after convolution Conv, and then passing through the C3 and EMA_4 modules; At the detection head, after extracting feature information from the 160*160 feature map, the content of Out_1 is transmitted to the detection head for detection; Among them, C3 is the process of dividing the input feature map into two parts and performing convolution and normalization respectively, and then merging the processed feature maps together; Step 3: Input the training sample set into the improved YOLOv5 target detection model for training to obtain the model training weights; Step 4: Input the test sample set into the trained YOLOv5 target detection model to obtain the corresponding target detection results; Step 5. When introducing the angle information into the YOLOv5 target detection model, the angle prediction is converted into angle classification in the directional detection part, a circular smooth label is used, and the predicted angle and the true angle are smoothed by a window function to measure the angle distance, thereby realizing angle prediction and calculating the angle loss.
2. According to claim 1, a directed target detection method for improving SAR ship target detection accuracy is characterized by: In step 1, the training sample set and the test sample set are constructed in a ratio of 5:
2.
3. The method for directional target detection for improving SAR ship target detection accuracy according to claim 1, characterized in that: The window function in step 5 adopts a Gaussian function.
4. The method for directional target detection for improving SAR ship target detection accuracy according to claim 1, characterized in that: The angle classification loss in step 5 is calculated as follows: Use the binary cross entropy loss function to calculate the class probability loss , confidence loss and angle class loss , use CIoU Loss to calculate the bounding box loss , the total network loss is .
5. The method for directional target detection for improving SAR ship target detection accuracy according to claim 1, characterized in that: The circle smoothing label expression is: ; in, is the actual angle of the current rotation box, yes 180 degrees of angle value, is the radius of the Gaussian window function.
Citation Information
Patent Citations
Geographic information visualization analysis system for high-score remote sensing images
CN109165272A
Remote sensing image marine ship identification system and method based on improved YOLOv4 algorithm
CN113920436A
SAR (Synthetic Aperture Radar) image ship detection method based on improved Center Net network
CN116071664A
Contextual visual-based SAR target detection method and apparatus, and storage medium
US20230184927A1
Method for enhancing SAR image data for ship target detection
WO2023050746A1
