An autonomous driving target detection method for multi-scale targets and occluded targets
Through the combination of K-means and genetic algorithm clustering and attention feature pyramid network, combined with the optimization of Focal loss and CloU loss, and using the Soft-CIoU-NMS algorithm for post-processing, multi-scale and occlusion targets in autonomous driving scenarios are solved. The problem of detection precision and accuracy improves the detection precision and recall rate.
Patent Information
- Application Number
- CN202210787123.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-07-04
AI Technical Summary
There is room for improvement in the detection precision and accuracy of multi-scale targets and occluded targets in autonomous driving scenarios, especially in complex traffic scenarios where problems of missed detection and inaccurate positioning are prone to occur.
A clustering method based on K-means and genetic algorithm is used to generate a variety of anchor boxes, combined with the attention feature pyramid network to obtain the regression parameters of the target bounding box, and the loss function is optimized through Focal loss and CloU loss, and finally Soft-CIoU-NMS is used The algorithm performs post-processing to improve detection precision and recall.
It effectively improves the accuracy of multi-scale target detection, reduces the problem of missed detection and inaccurate positioning of occluded targets in complex scenes, and enhances the generalization ability and accuracy of autonomous driving target detection.
Smart Images

Figure CN115100629B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of autonomous driving control technology, and in particular to an autonomous driving target detection method for multi-scale targets and occluded targets. Background Art
[0002] Autonomous driving is an effective solution to improve vehicle safety, reduce traffic accidents, and increase travel efficiency and fuel economy. Object detection is an important way to perceive the environment for autonomous driving, and its detection results greatly affect the decision-making behavior of autonomous driving and driving safety.
[0003] Current target detection technologies are mainly divided into traditional target detection algorithms and deep learning-based target detection algorithms. Traditional target detection algorithms are based on artificially designed features, such as HOG features, LBP features, SIFT features, etc. These features have poor generalization capabilities and are difficult to detect multiple types of targets in autonomous driving scenarios. Deep learning-based target detection algorithms use convolutional neural networks to extract features, have certain generalization capabilities, and have certain advantages in detection accuracy. However, in complex traffic scenarios, due to reasons such as changes in target scale and occlusion, autonomous driving target detection algorithms also face huge challenges. There is still much room for improvement in the detection of multi-scale targets and occluded targets in autonomous driving scenarios. Summary of the invention
[0004] The present invention aims to provide an autonomous driving target detection method for multi-scale targets and occluded targets, so as to improve the detection accuracy of multi-scale targets and alleviate the problems of missed detection and inaccurate positioning of occluded targets in complex scenes.
[0005] In order to solve the above technical problems, the specific solution adopted by the present invention is: an autonomous driving target detection method for multi-scale targets and occluded targets, by constructing an autonomous driving complex traffic scene dataset, clustering the target bounding boxes in the dataset, and calculating the regression parameters of the target bounding boxes to improve the detection accuracy of multi-scale targets, and then post-processing the predicted bounding boxes to alleviate the missed detection and positioning of occluded targets.
[0006] Furthermore, the method includes the following steps: S1: collecting target image information on actual roads, constructing a data set of complex traffic scenes for autonomous driving, and preprocessing the target image information; S2: clustering the bounding boxes in the data set by a clustering method based on a combination of K-means and genetic algorithm to generate anchor boxes of 9 different sizes; S3: obtaining the regression parameters of the target bounding box through an attention feature pyramid network; S4: constructing a loss function based on Focal loss and CloU loss to optimize the regression parameters of the target bounding box obtained in S3 to obtain a predicted bounding box; S5: post-processing the predicted bounding box obtained in S4 based on the Soft-CloU-NMS algorithm to obtain the final prediction result.
[0007] Furthermore, the target image information refers to image information collected by a visual camera, including vehicles, pedestrians, and traffic signs on the actual road.
[0008] Furthermore, the target bounding boxes in the constructed data set are clustered to obtain 9 anchor boxes. The clustering method of the anchor boxes is to combine K-Means with a genetic algorithm, and use the genetic algorithm to inherit and mutate the bounding box parameters of the 9 anchor boxes obtained by K-Means.
[0009] Furthermore, the attention feature pyramid network applies a channel attention mechanism to the high-level semantic features to obtain a channel attention map M c , apply the spatial attention mechanism to the low-level position features to obtain the spatial attention map M s .
[0010] Furthermore, the expression of the feature attention pyramid network is:
[0011]
[0012]
[0013] M c (x) = σ(Con v 1×1 (GAP channel (x)))
[0014] In the formula, F i in represents the i-th layer feature of the downsampling branch; F i out represents the i-th layer feature of the upsampling branch; Indicates a matrix multiplication operation with a broadcast mechanism; Upsample indicates an upsampling operation; cat indicates a concatenation operation; M c (x) channel attention map; x represents input features; σ represents sigmoid activation function; GAP channelRepresents a global pooling layer along the channel dimension. M s (x) Spatial attention map, x represents the input feature; GAP spatial represents the global pooling layer along the spatial dimension, Con v 3×3 and Con v 1×1 They represent 3×3 convolution and 1×1 convolution respectively.
[0015] Furthermore, the loss function includes a classification loss function for solving the problem of imbalance between positive and negative samples and a positioning loss function for improving positioning accuracy. The classification loss function is Focal Loss, and the positioning loss function is CloUloss.
[0016] Furthermore, the loss function is expressed as:
[0017] L=L Focal +L CIoU
[0018] =-(1-p t ) γ log(p t )+(1-CIo U)
[0019]
[0020] In the formula, p t represents the probability that the target is a positive sample; γ represents the positive and negative sample adjustment factor; b and b gt They represent the coordinates of the center points of the predicted bounding box and the true bounding box respectively; c represents the diagonal distance between the minimum circumscribed rectangle of the predicted bounding box and the true bounding box, p is the Euclidean distance between the center points of the predicted bounding box and the true bounding box; IoU represents the degree of overlap between the predicted bounding box and the true bounding box.
[0021] Furthermore, the input of the Soft-CloU-NMS algorithm is two lists, one is a bounding box parameter list B = {b1, ..., b N}, one is the bounding box confidence list S = {s1, ..., s N}, the hyperparameter of the algorithm is the non-maximum suppression threshold N t .
[0022] Furthermore, the steps of the Soft-CloU-NMS algorithm are:
[0023] Step 1: Define an empty list D to store the predicted bounding box of the final output;
[0024] Step 2, sort the bounding box confidence list S;
[0025] Step 3: Delete the bounding box M corresponding to the largest element in the S list from the B list and add M to the output list D. At this time, M is a local extreme value and is regarded as a target.
[0026] Step 4: traverse the remaining bounding boxes, i.e., list B, and determine whether the CloU value between the elements in B and M is greater than the threshold N. t , use CloU as the basis for dividing positive and negative samples;
[0027] Step 5: The CloU value between the element in B and M is greater than the threshold N t When , the confidence of the element is reduced, and the update method is S = s i (1-CIo U(M,b i ));
[0028] Step 6: Repeat steps 1-5 until B=φ, at which point all targets in B are screened out and the algorithm ends.
[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention prevents overfitting by enhancing data; generates high-quality anchor boxes by a clustering method based on the combination of K-means and genetic algorithm; obtains the regression parameters of the target bounding box by the attention feature pyramid network, thereby improving the detection accuracy of multi-scale targets; and post-processes the predicted bounding box by the Soft-CIoU-NMS algorithm, thereby effectively alleviating the problem of missed detection and inaccurate positioning of occluded targets in complex scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the process of the present invention;
[0031] Figure 2 It is a schematic diagram of the characteristic pyramid structure of the present invention; DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] like Figure 1 As shown, the present invention provides an automatic driving target detection method for multi-scale targets and occluded targets, comprising the following steps:
[0035] S1: Use visual cameras to collect image information of targets such as vehicles, pedestrians, and traffic signs on actual roads, and construct a complex traffic scene dataset for autonomous driving. To prevent overfitting of the model, perform data enhancement on the image information in the dataset, read four pictures each time, and then perform random color gamut transformation, random horizontal flipping, random scaling, and random cropping on the four pictures, place them in fixed positions in turn, and finally splice the four pictures into an image of the original size.
[0036] S2: The bounding boxes in the data set are clustered using the clustering method based on K-means combined with genetic algorithm proposed in the present invention to generate anchor boxes of 9 different sizes. The algorithm flow is as follows:
[0037] (1) Randomly select 9 bboxes from all bboxes as the centers of 9 clusters;
[0038] (2) Calculate the distance between each bbox and the center of the nine clusters. The distance can be the Euclidean distance or 1-IOU (bbox, anchor).
[0039] (3) Assign each bbox to the cluster corresponding to the center of the cluster closest to it;
[0040] (4) Calculate the distance between all bboxes in each cluster and the center of the corresponding cluster, and use the bbox corresponding to the median of the distance as the new cluster center;
[0041] (5) Repeat steps (3) and (4) until the elements in each cluster no longer change;
[0042] (6) Calculate the fitness values corresponding to the 9 anchors obtained. The calculation formula is as follows:
[0043]
[0044]
[0045] In the formula, thr represents the preset ratio threshold, N represents the number of bboxes, Count(x, y) represents the counting function, and x and y represent the two independent variables of the function, corresponding to y and thr in (1), respectively. i It represents the anchor box scale factor that best overlaps with the i-th target bounding box. The solution is as follows:
[0046]
[0047]
[0048] y i=max(x i1 , …x i9 ) (5)
[0049] In the formula, i∈(1, N), j∈(1, 9) represent the indexes of bbox and anchor respectively, N represents the number of bboxes, Respectively represent the width and height of the i-th bbox, Respectively represent the width and height of the j-th anchor.
[0050] (7) Randomly mutate the w and h of the anchors. The mutation rule is:
[0051] w′=clip(0.3,w*(1±randn(f),3)) (6)
[0052] h′=clip(0.3,h*(1±randn(f),3)) (7)
[0053]
[0054] In the formula, w′ and h′ represent the mutated w and h, f represents the amplitude of the mutation, randn(f) represents a normal random number within the amplitude f, clip(0.3, x, 3) is to limit the function output value to between 0.3 and 3, and x represents the independent variable.
[0055] (8) Calculate the fitness value after mutation. If the fitness after mutation is greater than the fitness before mutation, update the anchor parameter.
[0056] (9) Repeat steps (6), (7), (8) to the set number of times.
[0057] S3: Figure 2 As shown in the figure, for the complex multi-scale target detection problem, an attention feature pyramid network is proposed to obtain the regression parameters of the target bounding box; the attention feature pyramid network applies a channel attention mechanism to the high-level semantic features to obtain the channel attention map M c , apply the spatial attention mechanism to the low-level position features to obtain the spatial attention map M s , such a feature fusion method can adapt to multi-scale changes. The expression of the attention feature pyramid network is as follows:
[0058]
[0059]
[0060] M c (x) = σ(Con v 1×1 (GAPchannel (x))) (11)
[0061] In the formula, F i in represents the i-th layer feature of the downsampling branch; F i out represents the i-th layer feature of the upsampling branch; Indicates a matrix multiplication operation with a broadcast mechanism; Upsample indicates an upsampling operation; cat indicates a concatenation operation; M c (x) represents the channel attention map; x represents the input feature; σ represents the sigmoid activation function; GAP channel represents the global pooling layer along the channel dimension, M s (x) Spatial attention map, x represents the input feature; GAP spatial represents the global pooling layer along the spatial dimension, Conv 3×3 and Con v 1×1 They represent 3×3 convolution and 1×1 convolution respectively.
[0062] S4: To improve positioning accuracy and solve the problem of uneven positive and negative samples, a loss function is constructed to optimize the regression parameters of the target bounding box obtained in S3 to obtain a predicted bounding box. The optimizer uses SGD with momentum, and the initial learning rate is adjusted to 0.001 by warm start. The final learning rate is 0.00001, and the training round epoches is set to 50. The loss function includes classification loss function and positioning loss function. The classification loss function is Focalloss, which can effectively solve the problem of uneven positive and negative samples; the positioning loss function is CIoU loss, which can effectively improve positioning accuracy. The expression of the loss function is as follows:
[0063]
[0064]
[0065] In the formula, p t represents the probability that the target is a positive sample; γ represents the positive and negative sample adjustment factor; b and b gt They represent the coordinates of the center points of the predicted bounding box and the true bounding box respectively; c represents the diagonal distance between the minimum enclosing rectangle of the predicted bounding box and the true bounding box, and p is the Euclidean distance between the center points of the predicted bounding box and the true bounding box; IoU represents the overlap between the predicted bounding box and the true bounding box, and its calculation is shown in formula (16); αv is the aspect ratio penalty factor, and the expressions of α and v are shown in formulas (14) and (15) respectively:
[0066]
[0067]
[0068]
[0069] Where A and B represent the predicted bounding box and the true bounding box respectively; w gt ,h gt They represent the width and height of the true bounding box, and w and h represent the width and height of the predicted bounding box, respectively.
[0070] S5: To alleviate the problem of missed detection of occluded targets, a post-processing of the predicted bounding box obtained in S4 based on the Soft-CIoU-NMS algorithm is proposed. The problem of missed detection of occluded targets in complex traffic scenes is effectively alleviated through reasonable positive and negative sample division criteria and redundant box screening rules, and the final prediction result is obtained.
[0071] The input of the Soft-CIoU-NMS algorithm is two lists, one is the bounding box parameter list B = {b1, ..., b N}, one is the bounding box confidence list S = {s1, .., s N}, the hyperparameter of the algorithm is the non-maximum suppression threshold N t . Step 1, define an empty list D to store the predicted bounding boxes of the final output; Step 2, sort the bounding box confidence list S; Step 3, delete the bounding box M corresponding to the largest element in the S list from the B list, and add M to the output list D. At this time, M is a local extreme value and can be used as a target; Step 4, traverse the remaining bounding boxes, that is, the list B, and determine whether the CIoU value between the elements in B and M is greater than the threshold N t , using CIoU as the basis for dividing positive and negative samples can make it more difficult for occluded targets to reach the condition of being suppressed; Step 5, the CIoU value of the element in B and M is greater than the threshold N t When , the confidence of the element is reduced, and the update method is S = s i (1-CIo U(M,b i )), this can retain the occluded targets; in step 6, repeat steps 1-5 until B = φ, at which point all targets in B are screened out and the algorithm ends. The Soft-CIoU-NMS algorithm can effectively improve the recall rate of occluded targets and alleviate the problem of missed detection of occluded targets.
[0072] The pseudo code of the Soft-CIoU-NMS algorithm is as follows:
[0073] Soft-CIoU-NMS algorithm pseudo code
[0074]
Claims
1. An automatic driving target detection method for multi-scale targets and occluded targets, characterized in that: By constructing a complex traffic scene dataset for autonomous driving and clustering the target bounding boxes in the dataset, the regression parameters of the target bounding boxes are calculated to improve the detection accuracy of multi-scale targets, and then the predicted bounding boxes are post-processed to alleviate the missed detection and positioning of occluded targets. The following steps are involved: S1: Collect target image information on the actual road, build a complex traffic scene dataset for autonomous driving, and pre-process the target image information; S2: Clustering the bounding boxes in the dataset using a clustering method based on K-means combined with a genetic algorithm to generate anchor boxes of 9 different sizes; S3: Obtain the regression parameters of the target bounding box through the attention feature pyramid network; S4: Construct a loss function based on Focal loss and CIoU loss to optimize the regression parameters of the target bounding box obtained in S3 to obtain a predicted bounding box; S5: Post-process the predicted bounding box obtained in S4 based on the Soft-CIoU-NMS algorithm to obtain the final prediction result; The attention feature pyramid network applies a channel attention mechanism to high-level semantic features to obtain a channel attention map , apply the spatial attention mechanism to the low-level position features to obtain the spatial attention map ; The input of the Soft-CIoU-NMS algorithm is two lists, one is the bounding box parameter list , one is the bounding box confidence list , the algorithm's hyperparameter is the non-maximum suppression threshold ; The steps of the Soft-CIoU-NMS algorithm are: Step 1: Define an empty list Used to store the predicted bounding box of the final output; Step 2: List the bounding box confidences Sorting; Step 3: The bounding box of the largest element in the list from Delete the list and Add to Output List In, at this time It is a local extreme value, which is regarded as a target; Step 4: Traverse the remaining bounding boxes, i.e. the list ,judge Elements and Is the CIoU value greater than the threshold? , using CIoU as the basis for dividing positive and negative samples; Step 5, Elements and The CIoU value is greater than the threshold , reduce the confidence of the element, and its update method is ; Step 6, repeat steps 1-5 until ,at this time All targets are screened out and the algorithm ends.
2. The automatic driving target detection method for multi-scale targets and occluded targets according to claim 1, characterized in that: Target image information refers to image information collected by visual cameras, including vehicles, pedestrians, and traffic signs on the actual road.
3. The automatic driving target detection method for multi-scale targets and occluded targets according to claim 1, characterized in that: The target bounding boxes in the constructed data set are clustered to obtain 9 anchor boxes. The clustering method of the anchor boxes is to combine K-Means with the genetic algorithm, and use the genetic algorithm to inherit and mutate the bounding box parameters of the 9 anchor boxes obtained by K-Means.
4. The automatic driving target detection method for multi-scale targets and occluded targets according to claim 1, characterized in that: The expression of the feature attention pyramid network is: In the formula, Indicates the downsampling branch Layer characteristics; Indicates the upsampling branch Layer characteristics; Represents a matrix multiplication operation with broadcasting mechanism; Represents an upsampling operation; Represents a splicing operation; represents the channel attention map; Represents input features; Represents the sigmoid activation function; represents a global pooling layer along the channel dimension, Spatial Attention Map, Represents input features; represents a global pooling layer along the spatial dimension, and They represent 3×3 convolution and 1×1 convolution respectively.
5. The automatic driving target detection method for multi-scale targets and occluded targets according to claim 1, characterized in that: The loss function includes a classification loss function for solving the problem of imbalance between positive and negative samples and a positioning loss function for improving positioning accuracy. The classification loss function is Focal loss, and the positioning loss function is CIoU loss.
6. The automatic driving target detection method for multi-scale targets and occluded targets according to claim 1, characterized in that: The expression of the loss function is: In the formula, Indicates the probability that the target is a positive sample; Represents the positive and negative sample adjustment factor; and Represent the center point coordinates of the predicted bounding box and the true bounding box respectively; Represents the diagonal distance between the minimum enclosing rectangle of the predicted bounding box and the true bounding box, It is the Euclidean distance between the center points of the predicted bounding box and the true bounding box; IoU indicates the degree of overlap between the predicted bounding box and the true bounding box.
