A positive and negative sample selection method for extreme scale target detection

By redefining the positive and negative sample allocation method, calculating the Distance value, and setting the hyperparameter k, the problem of insufficient Anchor allocation in extreme-scale target detection is solved, the detection recall and sample balance are improved, and more accurate target detection is achieved.

CN114627350BActive Publication Date: 2025-11-04NANJING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210310834.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-11-04
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

In the detection of targets at extreme scales, existing technologies based on cross-union ratio (CUNR) struggle to assign suitable anchors to targets of extreme sizes, resulting in insufficient positive sample allocation and an imbalance between positive and negative samples.

Method used

By calculating the area of ​​the true bounding box, the Distance value, and setting the hyperparameter k and the Distance threshold, the method for allocating positive and negative samples is redefined to ensure that targets at extreme scales can be allocated more suitable positive samples, thus alleviating the problem of imbalanced samples.

Benefits of technology

It improves the recall rate of extreme-scale targets, alleviates the problem of imbalance between positive and negative samples, and achieves more accurate target detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0003568167500000011
    Figure HDA0003568167500000011
  • Figure HDA0003568167500000021
    Figure HDA0003568167500000021
Patent Text Reader

Abstract

The application provides a positive and negative sample selection method for extreme scale target detection, comprising the following steps: step 1: arranging the target real value bounding box area in descending order; step 2: calculating the Distance value of each real value bounding box and all Anchors; step 3: calculating the Distance threshold value of the negative training sample; step 4: setting the value of the hyperparameter k; step 5: assigning the negative training sample of all targets; step 6: assigning the positive training sample of all targets; step 7: directly discarding the Anchor which is not a positive training sample and not a negative training sample; and step 8: outputting the respective positive and negative training samples of all targets for subsequent target detection training. The application can assign more suitable training samples to the target, thereby improving the detection effect of the extreme scale target and further improving the recall rate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0002] The application belongs to the field of artificial intelligence and relates to a positive and negative sample selection method for extreme scale target detection. BACKGROUND

[0004] Currently, most target detection algorithms based on Anchor use the method of intersection over union to define positive and negative training samples. If the intersection over union is higher than the positive threshold, the sample is determined as a positive sample. If the intersection over union is lower than the negative threshold, the sample is determined as a negative sample. The samples in the middle are directly discarded.

[0005] However, for targets of extreme size, the method based on intersection over union may not assign the most appropriate Anchor to the target, and the assigned positive samples are extremely few. For example, if the intersection over union of all Anchors is lower than the positive threshold, the Anchor with the largest intersection over union will be assigned to the target as a positive sample. SUMMARY

[0007] To solve the above sample assignment problem, the application provides a positive and negative sample selection method for extreme scale target detection, which specifically comprises the following steps:

[0008] Step 1: arrange the target real value bounding box area in descending order;

[0009] Step 2: calculate the Distance value of each real value bounding box and all Anchors;

[0010] Step 3: calculate the Distance threshold of the negative training sample;

[0011] Step 4: set the value of the hyperparameter k;

[0012] Step 5: assign the negative training samples of all targets;

[0013] Step 6: assign the positive training samples of all targets;

[0014] Step 7: discard the Anchors that are neither positive training samples nor negative training samples;

[0015] Step 8: output the respective positive and negative training samples of all targets for subsequent target detection training.

[0016] Further, step 1 comprises the following steps:

[0017] Step 1-1: calculate the area of all real value bounding boxes;

[0018] Step 1-2: arrange all target bounding boxes in descending order according to the size of the area.

[0019] Further, step 2 comprises the following steps:

[0020] Step 2-1: define the calculation formula of Distance, which is the sum of the distance between the centers of two rectangles and the difference between the lengths and widths of two rectangles;

[0021] Step 2-2: calculate the value of Distance between all target bounding boxes and all Anchors using the calculation formula defined in step 2-1;

[0022] Step 2-3: sort all Anchors in ascending order for each target based on the Distance value calculated in step 2-2, and each target has a sorted version of all Anchors.

[0023] Further, step 3 includes the following steps:

[0024] Step 3-1: calculate the mean and standard deviation of the Distance of each target;

[0025] Step 3-2: calculate the negative sample threshold based on the mean and standard deviation calculated in step 3-1, and the threshold is defined as the difference between the mean and 1.75 times the standard deviation.

[0026] Further, step 4 method includes:

[0027] Set the hyperparameter k value of the number of positive samples for each target, k is 16.

[0028] Further, step 5 method includes:

[0029] According to the Distance value calculated in step 2-2 and the negative sample threshold calculated in step 3-2, set the Anchors whose Distance value is lower than the negative threshold for each target as negative samples.

[0030] Further, step 6 method includes:

[0031] According to the sorted version of Anchors for each target obtained in step 2-3 and the value of k obtained in step 4, set the first k Anchors for each target as positive samples according to the sorting order in step 1-2.

[0032] Further, step 7 method includes:

[0033] For Anchors that are not positive samples and not negative samples, discard them and do not use them.

[0034] Further, step 8 method includes:

[0035] Output the positive samples and negative samples for each target for subsequent training of target detection.

[0036] The application provides a positive and negative sample selection method for extreme scale target detection.

[0037] 1) Compared with the original assignment method based on the intersection over union, the application can assign more suitable training positive samples to the extreme scale target, which is more conducive to detecting the extreme scale target.

[0038] 2) The application can assign more training positive samples to the extreme scale target, which is not only conducive to improving the recall rate, but also alleviates the imbalance problem of positive and negative samples. BRIEF DESCRIPTION OF DRAWINGS

[0040] The above or other aspects of the application will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings.

[0041] Figure 1 is a step flowchart of the entire algorithm;

