Target detection method, device, computer equipment and computer readable storage medium

By determining the bounding box loss function and adjusting the predicted anchor box in target detection, the problem of complex bounding box regression calculations is solved, efficiency and accuracy are improved, and efficient bounding box regression is achieved.

CN117456294BActive Publication Date: 2024-09-17华润数字科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311359506.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-18
Publication Date
2024-09-17
Estimated Expiration
2043-10-18

AI Technical Summary

Technical Problem

The bounding box regression calculation in the existing target detection process is complex, resulting in low efficiency and difficulty in achieving efficient bounding box regression convergence.

Method used

By obtaining the image sample data set to be detected, the predicted anchor frame is initially identified, and the bounding box loss function is determined based on the intersection ratio between the predicted anchor frame and the real target frame, the direction matching information and the quality of the data set, and then the predicted anchor frame is adjusted to simplify Bounding box regression calculation.

Benefits of technology

The recall rate and convergence efficiency of bounding box regression are improved, the angle and distance losses are unified, the bounding box regression calculation is simplified, and the accuracy and robustness are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117456294B
    Figure CN117456294B
Patent Text Reader

Abstract

The present invention relates to the field of image recognition technology, and provides a target detection method, device, computer equipment and computer-readable storage medium, the method comprising: obtaining a sample data set of an image to be detected; performing preliminary recognition on the sample data set of the image to be detected to obtain multiple prediction anchor frames; determining the intersection-over-union ratio and direction matching information according to each prediction anchor frame and the corresponding real target frame in the sample data set of the image to be detected; determining a bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the sample data set of the image to be detected; and adjusting and processing the corresponding prediction anchor frame according to the bounding box loss function. Through the above technical solution, the bounding box regression calculation can be simplified, thereby improving the efficiency of the bounding box regression convergence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a target detection method, device, computer equipment and computer-readable storage medium. Background Art

[0002] With the continuous development of social economy and the continuous progress of science and technology, people's living standards are also constantly improving, and artificial intelligence has been increasingly applied to people's daily lives; among them, machine vision is an important part of artificial intelligence, and target detection is a basic step in machine vision. In the target detection task, bounding box regression is an important indicator to measure the accuracy of target positioning. A well-defined bounding box regression loss can bring significant performance and accuracy improvements. However, the bounding box regression calculation in the current target detection process is relatively complex, which reduces the efficiency of bounding box regression convergence. Summary of the invention

[0003] Embodiments of the present invention provide a target detection method, apparatus, computer device, and computer-readable storage medium, which can simplify bounding box regression calculation, thereby improving the efficiency of bounding box regression convergence.

[0004] A first aspect of the present invention provides a target detection method, the method comprising:

[0005] Obtain a sample dataset of images to be detected;

[0006] Performing preliminary recognition on the sample image data set to be detected to obtain multiple prediction anchor frames;

[0007] Determine the intersection-over-union ratio and direction matching information according to each of the predicted anchor frames and the corresponding real target frame in the image sample data set to be detected;

[0008] Determine a bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the image sample data set to be detected;

[0009] The corresponding predicted anchor box is adjusted according to the bounding box loss function.

[0010] According to some embodiments of the present invention, the direction matching information includes a center distance and an arc length difference, and determining the intersection-over-union ratio and the direction matching information according to each of the predicted anchor frames and the corresponding real target frame in the to-be-detected image sample data set includes:

[0011] Determine the intersection-over-union ratio according to the intersection area and union area of ​​the predicted anchor frame and the corresponding real target frame;

[0012] Determine the center distance according to the center of the predicted anchor frame and the center of the corresponding real target frame;

[0013] A minimum enclosing rectangle is determined according to the predicted anchor frame and the corresponding real target frame; and the arc length difference is determined according to a first arc angle of the predicted anchor frame, a second arc angle of the real target frame, and a third arc angle of the minimum enclosing rectangle.

