SAR ship target detection method and device based on multilayer non-maximum suppression

By employing a multi-level nonmaximum suppression method, multi-scale cropping and segmentation of large-scene SAR images are combined with multi-level NMS processing, which solves the problems of differences in detection box size and shape and sidelobe effect, and achieves high-precision ship target detection.

CN121010752APending Publication Date: 2025-11-25BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511045355.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing technologies for target detection in large-scene SAR images suffer from problems such as differences in the size and shape of detection boxes caused by block slicing, blurring caused by sidelobe effects, and the inability of traditional nonmaximum suppression methods to effectively remove redundant detection boxes, resulting in low detection accuracy.

Method used

A multi-level nonmaximum suppression method is adopted, which improves detection accuracy by multi-scale cropping and segmentation, first-level NMS processing to remove redundant boxes of the same slice, second-level NMS processing to remove overlapping areas and incomplete boxes at the edge position, and third-level NMS processing to remove redundant boxes of different scales.

Benefits of technology

It effectively improves the detection accuracy and recall rate of SAR ship targets in large scenes, enhances detection precision, and eliminates the need to retrain the detection network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010752A_ABST
    Figure CN121010752A_ABST
Patent Text Reader

Abstract

The invention discloses an SAR ship target detection method and device based on multilayer non-maximum suppression, and belongs to the technical field of SAR image intelligent processing. The method comprises the following steps: carrying out multi-scale overlapped cutting and blocking on a to-be-detected SAR image to obtain multi-scale SAR slices; outputting a target detection result for each slice by using a pre-trained SAR ship target detection network; carrying out first-stage NMS processing on each slice so as to screen out redundant detection frames on the slice; on the basis of the first NMS processing result, second-level NMS processing is carried out on the slices under each scale, so that redundant detection frames located in an overlapping area and incomplete detection frames located at the edge position in the slices under the scale are screened out; and on the basis of the second NMS processing result, carrying out third-stage NMS processing on the residual detection frames at the same time so as to screen out redundant detection frames under different scales and obtain a final target detection result for the to-be-detected SAR image. According to the invention, the target detection precision can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent SAR image processing technology, and in particular to a SAR ship target detection method and device based on multi-layer nonmaximum suppression. Background Technology

[0002] With the rapid development of ship target detection technology using spaceborne synthetic aperture radar (SAR), detection methods based on deep learning models have achieved significant breakthroughs. In actual detection tasks, the size of spaceborne SAR images is large, while the size of the input image of the model is small. To avoid missing detections due to targets being located at the edge of slices, block cropping with overlapping areas is usually adopted. The slices are detected first, and then the results are merged. However, traditional block detection has the following problems: (1) The target size of the slices differs from the target size of the model training set image, resulting in domain knowledge bias; (2) If the same target is detected on multiple slices, and the target is located at the edge of a slice, the size and shape of the target's detection box may differ significantly due to edge truncation; (3) The SAR sidelobe effect changes the outline of the ship target, causing some ambiguity in the target's detection box location, which also leads to significant differences in the size of the target detection box in multiple slices.

[0003] Currently, existing post-processing methods for large-scene SAR target detection mainly apply uniform non-maximum suppression (NMS) based on the intersection over union (IoU) of the detection boxes in the block detection results. This results in targets located at the edge of the slice having incomplete detection boxes or multiple detection boxes. However, the detection accuracy still needs to be improved. Summary of the Invention

[0004] This invention provides a SAR ship target detection method and apparatus based on multi-layer nonmaximum suppression. The technical solution is as follows:

[0005] On the one hand, a SAR ship target detection method based on multi-layer nonmaximum suppression is provided, the method comprising:

[0006] The SAR image to be detected is cropped into blocks with overlapping dimensions at multiple scales to obtain multi-scale SAR slices.

[0007] Using a pre-trained SAR ship target detection network, target detection results are output for each slice;

[0008] For each slice, a first-level NMS process is performed to remove redundant detection boxes on that slice, thus obtaining the first NMS processing result;

[0009] Based on the first NMS processing result, a second-level NMS processing is performed on each slice at each scale to filter out redundant detection boxes in the overlapping area and incomplete detection boxes at the edge position in the slice at that scale, thus obtaining the second NMS processing result.

