A prediction frame post-processing method and device for ship target detection

By screening the prediction boxes based on size, confidence, and overlap, and combining them with the relative position of the bow in the ship, the problems of target box overlap and repeated bow position detection in ship detection are solved, thereby improving detection accuracy and robustness.

CN120279257BActive Publication Date: 2025-09-12BEIJING INST OF ENVIRONMENTAL FEATURES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510429692.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-09-12
Estimated Expiration
2045-04-08

AI Technical Summary

Technical Problem

Existing target detection algorithms have problems with target frame overlap and repeated detection of bow positions in ship detection, which affects detection accuracy and robustness.

Method used

By screening the prediction boxes based on size, confidence, and overlap, and combining the relative position of the bow of the ship, redundant and overlapping prediction boxes are removed to ensure that the prediction boxes are not located at the four corners of the ship.

Benefits of technology

The accuracy of ship target detection and its robustness in complex overlapping scenarios are improved, ensuring the accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279257B_ABST
    Figure CN120279257B_ABST
Patent Text Reader

Abstract

The present invention provides a prediction frame post-processing method and device for ship target detection, relating to the field of target detection technology. The method comprises: inputting an image to be detected into a target detection model, outputting a prediction frame labeled with a ship; filtering the prediction frame based on its size, confidence, and overlap to obtain a first prediction frame; filtering the first prediction frame based on its size and overlap to obtain a second prediction frame; and filtering the second prediction frame based on the relative position of the bow of the ship to obtain a target prediction frame. This solution solves the problems of target frame overlap and repeated bow position detection that occur in existing detection methods, effectively improving the accuracy and robustness of ship target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of target detection, and in particular to a prediction frame post-processing method and device for ship target detection. Background Art

[0002] With the rapid development of computer vision technology, target detection algorithms have been applied in more and more scenarios. As a key control target in the field of coastal defense, how to enable ships to be accurately and robustly detected by target detection algorithms is an important task at present. At present, target detection methods based on deep learning have been widely used in ship target detection tasks because they can accurately detect targets in real time. However, during post-processing, traditional target detection models only use non-maximum suppression (NMS) to remove redundant detected frames, but there will be repeated detection of multiple target frames of different sizes and overlapping with each other for the same ship target, or repeated marking of the bow part. In actual application, these phenomena will lead to incorrect ship target positioning and tracking, thereby affecting the accuracy of ship target detection. Therefore, there is an urgent need to provide a prediction frame post-processing method and device for ship target detection. Summary of the Invention

[0003] The present invention provides a prediction frame post-processing method and device for ship target detection, which can effectively improve the accuracy and robustness of ship target detection and solve the problems of target frame overlap and repeated bow position detection that occur in existing detection methods.

[0004] In a first aspect, the present invention provides a prediction frame post-processing method for ship target detection, comprising:

[0005] Input the image to be detected into the object detection model and output the predicted box marked with the ship;

[0006] Filtering the prediction boxes according to the size, confidence, and overlap of the prediction boxes to obtain a first prediction box;

[0007] Filtering the first prediction box according to the size and overlap of the first prediction box to obtain a second prediction box;

[0008] The second prediction frame is filtered according to the relative position relationship of the bow of the ship to obtain a target prediction frame.

[0009] Optionally, the filtering the prediction boxes according to the size, confidence, and overlap of the prediction boxes to obtain the first prediction box includes:

[0010] Eliminate the prediction boxes corresponding to the confidence levels lower than a preset confidence threshold to obtain the remaining prediction boxes;

[0011] Taking the predicted frame with the highest confidence as the optimal frame, and calculating the intersection-over-union ratio between the optimal frame and the remaining predicted frames;

[0012] The remaining prediction frames corresponding to the intersection-over-union ratios greater than a first preset threshold are eliminated to obtain the first prediction frame.

[0013] Optionally, the filtering the first prediction box according to the size and overlap of the first prediction box to obtain the second prediction box includes:

[0014] Pairing the first prediction frames in pairs to obtain matching pairs, and calculating the maximum intersection area of ​​the matching pairs;

[0015] Determining the matching pairs corresponding to the maximum intersection areas greater than a second preset threshold as overlapping matching pairs;

[0016] Calculating a similarity score of the overlapping matching pairs according to the size and overlap of the first prediction boxes;