[0014] According to some embodiments of the present invention, determining a bounding box loss function according to the intersection-over-union ratio, the center distance, the arc length difference, and the quality status of the image sample data set to be detected includes:

[0015] When the quality status of the image sample data set to be detected indicates that the number of low-quality samples in the image sample data set to be detected is less than a preset first judgment threshold, determining the bounding box loss function according to the intersection-over-union ratio, the center distance and the arc length difference;

[0016] In a case where the quality state of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is greater than or equal to the first judgment threshold and less than a preset second judgment threshold, determining the bounding box loss function according to the intersection-and-union ratio, the center distance, the arc length difference and a monotonic focusing dynamic term, wherein the monotonic focusing dynamic term is determined by the intersection-and-union ratio and a preset momentum weighting coefficient;

[0017] When the quality status of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is greater than or equal to the second judgment threshold, the bounding box loss function is determined according to the intersection-and-union ratio, the center distance, the arc length difference and the non-monotonic focusing dynamic term, wherein the non-monotonic focusing dynamic term is determined by the monotonic focusing dynamic term and a preset adjustment variable.

[0018] According to some embodiments of the present invention, the step of performing preliminary recognition on the to-be-detected image sample dataset to obtain a plurality of predicted anchor frames includes:

[0019] Performing uniform sampling processing on the sample data set of the image to be detected to obtain a plurality of sampling pixels;

[0020] The predicted anchor box is generated with each of the sampled pixels as the center.

[0021] According to some embodiments of the present invention, the adjusting the corresponding predicted anchor box according to the bounding box loss function includes:

[0022] Determining a bounding box regression gradient gain according to the bounding box loss function;

[0023] The corresponding predicted anchor box is recursively adjusted according to the bounding box regression gradient gain.

[0024] According to some embodiments of the present invention, the monotonic focusing dynamic term is obtained by:

[0025] Calculating an average of a plurality of the intersection-and-union ratios in the to-be-detected image sample data set to obtain an average intersection-and-union ratio;

[0026] The monotonic focusing dynamic term is determined according to the average intersection-and-combination ratio, the intersection-and-combination ratio and the momentum weighting coefficient.

[0027] According to some embodiments of the present invention, the non-monotonic focusing dynamic term is obtained by:

[0028] Determining an amplitude offset adjustment amount and a telescopic offset adjustment amount from the adjustment variables;

[0029] The non-monotonic focusing dynamic item is determined according to the amplitude offset adjustment amount, the telescopic offset adjustment amount and the monotonic focusing dynamic item.

[0030] A second aspect of the present invention provides a target detection device, the device comprising:

[0031] The first processing module is used to obtain a sample data set of images to be detected;

[0032] A second processing module is used to perform preliminary recognition on the to-be-detected image sample data set to obtain a plurality of predicted anchor frames;

[0033] A third processing module is used to determine the intersection-over-union ratio and direction matching information according to each of the predicted anchor frames and the corresponding real target frame in the image sample data set to be detected;

[0034] A fourth processing module, used to determine a bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the image sample data set to be detected;

[0035] The fifth processing module is used to adjust the corresponding predicted anchor box according to the bounding box loss function.

[0036] A third aspect of the present invention provides a computer device, the device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0037] Memory, used to store computer programs;

[0038] The processor is used to implement the steps of the target detection method as described above when executing the program stored in the memory.

[0039] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the target detection method described above when executed by a processor.

[0040] The target detection method according to the embodiment provided in the present application has at least the following beneficial effects: in the process of target detection, firstly obtain a data set of sample images to be detected; then, perform preliminary recognition on the data set of sample images to be detected to obtain multiple predicted anchor frames; then determine the intersection-over-union ratio and direction matching information based on each predicted anchor frame and the corresponding real target frame; and then subsequently determine the bounding box loss function based on the intersection-over-union ratio, direction matching information and the quality status of the data set of sample images to be detected; in the process of determining the bounding box loss function, the direction matching information is taken into account, thereby improving the recall rate of the bounding box regression; the direction matching information can also improve the convergence efficiency of the bounding box regression, and unify the angle loss and distance loss, which not only ensures the consistency of the measurement units but also simplifies the bounding box regression calculation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0042] Figure 1 is a flow chart of a target detection method provided by an embodiment of the present invention;