[0010] Based on the results of the second NMS processing, a third-level NMS processing is performed on all remaining detection boxes to filter out redundant detection boxes at different scales, thus obtaining the final target detection result for the SAR image to be detected.

[0011] On the other hand, a SAR ship target detection device based on multi-layer nonmaximum suppression is provided, the device comprising:

[0012] The cropping unit is used to crop and divide the SAR image to be detected into multi-scale overlapping blocks to obtain multi-scale SAR slices.

[0013] The detection unit is used to output target detection results for each slice using a pre-trained SAR ship target detection network.

[0014] The first processing unit is used to perform first-level NMS processing on each slice to remove redundant detection boxes on the slice and obtain the first NMS processing result.

[0015] The second processing unit is used to perform a second-level NMS processing on each slice at each scale based on the first NMS processing result, so as to filter out redundant detection boxes located in the overlapping area and incomplete detection boxes at the edge position in the slice at that scale, and obtain the second NMS processing result.

[0016] The third processing unit is used to perform a third-level NMS process on all remaining detection boxes based on the second NMS processing result, so as to filter out redundant detection boxes at different scales and obtain the final target detection result for the SAR image to be detected.

[0017] On the other hand, a computer device is provided, the computer device including a memory and a processor, the memory for storing computer programs, and the processor for executing the computer programs stored in the memory to implement the steps of the SAR ship target detection method based on multi-layer nonmaximum suppression described above.

[0018] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of the SAR ship target detection method based on multi-layer nonmaximum suppression described above.

[0019] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the SAR ship target detection method based on multi-layer nonmaximum suppression described above.

[0020] The technical solution provided by this invention can bring at least the following beneficial effects:

[0021] By employing multi-scale cropping and segmentation for detection, the accuracy for detecting both large and small targets is improved compared to traditional single-scale detection. Firstly, non-maximum suppression (NMS) processing on each slice removes redundant detection boxes on the same slice. Secondly, NMS processing on detection boxes at each scale removes redundant detection boxes in overlapping areas and incomplete detection boxes at edges. Thirdly, cross-scale NMS processing on the remaining detection boxes removes redundant detection boxes at different scales. Therefore, through three layers of non-maximum suppression, the accuracy and recall rate of SAR ship target detection in large scenes can be effectively improved without retraining the SAR ship target detection network, thus enhancing detection precision. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a SAR ship target detection method based on multi-layer nonmaximum suppression provided by an embodiment of the present invention;

[0024] Figure 2 This is a schematic diagram of cropping a SAR image to be detected according to three different scales, provided by an embodiment of the present invention;

[0025] Figure 3 This is a schematic diagram of the first NMS processing result provided in an embodiment of the present invention;

[0026] Figure 4 This is a schematic diagram of the second NMS processing result provided in an embodiment of the present invention.

[0027] Figure 5 This is a schematic diagram of the final target detection result provided in an embodiment of the present invention;

[0028] Figure 6 This is a structural diagram of a SAR ship target detection device based on multi-layer nonmaximum suppression provided in an embodiment of the present invention;

[0029] Figure 7 This is a hardware architecture diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0031] Please refer to Figure 1 This invention provides a SAR ship target detection method based on multi-layer nonmaximum suppression, the method comprising:

[0032] Step 100: The SAR image to be detected is cropped into multiple overlapping blocks at multiple scales to obtain multi-scale SAR slices.

[0033] Step 102: Using a pre-trained SAR ship target detection network, output target detection results for each slice;

[0034] Step 104: Perform first-level NMS processing on each slice to remove redundant detection boxes on the slice and obtain the first NMS processing result.

[0035] Step 106: Based on the first NMS processing result, a second-level NMS processing is performed on each slice at each scale to remove redundant detection boxes located in the overlapping area and incomplete detection boxes at the edge position in the slice at that scale, thus obtaining the second NMS processing result.

[0036] Step 108: Based on the second NMS processing result, a third-level NMS processing is performed simultaneously on all remaining detection boxes to filter out redundant detection boxes at different scales, thereby obtaining the final target detection result for the SAR image to be detected.