[0017] The overlapping matching pairs and the first prediction box are screened according to the similarity score and a preset score threshold to obtain a screened matching pair and the second prediction box.

[0018] Optionally, calculating the similarity score of the overlapping matching pair according to the size and overlap of the first prediction box includes:

[0019] Determining an aspect ratio according to a size of the first prediction frame;

[0020] For each overlapping matching pair, the following steps are performed: calculating a ratio of a minimum aspect ratio to a maximum aspect ratio of a first prediction box included in the overlapping matching pair, and taking the product of the ratio and a maximum intersection area of ​​the first prediction box included in the overlapping matching pair as the similarity score.

[0021] Optionally, the screening the overlapping matching pairs and the first prediction box according to the similarity score and a preset score threshold to obtain the screened matching pairs and the second prediction box includes:

[0022] Determining whether the similarity score of the overlapping matching pair is less than the preset score threshold;

[0023] If the judgment result is yes, the first prediction boxes in the overlapping matching pair are all used as the second prediction box, and the overlapping matching pair is used as the screening matching pair;

[0024] If the judgment result is no, the first prediction box with the smaller maximum intersection area in the overlapping matching pair is used as the second prediction box.

[0025] Optionally, the screening matching pair includes a first prediction frame and a second prediction frame, and the first prediction frame and the second prediction frame are respectively a second prediction frame with a larger size and a second prediction frame with a smaller size in the screening matching pair;

[0026] The step of filtering the second prediction frame according to the relative position relationship of the bow of the ship to obtain a target prediction frame includes:

[0027] For each screening matching pair including the larger I prediction box and the smaller II prediction box, the following steps are performed:

[0028] Taking each vertex of the first prediction box as an anchor point, construct a virtual box with the same size as the second prediction box inside the first prediction box; wherein the number of the virtual boxes is the same as the number of the anchor points;

[0029] Calculating the intersection-over-union ratio between the second prediction frame and the virtual frame;

[0030] When the intersection-over-union ratio is not less than a third preset threshold, the second predicted frame is used as a removal frame;

[0031] The removal box is deleted from the second prediction box to obtain the target prediction box.

[0032] In a second aspect, the present invention further provides a prediction frame post-processing device for ship target detection, comprising:

[0033] The detection module is used to input the image to be detected into the object detection model and output the predicted box marked with the ship;

[0034] A primary screening module, configured to screen the prediction boxes according to the size, confidence level, and overlap of the prediction boxes to obtain a first prediction box;

[0035] A second screening module, screening the first prediction frame according to the size and overlap of the first prediction frame to obtain a second prediction frame;

[0036] The final screening module is used to screen the second prediction frame according to the relative position relationship of the bow of the ship to obtain a target prediction frame.

[0037] In a third aspect, the present invention further provides a computing device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements any of the above-mentioned prediction frame post-processing methods for ship target detection.

[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute any of the above-mentioned prediction frame post-processing methods for ship target detection.

[0039] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method described in any first aspect of this specification.

[0040] The present invention provides a prediction frame post-processing method and device for ship target detection. The method inputs the image to be detected into the target detection model, outputs the prediction frame marked with the ship, and then performs primary screening and secondary screening on the existing prediction frames based on the size, confidence and overlap of the prediction frames, respectively, to remove redundant prediction frames and prediction frames with high overlapping similarities. Then, based on the relative position relationship between the ship and its bow, possible bow prediction frames are further screened to ensure that the prediction frames are not located at the four corners of the ship, thereby effectively solving the common target overlap and repeated detection problems in ship target detection, and improving the accuracy of the detection results and the robustness in complex overlapping scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 This is a flowchart of a prediction frame post-processing method for ship target detection provided by one embodiment of the present invention;

[0043] Figure 2 This is a schematic diagram of overlapping prediction frames of a ship provided by the present invention;

[0044] Figure 3 1 is a schematic diagram of repeated detection of a prediction frame of a ship and a prediction frame of a bow position provided by the present invention;

[0045] Figure 4 This is a hardware architecture diagram of a computing device provided by one embodiment of the present invention;

[0046] Figure 5 This is a structural diagram of a prediction frame post-processing device for ship target detection provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0048] Please refer to Figure 1 The embodiment of the present invention provides a prediction frame post-processing method for ship target detection, comprising:

[0049] Step 100: Input the image to be detected into the target detection model and output the predicted box marked with the ship;

[0050] Step 102: Filter the prediction boxes based on their size, confidence, and overlap to obtain a first prediction box.

[0051] Step 104: Filter the first prediction frame based on the size and overlap of the first prediction frame to obtain a second prediction frame.

[0052] Step 106 : Filter the second prediction frame according to the relative position relationship of the bow of the ship to obtain a target prediction frame.

[0053] In the present invention, the image to be detected is input into the target detection model, and the prediction frame marked with the ship is output. Then, based on the size, confidence and overlap of the prediction frame, the existing prediction frame is screened initially and again, and redundant prediction frames and prediction frames with high overlapping similarities are removed. Then, based on the relative position relationship between the ship and its bow, possible bow prediction frames are further screened to ensure that the prediction frame is not located at the four corners of the ship, thereby effectively solving the common target overlap and repeated detection problems in ship target detection, and improving the accuracy of the detection results and the robustness in complex overlapping scenarios.

[0054] Described below Figure 1 How to perform the steps shown.

[0055] First, in step 100, a real-time video image is used as the image to be detected, and an object detection model includes, but is not limited to, a YOLOv5 detection model. For example, when using the YOLOv5 detection model, it is necessary to train the YOLOv5 detection model using a large number of different types of ship samples, including various images, photos, or video frames of ships to be detected, collected from real scenes, combined with ship samples from public datasets such as COCO, as a training dataset to obtain the object detection model in step 100.

[0056] Preferably, step 100 further includes: adjusting the resolution consistency of each detection key frame (i.e., the image to be detected) of the video in real time, and normalizing the values ​​of each channel of the image to be detected; and then inputting the image to be detected with the adjusted resolution into a pre-trained target detection model, so that the model infers and outputs all possible prediction boxes marked with ships.

[0057] In step 102, the prediction boxes are screened based on their size, confidence, and overlap to obtain a first prediction box, including:

[0058] Eliminate the prediction boxes corresponding to the confidence values ​​lower than the preset confidence threshold to obtain the remaining prediction boxes;

[0059] The prediction box with the highest confidence is taken as the optimal box, and the intersection-over-union ratio between the optimal box and the remaining prediction boxes is calculated;

[0060] The remaining prediction frames corresponding to the intersection-over-union ratios greater than the first preset threshold are eliminated to obtain a first prediction frame.

[0061] Specifically, all prediction boxes are sorted from high to low according to their confidence, with prediction boxes with higher confidence placed first. Prediction boxes with confidence below a preset confidence threshold are deleted. Then, the prediction box with the highest confidence is selected from the remaining prediction boxes as the current optimal box. For each remaining prediction box, the intersection over union (IOU) between the current optimal box and the remaining prediction box is calculated. If the IOU is greater than a first preset threshold (i.e., the preset IOU threshold), the remaining prediction box is deleted. The above process is repeated until all remaining prediction boxes are judged. In this way, the prediction boxes directly output by the model are preliminarily screened, the overlap between the prediction boxes is determined by calculating the IOU, and redundant prediction boxes are removed by setting the first preset threshold and the preset confidence threshold.

[0062] In the present invention, the setting of the preset confidence threshold and the first preset threshold is related to the task requirements. The higher the preset confidence threshold, the higher the ship detection accuracy, but the detection rate will be lower; the higher the first preset threshold, the higher the ship detection rate will be, but a large number of overlapping target frames may be generated. Therefore, while removing redundant prediction frames through the preset confidence threshold and the first preset threshold, and ensuring the accuracy and detection rate of ship detection, it is also necessary to further remove prediction frames with high repetition rates through subsequent screening to effectively improve the accuracy of ship target detection.

[0063] In step 104, the first prediction frame is filtered according to the size and overlap of the first prediction frame to obtain a second prediction frame, including:

[0064] S1, pair the first prediction boxes to obtain matching pairs and calculate the maximum intersection area of ​​the matching pairs;

[0065] S2, determining the matching pairs corresponding to the maximum intersection area greater than a second preset threshold as overlapping matching pairs;

[0066] S3, calculating the similarity score of the overlapping matching pairs according to the size and overlap of the first predicted box;

[0067] S4: Filter the overlapping matching pairs and the first prediction box according to the similarity score and the preset score threshold to obtain filtered matching pairs and the second prediction box.

