SAR ship detection method based on anchor-free frame multi-scale feature enhancement
By adopting the multi-scale feature enhancement method and consistent label allocation strategy of the anchor-free framework in SAR ship detection, the problems of insufficient multi-scale feature extraction and sample definition in the existing technology are solved, and the detection performance is improved, especially in large-scale and detection accuracy in densely arranged scenarios.
Patent Information
- Application Number
- CN202410208545.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-26
- Publication Date
- 2024-08-23
AI Technical Summary
Existing SAR ship detection methods based on deep learning have deficiencies in multi-scale feature extraction and fusion, definition and allocation of positive and negative samples, resulting in poor detection performance, especially in large scenes and close-packed target detection near the coast. .
A multi-scale feature enhancement method based on an anchor-free framework is used to extract multi-scale features of SAR images through a multi-layer convolutional neural network, and a pyramid enhancement network with cross-layer fusion of adjacent features is used to enhance high-level semantic information and low-level positioning information, combining them consistently Sexually constrained label assignment strategy ensures consistent semantic expression and adapts to multi-scale target detection.
Effectively utilize high-level semantic information and low-level positioning information to avoid the aliasing effect of cross-scale feature fusion, improve the detection performance of densely arranged areas, and enhance the accuracy and consistency of target detection.
Smart Images