[0037] In this embodiment of the invention, detection is performed by multi-scale cropping and segmentation, which improves the detection accuracy for targets of large or small size compared to traditional single-scale detection. By performing a first Non-Maximum Suppression (NMS) process on each slice, redundant detection boxes on the same slice can be filtered out. By performing a second NMS process on the detection boxes at each scale, redundant detection boxes in overlapping areas and incomplete detection boxes at edge positions can be filtered out. By performing a third NMS process across scales on the remaining detection boxes, redundant detection boxes at different scales can be filtered out. It can be seen that by performing three layers of non-maximum suppression processing, the accuracy and recall rate of SAR ship target detection in large scenes can be effectively improved without retraining the SAR ship target detection network, thereby improving the detection accuracy.

[0038] The following description Figure 1 The execution method of each step is shown.

[0039] First, for step 100, the SAR image to be detected is cropped into blocks with overlapping dimensions at multiple scales to obtain multi-scale SAR slices.

[0040] In this embodiment of the invention, the SAR image to be detected is a large-size image. When cropping the SAR image to be detected, a baseline cropping length c can be set based on prior information such as the size of the SAR image to be detected and the size of the target. b and the reference overlap length o b The scale factor array S and the number of scale factors K are set. In one embodiment, the baseline clipping length can be c. b =640, the reference overlap length can be o b =300, the scale factor array is S={s1=0.5,s2=1.0,s3=1.5}, and the number of scale factors is K=3.

[0041] For each dimension requiring trimming, the following steps (steps 1000-1008) can be followed:

[0042] Step 1000: Calculate the cutting length and overlap length at this scale;

[0043] In this embodiment of the invention, the trimming length and overlap length at the k-th scale can be calculated using the following formula:

[0044] c k = <c b ×s k >

[0045] o k = <o b ×s k >

[0046] Among them, c kO represents the cut length at the k-th scale. k This represents the overlap length at the k-th scale.

[0047] Step 1002: Determine the difference between the trimming length and the overlap length at this scale as the trimming block step size d at this scale. k ;

[0048] The formula for calculating the cutting step length is as follows:

[0049] d k =c k -o k

[0050] Step 1004: Calculate the number of cutting blocks at this scale based on the cutting length and cutting block step size at this scale;

[0051] In this embodiment of the invention, when cropping and dividing the SAR image to be detected into blocks, both the width direction (x-direction) and the height direction (y-direction) are involved. The number of blocks to be cropped in both directions can be calculated using the following formula:

[0052]

[0053] Where, N xk N represents the number of cropped blocks in the x-direction at the k-th scale. yk The number of cropped blocks in the y-direction at the k-th scale is represented by W and H, which represent the width and height of the SAR image to be detected.

[0054] Step 1006: Calculate the coordinate position of each cropped block in the SAR image to be detected at this scale;

[0055] The coordinates of the top-left vertex of the cropping block in the i-th row and j-th column of the k-th scale are calculated using the following formula. and the coordinates of the bottom right vertex for:

[0056]

[0057] Step 1008: Cut according to the coordinate position of each cutting block.

[0058] In this way, multiple SAR slices can be obtained for each scale.

[0059] Please refer to Figure 2 This is a schematic diagram showing the cropping of the SAR image to be detected according to three different scales.

[0060] Then, for step 102, the pre-trained SAR ship target detection network is used to output target detection results for each slice.

[0061] In this embodiment of the invention, the SAR ship target detection network is pre-trained. The slice is input into the SAR ship target detection network, and the SAR ship target detection network performs target detection and recognition on the slice and outputs the target detection result.

[0062] In one implementation, before inputting the slice into the SAR ship target detection network, the slice can be processed to express the slice in the following form:

[0063]

[0064] Among them, I k(i,j) I0 is the SAR image to be detected at the k-th scale, where I is the slice in the i-th row and j-th column.

[0065] Furthermore, it is also possible to slice I k(i,j) Set the image numbers to {i,j,k}, that is: X={i,j,k} k(i,j) ,{i,j,k}}.

[0066] In this embodiment of the invention, after the slice is input into the SAR ship target detection network, the SAR ship target detection network performs the following inference on the input slice:

[0067] [cls,conf,x l ,y t ,x r ,y b ] N×6 =f θ (I k(i,j) )