[0068] It should be noted that, for the first prediction frame a and the first prediction box b The matching pair, the first prediction box a The intersection area IOA a =( S a ∩ S b ) / S a ; First prediction box b The intersection area IOA b =( S a ∩ S b ) / S b ;in, S a 、 S b The first prediction box a The area of ​​the first prediction box b The area, S a ∩ S b is the first prediction box a With the first prediction box b The area of ​​the intersection of the matching pairs. The maximum intersection area of ​​the matching pairs = max( IOA a , IOA b ); for example, if IOA a > IOA b , then the maximum intersection area of ​​the matching pairs is IOA a .

[0069] Specifically, for the first prediction frame remaining after the initial screening, the maximum intersection area between the matching pairs is calculated by pairing them together ( IOA ), if the maximum of a pair of matching IOA If the intersection area is greater than a second preset threshold (i.e., the preset maximum intersection area threshold), the pair is considered a suspicious overlapping match pair, and a list of suspicious overlapping match pairs is constructed. A preset scoring threshold is then used to further filter out ship prediction frames with high overlapping similarity, resulting in the remaining filtered match pairs and second prediction frames. For example, in actual implementation, setting the second preset threshold to 0.85 effectively filters out prediction frames with high overlapping areas.

[0070] It should be noted that, for the matching pair corresponding to the maximum intersection area that is not greater than the second preset threshold, it is directly retained, that is, determined as the second prediction box.

[0071] In a preferred embodiment, in step S3, the similarity score of the overlapping matching pairs is calculated based on the size and overlap of the first prediction box, including:

[0072] Determine the aspect ratio according to the size of the first prediction box;

[0073] For each overlapping matching pair, the following steps are performed: calculating the ratio of the minimum aspect ratio to the maximum aspect ratio of the first prediction box included in the overlapping matching pair, and multiplying the ratio by the maximum intersection area of ​​the first prediction box included in the overlapping matching pair as the similarity score.

[0074] Specifically, for each overlapping match pair in the list of suspicious overlapping match pairs, the similarity score of the overlapping match pair is calculated using the following formula:

[0075]

[0076] in, sim ab To include the first prediction box a With the first prediction box b Similarity scores of overlapping matching pairs; IOA a 、 IOA b are the first predicted boxes in the overlapping matching pairs a , the first prediction box b The maximum intersection area of γ a 、 γ b The first prediction box a With the first prediction box b aspect ratio; for γ a and γ b The minimum aspect ratio in ; for γ aand γ b The maximum aspect ratio in .

[0077] Since the target detection model for ships usually contains several detection heads for detecting features of different scales, it is used to detect targets of multiple scales. Figure 2 As shown in the figure, for the same ship, due to the different observation scales of different detection heads, different detection heads output detection results of different sizes. However, there is only one ship target, so redundant detection frames need to be filtered out. In this invention, by considering the aspect ratio to determine the shape similarity of the two prediction frames, not only does this avoid the interference of prediction frame scale changes on the similarity assessment, but it also more accurately eliminates overlapping frames with similar aspect ratios and retains overlapping frames with dissimilar shapes. At the same time, by combining the maximum intersection area, the adaptive recognition of ship targets is improved.

[0078] In a preferred embodiment, in step S4, the overlapping matching pairs and the first prediction box are screened according to the similarity score and the preset score threshold to obtain the screened matching pairs and the second prediction box, including:

[0079] Determine whether the similarity score of the overlapping matching pairs is less than a preset score threshold;

[0080] If the judgment result is yes, the first prediction boxes in the overlapping matching pair are all used as the second prediction box, and the overlapping matching pair is used as the screening matching pair;

[0081] If the judgment result is no, the first prediction box with the smaller maximum intersection area in the overlapping matching pair is used as the second prediction box.

[0082] Specifically, if the similarity score of an overlapping match pair is less than a preset score threshold, the two first prediction frames within the overlapping match pair are retained. Otherwise, the first prediction frame with the larger IOA in the overlapping match pair is deleted from the initial screening prediction results, and the overlapping match pair is removed from the list of suspicious overlapping match pairs. The retained overlapping match pair becomes the screened match pair, and the retained first prediction frame becomes the second prediction frame. For example, in actual implementation, setting the preset score threshold to 0.7 can more accurately filter out duplicate prediction frames of the same ship target.

