Target detection candidate box screening method and device
By using the intersection ratio and Gaussian index algorithm to screen candidate frames in target detection, the problem of reduced detection accuracy caused by target overlap in dense scenes is solved, missed detections and false detections are reduced, the amount of calculation is controlled, and the overall detection accuracy is improved. .
Patent Information
- Application Number
- CN202411010498.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN118537545A
Abstract
Description
Technical Field
[0001] The present application relates to the field of target detection technology, and more particularly to a target detection candidate frame screening method, a target detection candidate frame screening device, a computing device, and a computer-readable storage medium. Background Art
[0002] During target detection using SSD and YOLO models, multiple candidate boxes are generated for each target. These candidate boxes overlap with each other, and each candidate box contains the following information: the coordinate value, category, and confidence of the box. The commonly used non-maximum suppression method (NMS) extracts the candidate box that is closest to the target and has the highest confidence as the final detection result, and filters out other boxes with large overlaps. However, in dense scenes, there are multiple overlapping targets. Using the NMS method will also filter out the occluded targets, resulting in reduced detection accuracy.
[0003] In response to the above problems, Soft-NMS was proposed to solve the problem of incorrectly filtered targets. For boxes with high overlap, Soft-NMS will not simply discard them all, but will calculate the IoU (intersection over union of two boxes, indicating the degree of overlap) of the box with the highest confidence with all other boxes, and reduce the confidence of these boxes according to the IoU value; then select the new highest confidence candidate box from the updated box, perform IoU calculation and confidence update on the remaining candidate boxes again, and the boxes will not be filtered in this process; finally, determine whether the confidence of each box is lower than the specified threshold. If it is lower than the threshold, the box is filtered, otherwise it is retained.
[0004] Soft-NMS can effectively solve the problem of overlapping targets being incorrectly filtered and reduce the number of missed detections. However, Soft-NMS will increase the number of false detections, that is, the same target may retain multiple candidate boxes, which will also reduce the overall detection accuracy. In addition, Soft-NMS must update the confidence of the remaining candidate boxes in each iteration, sort the remaining candidate boxes according to the confidence, and select the candidate box with the highest confidence, which inevitably leads to a significant increase in the amount of calculation. Summary of the invention
[0005] In view of this, the embodiment of the present application provides a method for selecting candidate frames for target detection to solve the technical defects in the prior art. The embodiment of the present application also provides a device for selecting candidate frames for target detection, a computing device, and a computer-readable storage medium.
[0006] According to a first aspect of an embodiment of the present application, a method for screening candidate boxes for object detection is provided, comprising: S102, detecting the target image according to the pre-trained target detection model to obtain multiple candidate boxes and confidence levels corresponding to the multiple candidate boxes; S104, selecting one of the multiple candidate frames as an initial candidate frame; S106, calculating the intersection-over-union ratio between the initial candidate box and other candidate boxes, and performing a preliminary screening of the multiple candidate boxes based on the intersection-over-union ratio calculation result; S108, calculating enhanced confidences corresponding to the candidate boxes after the initial screening based on a preset Gaussian index algorithm, and performing a secondary screening on the candidate boxes after the initial screening according to the enhanced confidence calculation results; S110, selecting one of the candidate frames after the secondary screening as the initial candidate frame, and executing steps S106-S110 until the number of candidate frames remains unchanged, thereby obtaining a target candidate frame.
[0007] Optionally, the step S104 includes: Sorting the confidences of the multiple candidate boxes one by one; Select the candidate box corresponding to the maximum confidence as the initial candidate box.
[0008] Optionally, the step S106 includes: Calculating an intersection-and-union ratio between the initial candidate box and the other candidate boxes by using the intersection area and union area between the initial candidate box and the other candidate boxes; The IoU calculation result is compared with a preset IoU threshold, and candidate boxes with a value greater than the IoU threshold are eliminated.
[0009] Optionally, the step S108 includes: Based on the preset Gaussian index algorithm, the confidence and intersection-over-union ratio corresponding to the candidate boxes after the initial screening are calculated to obtain enhanced confidence corresponding to the candidate boxes after the initial screening; The enhanced confidences corresponding to the candidate boxes after the initial screening are compared with a preset enhanced confidence threshold, and the candidate boxes with a value less than the enhanced confidence threshold are eliminated.
[0010] Optionally, the confidence and intersection-over-union ratio corresponding one-to-one to the candidate boxes after the initial screening are calculated based on a preset Gaussian index algorithm to obtain enhanced confidence corresponding one-to-one to the candidate boxes after the initial screening, including: Select the candidate boxes A after the initial screening in sequence i , and determine the candidate box A i The corresponding confidence score i , and candidate box A i The corresponding intersection over union (IoU) i; Calculate candidate box A i The corresponding enhanced confidence ; Among them, i∈[1,n], n is the number of candidate boxes after initial screening, and v is a constant.
[0011] Optionally, in step S110, selecting one of the candidate boxes after the secondary screening as the initial candidate box includes: Sort the confidences of the candidate boxes after the secondary screening one by one; Select the candidate box corresponding to the maximum confidence as the initial candidate box.
[0012] According to a second aspect of an embodiment of the present application, a device for screening candidate frames for target detection is provided, comprising: A detection module is configured to detect the target image according to a pre-trained target detection model to obtain a plurality of candidate frames and confidences corresponding to the plurality of candidate frames; A selection module is configured to select one of the multiple candidate frames as an initial candidate frame; A primary screening module is configured to calculate an intersection-and-union ratio between the initial candidate box and other candidate boxes, and perform a primary screening on the multiple candidate boxes based on the intersection-and-union ratio calculation result; The secondary screening module is configured to calculate the enhanced confidence corresponding to the candidate boxes after the initial screening based on a preset Gaussian index algorithm, and perform secondary screening on the candidate boxes after the initial screening according to the enhanced confidence calculation result; The loop module is configured to select one of the candidate frames after the secondary screening as the initial candidate frame, call the primary screening module and the secondary screening module until the number of candidate frames remains unchanged, and obtain the target candidate frame.
[0013] According to a third aspect of an embodiment of the present application, a computing device is provided, including: Memory and processor; The memory is used to store computer-executable instructions, and the processor implements the steps of the target detection candidate box screening method when executing the computer-executable instructions.
[0014] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the target detection candidate box screening method are implemented.
[0015] According to a fifth aspect of an embodiment of the present application, a chip is provided, which stores a computer program, and when the computer program is executed by the chip, the steps of the target detection candidate box screening method are implemented.
[0016] The target detection candidate frame screening method provided in the present application, through S102, detects the target image according to the pre-trained target detection model to obtain multiple candidate frames and confidences corresponding to the multiple candidate frames one by one; S104, selects one of the multiple candidate frames as the initial candidate frame; S106, calculates the intersection and union ratio between the initial candidate frame and other candidate frames, and based on the intersection and union ratio calculation result, performs a preliminary screening of the multiple candidate frames; S108, based on a preset Gaussian index algorithm, calculates the enhanced confidences corresponding to the candidate frames after the preliminary screening one by one, and performs a secondary screening of the candidate frames after the preliminary screening according to the enhanced confidence calculation result; S110, selects one of the candidate frames after the secondary screening as the initial candidate frame, executes steps S106-S110, until the number of candidate frames remains unchanged, and obtains the target candidate frame. It is achieved that the confidence of the box is not updated in each round of iteration. Instead, the candidate boxes are filtered according to the enhanced confidence calculated by IoU and Gaussian index. In addition to filtering the candidate boxes with high overlap, the Gaussian index algorithm is also combined to reduce the number of missed detections. Moreover, the IoU calculated by not any candidate box will participate in the calculation of the Gaussian index. The candidate boxes with high overlap will be directly discarded. Only the candidate boxes with relatively low overlap will participate in the calculation of the Gaussian index to ensure that the number of false detections will not increase. In addition, because the confidence of the retained candidate boxes will not be updated, there is no need to re-sort them. Combined with the above-mentioned non-arbitrary candidate boxes, the Gaussian index will be calculated, which reduces the increase in calculation amount. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is a flowchart of a method for screening candidate boxes for target detection provided by an embodiment of the present application; Figure 2 It is a schematic diagram of calculating the intersection-over-union ratio of a method for screening candidate boxes for target detection provided by an embodiment of the present application; Figure 3 is a schematic diagram of a Gaussian exponential function curve of a method for screening candidate boxes for target detection provided by an embodiment of the present application; Figure 4 It is a structural schematic diagram of a device for screening candidate frames for target detection provided by an embodiment of the present application; Figure 5 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0019] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0020] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0021] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0022] First, the terms involved in one or more embodiments of the present invention are explained.
[0023] Confidence: In statistics, the confidence interval of a probability sample is an interval estimate of a population parameter of this sample.
[0024] SSD: Single Shot Multibox Detector, is a single-stage object detector designed to achieve a balance between inference speed and accuracy.
[0025] YOLO: You Only Look Once is a target detection model that aims to simultaneously locate and classify targets through a single neural network to achieve real-time and efficient target detection.
[0026] In the present application, a method for selecting candidate frames for object detection is provided. The present application also relates to an apparatus for selecting candidate frames for object detection, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0027] Figure 1 A flowchart of a method for selecting candidate frames for object detection provided according to an embodiment of the present application is shown, which specifically includes the following steps: S102, detecting the target image according to the pre-trained target detection model to obtain multiple candidate boxes and confidence levels corresponding to the multiple candidate boxes; S104, selecting one of the multiple candidate frames as an initial candidate frame; S106, calculating the intersection-over-union ratio between the initial candidate box and other candidate boxes, and performing a preliminary screening of the multiple candidate boxes based on the intersection-over-union ratio calculation result; S108, calculating enhanced confidences corresponding to the candidate boxes after the initial screening based on a preset Gaussian index algorithm, and performing a secondary screening on the candidate boxes after the initial screening according to the enhanced confidence calculation results; S110, selecting one of the candidate frames after the secondary screening as the initial candidate frame, and executing steps S106-S110 until the number of candidate frames remains unchanged, thereby obtaining a target candidate frame.
[0028] Among them, the type of target detection model is not unique, and it can be any one of the SSD and YOLO series models. The specific target detection model type is determined by the actual usage scenario and is not limited in this embodiment.
[0029] Based on this, the target image is processed according to the target detection model to obtain candidate frames of the target objects that need to be detected in the target image and the confidence corresponding to each candidate frame; the initial candidate frame is selected from the multiple candidate frames obtained, and the intersection and union ratio between the initial candidate frame and the remaining candidate frames is calculated, and the first screening is performed according to the intersection and union ratio calculation result; then, according to the Gaussian index algorithm, the enhanced confidence corresponding to the candidate frame after the first screening is calculated, and the second screening is performed according to the enhanced confidence calculation result to obtain the target candidate frame.
[0030] In summary, by determining the target candidate box in the above manner, the probability of overlapping targets and small targets being filtered out is reduced, that is, missed detection is reduced, and the probability of retaining non-target areas and target sub-areas is minimized, that is, false detection remains unchanged. Finally, while improving the detection accuracy, the complexity of the algorithm is effectively controlled to avoid a significant increase in calculation amount.
[0031] Furthermore, in step S104, the process of selecting one of the plurality of candidate frame groups as the initial candidate frame is specifically implemented as follows in this embodiment: The confidences of the multiple candidate boxes are sorted one by one; and the candidate box corresponding to the maximum confidence is selected as the initial candidate box.
[0032] Among them, the target detection model processes the target image and outputs a set of candidate boxes. Each candidate box has corresponding bounding box coordinates and confidence. The candidate boxes are sorted from high to low according to their confidence, and the first one, that is, the candidate box with the highest confidence, is selected from these candidate boxes as the initial candidate box.
[0033] Furthermore, in step S106, the intersection-and-union ratio between the initial candidate box and other candidate boxes is calculated, and the multiple candidate boxes are initially screened based on the intersection-and-union ratio calculation result. In this embodiment, the specific implementation method is as follows: The intersection-and-union ratio between the initial candidate box and other candidate boxes is calculated by the intersection area and the union area between the initial candidate box and other candidate boxes; the intersection-and-union ratio calculation result is compared with a preset intersection-and-union ratio threshold, and the candidate boxes with an intersection-and-union ratio greater than the intersection-and-union ratio threshold are eliminated.
[0034] Among them, the intersection and union ratio between the initial candidate box and each candidate box outside the initial candidate box is calculated respectively, such as Figure 2 As shown in the provided diagram of IoU calculation of a method for screening candidate frames for target detection, IoU is represented as IoU (Intersection over Union), and its value is the intersection area of two frames divided by the union area. It should be noted that the setting of the IoU threshold is determined by the actual usage needs of users in actual usage scenarios, and this embodiment does not limit the specific value of the IoU threshold. For example, if the detection accuracy of the target detection model is too high and the probability of false detection is high, the IoU threshold can be appropriately reduced to eliminate more candidate frames in the initial screening process, reduce the number of overlapping candidate frames, and improve detection accuracy; otherwise, the IoU threshold is increased.
[0035] Furthermore, in step S108, based on the preset Gaussian index algorithm, the enhanced confidence corresponding to the candidate boxes after the initial screening is calculated, and according to the enhanced confidence calculation result, the candidate boxes after the initial screening are subjected to a secondary screening process. In this embodiment, the specific implementation method is as follows: Based on the preset Gaussian index algorithm, the confidences and intersection-over-union ratios corresponding one-to-one to the candidate boxes after the initial screening are calculated to obtain enhanced confidences corresponding one-to-one to the candidate boxes after the initial screening; the enhanced confidences corresponding one-to-one to the candidate boxes after the initial screening are compared with the preset enhanced confidence threshold, and the candidate boxes with a value less than the enhanced confidence threshold are eliminated.
[0036] Furthermore, based on the preset Gaussian index algorithm, the confidence and intersection-over-union ratio corresponding to the candidate boxes after the initial screening are calculated to obtain the enhanced confidence corresponding to the candidate boxes after the initial screening. In this embodiment, the specific implementation method is as follows: Select the candidate boxes A after the initial screening in sequence i , and determine the candidate box A i The corresponding confidence score i , and candidate box A i The corresponding intersection over union (IoU) i ; Calculate candidate box A i The corresponding enhanced confidence ; Where i∈[1,n], n is the number of candidate boxes after initial screening, and v is a constant.
[0037] Among them, the selection of constant v can adjust the calculation result of the enhanced confidence to ensure that the calculated enhanced confidence meets the actual usage needs of the user. In addition, the enhanced confidence threshold is similar to the setting of the intersection-over-union ratio threshold, which limits the screening intensity of the secondary screening. The specific value is determined by the actual usage needs of the user and is not limited in this embodiment.
[0038] Based on this, Figure 3 As shown in the schematic diagram of the Gaussian exponential function curve of a target detection candidate box screening method, the constant v is set to 0.25. Since the IoU value range is [0,1], 0 means that the two boxes do not overlap, the calculated value of the Gaussian exponential function is 1, and the enhanced confidence value remains unchanged compared to the confidence value; 1 means that the two boxes overlap completely, and the calculated value of the Gaussian exponential function is very small, close to 0, so the enhanced confidence is close to 0, and this value will be less than the confidence threshold so that it is filtered out. In other words, when IoU is between 0 and 1, the larger the value, the higher the overlap of the two boxes, and the greater the reduction in the enhanced confidence compared to the original confidence, and vice versa. This is because when the overlap of the two boxes is very low, the probability of being the same target is very small, so the degree of confidence will be affected to a lesser extent.
[0039] Furthermore, in step S110, the process of selecting one of the candidate boxes after the secondary screening as the initial candidate box is specifically implemented as follows in this embodiment: The confidences of the candidate boxes after the secondary screening are sorted one by one; and the candidate box with the maximum confidence is selected as the initial candidate box.
[0040] Among them, the candidate box with the largest confidence among the candidate boxes after the secondary screening is selected as the initial candidate box. This is because in actual usage scenarios, after the target detection model detects the target image, multiple candidate boxes are obtained and distributed in several areas. By repeatedly selecting the initial candidate boxes and iteratively screening, the candidate boxes in several areas where the candidate boxes are distributed can be screened in turn to finally obtain the target candidate box.
[0041] Corresponding to the above method embodiment, the present application also provides an embodiment of a device for screening candidate frames for target detection, Figure 4FIG. 1 is a schematic diagram showing a structure of a device for selecting candidate frames for target detection provided by an embodiment of the present application. Figure 4 As shown, the device comprises: The detection module 402 is configured to detect the target image according to the pre-trained target detection model to obtain multiple candidate boxes and confidence levels corresponding to the multiple candidate boxes. A selection module 404 is configured to select one of the multiple candidate frames as an initial candidate frame; A primary screening module 406 is configured to calculate an intersection-and-union ratio between the initial candidate box and other candidate boxes, and perform a primary screening on the multiple candidate boxes based on the intersection-and-union ratio calculation result; The secondary screening module 408 is configured to calculate the enhanced confidence corresponding to the candidate boxes after the initial screening based on a preset Gaussian index algorithm, and perform secondary screening on the candidate boxes after the initial screening according to the enhanced confidence calculation result; The loop module 410 is configured to select one of the candidate frames after the secondary screening as the initial candidate frame, call the primary screening module and the secondary screening module until the number of candidate frames remains unchanged, and obtain the target candidate frame.
[0042] In an optional embodiment, the selection module 404 is further configured to: The confidences of the multiple candidate boxes are sorted one by one; and the candidate box corresponding to the maximum confidence is selected as the initial candidate box.
[0043] In an optional embodiment, the primary screening module 406 is further configured to: The intersection-and-union ratio between the initial candidate box and other candidate boxes is calculated by the intersection area and the union area between the initial candidate box and other candidate boxes; the intersection-and-union ratio calculation result is compared with a preset intersection-and-union ratio threshold, and the candidate boxes with an intersection-and-union ratio greater than the intersection-and-union ratio threshold are eliminated.
[0044] In an optional embodiment, the secondary screening module 408 is further configured to: Based on the preset Gaussian index algorithm, the confidences and intersection-over-union ratios corresponding one-to-one to the candidate boxes after the initial screening are calculated to obtain enhanced confidences corresponding one-to-one to the candidate boxes after the initial screening; the enhanced confidences corresponding one-to-one to the candidate boxes after the initial screening are compared with the preset enhanced confidence threshold, and the candidate boxes with a value less than the enhanced confidence threshold are eliminated.
[0045] In an optional embodiment, the secondary screening module 408 is further configured to: Select the candidate boxes A after the initial screening in sequence i , and determine the candidate box Ai The corresponding confidence score i , and candidate box A i The corresponding intersection over union (IoU) i ; Calculate candidate box A i The corresponding enhanced confidence ; Where i∈[1,n], n is the number of candidate boxes after initial screening, and v is a constant.
[0046] In an optional embodiment, the loop module 410 is further configured to: The confidences of the candidate boxes after the secondary screening are sorted one by one; and the candidate box with the maximum confidence is selected as the initial candidate box.
[0047] The target detection candidate frame screening device provided in the present application is configured to detect the target image according to the pre-trained target detection model through the detection module 402, and obtain multiple candidate frames and confidences corresponding to the multiple candidate frames one by one; the selection module 404 is configured to select one of the multiple candidate frames as the initial candidate frame; the primary screening module 406 is configured to calculate the intersection and union ratio between the initial candidate frame and other candidate frames, and perform primary screening on the multiple candidate frames based on the intersection and union ratio calculation result; the secondary screening module 408 is configured to calculate the enhanced confidence corresponding to the candidate frames after the primary screening based on the preset Gaussian index algorithm, and perform secondary screening on the candidate frames after the primary screening according to the enhanced confidence calculation result; the loop module 410 is configured to select one of the candidate frames after the secondary screening as the initial candidate frame, call the primary screening module and the secondary screening module until the number of candidate frames remains unchanged, and the target candidate frame is obtained. It is achieved that the confidence of the box is not updated in each round of iteration. Instead, the candidate boxes are filtered according to the enhanced confidence calculated by IoU and Gaussian index. In addition to filtering the candidate boxes with high overlap, the Gaussian index algorithm is also combined to reduce the number of missed detections. Moreover, the IoU calculated by not any candidate box will participate in the calculation of the Gaussian index. The candidate boxes with high overlap will be directly discarded. Only the candidate boxes with relatively low overlap will participate in the calculation of the Gaussian index to ensure that the number of false detections will not increase. In addition, because the confidence of the retained candidate boxes will not be updated, there is no need to re-sort them. Combined with the above-mentioned non-arbitrary candidate boxes, the Gaussian index will be calculated, which reduces the increase in calculation amount.
[0048] The above is a schematic scheme of a target detection candidate box screening device of the present embodiment. It should be noted that the technical scheme of the target detection candidate box screening device and the technical scheme of the target detection candidate box screening method mentioned above belong to the same concept. For the details not described in detail in the technical scheme of the target detection candidate box screening device, please refer to the description of the technical scheme of the target detection candidate box screening method mentioned above. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0049] Figure 5 The block diagram of a computing device 500 provided according to an embodiment of the present application is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0050] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0051] In one embodiment of the present application, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0052] Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.
[0053] The processor 520 is used to execute computer executable instructions of each step of the target detection candidate box screening method.
[0054] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned target detection candidate box screening method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned target detection candidate box screening method.
[0055] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to execute the steps of the target detection candidate box screening method.
[0056] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned target detection candidate box screening method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned target detection candidate box screening method.
[0057] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the target detection candidate box screening method when the computer program is executed by the chip.
[0058] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0059] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0060] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0061] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0062] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A method for screening candidate boxes for target detection, characterized in that: include: S102, detecting the target image according to the pre-trained target detection model to obtain multiple candidate boxes and confidence levels corresponding to the multiple candidate boxes; S104, selecting one of the multiple candidate frames as an initial candidate frame; S106, calculating the intersection-over-union ratio between the initial candidate box and other candidate boxes, and performing a preliminary screening of the multiple candidate boxes based on the intersection-over-union ratio calculation result; S108, calculating enhanced confidences corresponding to the candidate boxes after the initial screening based on a preset Gaussian index algorithm, and performing a secondary screening on the candidate boxes after the initial screening according to the enhanced confidence calculation results; S110, selecting one of the candidate frames after the secondary screening as the initial candidate frame, and executing steps S106-S110 until the number of candidate frames remains unchanged, thereby obtaining a target candidate frame.
2. The method according to claim 1, characterized in that The step S104 includes: Sorting the confidences of the multiple candidate boxes one by one; Select the candidate box corresponding to the maximum confidence as the initial candidate box.
3. The method according to claim 1, characterized in that The step S106 includes: Calculating an intersection-and-union ratio between the initial candidate box and the other candidate boxes by using the intersection area and union area between the initial candidate box and the other candidate boxes; The IoU calculation result is compared with a preset IoU threshold, and candidate boxes with a value greater than the IoU threshold are eliminated.
4. The method according to claim 1, characterized in that: The step S108 includes: Based on the preset Gaussian index algorithm, the confidence and intersection-over-union ratio corresponding to the candidate boxes after the initial screening are calculated to obtain enhanced confidence corresponding to the candidate boxes after the initial screening; The enhanced confidences corresponding to the candidate boxes after the initial screening are compared with a preset enhanced confidence threshold, and the candidate boxes with a value less than the enhanced confidence threshold are eliminated.
5. The method according to claim 4, characterized in that The preset Gaussian index algorithm is used to calculate the confidence and intersection-over-union ratio corresponding to the candidate boxes after the initial screening, so as to obtain the enhanced confidence corresponding to the candidate boxes after the initial screening, including: Select the candidate boxes A after the initial screening in sequence i , and determine the candidate box A i The corresponding confidence score i , and candidate box A i The corresponding intersection over union (IoU) i ; Calculate candidate box A i The corresponding enhanced confidence ; Among them, i∈[1,n], n is the number of candidate boxes after initial screening, and v is a constant.
6. The method according to claim 1, characterized in that In the step S110, selecting one of the candidate frames after the secondary screening as the initial candidate frame includes: Sort the confidences of the candidate boxes after the secondary screening one by one; Select the candidate box corresponding to the maximum confidence as the initial candidate box.
7. A device for selecting candidate frames for target detection, characterized in that: include: A detection module is configured to detect the target image according to a pre-trained target detection model to obtain a plurality of candidate frames and confidences corresponding to the plurality of candidate frames; A selection module is configured to select one of the multiple candidate frames as an initial candidate frame; A primary screening module is configured to calculate an intersection-and-union ratio between the initial candidate box and other candidate boxes, and perform a primary screening on the multiple candidate boxes based on the intersection-and-union ratio calculation result; The secondary screening module is configured to calculate the enhanced confidence corresponding to the candidate boxes after the initial screening based on a preset Gaussian index algorithm, and perform secondary screening on the candidate boxes after the initial screening according to the enhanced confidence calculation result; The loop module is configured to select one of the candidate frames after the secondary screening as the initial candidate frame, call the primary screening module and the secondary screening module until the number of candidate frames remains unchanged, and obtain the target candidate frame.
8. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the target detection candidate box screening method described in any one of claims 1 to 6.
9. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the target detection candidate box screening method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Target recognition method, computer device, and readable storage medium
CN109214389A
Pig injury detection method and device and readable storage medium
CN113743261A
Generation method and device of target detection box, storage medium and electronic equipment
CN115294328A
Defect detection method and device, computer equipment and storage medium
CN116977239A
Non-maximum suppression small target multi-order screening method for edge side hardware
CN117372673A