Figure CN118537585A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of synthetic aperture radar image processing, and in particular relates to a SAR ship detection method based on anchor-free framework multi-scale feature enhancement. Background Art
[0002] Synthetic Aperture Radar (SAR) has become one of the important means of land and sea monitoring due to its advantages of being unaffected by climate, all-day detection, strong penetration and long range. In the military and security fields, position detection of specific targets can effectively improve the coastal defense warning capability; in civilian fields such as fishery management and maritime monitoring, ship detection also plays an important role. The performance of ship target detection in SAR images directly affects the reliability of subsequent target recognition tasks. However, due to many factors such as interference from clutter in the monitoring environment, the scale diversity of ship targets, and the dense characteristics of ships near the coast, ship target detection in SAR images has always been a very challenging task.
[0003] With the vigorous development of deep learning technology, deep learning-based target detection methods have emerged in recent years. However, there are still many challenges in directly applying the existing advanced target detection framework to the SAR image ship detection task, especially the multi-scale targets in large scenes and the densely packed targets near the coast. To this end, in recent years, scholars have drawn on the FCOS anchor-free detection framework to conduct preliminary research on SAR target detection based on deep learning and have made initial progress. Existing anchor-free SAR ship target detection methods based on deep learning mainly focus on the fusion of multi-scale features and the improvement of the definition of positive and negative sample labels during model training.
[0004] Although the existing SAR ship detection methods based on deep learning have achieved good detection performance, they are still insufficient in solving the definition and allocation of positive and negative samples, multi-scale feature extraction and fusion, etc., resulting in the performance of the detection model not being optimal. Therefore, in order to further solve the above-mentioned problems, the present invention proposes a SAR ship detector based on the anchor-free detection framework and multi-scale feature enhancement. Summary of the invention
[0005] In view of the above problems in SAR ship detection, the present invention proposes a SAR ship detection method based on anchor-free framework multi-scale feature enhancement. First, the method uses a multi-layer convolutional neural network to extract multi-scale features of SAR image targets; then, based on the pyramid enhancement network of cross-layer fusion of adjacent features, the high-level semantic information and low-level positioning information of the feature layer are enhanced to better adapt to the multi-scale target detection task; finally, the label allocation strategy based on consistency constraints ensures that the semantic expression of ship targets is more consistent, which can provide more reasonable label division for densely arranged ships, thereby improving the overall detection performance.
[0006] In order to effectively fuse the multi-scale features of ships and avoid the semantic aliasing effect when cross-scale features are fused, the present invention proposes a pyramid enhancement network for cross-layer fusion of adjacent features, which reduces the multi-scale high-level semantic loss of adjacent feature layers and enhances the low-level positioning features of adjacent feature layers to facilitate multi-scale ship detection. In order to effectively cope with the challenge of dense detection of near-shore ships, a positive and negative sample label allocation mechanism based on consistent feature scale constraints is proposed. Specifically, positive samples are uniformly constrained and allocated to adjacent two-level feature layers according to the size of the ship to facilitate network training. For fuzzy samples in dense arrangement, the sample points are segmented according to the shortest distance from the sample points to the center points of different ships, so that the allocation of sample points is more in line with the contour characteristics of the ship, thereby improving the detection performance in dense scenes.
[0007] The technical solution of the present invention is: a SAR ship detection method based on anchor-free framework multi-scale feature enhancement, the method steps are as follows:
[0008] Step 1: Get the hierarchical feature maps {C2, C3, C4, C5} output by the backbone network, whose channel numbers are {256, 512, 1024, 2048} respectively, and the strides of the feature maps are {8, 16, 32, 64} relative to the original image;
[0009] Step 2: Perform top-down feature refinement and fusion based on channel attention and sub-pixel sampling features;
[0010] Step 2.1: The channel reduction of the traditional feature pyramid network leads to a large loss of semantic information. To this end, this method firstly builds a feature pyramid network and performs channel feature weighting on the features of each layer through the following formula to enhance important channel information:
[0011] C′ i =F SE (C i ) i=2,3,4,5
[0012] Among them, F SErepresents the channel weighting function, which uses the weighting function defined in the SENet network; C i ′ represents the feature map after channel weighting;
[0013] Step 2.2: Reduce the channels of the feature maps of each layer after channel weighting, and unify the number of output channels to 256 for subsequent feature fusion:
[0014] I i =Φ(C′ i ) i=2,3,4,5
[0015] Among them, I i represents the feature layer after channel reduction, Φ represents the convolution operation with a kernel size of 1×1;
[0016] Step 2.3: Based on the sub-pixel sampling method, the adjacent layer features of the channel-weighted feature map {C′3, C′4, C′5} and the channel-reduced feature layer {I2, I3, I4, I5} are fused: (1) To reduce the loss of high-level semantic information, sub-pixel convolution upsampling is introduced to replace the traditional 1×1 convolution channel reduction and nearest neighbor upsampling operations; (2) The convolution operation with a kernel size of 1×1 is used to adjust the channel dimension so that the feature channels of adjacent levels are the same for feature fusion; (3) To reduce the aliasing effect caused by cross-scale pixel fusion, fusion is only performed on two adjacent feature scales, and a convolution operation with a kernel size of 3×3 is used to further reduce the aliasing effect caused by the addition of feature map pixels;
[0017] Sub-pixel upsampling converts a low-resolution feature map into a high-resolution feature map by rearranging pixels in a specific order. 2 The features are rearranged into rH×rW×M, and sub-pixel upsampling can be expressed as:
[0018]
[0019] Where H and W are the feature map sizes, M is the number of channels, r is the upsampling factor, considering that upsampling operations are performed between adjacent feature layers, r = 2, mod(·, ·) represents the remainder operation, PS(C′) x,y,c Represents the output pixel at coordinates (x, y, c); represents the input pixel on the low-resolution feature map, represents the coordinates on the input feature map, M·r·mod(y,r)+M·mod(x,r)+c represents the channel number of the input feature map; the output feature map P i It is expressed as follows:
[0020]
[0021] Where Ψ represents a convolution operation with a kernel size of 3×3, Φ represents a convolution operation with a kernel size of 1×1, channels are reduced when i=4, and channels are expanded when i=2, and sub-pixel upsampling is combined to make the final number of feature channels equal to I i same;
[0022] Step 3: Input the fused feature map into the adjacent feature positioning enhancement submodule to achieve high-precision positioning of the target;
[0023] Step 3.1: Transform the low-level feature map P i-1 The convolution operation with a kernel size of 3×3 is converted to the high-level feature map P i The same size, and then the features between adjacent layers are concatenated through a series operation along the channel dimension to obtain the concatenated feature F i :
[0024] F i =Concat(P i ,Ψ stride=2 (P i-1 ))i=3,4,5
[0025] Where Concat(·) represents the feature concatenation operation; Ψ stride=2 represents a convolution operation with a kernel size of 3×3 and a stride of 2 to achieve downsampling so that the sizes of the feature maps of the two layers remain consistent;
[0026] Step 3.2: The feature map F is enhanced at the channel and spatial levels through the hybrid attention CBAM module. The enhanced feature map is F″; the operation of CBAM is expressed as:
[0027]
[0028]
[0029] Among them, M C is a one-dimensional channel attention map, M S is a two-dimensional spatial attention map;
[0030] Step 3.3: Perform a 1×1 convolution operation on F″ to reduce the channel, and add the residual to the input feature map P to obtain the fused 3, 4, and 5 layer feature maps R:
[0031] R i =P i +Φ(F″ i ) i=3,4,5
[0032] Step 3.4: Based on the 5th layer features, obtain the 6th and 7th layer features through convolution operations with a kernel size of 3×3:
[0033] R i =Ψ stride=2 (R i-1 ) i=6,7
[0034] Step 4: Detection head with consistent label assignment based on dense prediction;
[0035] Step 4.1: Map each sample point position (x, y) on the i-th level feature map to the original image coordinates. The mapping formula is as follows:
[0036]
[0037] Among them, s is the stride of the i-th level feature map;
[0038] Step 4.2: Get the distances from the sample point to the four sides of the left, right, top and bottom of all ground truth boxes (l * ,r * ,t * ,b * ), the ground truth box is the GT box, which determines whether the sample belongs to a certain GT box. If it does not belong to any GT box, it is set as a negative sample;
[0039] Step 4.3: Get the maximum width and height of the GT box where the sample point is located max(h * ,w * ), set the feature layer {R3, R4, R5, R6, R7} for max(h * ,w * ) are [0,128],[64,256],[128,512],[256,1024],[512,+∞] respectively. If a sample point falls into a GT box and the maximum width and height of the GT box meets the regression constraints of the feature layer, then the sample point is assigned as a positive sample in this feature layer:
[0040]
[0041] Among them, [m i-1 ,2m i ] is R i The regression constraints corresponding to the feature layer, is the label of the sample point in this layer, 1 represents a positive sample and 0 represents a negative sample. Since the regression constraint ranges of different feature layers overlap to a certain extent, the positive sample points corresponding to the same GT frame can be assigned as positive samples on two adjacent feature layers, and the sample points in the same GT frame of the same feature layer are constrained to be consistent, ensuring the consistency of the target semantic information during the training process;
[0042] Step 4.4: For fuzzy samples in the dense ship overlap area, the sampling points are assigned to the nearest GT frame according to the Euclidean distance from the sample point to the center point of each ship's GT frame, so that the label assignment is more consistent with the ship's contour characteristics;
[0043] Step 4.5: Combine the label assignment method with consistency constraints with the positive sample sampling strategy of center sampling to highlight the center area of the ship and avoid the influence of edge samples and background clutter on the detection performance;
[0044] Step 4.6: Use focal loss, GIoU loss and center loss to train the network. The loss function is defined as follows:
[0045]
[0046] Among them, N pos is the number of positive samples, If If the value is 1, then it is 0. cls represents the classification loss, using the focal loss function, c x,y Represents the confidence of the predicted sample label, represents the true value of the sample label, L reg Represents the regression loss, using the GIoU loss function, L cen represents the centrality loss, using the binary cross entropy loss function, and the centrality is defined as:
[0047]
[0048] Among them, l * , r * , t * , b * Represents the regression distance from the sample point (x, y) to the left, right, top and bottom edges of the GT box.
[0049] In summary, the beneficial effects of the present invention are:
[0050] The present invention designs a SAR image ship detection method based on anchor-free framework multi-scale feature enhancement. Compared with the currently widely used SAR target detection model based on deep learning, this method can more effectively utilize high-level semantic information and low-level positioning information through adjacent layer feature enhancement and cross-layer fusion, and avoid the aliasing effect during cross-scale feature fusion. Through the consistent constrained label assignment method, the positive sample points in the real frame can be consistently constrained on the adjacent feature layers, so that the allocation of fuzzy samples in densely arranged areas is more in line with the contour characteristics of the ship, which is more conducive to network training and improves target detection performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is the overall structure diagram of the present invention.
[0052] Figure 2 This is the structural diagram of the sub-pixel sampling adjacent feature fusion module.
[0053] Figure 3 A comparison chart between the consistency constraint label allocation method and the FCOS allocation method.
[0054] Figure 4 This is the visual comparison result of the present invention and other four methods on SSDD.
[0055] Figure 5 This is the visual comparison result of the present invention and other four methods on HRSID. DETAILED DESCRIPTION
[0056] The following will be a detailed description of the invention content of this article in combination with the accompanying drawings and specific implementation steps, so as to better reflect the technical points of the present invention. The present invention is a SAR ship detection method based on anchor-free framework multi-scale feature enhancement, the overall architecture is as follows Figure 1 As shown, each step is specifically implemented in the following manner:
[0057] Step 1: Get the hierarchical feature maps {C2, C3, C4, C5} output by the backbone network, whose channel numbers are {256, 512, 1024, 2048} respectively, and the strides of the feature maps are {8, 16, 32, 64} relative to the original image;
[0058] Step 2: Perform top-down feature refinement and fusion based on channel attention and sub-pixel sampling features;
[0059] Step 2.1: The channel reduction of the traditional feature pyramid network leads to a large loss of semantic information. To this end, based on the idea of the attention mechanism, this method first weights the channel features of each layer through the following formula to enhance important channel information:
[0060] C′ i =F SE (C i ) i=2,3,4,5
[0061] Among them, F SE represents the channel weighting function, which can adopt the weighting function defined in the SENet network.
[0062] Step 2.2: Reduce the channels of each layer of features after channel weighting, and unify the number of output channels to 256 for subsequent feature fusion:
[0063] I i =Φ(C′ i)i=2,3,4,5
[0064] Among them, I i It represents the feature layer after channel reduction, and Φ represents the convolution operation with a kernel size of 1×1.
[0065] Step 2.3: Based on the sub-pixel sampling method, the adjacent layer features of the channel weighted feature layer {C′3, C′4, C′5} and the channel reduced feature layer {I2, I3, I4, I5} are fused. Specifically, in order to reduce the loss of high-level semantic information, sub-pixel convolution upsampling is introduced to replace the traditional 1×1 convolution channel reduction and nearest neighbor upsampling operations; then, the convolution operation with a kernel size of 1×1 is used to adjust the channel dimension so that the adjacent level feature channels are the same for feature fusion; in order to reduce the aliasing effect caused by cross-scale pixel fusion, this method only fuses at adjacent feature scales, and uses a convolution operation with a kernel size of 3×3 to further reduce the aliasing effect caused by the addition of feature map pixels.
[0066] Sub-pixel upsampling converts a low-resolution feature map into a high-resolution feature map by rearranging pixels in a specific order. 2 The features are rearranged into rH×rW×M, and sub-pixel upsampling can be expressed as:
[0067]
[0068] Where H and W are the feature map sizes, M is the number of channels, r is the upsampling factor, considering that upsampling operations are performed between adjacent feature layers, r = 2, mod(·, ·) represents the remainder operation, PS(C′) x,y,c Represents the output pixel at coordinates (x, y, c); represents the input pixel on the low-resolution feature map, represents the coordinates on the input feature map, M·r·mod(y,r)+M·mod(x,r)+c represents the channel number of the input feature map; the output feature map P i It is expressed as follows:
[0069]
[0070] Where Ψ represents a convolution operation with a kernel size of 3×3, Φ represents a convolution operation with a kernel size of 1×1, channels are reduced when i=4, and channels are expanded when i=2. Combined with sub-pixel upsampling, the number of feature channels can be reduced to the same as I. i same;
[0071] Step 3: Input the fused feature map into the adjacent feature positioning enhancement submodule to achieve high-precision positioning of the target;
[0072] Step 3.1: Transform the low-level feature map P i-1 The convolution operation with a kernel size of 3×3 is converted to the high-level feature map P i The same size, and then concatenate the features between adjacent layers through a series operation along the channel dimension to obtain:
[0073] F i =Concat(P i ,Ψ stride=2 (P i-1 )) i=3,4,5
[0074] Among them, Concat(·) represents the feature concatenation operation, Ψ stride=2 Represents a convolution operation with a kernel size of 3×3 and a stride of 2 to achieve downsampling so that the sizes of the feature maps of the two layers remain consistent.
[0075] Step 3.2: The feature map F is enhanced at the channel and spatial levels through the hybrid attention CBAM module, and the enhanced feature map is F″. Mathematically, the operation of CBAM can be expressed as:
[0076]
[0077]
[0078] Among them, M C is a one-dimensional channel attention map, M S is a two-dimensional spatial attention map.
[0079] Step 3.3: Perform a 1×1 convolution operation on F″ to reduce the channel and add the residual to the input feature map P to obtain the fused 3, 4, and 5 layer feature maps R:
[0080] R i =P i +Φ(F″ i ) i=3,4,5
[0081] Step 3.4: Based on the 5th layer features, obtain the 6th and 7th layer features through convolution operations with a kernel size of 3×3:
[0082] R i =Ψ stride=2 (R i-1 ) i=6,7
[0083] Step 4: Detection head with consistent label assignment based on dense prediction;
[0084] Step 4.1: Map each sample point position (x, y) on the i-th level feature map to the original image coordinates. The mapping formula is as follows:
[0085]
[0086] Among them, s is the stride of the i-th level feature map;
[0087] Step 4.2: Get the distances (l * ,r * ,t * ,b * ), determine whether the sample belongs to a certain GT frame. If it does not belong to any GT frame, it is set as a negative sample;
[0088] Step 4.3: Get the maximum width and height of the GT box where the sample point is located max(h * ,w * ), set the feature layer {R3, R4, R5, R6, R7} for max(h * ,w * ) are [0,128],[64,256],[128,512],[256,1024],[512,+∞] respectively. If a sample point falls into a GT box and the maximum width and height of the GT box meets the regression constraints of a feature layer, then the sample point is assigned as a positive sample in this feature layer:
[0089]
[0090] Among them, [m i-1 ,2m i ] is R i The regression constraints corresponding to the feature layer, is the label of the sample point in this layer, 1 represents a positive sample and 0 represents a negative sample. Since the regression constraint ranges of different feature layers overlap to a certain extent, the positive sample points corresponding to the same GT frame can be assigned as positive samples on two adjacent feature layers, and the sample points in the same GT frame of the same feature layer are constrained to be consistent, ensuring the consistency of the target semantic information during the training process;
[0091] Step 4.4: For fuzzy samples in the dense ship overlap area, the sampling points are assigned to the nearest GT frame according to the Euclidean distance from the sample point to the center point of each ship's GT frame, so that the label assignment is more consistent with the ship's contour characteristics;
[0092] Step 4.5: Combine the label assignment method with consistency constraints with the positive sample sampling strategy of center sampling to highlight the center area of the ship and avoid the influence of edge samples and background clutter on the detection performance;
[0093] Step 4.6: Use focal loss, GIoU loss and center loss to train the network. The loss function is defined as follows:
[0094]
[0095] Among them, N pos is the number of positive samples, If If the value is 1, then it is 0. cls represents the classification loss, using the focal loss function, c x,y Represents the confidence of the predicted sample label, represents the true value of the sample label, L reg Represents the regression loss, using the GIoU loss function, L cen represents the centrality loss, using the binary cross entropy loss function, and the centrality is defined as:
[0096]
[0097] Among them, l * , r * , t * , b * Represents the regression distance from the sample point (x, y) to the left, right, top and bottom edges of the GT box.
[0098] The present invention will be described below in conjunction with examples:
[0099] 1. Simulation conditions
[0100] This simulation experiment is implemented on two public datasets: SSDD and HRSID.
[0101] The SSDD dataset selects image indexes with suffixes 1 and 9 as test data, and the rest are used for model training. In the experiment, each SAR image was resized to 800×600 pixels. The HRSID dataset was randomly divided into training and test datasets in a ratio of 13:7. The size of each SAR image in the experiment was resized to 1000×1000 pixels. The experiment was carried out on a server equipped with an NVIDIA GeForce RTX 3090Ti GPU and an AMD Ryzen 9 7950X 16-core processor CPU. All simulation experiments were implemented in Python using the PyTorch framework. In order to ensure the consistency of hyperparameter settings in the experiment, the MMDetection2.25.3 framework was selected for training and testing.
[0102] In order to comprehensively evaluate the performance of this method, two sets of evaluation standards, namely Pascal VOC and MS COCO standards, were used. Among them, Pascal VOC contains precision (P), recall (R) and F1 score indicators, which can comprehensively evaluate the false alarm and missed detection rates of the detector. MS COCO includes 6 indicators (MAP, AP50, AP75, APs, APm, APl), which are important indicators for evaluating the detection performance of this method for multi-scale ships. Among them, AP50 and AP75 represent the detection accuracy of the model when the IoU threshold is set to 0.5 and 0.75, respectively. MAP represents the average accuracy of the model when all values are taken within the threshold range of IoU=0.50:0.05:0.95. The three indicators of APs, APm and APl refer to the detection of small ships (area <32 2 pixels), medium ships (32 2 <Area<64 2 pixels) and large ships (area > 64 2 The detection accuracy of targets with different sizes (pixels) can more intuitively reflect the detection performance of the model for ship targets of different scales.
[0103] 2. Experimental content and results
[0104] Experiment 1: Verify the effectiveness of each sub-module in this method.
[0105] In order to verify the effectiveness of each submodule of the method, a series of ablation experiments were carried out on the SSDD dataset. The baseline method uses ResNet101 as the backbone network, feature pyramid network (FPN) and FCOS detection head. The backbone network of the present invention is consistent with that of the baseline method. The proposed method mainly includes a pyramid enhancement network for cross-layer fusion of adjacent features and a consistency constraint label allocation detection head. For simplicity, the modules in the baseline method are used to replace the corresponding modules in the proposed method, and the replaced methods are named model1 and model2 respectively. The results of the ablation experiment are shown in Table 1. From the experimental results in Table 1, it can be seen that the modules of the present method have been improved in all indicators compared with the baseline method, among which the comprehensive index AP has been improved by 3.1%, and the AP75 index has been improved by 5.5%. This preliminarily demonstrates the effectiveness of the modules of the proposed method in improving SAR ship detection.
[0106] In addition, in order to more intuitively verify the effectiveness of the label allocation mechanism, this simulation also conducts a visual analysis of the experimental results. Figure 3 As shown in the figure, the sample label values corresponding to different feature layers are converted into masks, and then covered to the area where the original image is located. The colored area is the positive sample, and the other areas are the negative samples. Different colors correspond to different GT boxes. Figure 3In the figure, the first line is the result of the label assignment method of FCOS, and the second line is the result of the label assignment method with consistency constraints. In contrast, the present invention can well ensure the consistency of the ship semantic information of adjacent feature layers, especially for the center area of the ship, and it can better cope with the densely arranged ship scene.
[0107] Experiment 2: Evaluate the effectiveness and generalization ability of the present invention.
[0108] In order to evaluate the effectiveness and generalization ability of the present invention, comparative experiments were conducted on SSDD and HRSID respectively. In the experiment, the four most advanced detection methods were compared, including Faster R-CNN in the two-stage method, ATSS in the one-stage method, and YOLOX and FCOS in the anchor-free method. Table 2 shows the experimental results of all methods on the SSDD dataset, and Table 3 shows the experimental results on the HRSID dataset. The experimental results in Table 2 show that YOLOX can be comparable to the present invention in large-scale target detection, and the present invention has the highest other indicators. Table 3 shows that the present invention has achieved the best in all evaluation indicators, especially in multi-scale ship detection. The detection effect of the present invention on small, medium and large ship targets reached 68.0%, 68.9% and 33.3% respectively, which is 1.8%, 3.9% and 16.4% higher than the best indicators of all comparison methods. The experimental results demonstrate that the present invention has better detection and generalization capabilities than the currently advanced SAR ship detection methods.
[0109] Experiment 3: Visual analysis of the detection performance of the present invention.
[0110] In order to further demonstrate the superiority of this method, the visualization detection results of the two datasets in this simulation experiment are as follows: Figure 4-5 As shown in the figure, the blue box, yellow box and red box represent the correct, missed and false alarm results respectively. The comparison methods include (a) Faster R-CNN, (b) YOLOX, (c) ATSS and (d) FCOS. The experiments were conducted in different scenarios. Figure 4 The detection results on the SSDD dataset are shown in Figure 1, which show the detection results of offshore ships, densely arranged ships, and offshore ships respectively. Figure 4 It can be seen from the visualization results that the present invention has fewer missed detections and false alarms. Figure 5 The detection results in river, nearshore and offshore scenes in the HRSID dataset are shown in Figure 2. Figure 5 The detection results show that in river scenes, the present invention has fewer missed detections and false alarms; in offshore scenes, the number of missed detections is the least, and in offshore scenes, the detection performance of this method is comparable to that of Faster R-CNN, reaching the best.
[0111] Table 1 Details of the ablation experiment of the present invention on SSDD
[0112] model1 Model2 P R F1 AP AP50 AP75 APs APm APl 93.9 92.5 93.2 58.9 94.3 67.2 55.1 65.3 57.4 √ 95.6 92.9 94.2 60.9 95.5 70.0 56.3 68.1 61.5 √ √ 95.9 93.0 94.4 62.0 96.3 72.7 57.2 69.2 66.4
[0113] Table 2 Details of the comparative experiments of the present invention and other four detection methods on SSDD
[0114] method P R F1 AP AP50 AP75 APs APm APl Faster R-CNN 94.9 90.8 92.8 59.6 94.4 69.9 55.8 65.7 60.4 ATSS 95.0 91.9 93.4 58.4 94.6 65.0 52.9 67.0 60.4 YOLOX 94.2 93.8 94.0 61.2 95.0 69.6 57.3 66.8 67.2 FCOS 93.9 92.5 93.2 58.9 94.3 67.2 55.1 65.3 57.4 The present invention 95.9 93.0 94.4 62.0 96.3 72.7 57.2 69.2 66.4
[0115] Table 3 Details of the comparative experiments of the present invention and other four detection methods on HRSID
[0116] method P R F1 AP AP50 AP75 APs APm APl Faster R-CNN 91.7 82.0 86.5 62.2 86.1 71.4 63.3 63.8 14.2 ATSS 89.9 78.7 84.0 61.5 86.3 68.8 62.6 65.0 16.9 YOLOX 90.8 77.8 83.8 62.8 85.8 71.9 66.2 51.8 1.7 FCOS 89.5 80.3 84.7 60.7 86.4 67.6 62.0 61.6 14.7 The present invention 92.2 83.9 87.3 66.4 90.3 75.4 68.0 68.9 33.3
Claims
1. A SAR ship detection method based on anchor-free framework multi-scale feature enhancement, the method steps are as follows: Step 1: Get the hierarchical feature maps {C2, C3, C4, C5} output by the backbone network, whose channel numbers are {256, 512, 1024, 2048} respectively, and the strides of the feature maps are {8, 16, 32, 64} relative to the original image; Step 2: Perform top-down feature refinement and fusion based on channel attention and sub-pixel sampling features; Step 3: Input the fused feature map into the adjacent feature positioning enhancement submodule to achieve high-precision positioning of the target; Step 3.1: Transform the low-level feature map P i-1 The convolution operation with a kernel size of 3×3 is converted to the high-level feature map P i The same size, and then the features between adjacent layers are concatenated through a series operation along the channel dimension to obtain the concatenated feature F i : F i =Concat(P i ,Ψ stride=2 (P i-1 ))i=3,4,5 in, Concat(·) represents the feature concatenation operation; Ψ stride=2 represents a convolution operation with a kernel size of 3×3 and a stride of 2 to achieve downsampling so that the sizes of the feature maps of the two layers remain consistent; Step 3.2: The feature map F is enhanced at the channel and spatial levels through the hybrid attention CBAM module. The enhanced feature map is F″; the CBAM operation is expressed as: Among them, M C is a one-dimensional channel attention map, M S is a two-dimensional spatial attention map; Step 3.3: Perform a 1×1 convolution operation on F″ to reduce the channel, and add the residual to the input feature map P to obtain the fused 3, 4, and 5 layer feature maps R: R i =P i +Φ(F″ i )i=3,4,5 Step 3.4: Based on the 5th layer features, obtain the 6th and 7th layer features through convolution operations with a kernel size of 3×3: R i =Ψ stride=2 (R i-1 )i=6,7 Step 4: Assign detection head based on the consistency constraint label of dense prediction; Step 4.1: Map the position (x, y) of each sample point on the i-th level feature map to the original image coordinates. The mapping formula is as follows: Among them, s is the stride of the i-th level feature map; Step 4.2: Get the distances from the sample point to the four sides of the left, right, top and bottom of all ground truth boxes (l * ,r * ,t * ,b * ), the ground truth box is the GT box, which determines whether the sample belongs to a certain GT box. If it does not belong to any GT box, it is set as a negative sample; Step 4.3: Get the maximum width and height of the GT box where the sample point is located max(h * ,w * ), set the feature layer {R3, R4, R5, R6, R7} for max(h * ,w * ) are [0,128],[64,256],[128,512],[256,1024],[512,+∞] respectively. If a sample point falls into a GT box and the maximum width and height of the GT box meets the regression constraints of the feature layer, then the sample point is assigned as a positive sample in this feature layer: Among them, [m i-1 ,2m i ] is R i The regression constraints corresponding to the feature layer, is the label of the sample point in this layer, 1 represents a positive sample and 0 represents a negative sample. Since the regression constraint ranges of different feature layers overlap to a certain extent, the positive sample points corresponding to the same GT frame can be assigned as positive samples on two adjacent feature layers, and the sample points in the same GT frame of the same feature layer are constrained to be consistent, ensuring the consistency of the target semantic information during the training process; Step 4.4: For the fuzzy samples in the dense ship overlap area, the sampling points are assigned to the nearest GT frame according to the Euclidean distance from the sample point to the center point of each ship's GT frame, so that the label assignment is more consistent with the ship's contour characteristics; Step 4.5: Combine the label assignment method with consistency constraints with the positive sample sampling strategy of center sampling to highlight the center area of the ship and avoid the influence of edge samples and background clutter on the detection performance; Step 4.6: Use focal loss, GIoU loss and center loss to train the network. The loss function is defined as follows: Among them, N pos is the number of positive samples, If If the value is 1, then it is 0. cls represents the classification loss, using the focal loss function, c x,y Represents the confidence of the predicted sample label, represents the true value of the sample label, L reg Represents the regression loss, using the GIoU loss function, L cen represents the centrality loss, using the binary cross entropy loss function, and the centrality is defined as: Among them, l * , r * , t * , b * Represents the regression distance from the sample point (x, y) to the left, right, top and bottom edges of the GT box.
2. The SAR ship detection method based on anchor-free framework multi-scale feature enhancement as claimed in claim 1, characterized in that: The specific method of step 2 is: Step 2.1: Establish a feature pyramid network and weight the channel features of each layer by the following formula to enhance important channel information: C′ i =F SE (C i )i=2,3,4,5 Among them, F SE represents the channel weighting function, which uses the weighting function defined in the SENet network; C′ i Represents the channel-weighted feature map; Step 2.2: Perform channel reduction on the channel-weighted feature maps of each layer for subsequent feature fusion: I i =Φ(C′ i )i=2,3,4,5 Among them, I i represents the feature layer after channel reduction, Φ represents the convolution operation with a kernel size of 1×1; Step 2.3: Based on the sub-pixel sampling method, adjacent layer features are fused for the channel-weighted feature maps {C′3, C′4, C′5} and the channel-reduced feature layers {I2, I3, I4, I5}; Sub-pixel upsampling converts the low-resolution feature map into a high-resolution feature map by rearranging pixels in a specific order. 2 The features are rearranged into rH×rW×M, and sub-pixel upsampling can be expressed as: Where H and W are the feature map sizes, M is the number of channels, r is the upsampling factor, considering that upsampling operations are performed between adjacent feature layers, r = 2, mod(·, ·) represents the remainder operation, PS(C′) x,y,c Represents the output pixel at coordinates (x, y, c); represents the input pixel on the low-resolution feature map, represents the coordinates on the input feature map, M·r·mod(y,r)+M·mod(x,r)+c represents the channel number of the input feature map; the output feature map P i It is expressed as follows: Where Ψ represents a convolution operation with a kernel size of 3×3, Φ represents a convolution operation with a kernel size of 1×1, channels are reduced when i=4, and channels are expanded when i=2, and sub-pixel upsampling is combined to make the final number of feature channels equal to I i same.
3. The SAR ship detection method based on anchor-free framework multi-scale feature enhancement as claimed in claim 2, characterized in that: In the sub-pixel sampling method in step 2.3: (1) sub-pixel convolution upsampling is introduced to replace the traditional 1×1 convolution channel reduction and nearest neighbor upsampling operations; (2) the convolution operation with a kernel size of 1×1 is used to adjust the channel dimension so that the feature channels of adjacent levels are the same for feature fusion; (3 Only two adjacent feature scales are fused, and a convolution operation with a kernel size of 3×3 is used.
4. The SAR ship detection method based on anchor-free framework multi-scale feature enhancement as claimed in claim 2, characterized in that: The number of channels after channel reduction of each layer feature map after channel weighting is 256.