[0043] Figure 2 is a specific flow chart of step S300 provided by an embodiment of the present invention;

[0044] Figure 3 is a specific flow chart of step S400 provided by an embodiment of the present invention;

[0045] Figure 4 is a schematic diagram of geometric parameters for obtaining a bounding box loss function provided by an embodiment of the present invention;

[0046] Figure 5 is a bounding box regression gradient gain change curve diagram provided by an embodiment of the present invention;

[0047] Figure 6 is a specific flow chart of step S200 provided by an embodiment of the present invention;

[0048] Figure 7 is a specific flow chart of step S500 provided by an embodiment of the present invention;

[0049] Figure 8 is a specific flow chart of determining a monotonic focusing dynamic item provided by an embodiment of the present invention;

[0050] Fig. 9 is a specific flow chart for determining a non-monotonic focusing dynamic item provided by an embodiment of the present invention;

[0051] Fig.10 is a schematic diagram of a target detection device provided by an embodiment of the present invention;

[0052] Fig.11 It is a schematic diagram of a computer device provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the module division in the device or the logical order in the flowchart may be different, but in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0055] The embodiments of the present application are further described below in conjunction with the accompanying drawings.

[0056] like Figure 1 As shown, Figure 1 It is a flowchart of a target detection method provided by an embodiment of the present invention. The target detection method includes but is not limited to steps S100 to S500.

[0057] Step S100, obtaining a sample data set of images to be detected;

[0058] Step S200, performing preliminary recognition on the image sample data set to be detected to obtain multiple predicted anchor frames;

[0059] Step S300, determining the intersection-over-union ratio and direction matching information according to each predicted anchor frame and the corresponding real target frame in the image sample data set to be detected;

[0060] Step S400, determining a bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the image sample data set to be detected;

[0061] Step S500: adjusting the corresponding predicted anchor box according to the bounding box loss function.

[0062] It should be noted that in the process of target detection, first, a sample data set of images to be detected is obtained; then, a preliminary recognition of the sample data set of images to be detected can be performed to obtain multiple predicted anchor frames; then, the intersection-over-union ratio and direction matching information are determined based on each predicted anchor frame and the corresponding real target frame in the sample data set of images to be detected; subsequently, the bounding box loss function can be determined based on the intersection-over-union ratio, direction matching information and the quality status of the sample data set of images to be detected; in the process of determining the bounding box loss function, the direction matching information is taken into account, thereby improving the recall rate of the bounding box regression; the direction matching information can also improve the convergence efficiency of the bounding box regression, and also unify the angle loss and distance loss, which not only ensures the consistency of the measurement units but also simplifies the bounding box regression calculation; finally, the corresponding predicted anchor frame is adjusted according to the obtained bounding box loss function to improve the accuracy and robustness of the bounding box regression.

[0063] It should be noted that the image sample data set to be detected may include multiple image sample data to be detected. It should be understood that each image sample data to be detected can be a picture, and these pictures can be taken by a camera device, wherein the camera device can be a camera, a mobile phone, a surveillance camera, and other electronic devices with recording functions.

[0064] It is worth noting that the direction matching information can include center distance and arc length difference. The center distance and arc length difference contain direction matching factors, which can improve the recall rate of bounding box regression; the arc length difference can improve the convergence efficiency of bounding box regression, and the arc length difference also unifies the angle loss and distance loss, which not only ensures the consistency of measurement units but also simplifies the bounding box regression calculation.