[0068] Where N represents the number of object detection boxes, f θ This represents a network model with parameter θ. The output list has N rows and 6 columns, where each row represents an object detection box, cls represents the class, conf represents the confidence score, and (x l ,y t ), (x r ,y b ) represents the coordinates of the top-left and bottom-right vertices of the target detection box.

[0069] In other words, the target detection results output by the SAR ship target detection network for slices can include: detection box category, confidence level, coordinates of the top left corner vertex of the detection box, and coordinates of the bottom right corner vertex of the detection box.

[0070] In order to process slices of different scales and filter out detection boxes that do not meet the conditions, in one embodiment of the present invention, the detection boxes on each slice can be mapped to the SAR image to be detected to form a preliminary detection result of the SAR image to be detected. The preliminary detection result includes the detection box number, detection box category, confidence level, coordinates of the upper left corner vertex of the detection box, coordinates of the lower right corner vertex of the detection box, overlap flag, and edge flag.

[0071] Since the SAR ship target detection network outputs the target detection results for slices with the vertex coordinates of the detection boxes output in the slice coordinate system, in order to map the detection boxes in the slices to the SAR image to be detected, the following formula can be used to calculate the mapped coordinates (x, y, y) of the detection boxes in the i-th row and j-th column slice at the k-th scale. l ′,y t ′,x r ′,y b ′):

[0072]

[0073] Mapping is performed based on the coordinates of each detection box in each slice within the SAR image to be detected.

[0074] In this embodiment of the invention, the method for determining whether the detection box is located in the overlapping area and the edge position is as follows:

[0075] Suppose a total of M bounding boxes are detected, and the condition for a bounding box to be located in the overlapping region is any one of the following:

[0076]

[0077] If the m-th detection box is located in the overlapping region, then the overlap flag p m =1, otherwise p m =0.

[0078] The detection box is located at an edge position if any of the following conditions are met:

[0079]

[0080] Where d is the length of the protection unit, which is a preset value. If the m-th detection box is located at the edge, then the edge flag q is... m =1, otherwise q m =0.

[0081] Finally, preliminary detection results can be obtained for the SAR image to be detected:

[0082] {m,cls (m) ,conf (m) ,x′ l(m) ,y′t(m) ,x′ r(m) ,y′ b(m) ,p m ,q m}

[0083] In the preliminary detection results, the parameters for each detection box are represented as follows: the sequence number, category, confidence level, x-coordinate of the top-left vertex, y-coordinate of the top-left vertex, x-coordinate of the bottom-right vertex, y-coordinate of the bottom-right vertex, overlap flag, and edge flag for the m-th detection box. The slice number to which this detection box belongs is {k,i,j}, representing the slice in the kth row and jth column at the k-th scale.

[0084] Next, for step 104, a first-level NMS process is performed on each slice to remove redundant detection boxes on the slice, thus obtaining the first NMS processing result.

[0085] In this embodiment of the invention, the first-level NMS processing may include:

[0086] A0: Based on the target detection results of this slice, sort the detection boxes in this slice according to their confidence levels from highest to lowest to form the first list;

[0087] A2: Select the detection box with the highest confidence from the current first list as the first reference box and put it into the second list;

[0088] A4: For the remaining detection boxes in the first list, perform the following: Calculate the improved M-CIoU value of the aspect ratio constraint between the detection box and the first reference box. If the M-CIoU value is greater than the first threshold, the detection box is determined to be a redundant detection box, and the redundant detection box is deleted from the first list.

[0089] A6: Repeat steps A2-A4 until the first list is empty, and use the detection boxes in the second list as the first NMS processing result for this slice.

[0090] In one embodiment of the present invention, the calculation method of the M-CIoU value for aspect ratio constraint improvement includes:

[0091] For any two detection boxes in the SAR image to be detected, calculate the area of ​​the two detection boxes:

[0092] A=(y b -y t )×(x r -x l )

[0093]

[0094] Among them, A, The areas of detection boxes 1 and 2 are respectively, (x l ,y t ,x r ,y r )and These represent the coordinates of the left and bottom right corners of the top-left and bottom-right corners of detection boxes 1 and 2, respectively.

[0095] Calculate the area A of the intersection of two bounding boxes and the area A' of their union. ∪ :

[0096]