[0042] Figure 2 is a comparison of the positive training samples assigned by the method based on the intersection over union and the method of the application, and in order to facilitate comparison, the value of k is set to 1. DETAILED DESCRIPTION

[0044] The application will be described in detail below with reference to the accompanying drawings and examples.

[0045] As shown in the figure, the specific steps of a positive and negative sample selection method for extreme scale target detection include: Figure 1

[0046] Step 1: Arrange the target real value bounding box area in descending order;

[0047] Step 2: Calculate the Distance value of each real value bounding box and all Anchors;

[0048] Step 3: Calculate the Distance threshold value of the negative training sample;

[0049] Step 4: Set the value of the hyperparameter k;

[0050] Step 5: Assign the negative training sample of all targets;

[0051] Step 6: Assign the positive training sample of all targets;

[0052] Step 7: For Anchors that are neither positive training samples nor negative training samples, discard directly;

[0053] Step 8: Output the respective positive and negative training samples of all targets for subsequent target detection training.

[0054] ​Further, step 1 comprises the following steps:

[0055] Step 1-1: Calculate the area of all real bounding boxes.

[0056] Step 1-2: Sort all target bounding boxes in descending order according to the size of the area.

[0057] Further, step 2 comprises the following steps:

[0058] Step 2-1: Define the calculation formula of Distance, which is the sum of the distance between the centers of two rectangles and the difference between the lengths and widths of two rectangles.

[0059] Step 2-2: Calculate the value of Distance between all target bounding boxes and all Anchors using the calculation formula defined in step 2-1.

[0060] Step 2-3: Sort all Anchors for each target in ascending order according to the Distance value calculated in step 2-2, and each target has a Distance sorted version of all Anchors.

[0061] Further, step 3 comprises the following steps:

[0062] Step 3-1: Calculate the mean and standard deviation of the Distance of each target.

[0063] Step 3-2: Calculate the negative sample threshold value according to the mean and standard deviation calculated in step 3-1, and the threshold value is defined as the difference between the mean and 1.75 times the standard deviation.

[0064] Further, step 4 method comprises:

[0065] Set the hyperparameter k value of the number of positive samples for each target, k is 16.

[0066] Further, step 5 method comprises:

[0067] According to the Distance value calculated in step 2-2 and the negative sample threshold value calculated in step 3-2, set the Anchors whose Distance value is lower than the negative threshold value for each target as negative samples.

[0068] Further, step 6 method comprises:

[0069] According to the respective target sorted version of Anchors obtained in step 2-3 and the value of k obtained in step 4, set the first k Anchors for each target as positive samples according to the arrangement order in step 1-2.

[0070] Further, step 7 method comprises:

[0071] For Anchor which is not positive sample and not negative sample, directly discard no longer use.

[0072] Further, the step 8 method comprises:

[0073] For each target output its positive sample and negative sample, training for subsequent target detection.

[0074] Figure 2 For the positive training sample pair assigned for the method based on the intersection over union and the method of the present application, for the convenience of comparison, the figure shows that the value of k is set to 1.

[0075] There are many methods and ways to realize the technical scheme, and the above description is only the preferred embodiment of the present application. It should be pointed out that for ordinary technical personnel in the technical field, without departing from the principle of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be regarded as the protection scope of the present application. The components not explicitly described in the embodiment can be realized by the existing technology.

Claims

1. A method for positive and negative sample selection of extreme scale object detection, characterized in that, The method comprises the following steps: Step 1: arrange the target real value bounding box area in descending order; Step 1 comprises the following steps: Step 1-1: calculate the area of all real value bounding boxes; Step 1-2: arrange all target bounding boxes in descending order according to the size of the area; Step 2: calculate the Distance value of each real value bounding box and all anchors; Step 2 comprises the following steps: Step 2-1: define the calculation formula of Distance, which is the sum of the distance between the centers of two rectangles and the difference between the lengths and widths of two rectangles; Step 2-2: calculate the Distance value of all target bounding boxes and all anchors using the calculation formula defined in step 2-1; Step 2-3: arrange all anchors in ascending order for each target according to the Distance value calculated in step 2-2, and each target has a Distance sorted version of all anchors; Step 3: calculate the Distance threshold value of the negative training sample; Step 3 comprises the following steps: Step 3-1: calculate the mean and standard deviation of the Distance of each target; Step 3-2: calculate the negative sample threshold value according to the mean and standard deviation calculated in step 3-1, and the threshold value is defined as the difference between the mean and 1.75 times the standard deviation; Step 4: set the value of the hyperparameter k; Step 4 method includes: Set the hyperparameter k value of the number of positive samples for each target, k is 16; Step 5: assign the negative training samples of all targets; Step 5 method includes: According to the Distance value calculated in step 2-2 and the negative sample threshold value calculated in step 3-2, set the anchors with a Distance value lower than the negative threshold value for each target as negative samples; Step 6: assign the positive training samples of all targets; Step 6 method includes: According to the respective target sorted version of anchors obtained in step 2-3 and the value of k obtained in step 4, set the first k anchors for each target as positive samples according to the arrangement order in step 1-2; Step 7: discard the anchors that are not positive training samples and not negative training samples; Step 8: output the respective positive and negative training samples of all targets for subsequent target detection training.

2. The method of claim 1, wherein, Step 7 method includes: Discard the anchors that are not positive samples and not negative samples.

3. The method of claim 2, wherein, Step 8 method includes: Output the positive and negative samples of each target for subsequent target detection training.

Citation Information

Patent Citations

  • Positive and negative sample balancing method for deep learning target detection

    CN110020664A

  • New intention recognition method for screening negative samples by utilizing called guest information

    CN112417132A