[0065] It is worth noting that the detection model can be used as the basis for the preliminary recognition of the image sample data set to be detected. The detection model can perform preliminary recognition processing of image targets on multiple image sample data to be detected respectively, so as to form a predicted anchor box on each image sample data to be detected. These predicted anchor boxes can only form preliminary positioning processing of the targets on the image sample data to be detected. In order to make the target positioning more accurate, it is necessary to recursively adjust the predicted anchor boxes based on the bounding box loss function.

[0066] It is worth noting that the real target box in the image sample data set to be detected is the real positioning box of the target image of the image sample data to be detected; for each predicted anchor box, there is a corresponding real target box; according to the predicted anchor box and the real target box, the intersection ratio, center distance and arc length difference can be determined, and then the bounding box loss function can be determined according to the intersection ratio, center distance and arc length difference; since the arc length difference unifies the arc angle and the longitudinal and transverse difference, and considers the direction matching factor, it can speed up the convergence efficiency of the bounding box regression.

[0067] In some embodiments of the present invention, Figure 2 As shown, the above step S300 may include but is not limited to step S310, step S320 and step S330.

[0068] Step S310, determining an intersection-over-union ratio according to the intersection area and union area of ​​the predicted anchor box and the corresponding real target box;

[0069] Step S320, determining a center distance according to the center of the predicted anchor box and the center of the corresponding real target box;

[0070] Step S330, determining a minimum enclosing rectangle according to the predicted anchor frame and the corresponding real target frame; and determining an arc length difference according to a first arc angle of the predicted anchor frame, a second arc angle of the real target frame, and a third arc angle of the minimum enclosing rectangle.

[0071] It should be noted that, in the process of determining the intersection-over-union ratio according to the predicted anchor box and the true target box, the intersection area between the predicted anchor box and the true target box is first determined, and then the union area is determined according to the predicted anchor box and the true target box, wherein the union area is equal to the sum of the areas of the predicted anchor box and the true target box minus the intersection area of ​​the two, and the ratio of the intersection area to the union area is the intersection-over-union ratio; the center distance in the embodiment of the present invention is the distance between the center of the predicted anchor box and the center of the true target box, wherein the predicted anchor box and the true target box are both rectangles, and the centers of both are the intersection points of the diagonals; the minimum enclosing rectangle can be determined according to the predicted anchor box and the corresponding true target box, and the minimum enclosing rectangle can cover the predicted anchor box and the true target box; subsequently, the arc length difference can be determined according to the first arc angle of the predicted anchor box, the second arc angle of the true target box, and the third arc angle of the minimum enclosing rectangle, so that the arc length difference takes into account the direction matching factor, thereby accelerating the convergence efficiency of the bounding box regression. Among them, the arc length in the embodiment of the present invention refers to the angle loss multiplied by the radius of the polar coordinates, and then added to the center distance to unify the dimension of distance, thereby enhancing the generalization ability of the model.

[0072] In some embodiments of the present invention, Figure 3 As shown, the above step S400 may also include but is not limited to steps S410 to S430.

[0073] Step S410, when the quality status of the image sample data set to be detected indicates that the number of low-quality samples in the image sample data set to be detected is less than a preset first judgment threshold, determining a bounding box loss function according to the intersection-over-union ratio, the center distance, and the arc length difference;

[0074] Step S420, when the quality status of the image sample data set to be detected indicates that the number of low-quality samples in the image sample data set to be detected is greater than or equal to a first judgment threshold and less than a preset second judgment threshold, determining a bounding box loss function according to the intersection-over-union ratio, the center distance, the arc length difference, and the monotonic focus dynamic term;

[0075] Step S430, when the quality status of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is greater than or equal to a second judgment threshold, determine the bounding box loss function according to the intersection-over-union ratio, the center distance, the arc length difference and the non-monotonic focusing dynamic term.

