Target detection method based on arc tangent differential function bounding box regression loss
By using the bounding box regression loss method of the arctangent differential function in object detection, the TanIoU difference between the real box and the prediction box is calculated and the neural network parameters are updated, which solves the low-precision problem caused by position deviation in traditional methods, and significantly improves the target detection average accuracy.
Patent Information
- Application Number
- CN202411175777.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-17
AI Technical Summary
Traditional target detection methods are sensitive to target position deviation, resulting in low detection average accuracy and difficult to meet high accuracy requirements.
The bounding box regression loss method based on the inverse tangent differential function is used to calculate the difference between the real box and the prediction box through TanIoU similarity, and the gradient parameters of the target detection neural network are updated until the lowest bounding box regression loss is reached, improving the detection accuracy.
The average detection accuracy of the target detection neural network is improved, making it insensitive to target position deviation, and improving detection accuracy.
Smart Images

Figure CN119152184A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a target detection method, and in particular to a target detection method based on arctangent differential function bounding box regression loss. Background Art
[0002] With the continuous development of the space field, target detection intersects with many other important fields and has become an important foundation of aerospace technology with great research significance.
[0003] For target detection, traditional target detection methods usually detect targets based on the bounding box intersection-union ratio indicator. However, this detection method is sensitive to the position deviation of the target, resulting in low average detection accuracy and difficulty in meeting the requirements of high-precision target detection. Summary of the invention
[0004] The purpose of the present invention is to solve the technical problem that the existing target detection methods are more sensitive to the position deviation of the target, resulting in low average detection accuracy, and to provide a target detection method based on the arctangent differential function bounding box regression loss.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A target detection method based on arctangent differential function bounding box regression loss, which is special in that it includes the following steps:
[0007] Step 1: Obtain a detection data set of a target image, and divide the detection data set of the target image into a training set and a test set;
[0008] Step 2: Build a target detection neural network;
[0009] Step 3: Input the images in the training set into the target detection neural network, and output the predicted box of the target through the target detection neural network;
[0010] Step 4: Calculate the TanIoU similarity between the real box and the predicted box to get the bounding box regression loss L TanIoU ;
[0011] Step 5: Bounding box regression loss L TanIoU , update the gradient parameters of the target detection neural network through forward and backward propagation, and determine the bounding box regression loss L TanIoU Whether the preset conditions are met, if yes, execute step 6, if no, return to step 3, input the target image in the training set into the target detection neural network with updated gradient parameters until the preset conditions are met;
[0012] Step 6: Input the test set into the target detection neural network after updating the gradient parameters to perform and complete the target detection.
[0013] Furthermore, step 4 is specifically as follows:
[0014] The following formula is used to calculate the TanIoU similarity between the real box and the predicted box, and the following bounding box regression loss L is obtained: TanIoU :
[0015] TanIoU=IoU-d1-d2;
[0016] Where: IoU is the intersection-over-union ratio of the real box and the predicted box; the upper left corner of the real box is defined as point a, the lower right corner is defined as point c, the upper left corner of the predicted box is defined as point b, and the lower right corner is defined as point g, then d1 is the inverse tangent differential distance between point a and point b, and d2 is the inverse tangent differential distance between point c and point g;
[0017] The bounding box regression loss L TanIoU for:
[0018] L TanIoU =1-TanIoU.
[0019] Furthermore, the coordinates of point b and point g are defined as and The coordinates of point a and point c are and Then d1 and d2 are calculated using the following formulas:
[0020]
[0021] Furthermore, in step 3, the prediction box is a four-dimensional tensor (x, y, w, h), where x and y represent the coordinates of the center point of the prediction box, and w and h represent the width and height of the prediction box, respectively;
[0022] In step 4, the coordinates of point b at the upper left corner and point g at the lower right corner of the prediction box are:
[0023] Point b (x-0.5w, y+0.5h), point g (x+0.5w, y-0.5h).
[0024] Furthermore, in step 5, the preset condition is the bounding box regression loss L TanIoU Reaching a minimum value that cannot be lowered.
[0025] The beneficial effects of the present invention are:
[0026] The present invention calculates the TanIoU similarity between the real box and the predicted box to obtain the bounding box regression loss L TanIoU , which is insensitive to the position deviation of the target, and then based on the bounding box regression loss LTanIoU The gradient parameters of the target detection neural network are updated, thereby improving the average detection accuracy of the target detection neural network. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the TanIoU similarity calculation principle in step 4 of an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, advantages and features of the present invention clearer, the following is a further detailed description of a target detection method based on inverse tangent differential function bounding box regression loss proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. According to the following specific implementation methods, the advantages and features of the present invention will be clearer.
[0029] This embodiment provides a target detection method based on arctangent differential function bounding box regression loss, specifically comprising the following steps:
[0030] Step 1: Obtain a detection data set of a target image, and divide the detection data set of the target image into a training set and a test set according to a preset ratio; the preset ratio may be 9:1, or 8:2, etc.
[0031] Step 2: Build a target detection neural network, which uses an existing neural network, such as YOLOv6L.
[0032] Step 3: Input the image in the training set into the target detection neural network. After feature extraction through the target detection neural network, the prediction box of the target is output after mapping. Specifically, the prediction box is a four-dimensional tensor (x, y, w, h), where x and y represent the coordinates of the center point of the prediction box, and w and h represent the width and height of the prediction box, respectively.
[0033] Step 4: Use the following formula to calculate the TanIoU similarity between the real box and the predicted box;
[0034] TanIoU=IoU-d1-d2;
[0035] Where: IoU is the intersection-over-union ratio of the real box and the predicted box, that is, the ratio between the intersection and union of the real box and the predicted box; see Figure 1 , define the upper left corner of the real box as point a, the lower right corner as point c, the upper left corner of the predicted box as point b, and the lower right corner as point g, then d1 is the inverse tangent differential distance between point a and point b, and d2 is the inverse tangent distance between point c and point g.
[0036] IoU can be expressed as:
[0037]
[0038] Where: A is the real box, B is the predicted box.
[0039] Points b and g are defined as and The coordinates of point a and point c are and Then d1 and d2 are calculated using the following formulas:
[0040]
[0041] The coordinates of point b in the upper left corner and point g in the lower right corner of the prediction box are:
[0042] Point b (x-0.5w, y+0.5h), point g (x+0.5w, y-0.5h).
[0043] The coordinates of point a at the upper left corner and point c at the lower right corner of the real frame can be obtained by manual marking in advance.
[0044] Based on the TanIoU similarity calculation results, the following bounding box regression loss L is obtained TanIoU :
[0045] L TanIoU =1-TanIoU.
[0046] Step 5: Bounding box regression loss L TanIoU , update the gradient parameters of the target detection neural network through forward and backward propagation, and determine the bounding box regression loss L TanIoU Whether it has reached the lowest value that cannot be reduced. During the training process of the model, the bounding box regression loss L TanIoU After reaching a relatively stable value, it is no longer possible to perform iterative optimization. This relatively stable value will cause the loss of bounding box loss L in the subsequent iterative training of the model. TanIoU It will not decrease any further and will basically remain stable at a certain value. If yes, execute step 6. If no, return to step 3 and input the target image in the training set into the target detection neural network with updated gradient parameters until the preset conditions are met.
[0047] Step 6: Input the test set into the target detection neural network after updating the gradient parameters to perform and complete the target detection.
[0048] Experimental results:
[0049] Using YOLOv6L as the target detection neural network, the effectiveness of this method was verified on the Pascal Voc public dataset. The batch size was set to 128, and fine-tuning was performed on the original YOLOv6L pre-trained model. The training batch was set to 150, and the stochastic gradient descent optimizer was used. The learning rate was set to 0.0032, the momentum was set to 0.843, and the weight decay was set to 0.00036. Data enhancement used rotation, offset, flip, image decay and other technologies. Compared with other popular bounding box regression loss methods, the verification average precision (AP) is significantly higher than other bounding box regression loss methods, as shown in Table 1:
[0050] Table 1 Accuracy comparison table
[0051] AP AP50 AP75 IoU 0.688 0.876 0.750 GIoU 0.691 0.877 0.751 SIoU 0.688 0.874 0.750 TanIoU 0.701 0.889 0.767
[0052] AP (average precision), the average of 10 mAPs at different TanIoUs, AP = (AP50 + AP55 + ... + AP95) / 10;
[0053] AP50( mAP@0.50 );
[0054] AP75 (mAP@0.75), AP75=(AP50+AP55+…+AP75).
Claims
1. A target detection method based on arctangent differential function bounding box regression loss, characterized in that: The following steps are involved: Step 1: Obtain a detection data set of a target image, and divide the detection data set of the target image into a training set and a test set; Step 2: Build a target detection neural network; Step 3: Input the images in the training set into the target detection neural network, and output the predicted box of the target through the target detection neural network; Step 4: Calculate the TanIoU similarity between the real box and the predicted box to get the bounding box regression loss L TanIoU ; Step 5: Bounding box regression loss L TanIoU , update the gradient parameters of the target detection neural network through forward and backward propagation, and determine the bounding box regression loss L TanIoU Whether the preset conditions are met, if yes, execute step 6, if no, return to step 3, input the target image in the training set into the target detection neural network with updated gradient parameters until the preset conditions are met; Step 6: Input the test set into the target detection neural network after updating the gradient parameters to perform and complete the target detection.
2. The target detection method based on arctangent differential function bounding box regression loss according to claim 1, characterized in that: Step 4 is as follows: The following formula is used to calculate the TanIoU similarity between the real box and the predicted box to obtain the bounding box regression loss L TanIoU : TanIoU=IoU-d1-d2; Where: IoU is the intersection-over-union ratio of the real box and the predicted box; the upper left corner of the real box is defined as point a, the lower right corner is defined as point c, the upper left corner of the predicted box is defined as point b, and the lower right corner is defined as point g, then d1 is the inverse tangent differential distance between point a and point b, and d2 is the inverse tangent differential distance between point c and point g; The bounding box regression loss L TanIoU for: L TanIoU = 1-TanIoU.
3. The object detection method based on arctangent differential function bounding box regression loss according to claim 2 is characterized in that: In step 4, the coordinates of point b and point g are defined as and The coordinates of point a and point c are and Then d1 and d2 are calculated using the following formulas:
4. The object detection method based on arctangent differential function bounding box regression loss according to claim 2 or 3, characterized in that: In step 3, the prediction box is a four-dimensional tensor (x, y, w, h), where x and y represent the coordinates of the center point of the prediction box, and w and h represent the width and height of the prediction box respectively; In step 4, the coordinates of point b at the upper left corner and point g at the lower right corner of the prediction box are: Point b (x-0.5w, y+0.5h), point g (x+0.5w, y-0.5h).
5. The object detection method based on arctangent differential function bounding box regression loss according to claim 1, characterized in that: In step 5, the preset condition is the bounding box regression loss L TanIoU Reached the set minimum value.
