Autonomous driving target detection methods, devices, electronic equipment and storage media
By using an improved Focal Loss function and a low-capacity backbone network, the problem of inaccurate detection by the traditional Focal Loss function in low-capacity networks is solved, achieving higher obstacle detection accuracy and improving the safety of autonomous driving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YINGCHE XINGCHUANG INTELLIGENT TECH (SHANGHAI) CO LTD
- Filing Date
- 2023-03-16
- Publication Date
- 2026-07-17
AI Technical Summary
Object detection models trained using traditional focus loss functions struggle to accurately distinguish background points in low-capacity backbone networks, leading to inaccurate detection results and impacting the safety of autonomous driving.
An improved Focal Loss function is adopted, which includes positive sample loss function and negative sample loss function. By weakening the loss of points near the target center and points prone to negative samples, the confidence gap between the target and the background is widened. Target detection is performed using a low-capacity backbone network and multiple task heads.
It improves the accuracy of target detection, reduces false detections of background points, and enhances obstacle detection performance in autonomous driving.
Smart Images

Figure CN116453083B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous driving technology, and in particular to an autonomous driving target detection method, device, electronic device, and storage medium. Background Technology
[0002] Object detection comprises two tasks: localization and classification, using discrete and continuous loss functions respectively. Common discrete loss functions for classification tasks include Cross Entropy (CE), Binary Cross Entropy (BCE), and Focal Loss. In one-stage object detection, to address the imbalance between positive and negative samples, the mainstream approach is to use Focal Loss-like loss functions for soft sampling, which can solve the problem of sampling difficult negative samples. Generally, when using a large-capacity backbone network for detection, since the features of the large-capacity backbone network are strong enough, and one ground truth (GT) bounding box corresponds to multiple positive anchor boxes or points, Focal loss is used normally. Traditional Focal Loss uses prediction confidence to distinguish between easy and difficult samples and applies weights to reduce the interference of the accumulated loss from massive positive samples on the optimization of the loss for negative samples. However, when the capacity of the backbone network is compressed to an extremely low level, such as 15M FLOPs of computation and 0.036M parameters, with the backbone itself having only 4.36M FLOPs of computation, the prediction confidence is generally very low. The features learned under the penalized focus loss function are weak in foreground and background discrimination, making it difficult to filter out negative samples of the positive class through the confidence threshold. This results in the target detection model trained based on the traditional focus loss function failing to accurately distinguish background points, leading to inaccurate detection results and interfering with autonomous driving. Summary of the Invention
[0003] This invention provides an autonomous driving target detection method, device, electronic device, and storage medium to address the shortcomings of traditional target detection models trained with focus loss functions, which produce inaccurate detection results and interfere with autonomous driving.
[0004] This invention provides an autonomous driving target detection method, comprising:
[0005] Acquire front-end image data of autonomous vehicles;
[0006] The front-end image data of the autonomous vehicle is input into the autonomous driving target detection model to obtain the detected target, wherein the autonomous driving target detection model is trained according to the Focal Loss function, which can improve the discriminativeness between the target and the background.
[0007] According to the autonomous driving target detection method provided by the present invention, the Focal Loss function that improves the discriminative power between the target and the background includes:
[0008] Positive sample loss function and negative sample loss function;
[0009] The negative sample loss function includes a first factor for reducing the negative sample loss of locations near the target center and a second factor for reducing the tendency to lose negative samples.
[0010] Focal Loss function is provided by an autonomous driving target detection method according to the present invention. The target detection model includes a low-capacity backbone network, a connection layer, and multiple task heads. The multiple task heads include a target center point localization heatmap prediction branch, which is used to predict the target center point.
[0011] According to the autonomous driving target detection method provided by the present invention, the Gaussian heatmap of the predicted target center point output by the target center point localization heatmap prediction branch is as follows:
[0012]
[0013] Where W, H, C, and R represent the width, height, target category, and stride of the output feature map, respectively.
[0014] According to the autonomous driving target detection method provided by the present invention, the plurality of task heads further include: a target center point quantization deviation prediction branch, a target width and height prediction branch, and an offset prediction branch from the target center point to its ground point;
[0015] The target center point quantization deviation prediction branch is used to predict the target center point discretization deviation caused by stride.
[0016] The target width and height prediction branch is used to predict the target width and height;
[0017] The offset prediction branch from the target center point to its ground point is used to predict the 2D offset from the target center point to each of its ground points;
[0018] The target detection model is used to output the target bounding box of the detected target based on the target center point positioning heatmap prediction branch, the target center point quantization deviation prediction branch, and the target width and height prediction branch. It is also used to output the grounding point of the detected target based on the target center point positioning heatmap prediction branch, the target center point quantization deviation prediction branch, and the offset prediction branch from the target center point to its grounding point.
[0019] According to the present invention, an autonomous driving target detection method is provided, wherein the autonomous driving target detection model is used to detect obstacles in front of a vehicle, and the autonomous driving vehicle front image data is input into the autonomous driving target detection model for detecting obstacles in front of the vehicle to obtain the detected target, including:
[0020] The front-end image data of the autonomous vehicle is preprocessed to convert it into a preset size image that meets the input requirements of the low-capacity backbone network.
[0021] The image of the preset size is input into a target detection model with a low-capacity backbone network to obtain the obstacle target bounding box and obstacle grounding point on the image of the preset size;
[0022] The obstacle target bounding box and the obstacle grounding point are subjected to affine transformation to obtain the obstacle target bounding box and the obstacle grounding point on the front-end image data of the autonomous vehicle;
[0023] Non-maximum suppression processing is performed on the obstacle target boxes in the front-end image data of the autonomous vehicle to remove duplicate obstacle target boxes, so as to obtain the final detected obstacle target boxes and obstacle grounding points.
[0024] According to the present invention, an autonomous driving target detection method includes inputting the preset-size image into a target detection model with a low-capacity backbone network to obtain obstacle target boxes and obstacle grounding points on the preset-size image, comprising:
[0025] Based on the target center localization heatmap prediction branch, the background points and points near the target center are filtered using a confidence threshold, and a preset number of points with the maximum local confidence are output as the obstacle center points.
[0026] Based on the target center point quantization deviation prediction branch, output the quantization deviation of the obstacle center point;
[0027] Based on the target's width and height, predict the width and height of the obstacle in the branch output;
[0028] Based on the target center point quantization deviation prediction branch output, the 2D offset prediction value from the obstacle center point to the ground point is output.
[0029] Obtain the obstacle target box and obstacle ground point based on the location index of the detected obstacle center point, the quantization deviation of the obstacle center point, the width and height of the obstacle, and the 2D offset prediction value from the obstacle center point to the ground point.
[0030] According to the present invention, an autonomous driving target detection method is provided, wherein the autonomous driving target detection model is used to detect obstacles in front of a vehicle, and training the autonomous driving target detection model includes:
[0031] Acquire training data, which includes multi-scene distributed image data sampled according to actual driving scenarios and their corresponding annotation data. The annotation data includes obstacle target boxes and grounding points in high-speed scenarios, obstacle target boxes and grounding points in non-high-speed scenarios, and pedestrian target boxes and grounding points.
[0032] The training autonomous driving target detection model is trained using the training data and the Focal Loss function, which improves the discriminative power between the target and the background.
[0033] The present invention also provides an autonomous driving target detection device, comprising:
[0034] The acquisition module is used to acquire front-end image data of autonomous vehicles;
[0035] The detection module is used to input the front-end image data of the autonomous vehicle into the autonomous driving target detection model to obtain the detected target, wherein the autonomous driving target detection model is trained according to the Focal Loss function, which can improve the discriminativeness between the target and the background.
[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the autonomous driving target detection method as described above.
[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the autonomous driving target detection method as described above.
[0038] The autonomous driving target detection method, device, electronic device, and storage medium provided by this invention acquire front-end image data of an autonomous vehicle; input the front-end image data of the autonomous vehicle into an autonomous driving target detection model to obtain the detected target, wherein the autonomous driving target detection model is trained based on a Focal Loss function that can improve the discriminativeness between the target and the background, which can widen the confidence gap between the target and the background, reduce the influence of the background on the detected target, and improve the accuracy of target detection. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is one of the flowcharts of the autonomous driving target detection method provided by the present invention;
[0041] Figure 2 This is a schematic diagram of the structure of the autonomous driving target detection model provided by the present invention;
[0042] Figure 3 This is the second flowchart of the autonomous driving target detection method provided by the present invention;
[0043] Figure 4 This is a schematic diagram of the detection results of the autonomous driving target detection method provided by the present invention;
[0044] Figure 5 This is a schematic diagram of the structure of the autonomous driving target detection device provided by the present invention;
[0045] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0047] Figure 1 A flowchart of the autonomous driving target detection method provided in the embodiments of the present invention is shown below. Figure 1 As shown, the autonomous driving target detection method provided in this embodiment of the invention includes:
[0048] Step 101: Acquire front-end image data of the autonomous vehicle;
[0049] In this embodiment of the invention, the front-end image data of the autonomous vehicle can be acquired through a forward-facing camera installed on the vehicle.
[0050] Step 102: Input the front-end image data of the autonomous vehicle into the autonomous driving target detection model to obtain the detected target. The autonomous driving target detection model is trained based on the Focal Loss function, which can improve the discriminative power between the target and the background.
[0051] In this embodiment of the invention, the Focal Loss function that can improve the discriminative power between the target and the background includes:
[0052] Positive sample loss function and negative sample loss function;
[0053] The negative sample loss function includes a first factor for weakening the location points near the target center as negative sample loss and a second factor for weakening the easy negative sample loss.
[0054] Easy negative samples are negative samples with low prediction probabilities that are easy to classify because these boxes are easy to classify correctly.
[0055] The first factor can weaken the negative sample loss of the location points near the target center, and the second factor can weaken the loss of easily negative samples. Compared with the traditional penalized Focal Loss, the Focal Loss function of this embodiment, which can improve the discriminative power between the target and the background, is more suitable for target detection networks with extremely low-capacity backbone networks. It can significantly widen the confidence gap between the target and the background, and solve the false detection problem caused by the close confidence of the foreground and the background when the target detection network has too low capacity and too weak features.
[0056] Traditional Focal Loss distinguishes between easy and difficult samples based on prediction confidence and applies weights to mitigate the interference of the cumulative loss from massive positive samples on the optimization of the loss from negative samples. However, when the backbone network capacity is compressed to an extremely low level, such as 15 MFLOPs of computation and 0.036 M parameters, with the backbone itself accounting for only 4.36 MFLOPs of computation, the prediction confidence is generally very low. The features learned under the penalized focal loss function are weak in foreground (target) and background discrimination, making it difficult to filter out negative samples of the positive class through the confidence threshold. This results in the target detection model trained based on the traditional focal loss function failing to accurately distinguish background points, leading to inaccurate detection results and interfering with autonomous driving.
[0057] The autonomous driving target detection method provided in this embodiment of the invention acquires front-end image data of an autonomous vehicle; the front-end image data of the autonomous vehicle is input into an autonomous driving target detection model to obtain the detected target. The autonomous driving target detection model is trained based on a Focal Loss function that can improve the discriminative power between the target and the background. This can widen the confidence gap between the target and the background, reduce the influence of the background on the detected target, and improve the accuracy of target detection.
[0058] Based on any of the above embodiments, the Focal Loss function provided by the present invention to improve the discriminative power between the target and the background is as follows:
[0059]
[0060] Among them, Y xyc =1 represents a positive sample point, N is the number of positive sample points, the loss function corresponding to a positive sample point is the BCE loss function, and class C corresponds to C BCEs. (1-Y xyc ) 4To reduce the impact of points near the target center as the first factor in negative sample loss, To weaken the second factor that is prone to negative sample loss. xyc Confidence level for the actual target To predict the confidence level of the target.
[0061] Since the weighting factor of the focus loss function severely limits the confidence of positive foreground points, after using BCE, the prediction confidence of common foreground points can approach 1.0;
[0062] The first 4th power weighting factor of the loss corresponding to the negative anchor point is the penalty weighting of the ground truth heatmap, which weakens the loss of the position near the target center as a negative sample, thereby increasing recall. The second factor is the weakened Focal loss weight. After weakening, the confidence of the background point as a positive sample is around 0.2, and the confidence of the foreground point is close to 1.0. Therefore, when using confidence threshold filtering, the background point can be removed better.
[0063] The traditional penalized focus loss has two problems when used in detection networks of the very low-capacity CenterNet framework, as follows:
[0064] The anchor mechanism assigns a positive anchor point (the center point of the target) to each ground truth (GT), eliminating the imbalance between easy and difficult samples in the positive samples. Therefore, for the positive anchor points in the backbone network, the commonly used bounded loss function (BCE) is chosen instead of Focal loss. This means the loss generated by the positive anchor point is not weighted down, but rather fully learned using BCE to optimize the foreground confidence towards 1.
[0065] The prediction confidence of target detection models with extremely low-capacity backbone networks is generally very low, and there is no clear boundary between positive samples and negative samples of the positive class. The prediction confidence of negative samples of the positive class as positive samples is too high. That is, the prediction confidence of negative samples of the positive class as negative samples (equal to 1 - prediction confidence as positive samples) is too low, concentrated around 0.6, and the penalty focus loss function is difficult to further optimize.
[0066] In this embodiment of the invention, the penalized focus loss function is still used for negative anchor points, but its hyperparameter is reduced from 2 to 1. This relaxes the weakening effect on negative anchor points, allowing the focus loss function to generate sufficient loss to optimize the prediction confidence of negative samples in the positive class as negative samples to around 0.8. Consequently, the confidence of negative samples in the positive class as positive samples decreases to 0.2, significantly widening the gap between their confidence and that of positive samples in the positive class, thus reducing false positives introduced by the confidence threshold. It should be noted that a lower hyperparameter is not always better. A hyperparameter less than 1 can lead to an overabundance of easy negative samples, and an imbalance between easy and difficult negative samples can reduce the optimization effect on difficult negative samples.
[0067] Based on any of the above embodiments, such as Figure 2 As shown, the target detection model provided in this embodiment of the invention includes a low-capacity backbone network, a connection layer, and multiple task heads. The multiple task heads include a target center point localization heatmap prediction branch (obstacle_hm), which is used to predict the target center point.
[0068] In this embodiment of the invention, the Gaussian heatmap of the predicted target center point output by the target center point localization heatmap prediction branch is:
[0069]
[0070] in, This reflects the probability that different locations are the center point; the closer to the center, the higher the probability. W, H, C, and R represent the width, height, target category, and stride of the output feature map, respectively. Multiple task heads also include: a target center point quantization bias prediction branch (obstacle_offset), a target width and height prediction branch (obstacle_wh), and a target center point to ground point offset prediction branch (obstacle_kpt_offset).
[0071] The target center point quantization deviation prediction branch is used to predict the target center point discretization deviation caused by stride.
[0072] The target width and height prediction branch is used to predict the target's width and height;
[0073] The offset prediction branch from the target center point to its ground point is used to predict the 2D offset from the target center point to each of its ground points;
[0074] The target detection model is used to output the target bounding box of the detected target based on the target center point location heatmap prediction branch, the target center point quantization deviation prediction branch, and the target width and height prediction branch. It is also used to output the grounding point of the detected target based on the target center point location heatmap prediction branch, the target center point quantization deviation prediction branch, and the offset prediction branch from the target center point to its grounding point.
[0075] The target detection model in this embodiment of the invention includes a low-capacity backbone network, a connection layer, and multiple branch prediction task heads. Among them, the target center point localization heatmap prediction branch is the most important because if the target center point is not predicted accurately, no matter how high the accuracy of the width and height prediction, the resulting bounding box will not fit the target edge. It is also the main source of positive and negative samples.
[0076] Based on any of the above embodiments, such as Figure 3 As shown, the autonomous driving target detection model provided in this embodiment of the invention is used to detect obstacles in front of a vehicle. The autonomous driving vehicle front-end image data is input into the autonomous driving target detection model to obtain the detected target, including:
[0077] Step 301: Preprocess the front-end image data of the autonomous vehicle to convert it into a preset size image that meets the input requirements of the low-capacity backbone network.
[0078] Since the raw front-end image data of the autonomous vehicle acquired by the forward-looking camera is large, it will reduce the image processing speed. Therefore, it is necessary to convert the data into a preset size image that meets the input requirements of the low-capacity backbone network. The preset size image height*width is, for example, 144*256.
[0079] Step 302: Input the image of the preset size into the target detection model with a low-capacity backbone network to obtain the obstacle target box and obstacle grounding point on the image of the preset size;
[0080] In this embodiment of the invention, an image of a preset size is input into a target detection model with a low-capacity backbone network to obtain obstacle target boxes and obstacle grounding points on the image of the preset size, including:
[0081] Based on the target center localization heatmap prediction branch, the background points and points near the target center are filtered using a confidence threshold, and a preset number of points with the maximum local confidence are output as the obstacle center points.
[0082] Based on the target center point quantization deviation prediction branch, output the quantization deviation of the obstacle center point;
[0083] Based on the target's width and height, predict the width and height of the obstacle in the branch output;
[0084] Based on the target center point quantization deviation prediction branch output, the 2D offset prediction value from the obstacle center point to the ground point is output.
[0085] Obtain the obstacle target box and obstacle ground point based on the location index of the detected obstacle center point, the quantization deviation of the obstacle center point, the width and height of the obstacle, and the 2D offset prediction value from the obstacle center point to the ground point.
[0086] Step 303: Perform an affine transformation on the obstacle target bounding box and the obstacle grounding point to obtain the obstacle target bounding box and the obstacle grounding point on the front-end image data of the autonomous vehicle;
[0087] At this point, the obstacle target box and the obstacle grounding point are on the size * (144 / 4 * 256 / 4) of the monitoring signal action.
[0088] Step 304: Perform nonmaximum suppression processing on the obstacle target boxes in the front-end image data of the autonomous vehicle to remove duplicate obstacle target boxes, so as to obtain the final detected obstacle target boxes and obstacle grounding points.
[0089] In this embodiment of the invention, the coordinates of the two ends of the diagonal of the obstacle target box are as follows:
[0090] and
[0091] The obstacle grounding point is i∈{1,2,3,4};
[0092] in, To predict the center point of the obstacle, To correspond to the prediction quantification bias, Predict the width and height corresponding to the obstacles. i∈{1,2,3,4} represents the 2D offset value from the center point of the obstacle to the four corresponding grounding points.
[0093] In some embodiments of the present invention, the autonomous driving target detection model is used to detect obstacles in front of the vehicle, and training the autonomous driving target detection model includes:
[0094] Acquire training data, which includes multi-scene distributed image data sampled according to actual driving scenarios and their corresponding annotation data. The annotation data includes obstacle target boxes and grounding points in high-speed scenarios, obstacle target boxes and grounding points in non-high-speed scenarios, and pedestrian target boxes and grounding points.
[0095] The training of the autonomous driving target detection model is completed by iterative backpropagation of gradients using training data and the Focal Loss function, which improves the discriminative power between the target and the background, with the Adam optimizer employed.
[0096] Multiple scenarios include roads, traffic flow, weather (sunny, rainy, foggy, snowy, etc.), day and night.
[0097] The test results are shown in the image. Figure 4As shown, the left side is the detection result output by the model after training with the traditional penalized focus loss function, and the right side is the detection result output by the model after training with the Focal Loss function. It can be seen that the image on the left mistakenly detects the roadside greenery as an obstacle, and the confidence level of the obstacle (the truck in front) is low at about 86.1%. The image on the right only detects the truck in front as an obstacle, and the confidence level rises to close to 1.0, indicating a higher detection accuracy.
[0098] In this embodiment of the invention, the Focal Loss function, which enhances the discriminative power between the target and the background, is more suitable for use in backbone networks with extremely low capacity compared to the original focal loss function. It significantly widens the confidence gap between the foreground and background (making the confidence of background points around 0.2 and the confidence of foreground points close to 1.0), thus effectively removing background points and reducing false detections when using confidence threshold filtering. Furthermore, the overall detection performance can be improved by 1 AP (Average Precision). The Focal Loss function, which enhances the discriminative power between the target and the background, effectively solves the problem of false detections caused by the similar confidence levels of the foreground and background when the target detection network has too low a network capacity and weak features.
[0099] The autonomous driving target detection device provided by the present invention is described below. The autonomous driving target detection device described below can be referred to in correspondence with the autonomous driving target detection method described above.
[0100] Figure 5 This is a schematic diagram of an autonomous driving target detection device provided in an embodiment of the present invention, such as... Figure 5 As shown, the autonomous driving target detection device provided in this embodiment of the invention includes:
[0101] The acquisition module 501 is used to acquire front-end image data of autonomous vehicles;
[0102] The detection module 502 is used to input the front-end image data of the autonomous vehicle into the autonomous driving target detection model to obtain the detected target, wherein the autonomous driving target detection model is trained according to the FocalLoss function, which can improve the discriminativeness between the target and the background.
[0103] The autonomous driving target detection device provided in this embodiment of the invention acquires front-end image data of an autonomous vehicle; inputs the front-end image data of the autonomous vehicle into an autonomous driving target detection model to obtain the detected target, wherein the autonomous driving target detection model is trained based on a Focal Loss function that can improve the discriminativeness between the target and the background, which can widen the confidence gap between the target and the background, reduce the influence of the background on the detected target, and improve the accuracy of target detection.
[0104] Figure 6An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute an autonomous driving target detection method, which includes: acquiring front-end image data of an autonomous vehicle; inputting the front-end image data of the autonomous vehicle into an autonomous driving target detection model to obtain the detected target, wherein the autonomous driving target detection model is trained based on a Focal Loss function that improves the discriminative power between the target and the background.
[0105] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0106] On the other hand, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the autonomous driving target detection method provided by the above methods. The method includes: acquiring front-end image data of an autonomous vehicle; inputting the front-end image data of the autonomous vehicle into an autonomous driving target detection model to obtain a detected target, wherein the autonomous driving target detection model is trained based on a Focal Loss function that can improve the discriminative power between the target and the background.
[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0108] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting targets in autonomous driving, characterized in that, include: Acquire front-end image data of autonomous vehicles; The front-end image data of the autonomous vehicle is input into the autonomous driving target detection model to obtain the detected target, wherein the autonomous driving target detection model is trained based on the Focal Loss function, which can improve the discriminativeness between the target and the background. The Focal Loss function, which improves the discriminative power between the target and the background, includes: Positive sample loss function and negative sample loss function; The negative sample loss function includes a first factor for weakening the location points near the target center as negative sample loss and a second factor for weakening the easy negative sample loss. The Focal Loss function that improves the discriminative power between the target and the background is: ; in, When N is a positive sample point, N is the number of positive sample points, the loss function corresponding to the positive sample point is the BCE loss function, and class C corresponds to C BCEs; To reduce the impact of points near the target center as the first factor in negative sample loss, To weaken the second factor that is prone to negative sample loss; Confidence level for the actual target To predict the confidence level of the target; The first 4th power weighting factor of the loss corresponding to the negative anchor point is the penalty weighting of the ground truth heatmap, which weakens the loss of the position near the target center as a negative sample, thereby increasing recall. The second factor is the weakened Focal loss weight. After weakening, the confidence of the background point as a positive sample is around 0.2, and the confidence of the foreground point is close to 1.
0. Therefore, when using confidence threshold filtering, the background point can be removed better.
2. The autonomous driving target detection method according to claim 1, characterized in that, The target detection model includes a low-capacity backbone network, a connection layer, and multiple task heads. The multiple task heads include a target center point localization heatmap prediction branch, which is used to predict the target center point.
3. The autonomous driving target detection method according to claim 1, characterized in that, The Gaussian heatmap of the predicted target center point output by the target center point localization heatmap prediction branch is: ; Where W, H, C, and R represent the width, height, target category, and stride of the output feature map, respectively.
4. The autonomous driving target detection method according to claim 2, characterized in that, The multiple task heads also include: a target center point quantization deviation prediction branch, a target width and height prediction branch, and a target center point to ground point offset prediction branch; The target center point quantization deviation prediction branch is used to predict the target center point discretization deviation caused by stride. The target width and height prediction branch is used to predict the target width and height; The offset prediction branch from the target center point to its ground point is used to predict the 2D offset from the target center point to each of its ground points; The target detection model is used to output the target bounding box of the detected target based on the target center point positioning heatmap prediction branch, the target center point quantization deviation prediction branch, and the target width and height prediction branch. It is also used to output the grounding point of the detected target based on the target center point positioning heatmap prediction branch, the target center point quantization deviation prediction branch, and the offset prediction branch from the target center point to its grounding point.
5. The autonomous driving target detection method according to claim 2, characterized in that, The autonomous driving target detection model is used to detect obstacles in front of the vehicle. The autonomous driving vehicle front-end image data is input into the autonomous driving target detection model to obtain the detected targets, including: The front-end image data of the autonomous vehicle is preprocessed to convert it into a preset size image that meets the input requirements of the low-capacity backbone network. The image of the preset size is input into a target detection model with a low-capacity backbone network to obtain the obstacle target bounding box and obstacle grounding point on the image of the preset size; The obstacle target bounding box and the obstacle grounding point are subjected to affine transformation to obtain the obstacle target bounding box and the obstacle grounding point on the front-end image data of the autonomous vehicle; Non-maximum suppression processing is performed on the obstacle target boxes in the front-end image data of the autonomous vehicle to remove duplicate obstacle target boxes, so as to obtain the final detected obstacle target boxes and obstacle grounding points.
6. The autonomous driving target detection method according to claim 5, characterized in that, The step of inputting the preset-size image into a target detection model with a low-capacity backbone network to obtain obstacle bounding boxes and obstacle grounding points on the preset-size image includes: Based on the target center localization heatmap prediction branch, the background points and points near the target center are filtered using a confidence threshold, and a preset number of points with the maximum local confidence are output as the obstacle center points. Based on the target center point quantization deviation prediction branch, output the quantization deviation of the obstacle center point; Based on the target's width and height, predict the width and height of the obstacle in the branch output; The offset prediction branch outputs the 2D offset prediction value from the obstacle center point to the ground point based on the offset prediction from the target center point to its ground point; Obtain the obstacle target box and obstacle ground point based on the location index of the detected obstacle center point, the quantization deviation of the obstacle center point, the width and height of the obstacle, and the 2D offset prediction value from the obstacle center point to the ground point.
7. The autonomous driving target detection method according to claim 5 or 6, characterized in that, The autonomous driving target detection model is used to detect obstacles in front of the vehicle. Training the autonomous driving target detection model includes: Acquire training data, which includes multi-scene distributed image data sampled according to actual driving scenarios and their corresponding annotation data. The annotation data includes obstacle target boxes and grounding points in high-speed scenarios, obstacle target boxes and grounding points in non-high-speed scenarios, and pedestrian target boxes and grounding points. The autonomous driving target detection model is trained using the training data and the Focal Loss function, which improves the discriminative power between the target and the background.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the autonomous driving target detection method as described in any one of claims 1 to 7.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the autonomous driving target detection method as described in any one of claims 1 to 7.