[0097] Calculate the IoU value between the two detection boxes:

[0098]

[0099] Calculate the width cw, height ch, and diagonal distance c of the smallest enclosed rectangle containing two bounding boxes:

[0100]

[0101]

[0102]

[0103] Calculate the distance metric D between the center points of the two detection boxes. c :

[0104]

[0105] Among them, b and This indicates the coordinates of the center points of the two detection boxes. Represent two coordinate points b and The Euclidean distance between them.

[0106] Calculate the aspect ratio metric D of the two detection boxes. s :

[0107]

[0108] Where w and h are the width and height of detection box 1, and The width and height of detection box 2;

[0109] Finally, the aspect ratio-constrained improved M-CIoU is obtained:

[0110] M-CIoU=IoU-(D c +D s )

[0111] In summary, since the target detection results output by the SAR target detection network contain a large number of redundant detection boxes, and since the side lobes of ship targets affect the detection boxes of the same target to a certain extent, the proposed first-stage NMS processing can effectively remove a large number of redundant detection boxes.

[0112] Please refer to Figure 3 This is a schematic diagram of the first NMS processing result obtained after the first-level NMS processing.

[0113] Continuing with step 106, based on the first NMS processing result, a second-level NMS processing is performed on each slice at each scale to filter out redundant detection boxes located in overlapping areas and incomplete detection boxes at edge positions in the slice at that scale, thus obtaining the second NMS processing result.

[0114] In this embodiment of the invention, for each scale, the second-level NMS processing is performed as follows:

[0115] B0: Based on the overlap flag and edge flag, determine the first detection box located in the overlapping region among all slices at this scale, and perform B2-B6 and B8-B12 respectively;

[0116] B2: Move the edge detection boxes located at the edge positions in the first detection box to the third list;

[0117] B4: Select the edge detection box with the highest confidence from the current third list as the second reference box and put it into the fourth list. For the detection boxes of other slices in the third list, perform the following: calculate the area ratio of the detection box and the second reference box. If the area ratio of at least one detection box is greater than the second threshold, then delete the second detection box from the fourth list.

[0118] B6: Repeat steps B2-B4 until the third list is empty;

[0119] B8: Move the non-edge detection boxes that are not located at the edge position in the first detection box to the fifth list;

[0120] B10: Select the non-edge detection box with the highest confidence from the current fifth list as the third reference box and put it into the sixth list. For the detection boxes of other slices in the fifth list, perform the following: calculate the M-CIoU value between the detection box and the third reference box. If the M-CIoU value is greater than the third threshold, determine that the non-edge detection box is an overlapping detection box and delete the overlapping detection box from the fifth list.

[0121] B12: Repeat steps B8-B12 until the fifth list is empty;

[0122] B14: The final fourth and fifth lists are taken as the results of the second NMS processing for this scale.

[0123] Steps B2-B6 are used to remove incomplete detection boxes at the edge positions of overlapping slices, and steps B8-B12 are used to remove redundant detection boxes at non-edge positions of overlapping regions.