[0076] It is worth noting that in the process of determining the bounding box loss function, in addition to the intersection-and-union ratio, center distance and arc length difference, the quality status of the image sample data set to be detected also needs to be considered; when the quality status of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is less than the preset first judgment threshold, the bounding box loss function can be determined based on the intersection-and-union ratio, center distance and arc length difference; wherein, if the number of low-quality samples in the image sample data set to be detected is less than the first judgment threshold, it can be determined that the image sample data set to be detected is a small and medium-sized data set with few low-quality samples; for small and medium-sized data sets with few low-quality samples, the bounding box loss function can be determined based on the intersection-and-union ratio, center distance and arc length difference, wherein the penalty term can be determined based on the center distance and arc length difference, and the arc length difference contains the direction matching factor, thereby improving the recall rate of the target bounding box regression and using the arc difference can improve the convergence efficiency. In addition, the arc difference also unifies the angle loss and the distance loss, which not only ensures the consistency of the measurement unit, simplifies the calculation, improves the interpretability, but also improves the accuracy and robustness of the target bounding box regression.

[0077] It is worth noting that when the quality status of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is not less than the first judgment threshold but less than the second judgment threshold, the image sample data set to be detected will be determined to be a small and medium-sized data set with fewer low-quality samples. At this time, it is necessary to introduce a monotonic focusing dynamic term; wherein, the monotonic focusing dynamic term is determined by the intersection-over-union ratio and a preset momentum weighting coefficient. Based on the monotonic focusing dynamic term, a smaller gradient gain can be assigned to low-quality samples, so that the bounding box regression can focus on the anchor box of ordinary quality, effectively weakening the harm of low-quality samples to the bounding regression box, and improving the convergence speed and accuracy.

[0078] It is worth noting that when the quality status of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is greater than or equal to the second judgment threshold, the image sample data set to be detected will be determined to be a large data set with more low-quality samples, and at this time it is necessary to introduce a non-monotonic focusing dynamic term; wherein, the non-monotonic focusing dynamic term is determined by the monotonic focusing dynamic term and the adjustment variable; based on the non-monotonic focusing dynamic term, the non-monotonicity is further explored, and the accuracy and convergence speed are improved by adaptively formulating the gradient gain allocation strategy that best suits the current situation.

[0079] like Figure 4 As shown, an embodiment of the present invention shows a schematic diagram of geometric parameters for obtaining a bounding box loss function. When the quality status of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is less than a preset first judgment threshold, the bounding box loss function LIoUv1 adopts the paradigm of intersection over union (IoU) plus a penalty term. Among them, the penalty term takes into account the geometric factors of center distance and arc length difference. This problem may cause the prediction box to wander during the training process, resulting in slower convergence of the bounding box and the generation of a worse model. LIoUv1 uses center distance, arc length difference in horizontal and vertical orientations, and includes direction matching factors, thereby improving the recall rate of target bounding box regression and improving convergence efficiency by using radians. LIoUv1 unifies the angle loss and distance loss into the arc length difference of polar coordinates, which not only ensures the consistency of measurement units, simplifies the calculation method, improves interpretability, but also improves the accuracy and robustness of target bounding box regression. As Figure 1 As shown, B and B gt The predicted box and the real box center are respectively. From the perspective of polar coordinates, the diagonal length r of the predicted box, the real box and the minimum enclosing rectangle 1 、r 2 and r c The diameter of the corresponding circumscribed circle. θ 1 ,θ 2 and θ c , which correspond to the arc angles of the predicted box, the real box and the minimum bounding rectangle in the vertical direction. The calculation formula of LIoUv1 is as follows:

[0080]

[0081] Among them, ρ c is the center distance, r 2 ·θ 2 and r 1 ·θ 1 is the arc length, and r 2 ·θ 2 -r 1 ·θ 1 This is the arc length difference.

[0082] In addition, when the number of low-quality samples in the image sample data set to be detected is greater than or equal to the first judgment threshold but less than the preset second judgment threshold, it is necessary to add a monotonic focusing dynamic term F on the basis of LIoUv1. IoU , forming LIoUv2; F IoU The calculation formula is as follows:

[0083]

[0084]