[0083] For step 106, the screened matching pair includes the first prediction frame and the second prediction frame, and the first prediction frame and the second prediction frame are respectively the second prediction frame with a larger size and the second prediction frame with a smaller size in the screened matching pair;

[0084] According to the relative position relationship of the bow of the ship, the second prediction frame is filtered to obtain the target prediction frame, including:

[0085] For each screening matching pair including the larger I prediction box and the smaller II prediction box, perform the following:

[0086] Taking each vertex of the first prediction box as an anchor point, construct a virtual box with the same size as the second prediction box inside the first prediction box; wherein the number of virtual boxes is the same as the number of anchor points;

[0087] Calculate the intersection-over-union ratio between the second prediction frame and the virtual frame;

[0088] When the intersection-over-union ratio is not less than the third preset threshold, the second predicted frame is used as the removal frame;

[0089] Delete the removal box from the second prediction box to get the target prediction box.

[0090] Specifically, each screening matching pair includes a larger prediction box A of the first dimension and a smaller prediction box B of the second dimension (i.e., the size of A is larger than that of B). For each screening matching pair, let the four vertices of A be ( x A1 , y A1 )、( x A2 , y A2 )、( x A3 , y A3 )、( x A4 , y A4 ), the width of A is w B Gao Wei h B . Use the four vertices of A as anchor points and construct a virtual box with the same width and height as B inside A. x A1 , y A1 ) point as an example, the coordinates of the four vertices of the constructed virtual frame are ( x A1 , y A1 )、( x A1 , y A1 + h B )、( x A1 + w B , y A1 + hB )、( x A1 + w B , y A1 );by( x A2 , y A2 ) point as an example, the coordinates of the four vertices of the constructed virtual frame are ( x A2 , y A2 - h B )、( x A2 , y A2 )、( x A2 + w B , y A2 )、( x A2 + w B , y A2 - h B );by( x A3 , y A3 ) point as an example, the coordinates of the four vertices of the constructed virtual frame are ( x A3 - w B , y A3 - h B )、( x A3 - w B , y A3 )、( x A3 , y A3 )、( x A3 , y A3 - h B );by( x A4 , y A4 ) point as an example, the coordinates of the four vertices of the constructed virtual frame are (x A4 - w B , y A4 )、( x A4 - w B , y A4 + h B )、( x A4 , y A4 + h B )、( x A4 , y A4 After the four virtual boxes are constructed, the intersection-and-union (IoU) values ​​are calculated with B. If the calculated IoU values ​​are all less than the third preset threshold (i.e., the preset bow IoU threshold), B is retained; otherwise, B is deleted. The second predicted box that is retained is the final target predicted box.

[0091] In the present invention, Figure 3 As shown in the figure, if the bow of a ship is detected repeatedly, the prediction box of the bow will definitely be located at the corner of the ship's prediction box. Based on this relative positional relationship between the bow and the ship target, the second prediction box retained after the second screening is further filtered for the prediction box with the larger IOA in the screening matching pair, removing any smaller prediction boxes that may be the bow. Finally, the target prediction box for the ship target is obtained. This solves the problems of target box overlap and repeated bow position detection that occur in existing detection methods, effectively improving the accuracy and robustness of ship target detection.

[0092] It should be noted that Figure 2 、 Figure 3 The ship conf in corresponds to the confidence of the ship detected by the prediction box.

[0093] The method of the present invention improves the post-processing part of the traditional target detection algorithm. Starting from the target prediction frame overlap problem encountered in actual detection tasks, the prediction frame is further filtered by using the aspect ratio relationship and IOA. Through multiple screening and the introduction of relevant knowledge about the inherent characteristics of ship targets, the problems of target frame overlap and repeated detection of bow position in the detection results are greatly alleviated, making the ship target detection results more accurate and providing more reliable technical support for the smart coastal defense system.

[0094] like Figure 4 、 Figure 5As shown, the embodiment of the present invention provides a prediction frame post-processing device for ship target detection. The device embodiment can be implemented by software, hardware, or a combination of software and hardware. From the hardware level, Figure 4 As shown in FIG. 1 , a hardware architecture diagram of a computing device where a prediction frame post-processing device for ship target detection is provided in an embodiment of the present invention is located, except for Figure 4 In addition to the processor, memory, network interface, and non-volatile memory shown, the computing device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 5 As shown, as a logical device, the CPU of the computing device in which it is located reads the corresponding computer program in the non-volatile memory into the internal memory and runs it. This embodiment provides a prediction frame post-processing device for ship target detection, including:

[0095] The detection module 500 is used to input the image to be detected into the target detection model and output the predicted box marked with the ship;

[0096] A preliminary screening module 502 is used to screen the prediction boxes according to the size, confidence level, and overlap of the prediction boxes to obtain a first prediction box;

[0097] The second screening module 504 screens the first prediction frame according to the size and overlap of the first prediction frame to obtain a second prediction frame;

[0098] The final screening module 506 is used to screen the second prediction frame according to the relative position relationship of the bow of the ship to obtain a target prediction frame.

[0099] In some specific embodiments, the detection module 500 can be used to perform the above step 100, the primary screening module 502 can be used to perform the above step 102, the secondary screening module 504 can be used to perform the above step 104, and the final screening module 506 can be used to perform the above step 106.

[0100] In some specific embodiments, the primary screening module 502 is further configured to perform the following operations:

[0101] Eliminate the prediction boxes corresponding to the confidence values ​​lower than the preset confidence threshold to obtain the remaining prediction boxes;

[0102] Take the prediction box with the highest confidence as the optimal box and calculate the intersection-over-union ratio between the optimal box and the remaining prediction boxes;

[0103] The remaining prediction frames corresponding to the intersection-over-union ratios greater than the first preset threshold are eliminated to obtain a first prediction frame.

[0104] In some specific embodiments, the secondary screening module 504 is further configured to perform the following operations:

[0105] S1, pair the first prediction boxes to obtain matching pairs and calculate the maximum intersection area of ​​the matching pairs;

[0106] S2, determining the matching pairs corresponding to the maximum intersection area greater than a second preset threshold as overlapping matching pairs;

[0107] S3, determining the aspect ratio according to the size of the first prediction box;

[0108] For each overlapping matching pair, the following steps are performed: calculating the ratio of the minimum aspect ratio to the maximum aspect ratio of the first prediction box included in the overlapping matching pair, and multiplying the ratio by the maximum intersection area of ​​the first prediction box included in the overlapping matching pair as the similarity score;

[0109] S4, determining whether the similarity score of the overlapping matching pair is less than a preset score threshold;

[0110] If the judgment result is yes, the first prediction boxes in the overlapping matching pair are all used as the second prediction box, and the overlapping matching pair is used as the screening matching pair;

[0111] If the judgment result is no, the first prediction box with the smaller maximum intersection area in the overlapping matching pair is used as the second prediction box.

[0112] In some specific embodiments, the secondary screening module 504 is further configured to perform the following operations:

[0113] The similarity score of overlapping matching pairs is determined by the following formula:

[0114]

[0115] in, sim ab To include the first prediction box a With the first prediction box b Similarity scores of overlapping matching pairs; IOA a 、 IOA b are the first predicted boxes in the overlapping matching pairs a , the first prediction box b The maximum intersection area of γ a 、 γ b are aspect ratios; for γ a and γ b The minimum aspect ratio in ; for γ a and γ b The maximum aspect ratio in .

[0116] In some specific embodiments, the final screening module 506 is further configured to perform the following operations:

[0117] For each screening matching pair including the larger I prediction box and the smaller II prediction box, perform the following:

[0118] Taking each vertex of the first prediction box as an anchor point, construct a virtual box with the same size as the second prediction box inside the first prediction box; wherein the number of virtual boxes is the same as the number of anchor points;

[0119] Calculate the intersection-over-union ratio between the second prediction frame and the virtual frame;

[0120] When the intersection-over-union ratio is not less than the third preset threshold, the second predicted frame is used as the removal frame;

[0121] Delete the removal box from the second prediction box to get the target prediction box.

[0122] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the device for post-processing a prediction frame for ship target detection. In other embodiments of the present invention, the device for post-processing a prediction frame for ship target detection may include more or fewer components than illustrated, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0123] The information interaction, execution process, etc. between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For specific contents, please refer to the description in the embodiment of the method of the present invention and will not be repeated here.