[0124] Assume the coordinates of the vertex (top left, bottom right) of the edge detection box located at the edge are (x... l ,y t ,x r ,y r The vertex coordinates of a detection box from different slices of the same scale are... Then calculate the area A of the second reference box located at the edge, and the area of ​​a detection box from a slice of the same scale but different dimensions. The area A of the intersection of the two detection boxes ∩ Then, the area ratio (IoA) of the intersection of the two bounding boxes and the area of ​​the bounding box located at the edge can be calculated as:

[0125]

[0126] like Figure 4 As shown, the first NMS processing result contains many duplicate detection boxes because the target is located at the cropping edge and overlapping area; at multiple cropping scales, the second-level NMS processing can effectively remove incomplete detection boxes located at the slice edge and redundant detection boxes in the overlapping area.

[0127] Finally, for step 108, based on the second NMS processing result, a third-level NMS processing is performed on all remaining detection boxes to filter out redundant detection boxes at different scales, thus obtaining the final target detection result for the SAR image to be detected.

[0128] The third-level NMS processing includes:

[0129] C0: Move all remaining detection boxes to the seventh list;

[0130] C2: Select the detection box with the highest confidence from the current seventh list as the fourth baseline box and put it into the eighth list;

[0131] C4: For detection boxes in other slices of different scales from the slice where the fourth reference box is located in the current seventh list, perform the following: calculate the M-CIoU value between the detection box and the fourth reference box. If the M-CIoU value is greater than the fourth threshold, determine that the detection box is a redundant detection box and delete the redundant detection box from the seventh list.

[0132] C6: Repeat steps C2-C4 until the seventh list is empty, and use the detection boxes in the eighth list as the final target detection results.

[0133] Please refer to Figure 5 The final target detection result is shown below. After applying three layers of nonmaximum suppression, the target detection accuracy is effectively improved, and the location of the detection box is more accurate.

[0134] The effects of the embodiments of the present invention will be illustrated below through specific experiments.

[0135] The experimental dataset was the Air-SARShip dataset. The test images consisted of 10 SAR images of size 1000×1000 and 5 SAR images of size 3000×3000, containing a total of 327 ship targets. The experimental environment used an i9-13900K CPU and an RTX4090 GPU. The detection model was YOLOv8s, with inference performed on the GPU and non-maximum suppression (NMS) processing on the CPU. Under multi-scale detection, compared with traditional IoU-NMS, DIoU-NMS, and CIoU-NMS post-processing algorithms, the proposed three-layer NMS method effectively improves the precision and recall of ship target detection with a slight increase in processing time. Comparative data can be found in Table 1.

[0136] Table 1:

[0137] Post-detection processing methods Accuracy Recall rate F1 value Time (s) IoU-NMS 0.813 0.710 0.758 13.477 DIoU-NMS 0.818 0.721 0.766 13.682 CIoU-NMS 0.818 0.719 0.765 14.009 This method 0.876 0.784 0.827 14.430

[0138] Please refer to Figure 6 This invention provides a SAR ship target detection device based on multi-layer nonmaximum suppression, the device comprising:

[0139] The cropping unit 600 is used to perform multi-scale overlapping cropping and block division on the SAR image to be detected to obtain multi-scale SAR slices.

[0140] The detection unit 602 is used to output target detection results for each slice using a pre-trained SAR ship target detection network.

[0141] The first processing unit 604 is used to perform a first-level NMS process on each slice to remove redundant detection boxes on the slice and obtain the first NMS processing result.

[0142] The second processing unit 606 is used to perform a second-level NMS processing on each slice at each scale based on the first NMS processing result, so as to screen out redundant detection boxes located in the overlapping area and incomplete detection boxes at the edge position in the slice at that scale, and obtain the second NMS processing result.

[0143] The third processing unit 608 is used to perform a third-level NMS process on all remaining detection boxes based on the second NMS processing result, so as to filter out redundant detection boxes at different scales and obtain the final target detection result for the SAR image to be detected.

[0144] In one embodiment of the present invention, the cutting unit is specifically used for:

[0145] For each scale requiring cropping, the following steps are performed: calculate the cropping scale and overlap length at that scale; determine the difference between the cropping length and overlap length at that scale as the cropping block step size at that scale; calculate the number of cropping blocks at that scale based on the cropping length and cropping block step size at that scale; calculate the coordinate position of each cropping block at that scale in the SAR image to be detected; and perform cropping according to the coordinate position of each cropping block.

[0146] In one embodiment of the present invention, before performing first-level NMS processing on each slice, the first processing unit is further configured to: map the detection boxes on each slice to the SAR image to be detected, forming a preliminary detection result of the SAR image to be detected. The preliminary detection result includes the detection box number, detection box category, confidence level, coordinates of the upper left corner vertex of the detection box, coordinates of the lower right corner vertex of the detection box, overlap flag, and edge flag.

[0147] In one embodiment of the present invention, the first-level NMS processing includes:

[0148] A0: Based on the target detection results of this slice, sort the detection boxes in this slice according to their confidence levels from highest to lowest to form the first list;

[0149] A2: Select the detection box with the highest confidence from the current first list as the first reference box and put it into the second list;

[0150] A4: For the remaining detection boxes in the first list, perform the following: Calculate the improved M-CIoU value of the aspect ratio constraint between the detection box and the first reference box. If the M-CIoU value is greater than the first threshold, the detection box is determined to be a redundant detection box, and the redundant detection box is deleted from the first list.

[0151] A6: Repeat steps A2-A4 until the first list is empty, and use the detection boxes in the second list as the first NMS processing result for this slice.

[0152] In one embodiment of the present invention, the second-level NMS processing includes:

[0153] B0: Based on the overlap flag and edge flag, determine the first detection box located in the overlapping region among all slices at this scale, and perform B2-B6 and B8-B12 respectively;

[0154] B2: Move the edge detection boxes located at the edge positions in the first detection box to the third list;

[0155] B4: Select the edge detection box with the highest confidence from the current third list as the second reference box and put it into the fourth list. For the detection boxes of other slices in the third list, perform the following: calculate the area ratio of the detection box and the second reference box. If the area ratio of at least one detection box is greater than the second threshold, then delete the second detection box from the fourth list.

[0156] B6: Repeat steps B2-B4 until the third list is empty;

[0157] B8: Move the non-edge detection boxes that are not located at the edge position in the first detection box to the fifth list;

[0158] B10: Select the non-edge detection box with the highest confidence from the current fifth list as the third reference box and put it into the sixth list. For the detection boxes of other slices in the fifth list, perform the following: calculate the M-CIoU value between the detection box and the third reference box. If the M-CIoU value is greater than the third threshold, determine that the non-edge detection box is an overlapping detection box and delete the overlapping detection box from the fifth list.

[0159] B12: Repeat steps B8-B12 until the fifth list is empty;

[0160] B14: The final fourth and fifth lists are taken as the results of the second NMS processing for this scale.

[0161] In one embodiment of the present invention, the third-level NMS processing includes:

[0162] C0: Move all remaining detection boxes to the seventh list;

[0163] C2: Select the detection box with the highest confidence from the current seventh list as the fourth baseline box and put it into the eighth list;

[0164] C4: For detection boxes in other slices of different scales from the slice where the fourth reference box is located in the current seventh list, perform the following: calculate the M-CIoU value between the detection box and the fourth reference box. If the M-CIoU value is greater than the fourth threshold, determine that the detection box is a redundant detection box and delete the redundant detection box from the seventh list.

[0165] C6: Repeat steps C2-C4 until the seventh list is empty, and use the detection boxes in the eighth list as the final target detection results.

[0166] It should be noted that the SAR ship target detection device based on multi-layer non-maximum suppression provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the SAR ship target detection device based on multi-layer non-maximum suppression provided in the above embodiments and the SAR ship target detection method based on multi-layer non-maximum suppression are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0167] Embodiments of this application also provide a computer device, please refer to... Figure 7 The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, at least one program, code set or instruction set being loaded and executed by the processor to implement the SAR ship target detection method based on multi-layer nonmaximum suppression provided in the above method embodiments.