[0085] Among them, IoU # is the value of the intersection-over-union ratio, and # represents separation from the computational graph to prevent IoU from generating gradients that hinder convergence. represents the average value, and μ is the momentum weighting coefficient. to further reduce outlier differences.

[0086] In addition, when the quality status of the image sample data set to be detected indicates that the number of low-quality samples in the image sample data set to be detected is greater than or equal to the second judgment threshold, it is necessary to add a non-monotonic focusing dynamic term on the basis of LIoUv2 to form LIoUv3, and its calculation formula is as follows:

[0087]

[0088] In the above formula, the adjustable variables k, m and p are used to control the upper and lower amplitudes and the left and right shapes of the curve. After ablation experiments, the recommended values ​​are k = 6, m = 1.6, and p = 1. Figure 5 As shown in the figure, the left is the curve of the bounding box regression gradient gain changing with m when m=1.6, and the right is the curve of the bounding box regression gradient gain changing with m when k=6. For the inevitable low-quality samples in the training set, geometric factors such as center distance, angle, and aspect ratio will increase the penalty for low-quality samples, resulting in a decrease in the generalization performance of the bounding box regression model. When the predicted box and the true box are highly overlapped, the non-monotonic focused dynamic term in the above formula will weaken the penalty of geometric factors, and less low-quality sample training intervention will improve the generalization ability of the bounding box regression model.

[0089] In some embodiments of the present invention, Figure 6 As shown, the above step S200 may also include but is not limited to step S210 and step S220.

[0090] Step S210, uniformly sampling the image sample data set to be detected to obtain a plurality of sampling pixels;

[0091] Step S220: Generate a predicted anchor box with each sampled pixel as the center.

[0092] It should be noted that in the process of preliminary recognition processing of the image sample data set to be detected, the image sample data set to be detected is first uniformly sampled to obtain multiple sampling pixels; then each sampling pixel is used as the center to generate a prediction anchor box. Each sampling pixel will generate a prediction anchor box, so that multiple prediction anchor boxes can be generated according to the image sample data set to be detected, which is a prerequisite for the subsequent bounding box regression adjustment.

[0093] In some embodiments of the present invention, Figure 7 As shown, the above step S500 may also include but is not limited to step S510 and step S520.

[0094] Step S510, determining a bounding box regression gradient gain according to a bounding box loss function;

[0095] Step S520: adjusting the corresponding predicted anchor box according to the bounding box regression gradient gain.

[0096] It should be noted that in the process of adjusting the bounding box, the bounding box regression gradient gain is first determined according to the bounding box loss function; subsequently, the corresponding predicted anchor box can be recursively adjusted according to the bounding box regression gradient gain to better complete target detection and improve the generalization ability of the model, so as to continue to use the model for target detection processing and improve the accuracy of target detection.

[0097] In some embodiments of the present invention, Figure 8 As shown, the above-mentioned monotonic focusing dynamic term can be obtained by but not limited to the following steps.

[0098] Step S421, calculating the average of multiple intersection-and-union ratios in the image sample data set to be detected to obtain an average intersection-and-union ratio;

[0099] Step S422, determining the monotonic focusing dynamic term according to the average intersection-over-combination ratio, the intersection-over-combination ratio and the momentum weighting coefficient.

[0100] It should be noted that in the process of obtaining the monotone focus dynamic term, the average value of multiple intersection-and-union ratios in the image sample data set to be detected is first calculated, so that the average intersection-and-union ratio can be obtained; finally, the monotone focus dynamic term can be determined according to the average intersection-and-union ratio, the intersection-and-union ratio and the momentum weighting coefficient. Among them, the embodiment of the present invention can further reduce the outlier difference by averaging multiple intersection-and-union ratios in the image sample data set to be detected.

[0101] In some embodiments of the present invention, Fig. 9As shown, the above-mentioned non-monotonic focusing dynamic term can be obtained by but not limited to the following steps.