[0124] An embodiment of the present invention also provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, a prediction frame post-processing method for ship target detection in any embodiment of the present invention is implemented.

[0125] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes a prediction frame post-processing method for ship target detection in any embodiment of the present invention.

[0126] An embodiment of the present application also provides 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 the processor executes the computer program, so that the computer device executes a prediction frame post-processing method for ship target detection as described in any of the above embodiments.

[0127] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program codes stored in the storage medium.

[0128] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.

[0129] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROMs, CD-Rs, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs, and DVD+RWs), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer via a communications network.

[0130] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.

[0131] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.

[0132] It should be noted that, in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical factors in the process, method, article or device comprising the elements.

[0133] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk, etc. Various media that can store program codes.

[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A prediction frame post-processing method for ship target detection, characterized in that: include: Input the image to be detected into the object detection model and output the predicted box marked with the ship; Eliminate the prediction boxes corresponding to the confidence levels lower than a preset confidence threshold to obtain the remaining prediction boxes; Taking the predicted frame with the highest confidence as the optimal frame, and calculating the intersection-over-union ratio between the optimal frame and the remaining predicted frames; Eliminate the remaining prediction frames corresponding to the intersection-over-union ratios greater than a first preset threshold to obtain a first prediction frame; Pairing the first prediction frames in pairs to obtain matching pairs, and calculating the maximum intersection area of ​​the matching pairs; Determining the matching pairs corresponding to the maximum intersection areas greater than a second preset threshold as overlapping matching pairs; Calculating a similarity score of the overlapping matching pairs according to the size and overlap of the first prediction boxes; Filtering the overlapping matching pairs and the first prediction box according to the similarity score and a preset score threshold to obtain a filtered matching pair and a second prediction box; The second prediction frame is filtered according to the relative position relationship of the bow of the ship to obtain a target prediction frame.

2. The method according to claim 1, characterized in that Calculating the similarity score of the overlapping matching pairs according to the size and overlap of the first prediction box includes: Determining an aspect ratio according to a size of the first prediction frame; For each overlapping matching pair, the following steps are performed: calculating a ratio of a minimum aspect ratio to a maximum aspect ratio of a first prediction box included in the overlapping matching pair, and taking the product of the ratio and a maximum intersection area of ​​the first prediction box included in the overlapping matching pair as the similarity score.

3. The method according to claim 1, characterized in that The filtering of the overlapping matching pairs and the first prediction box according to the similarity score and a preset score threshold to obtain the filtered matching pairs and the second prediction box includes: Determining whether the similarity score of the overlapping matching pair is less than the preset score threshold; If the judgment result is yes, the first prediction boxes in the overlapping matching pair are all used as the second prediction box, and the overlapping matching pair is used as the screening matching pair; If the judgment result is no, the first prediction box with the smaller maximum intersection area in the overlapping matching pair is used as the second prediction box.

4. The method according to any one of claims 1 to 3, characterized in that The screening matching pair includes a first prediction frame and a second prediction frame, and the first prediction frame and the second prediction frame are respectively a second prediction frame with a larger size and a second prediction frame with a smaller size in the screening matching pair; The step of filtering the second prediction frame according to the relative position relationship of the bow of the ship to obtain a target prediction frame includes: For each screening matching pair including the larger I prediction box and the smaller II prediction box, the following steps are performed: Taking each vertex of the first prediction box as an anchor point, construct a virtual box with the same size as the second prediction box inside the first prediction box; wherein the number of the virtual boxes is the same as the number of the anchor points; Calculating the intersection-over-union ratio between the second prediction frame and the virtual frame; When the intersection-over-union ratio is not less than a third preset threshold, the second predicted frame is used as a removal frame; The removal box is deleted from the second prediction box to obtain the target prediction box.

5. A prediction frame post-processing device for ship target detection, characterized in that: Used to implement the method according to any one of claims 1 to 4, comprising: The detection module is used to input the image to be detected into the object detection model and output the predicted box marked with the ship; A primary screening module, configured to screen the prediction boxes according to the size, confidence level, and overlap of the prediction boxes to obtain a first prediction box; A second screening module, screening the first prediction frame according to the size and overlap of the first prediction frame to obtain a second prediction frame; The final screening module is used to screen the second prediction frame according to the relative position relationship of the bow of the ship to obtain a target prediction frame.

6. A computing device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 4.

8. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-target ship tracking system and method

    CN117475174A

  • Target detection method and apparatus

    US20230072289A1