[0168] The embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the SAR ship target detection method based on multi-layer nonmaximum suppression provided in the above-described method embodiments.

[0169] Embodiments of this application also provide a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium and executes the computer program, causing the computer device to perform any of the SAR ship target detection methods based on multilayer nonmaximum suppression described in the above embodiments.

[0170] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.

[0171] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0172] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0173] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A SAR ship target detection method based on multi-layer nonmaximum suppression, characterized in that, The method includes: The SAR image to be detected is cropped into blocks with overlapping dimensions at multiple scales to obtain multi-scale SAR slices. Using a pre-trained SAR ship target detection network, target detection results are output for each slice; For each slice, a first-level NMS process is performed to remove redundant detection boxes on that slice, thus obtaining the first NMS processing result; Based on the first NMS processing result, a second-level NMS processing is performed on each slice at each scale to filter out redundant detection boxes in the overlapping area and incomplete detection boxes at the edge position in the slice at that scale, thus obtaining the second NMS processing result. Based on the results of the second NMS processing, a third-level NMS processing is performed on all remaining detection boxes to filter out redundant detection boxes at different scales, thus obtaining the final target detection result for the SAR image to be detected.

2. The method according to claim 1, characterized in that, The step of performing multi-scale overlapping cropping and segmentation of the SAR image to be detected includes: For each dimension requiring cropping, perform the following: Calculate the trimming scale and overlap length at this scale; The difference between the trimming length and the overlap length at this scale is determined as the trimming block step size at this scale; Calculate the number of cut blocks at this scale based on the cut length and cut block step size at this scale; Calculate the coordinate position of each cropped block in the SAR image to be detected at this scale; Cut according to the coordinate position of each cut segment.