[0102] Step S431, determining an amplitude offset adjustment amount and a telescopic offset adjustment amount from the adjustment variables;

[0103] Step S432, determining the non-monotonic focusing dynamic item according to the amplitude offset adjustment amount, the telescopic offset adjustment amount and the monotonic focusing dynamic item.

[0104] It should be noted that in the process of obtaining the non-monotonic focusing dynamic term, the amplitude offset adjustment amount and the telescopic offset adjustment amount are first determined from the adjustment variables; finally, the non-monotonic focusing dynamic term can be determined based on the amplitude offset adjustment amount, the telescopic offset adjustment amount and the monotonic focusing dynamic term. The non-monotonic focusing dynamic term can weaken the penalty of geometric factors, and less low-quality sample training intervention will improve the generalization ability of the bounding box regression model.

[0105] In addition, if Fig.10 As shown, an embodiment of the present application further provides a target detection device 10, comprising:

[0106] The first processing module 100 is used to obtain a sample data set of an image to be detected;

[0107] The second processing module 200 is used to perform preliminary recognition on the image sample data set to be detected to obtain multiple predicted anchor frames;

[0108] The third processing module 300 is used to determine the intersection-over-union ratio and direction matching information according to each predicted anchor frame and the corresponding real target frame in the image sample data set to be detected;

[0109] A fourth processing module 400 is used to determine a bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the image sample data set to be detected;

[0110] The fifth processing module 500 is used to adjust the corresponding predicted anchor box according to the bounding box loss function.

[0111] The specific implementation of the target detection device 10 is basically the same as the specific embodiment of the above-mentioned target detection method, and will not be repeated here.

[0112] In addition, if Fig.11 As shown, an embodiment of the present invention further provides a computer device 700, which includes a processor 710, a communication interface, a memory 720 and a communication bus, wherein the processor 710, the communication interface, and the memory 720 communicate with each other through the communication bus; the memory 720 is used to store computer programs; the processor 710 is used to execute the program stored in the memory 720 to implement the target detection method of each embodiment described above, for example, to execute the above described Figure 1 The method steps S100 to S500, Figure 2 Steps S310 to S330 of the method, Figure 3 Steps S410 to S430 of the method, Figure 6 Steps S210 to S220 of the method, Figure 7 Steps S510 to S520 of the method, Figure 8 Method steps S421 to S422 and Fig. 9 Method steps S431 to S432.

[0113] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor, for example, by a processor 710 in the above-mentioned device embodiment, so that the above-mentioned processor 710 can execute the target detection method in the above-mentioned embodiment, for example, execute the above-mentioned Figure 1 The method steps S100 to S500, Figure 2 Steps S310 to S330 of the method, Figure 3 Steps S410 to S430 of the method, Figure 6 Steps S210 to S220 of the method, Figure 7 Steps S510 to S520 of the method, Figure 8 Steps S421 to S422 of the method and Fig. 9 Method steps S431 to S432.

[0114] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0115] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A target detection method, characterized in that: include: Obtain a sample dataset of images to be detected; Performing preliminary recognition on the sample image data set to be detected to obtain multiple prediction anchor frames; Determine the intersection-over-union ratio and direction matching information according to each of the predicted anchor frames and the corresponding real target frame in the image sample data set to be detected; Determine a bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the image sample data set to be detected; Adjusting the corresponding predicted anchor frame according to the bounding box loss function; The direction matching information includes the center distance and the arc length difference, and the determining of the intersection-over-union ratio and the direction matching information according to each of the predicted anchor frames and the corresponding real target frame in the sample image data set to be detected includes: Determine the intersection-over-union ratio according to the intersection area and union area of ​​the predicted anchor frame and the corresponding real target frame; Determine the center distance according to the center of the predicted anchor frame and the center of the corresponding real target frame; A minimum enclosing rectangle is determined according to the predicted anchor frame and the corresponding real target frame; and the arc length difference is determined according to a first arc angle of the predicted anchor frame, a second arc angle of the real target frame, and a third arc angle of the minimum enclosing rectangle.