3. The method according to claim 1, characterized in that, Before performing the first-level NMS processing on each slice, the following is also included: The detection boxes on each slice are mapped to the SAR image to be detected, forming the preliminary detection results of the SAR image to be detected. The preliminary detection results include the detection box number, detection box category, confidence level, coordinates of the top left corner vertex of the detection box, coordinates of the bottom right corner vertex of the detection box, overlap flag, and edge flag.

4. The method according to claim 3, characterized in that, The first-level NMS processing includes: A0: Based on the target detection results of this slice, sort the detection boxes in this slice according to their confidence levels from highest to lowest to form the first list; A2: Select the detection box with the highest confidence from the current first list as the first reference box and put it into the second list; A4: For the remaining detection boxes in the first list, perform the following: Calculate the improved M-CIoU value of the aspect ratio constraint between the detection box and the first reference box. If the M-CIoU value is greater than the first threshold, the detection box is determined to be a redundant detection box, and the redundant detection box is deleted from the first list. A6: Repeat steps A2-A4 until the first list is empty, and use the detection boxes in the second list as the first NMS processing result for this slice.

5. The method according to claim 3, characterized in that, The second-level NMS processing includes: B0: Based on the overlap flag and edge flag, determine the first detection box located in the overlapping region among all slices at this scale, and perform B2-B6 and B8-B12 respectively; B2: Move the edge detection boxes located at the edge positions in the first detection box to the third list; B4: Select the edge detection box with the highest confidence from the current third list as the second reference box and put it into the fourth list. For the detection boxes of other slices in the third list, perform the following: calculate the area ratio of the detection box and the second reference box. If the area ratio of at least one detection box is greater than the second threshold, then delete the second detection box from the fourth list. B6: Repeat steps B2-B4 until the third list is empty; B8: Move the non-edge detection boxes that are not located at the edge position in the first detection box to the fifth list; B10: Select the non-edge detection box with the highest confidence from the current fifth list as the third reference box and put it into the sixth list. For the detection boxes of other slices in the fifth list, perform the following: calculate the M-CIoU value between the detection box and the third reference box. If the M-CIoU value is greater than the third threshold, determine that the non-edge detection box is an overlapping detection box and delete the overlapping detection box from the fifth list. B12: Repeat steps B8-B12 until the fifth list is empty; B14: The final fourth and fifth lists are taken as the results of the second NMS processing for this scale.

6. The method according to claim 3, characterized in that, The third-level NMS processing includes: C0: Move all remaining detection boxes to the seventh list; C2: Select the detection box with the highest confidence from the current seventh list as the fourth baseline box and put it into the eighth list; C4: For detection boxes in other slices of different scales from the slice where the fourth reference box is located in the current seventh list, perform the following: calculate the M-CIoU value between the detection box and the fourth reference box. If the M-CIoU value is greater than the fourth threshold, determine that the detection box is a redundant detection box and delete the redundant detection box from the seventh list. C6: Repeat steps C2-C4 until the seventh list is empty, and use the detection boxes in the eighth list as the final target detection results.

7. A SAR ship target detection device based on multi-layer nonmaximum suppression, characterized in that, The device includes: The cropping unit is used to crop and divide the SAR image to be detected into multi-scale overlapping blocks to obtain multi-scale SAR slices. The detection unit is used to output target detection results for each slice using a pre-trained SAR ship target detection network. The first processing unit is used to perform first-level NMS processing on each slice to remove redundant detection boxes on the slice and obtain the first NMS processing result. The second processing unit is used to perform a second-level NMS processing on each slice at each scale based on the first NMS processing result, so as to filter out redundant detection boxes located in the overlapping area and incomplete detection boxes at the edge position in the slice at that scale, and obtain the second NMS processing result. The third processing unit is used to perform a third-level NMS process on all remaining detection boxes based on the second NMS processing result, so as to filter out redundant detection boxes at different scales and obtain the final target detection result for the SAR image to be detected.

8. A computer device, characterized in that, The computer device includes a memory and a processor. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1-6.