2. The target detection method according to claim 1, characterized in that: The determining of the bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the image sample data set to be detected includes: When the quality status of the image sample data set to be detected indicates that the number of low-quality samples in the image sample data set to be detected is less than a preset first judgment threshold, determining the bounding box loss function according to the intersection-over-union ratio, the center distance and the arc length difference; In a case where the quality state of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is greater than or equal to the first judgment threshold and less than a preset second judgment threshold, determining the bounding box loss function according to the intersection-and-union ratio, the center distance, the arc length difference and a monotonic focusing dynamic term, wherein the monotonic focusing dynamic term is determined by the intersection-and-union ratio and a preset momentum weighting coefficient; When the quality status of the image sample data set to be detected represents that the number of low-quality samples in the image sample data set to be detected is greater than or equal to the second judgment threshold, the bounding box loss function is determined according to the intersection-and-union ratio, the center distance, the arc length difference and the non-monotonic focusing dynamic term, wherein the non-monotonic focusing dynamic term is determined by the monotonic focusing dynamic term and a preset adjustment variable.

3. The target detection method according to claim 1, characterized in that: The preliminary recognition of the to-be-detected image sample data set to obtain a plurality of predicted anchor frames includes: Performing uniform sampling processing on the sample data set of the image to be detected to obtain a plurality of sampling pixels; The predicted anchor box is generated with each of the sampled pixels as the center.

4. The target detection method according to claim 1, characterized in that: The adjusting the corresponding predicted anchor box according to the bounding box loss function includes: Determining a bounding box regression gradient gain according to the bounding box loss function; The corresponding predicted anchor box is adjusted according to the bounding box regression gradient gain.

5. The target detection method according to claim 2, characterized in that: The monotonic focusing dynamic term is obtained by: Calculating an average of a plurality of the intersection-and-union ratios in the to-be-detected image sample data set to obtain an average intersection-and-union ratio; The monotonic focusing dynamic term is determined according to the average intersection-and-combination ratio, the intersection-and-combination ratio and the momentum weighting coefficient.

6. The target detection method according to claim 2, characterized in that: The non-monotonic focusing dynamic term is obtained by: Determining an amplitude offset adjustment amount and a telescopic offset adjustment amount from the adjustment variables; The non-monotonic focusing dynamic item is determined according to the amplitude offset adjustment amount, the telescopic offset adjustment amount and the monotonic focusing dynamic item.

7. A target detection device, characterized in that: include: The first processing module is used to obtain a sample data set of images to be detected; A second processing module is used to perform preliminary recognition on the to-be-detected image sample data set to obtain a plurality of predicted anchor frames; A third processing module is used to determine the intersection-over-union ratio and direction matching information according to each of the predicted anchor frames and the corresponding real target frame in the image sample data set to be detected; A fourth processing module, used to determine a bounding box loss function according to the intersection-over-union ratio, the direction matching information and the quality status of the image sample data set to be detected; A fifth processing module, configured to adjust the corresponding predicted anchor box according to the bounding box loss function; The direction matching information includes the center distance and the arc length difference, and the determining of the intersection-over-union ratio and the direction matching information according to each of the predicted anchor frames and the corresponding real target frame in the sample image data set to be detected includes: Determine the intersection-over-union ratio according to the intersection area and union area of ​​the predicted anchor frame and the corresponding real target frame; Determine the center distance according to the center of the predicted anchor frame and the center of the corresponding real target frame; A minimum enclosing rectangle is determined according to the predicted anchor frame and the corresponding real target frame; and the arc length difference is determined according to a first arc angle of the predicted anchor frame, a second arc angle of the real target frame, and a third arc angle of the minimum enclosing rectangle.

8. A computer device, characterized in that: The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the steps of the target detection method according to any one of claims 1 to 6 when executing a program stored in a memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the target detection method according to any one of claims 1 to 6 are implemented.