A method, apparatus, and electronic device for determining a driving test scenario
By using the gradient-enhancing decision tree model, virtual test scenarios are automatically generated, which solves the problem of fixed and inaccurate test scenarios in the prior art, and achieves more random and more accurate test scenario generation.
Patent Information
- Application Number
- CN202111648357.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-12-30
AI Technical Summary
When building virtual test scenarios in the prior art, the obtained test scenarios are fixed and do not have randomness, and there is insufficient data collected by manual construction and real-vehicles, resulting in insufficient comprehensive and accurate test scenarios.
Use the trained gradient to improve the decision tree model and automatically generate the test scenario based on the target trigger conditions. The method includes obtaining the target trigger condition, determining the parameter value range of the scene parameters, randomly sampling to obtain multiple parameter values, and generating a random test scenario through random combination.
The generated test scenarios are random, more in line with the real driving situation, and more accurate, and can cover possible driving scenarios more comprehensively.
Smart Images

Figure CN114330128B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology. Specifically, it relates to a method, device, and electronic device for determining a driving test scenario. Background Art
[0002] With the improvement of people's living standards, vehicles such as cars have become one of the main means of transportation for people. The intelligence of transportation tools has also made travel more convenient. In some cases, vehicles can automatically perform driving tasks. For example, household cars and buses equipped with autonomous driving functions.
[0003] The development of autonomous driving systems follows the process from simulation to real vehicle testing. As a zero-risk, fast-iterative, and reproducible testing method, virtual simulation testing has laid a solid foundation for the on-road testing of autonomous driving technology. Simulation testing can quickly and effectively test the correctness and performance of algorithms. To implement simulation testing, a virtual test scenario needs to be built for the simulation testing.
[0004] Currently, when building a virtual test scenario, generally, the trigger conditions of hazard scenarios are derived through the analysis of vehicle solutions, and then the test scenarios corresponding to the trigger conditions are obtained by manual construction or real vehicle collection, so that users can perform simulation testing. However, the test scenarios obtained by this method are very fixed and lack randomness. Moreover, the test scenarios considered during manual construction are not comprehensive enough, and during real vehicle collection, insufficient data may be collected due to the extremely rare occurrence of extreme events, resulting in inaccurate test scenarios. Therefore, how to automatically generate the corresponding test scenarios based on the trigger conditions has become a technical problem that cannot be underestimated. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a method, device, and electronic device for determining a driving test scenario. By using a trained gradient boosting decision tree model, the value range of each scenario parameter corresponding to the target trigger condition can be obtained, and then random sampling is performed on the value range of each scenario parameter. Each value range can obtain N parameter values. Finally, N parameter values of each scenario parameter are randomly combined to obtain the test scenario corresponding to the target trigger condition. In this way, the test scenario determined according to the target trigger condition has randomness, is more in line with the real driving situation, and the obtained test scenario is also more accurate.
[0006] In a first aspect, an embodiment of this application provides a method for determining a driving test scenario. The determining method includes:
[0007] Obtain the target trigger condition for retrieving the test scenario in the autonomous driving function test;
[0008] Input the target trigger condition into the trained gradient boosting decision tree model to obtain the value range of each scenario parameter corresponding to the target trigger condition;
[0009] For each scenario parameter, randomly extract N parameter values from the value range of the scenario parameter, where N is a positive integer greater than or equal to 2;
[0010] Extract one scenario value from each of the N parameter values corresponding to each scenario parameter for combination to obtain a test scenario corresponding to the target trigger condition.
[0011] Furthermore, the gradient boosting decision tree model is trained through the following method:
[0012] Obtain sample data, where the sample data includes at least one trigger condition and at least one sample scenario corresponding to each trigger condition in the at least one trigger condition;
[0013] Input the sample data into the original gradient boosting decision tree model and train the original gradient boosting decision tree model to obtain the gradient boosting decision tree model.
[0014] Furthermore, training the original gradient boosting decision tree model to obtain the gradient boosting decision tree model includes:
[0015] Generate a first decision tree based on the sample data, where the first decision tree represents the predicted trigger condition corresponding to each sample scenario in the sample data;
[0016] Compare the prediction result of the first decision tree with the trigger condition in the sample data and calculate the prediction error and loss value of the first decision tree;
[0017] Generate a second decision tree based on the prediction error of the first decision tree;
[0018] Compare the prediction result of the second decision tree with the trigger condition in the sample data and calculate the prediction error and loss value of the second decision tree;
[0019] If the loss value of the second decision tree is greater than the loss threshold, or the number of decision trees in the original gradient boosting decision tree model is less than the number threshold, generate the next decision tree based on the prediction error of the second decision tree until the loss value of the next decision tree is less than the loss threshold or the number of decision trees in the original gradient boosting decision tree model is equal to the number threshold to obtain the gradient boosting decision tree model.
[0020] Furthermore, a decision tree is generated through the following steps:
[0021] (A) Determine a splitting parameter and the splitting point corresponding to the splitting parameter according to each sample scenario parameter of each sample scenario in the sample data;
[0022] (B) Determine two node regions based on the splitting parameter and the splitting point corresponding to the splitting parameter, where the node region is used to represent the value range divided by the splitting point as the critical point;
[0023] (C) For each node region, determine the first output value corresponding to the node region based on the node region, where the first output value is used to represent the prediction situation of the node region;
[0024] (D) Determine the squared error corresponding to the splitting point based on the first output value corresponding to each node region, where the squared error is used to represent the prediction error between the two node regions divided by the splitting point;
[0025] (E) Adjust the splitting point corresponding to the splitting parameter, return to execute step (A), until the squared error reaches the error threshold, obtain the optimal target splitting point corresponding to the optimal splitting parameter, and use the optimal target splitting point under the optimal splitting parameter as the node corresponding to the decision tree.
[0026] Further, inputting the target trigger condition into the trained gradient boosting decision tree model to obtain the parameter value range of each scenario parameter corresponding to the target trigger condition includes:
[0027] Determine at least one scenario parameter corresponding to the target trigger condition based on the target trigger condition and the gradient boosting decision tree model;
[0028] For each scenario parameter, determine the value splitting point corresponding to the scenario parameter based on the decision tree in the gradient boosting decision tree model, where the value splitting point is used to represent the critical point of the scenario parameter under the target trigger condition;
[0029] Determine the parameter value range of the scenario parameter based on the scenario parameter and the value splitting point corresponding to the scenario parameter.
[0030] Further, for each scenario parameter, randomly extracting N parameter values from the parameter value range of the scenario parameter includes:
[0031] For each scenario parameter, equally spaced divide the parameter value range of the scenario parameter to obtain N sub-parameter value ranges within the parameter value range of the scenario parameter;
[0032] For N sub-parameter value ranges, the parameters within each sub-parameter value range are randomly sampled to obtain N parameter values corresponding to the scenario parameters in this scenario.
[0033] In a second aspect, an embodiment of the present application further provides a determination device for a driving test scenario. The determination device includes:
[0034] A target trigger condition determination module, configured to obtain a target trigger condition for retrieving a test scenario in an autonomous driving function test;
[0035] A parameter value range determination module, configured to input the target trigger condition into a trained gradient boosting decision tree model to obtain the parameter value ranges of the respective scenario parameters corresponding to the target trigger condition;
[0036] A parameter value determination module, configured to randomly extract N parameter values from the parameter value range of each scenario parameter, where N is a positive integer greater than or equal to 2;
[0037] A test scenario determination module, configured to extract one scenario value from the N parameter values corresponding to each scenario parameter for combination to obtain a test scenario corresponding to the target trigger condition.
[0038] Further, the determination device further includes a model training module, and the model training module is configured to train the gradient boosting decision tree model in the following manner:
[0039] Obtain sample data, where the sample data includes at least one trigger condition, and at least one sample scenario corresponding to each trigger condition in the at least one trigger condition;
[0040] Input the sample data into a gradient boosting decision tree original model, and train the gradient boosting decision tree original model to obtain a gradient boosting decision tree model.
[0041] In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the method for determining a driving test scenario as described above are executed.
[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the method for determining a driving test scenario as described above are executed.
[0043] The method for determining a driving test scenario provided by this application is as follows. First, obtain the target trigger condition for retrieving the test scenario in the autonomous driving function test. Then, input the target trigger condition into the trained gradient boosting decision tree model to obtain the range of parameter values of each scenario parameter corresponding to the target trigger condition. For each scenario parameter, randomly extract N parameter values from the range of parameter values of this scenario parameter, where N is a positive integer greater than or equal to 2. Finally, extract one scenario value from the N parameter values corresponding to each scenario parameter for combination to obtain the test scenario corresponding to the target trigger condition.
[0044] The method and device for determining a driving test scenario provided by the embodiments of this application obtain the target trigger condition for retrieving the test scenario in the autonomous driving function test. By using the trained gradient boosting decision tree model, the range of parameter values of each scenario parameter corresponding to the target trigger condition can be obtained. Then, random sampling is performed on the range of parameter values of each scenario parameter, and N parameter values can be obtained for each range of parameter values. Finally, random combination is performed using the N parameter values of each scenario parameter to obtain the test scenario corresponding to the target trigger condition. Compared with the method of manually constructing test scenarios according to trigger conditions in the prior art, the test scenarios determined according to the target trigger condition in this application have randomness, are more in line with real driving situations, and the obtained test scenarios are also more accurate.
[0045] To make the above objects, features, and advantages of this application more obvious and understandable, the following specifically gives preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. Description of the Drawings
[0046] To more clearly illustrate the technical solutions of the embodiments of this application, the following will briefly introduce the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0047] Figure 1 It is a flowchart of a method for determining a driving test scenario provided by the embodiments of this application;
[0048] Figure 2 It is a flowchart of a method for training a gradient boosting decision tree model provided by the embodiments of this application;
[0049] Figure 3 It is a structural schematic diagram of a device for determining a driving test scenario provided by the embodiments of this application;
[0050] Figure 4Schematic structural diagram of another driving test scenario determination device provided by an embodiment of this application;
[0051] Figure 5 Schematic structural diagram of an electronic device provided by an embodiment of this application. Detailed implementation manners
[0052] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only some of the embodiments of this application, rather than all the embodiments. Components of the embodiments of this application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without creative efforts belongs to the scope of protection of this application.
[0053] With the improvement of people's living standards, vehicles such as cars have become one of the main means of transportation for people, and the intelligence of transportation means has also made travel more convenient. In some cases, a vehicle can automatically perform driving tasks. For example, household cars and buses with the automatic driving function enabled, etc.
[0054] The development of an automatic driving system follows the process from simulation to real vehicle testing. As a zero-risk, fast-iterative, and reproducible testing method, virtual simulation testing has laid a solid foundation for the on-road testing of automatic driving technology. Simulation testing can quickly and effectively test the correctness and performance of algorithms. To implement simulation testing, a virtual test scenario needs to be built for the simulation testing.
[0055] It has been found through research that currently, when building a virtual test scenario, generally, the trigger conditions for a hazard scenario are derived through the analysis of vehicle solutions, and then the test scenarios corresponding to the trigger conditions are obtained through manual construction or real vehicle collection, so that users can perform simulation testing. However, the test scenarios obtained by this method are all very fixed and lack randomness, and the test scenarios considered during manual construction are not comprehensive enough. During real vehicle collection, insufficient data may not be collected due to the extremely rare occurrence of extreme events, resulting in inaccurate test scenarios. Therefore, how to automatically generate the corresponding test scenarios based on the trigger conditions has become a technical problem that cannot be underestimated.
[0056] Based on this, the embodiments of this application provide a method for determining a driving test scenario to solve the problem that the test scenarios constructed according to the trigger conditions in the prior art are all very fixed and lack randomness.
[0057] Please refer to Figure 1 , Figure 1 which is a flowchart of a method for determining a driving test scenario provided by an embodiment of the present application. As Figure 1 shown in
[0058] S101, obtain a target trigger condition for retrieving a test scenario in an autonomous driving function test.
[0059] It should be noted that autonomous driving refers to an operation state in which the work performed by the driver is fully automated and highly centrally controlled, and advanced communication, computer, network, and control technologies are used to achieve real-time and continuous control of the vehicle. An autonomous driving function test refers to a test of a certain function in vehicle autonomous driving. A test scenario refers to an autonomous driving simulation test scenario that needs to be simulated, and is also a test scenario used for the function test. The target trigger condition refers to a scenario condition that may trigger a certain mechanism in vehicle autonomous driving. For example, the target trigger condition can be a scenario condition in a test scenario such as low visibility or a slippery road surface. As an optional implementation manner, the target trigger condition can be set in advance or manually input by the user.
[0060] Here, it should be noted that the above examples of the target trigger condition are only examples, and in practice, the target trigger condition is not limited to the above examples.
[0061] For the above step S101, in specific implementation, obtain the target trigger condition for retrieving a test scenario in an autonomous driving function test that is input by the user or set in advance.
[0062] S102, input the target trigger condition into a trained gradient boosting decision tree model to obtain the value range of each scenario parameter corresponding to the target trigger condition.
[0063] It should be noted that the gradient boosting decision tree model is an iterative decision tree algorithm, which consists of multiple decision trees, and the conclusions of all the trees are accumulated to obtain the final answer. The scenario parameters refer to various basic test data that may be included in the scenario and are used to model the test scenario. For example, according to the embodiments provided in the present application, the scenario parameters may include vehicle states to be tested, road geometric topologies, road facility restrictions, traffic participants, environmental conditions, and so on. Specifically, the scenario parameters may be parameters such as "vehicle speed, speed of the vehicle in front, acceleration of the vehicle in front, distance between two vehicles" that the vehicle to be tested may be involved in the test scenario. The scenario parameters also include weather parameters, such as "sunny, cloudy, rainy", etc., and may also include time parameters of a day, such as "early morning, daytime, evening, night", etc., and may also include driving environment parameters, such as "highway, urban road, closed road", etc. When constructing a test scenario, a test scenario can be constructed according to a single scenario parameter. For example, using the scenario parameter "night", a scenario of autonomous driving at night can be constructed; a test scenario can also be constructed according to multiple scenario parameters. For example, using the two scenario parameters "night" and "rainy day", a scenario of autonomous driving on a rainy night can be constructed. The parameter value range refers to the range of values of the scenario parameters. For example, when the scenario parameter is "vehicle speed", the parameter value range of this scenario parameter can be "60KM / h < vehicle speed < 100KM / h"; when the scenario parameter is "speed of the vehicle in front", the parameter value range of this scenario parameter can be "90KM / h < speed of the adjacent vehicle < 110KM / h".
[0064] Here, it should be noted that the above examples of the scenario parameters and the parameter value range are only examples. In practice, the scenario parameters and the parameter value range are not limited to the above examples.
[0065] For the above step S102, in specific implementation, the target trigger condition obtained in step S101 is input into the trained gradient boosting decision tree model to obtain the parameter value range of each scenario parameter corresponding to the target trigger condition.
[0066] Please refer to Figure 2 , Figure 2 which is the flowchart of the training method of the gradient boosting decision tree model provided by the embodiment of the present application. As Figure 2 shown in, the gradient boosting decision tree model is trained in the following manner:
[0067] S201, obtain sample data.
[0068] It should be noted that the sample data refers to each piece of training data in the model training set used to train the gradient boosting decision tree model. Specifically, the sample data includes at least one trigger condition, and at least one sample scenario corresponding to each trigger condition in the at least one trigger condition. Here, according to the embodiments provided in the present application, in specific implementation, a scenario library will be preset in advance. Multiple trigger conditions are pre-stored in the scenario library, as well as multiple sample scenarios corresponding to each trigger condition. All the data in the scenario library will be used as sample data to train the gradient boosting decision model. Here, the sample scenario includes at least one sample scenario parameter, and the value of each sample scenario parameter is a specific data, so that a specific test scenario can be constructed. As an example, the trigger condition in the sample data can be "low visibility", and the sample scenario in the sample data can be "vehicle speed = 45KM / h, speed of the vehicle in front = 50KM\h, distance between two vehicles = 50M, visibility = 50M", or "vehicle speed = 80KM / h, distance to adjacent vehicle = 15M, speed of adjacent vehicle = 75KM / h, visibility = 20M". As an embodiment, the sample data can include "trigger condition A and trigger condition B, trigger condition A corresponds to sample scenario 1, sample scenario 2 and sample scenario 3, and trigger condition B corresponds to sample scenario 4, sample scenario 5 and sample scenario 6".
[0069] Here, it should be noted that the above examples of the trigger conditions in the sample data and the sample scenarios corresponding to the trigger conditions are only examples. In practice, the trigger conditions in the sample data and the sample scenarios corresponding to the trigger conditions are not limited to the above examples.
[0070] For the above step S201, in specific implementation, all the sample data in the model training set used to train the gradient boosting decision tree model is obtained, including at least one trigger condition, and at least one sample scenario corresponding to each trigger condition.
[0071] S202, input the sample data into the original gradient boosting decision tree model, and train the original gradient boosting decision tree model to obtain a gradient boosting decision tree model.
[0072] It should be noted that the original gradient boosting decision tree model refers to a pre-constructed original model used to predict the range of parameter values of the scenario parameters.
[0073] For the above step S202, in specific implementation, all the sample data obtained in step S201 is input into the pre-constructed original gradient boosting decision tree model, and the original gradient boosting decision tree model is trained to obtain a gradient boosting decision tree model.
[0074] Specifically, training the original gradient boosting decision tree model to obtain a gradient boosting decision tree model includes:
[0075] Step 2021: Generate a first decision tree based on the sample data.
[0076] It should be noted that the gradient boosting decision tree model is to sequentially establish multiple decision trees with the decision tree as the base classifier. Each tree learns to fit the negative gradient of the model formed by all the previous trees, so as to continuously approach the optimal classification. The first decision tree is the decision tree generated by the original gradient boosting decision tree model according to the input sample data. Here, the dependent variable of the first decision tree is the sample data, and the independent variable is the prediction trigger condition. The first decision tree represents the prediction trigger condition corresponding to each sample scenario in the sample data. Continuing the embodiment in step S202, the sample data includes "sample scenario 1 - sample scenario 6". The original gradient boosting decision tree model generates a first decision tree according to these six sample scenarios in the sample data. The first decision tree represents the prediction trigger conditions corresponding to these six sample scenarios as "ABAABB".
[0077] Step 2022: Compare the prediction result of the first decision tree with the trigger condition in the sample data, and calculate the prediction error and loss value of the first decision tree.
[0078] It should be noted that the prediction error here refers to the prediction error generated by comparing the prediction result of the first decision tree with the sample data. The loss value refers to a function that maps the value of a random event or its related random variable to a non - negative real number to represent the "risk" or "loss" of the random event. In applications, the loss value is usually associated with the learning criterion and the optimization problem, that is, the model is solved and evaluated by minimizing the loss function. Continuing the embodiment in step 2021, when the prediction result of the first decision tree is "ABAABB" and the trigger condition in the sample data is "AAABBB", it is considered that there is an error in the prediction result of the first decision tree, and the prediction error and loss value of the first decision tree are calculated based on the prediction result of the first decision tree. In the process of training the gradient boosting decision tree model, the method of calculating the prediction error and loss value according to the prediction result of the first decision tree is described in detail in the prior art and will not be elaborated here.
[0079] Step 2023: Generate a second decision tree based on the prediction error of the first decision tree.
[0080] It should be noted that the second decision tree is the decision tree generated by the original gradient boosting decision tree model according to the prediction error of the first decision tree. Here, the dependent variable of the second decision tree is the sample data, and the independent variable is the prediction error obtained by the first decision tree. That is, the second decision tree represents the prediction error of the first decision tree.
[0081] In the specific implementation of the above step 2023, a second decision tree is generated according to the prediction error of the generated first decision tree.
[0082] Step 2024: Compare the prediction result of the second decision tree with the triggering condition in the sample data, and calculate the prediction error and loss value of the second decision tree.
[0083] Regarding the above step 2024, after the second decision tree is generated, compare the prediction result of the second decision tree with the triggering condition in the sample data to calculate the prediction error and loss value of the second decision tree. Specifically, the method of calculating the prediction error and loss value of the second decision tree according to the prediction result of the second decision tree is the same as the method in step 2022, which will not be elaborated here.
[0084] Step 2025: If the loss value of the second decision tree is greater than the loss threshold, or the number of decision trees in the original gradient boosting decision tree model is less than the number threshold, then generate the next decision tree based on the prediction error of the second decision tree until the loss value of the next decision tree is less than the loss threshold or the number of decision trees in the original gradient boosting decision tree model is equal to the number threshold, obtaining the gradient boosting decision tree model.
[0085] It should be noted that the loss threshold refers to a pre-set standard. As an optional implementation method, the loss threshold can be set such that the second derivative of the loss value is close to 0. Because when the second derivative is close to 0, the slope of the loss value is the smallest, that is, the change in the loss values of the last two decision trees in the original gradient boosting decision tree model is very small. When the loss value is close to this loss threshold, it is considered that the original gradient boosting decision tree model reaches the convergence state. The number threshold refers to the pre-set number of decision trees required in the original gradient boosting decision tree model. Specifically, the number threshold can be pre-set to 10.
[0086] Regarding the above-mentioned step 2025, in specific implementation, after the second decision tree is generated, it is determined whether the loss value of the second decision tree is greater than the loss threshold, or whether the number of decision trees in the original model of the gradient boosting decision tree is less than the number threshold. If the loss value of the second decision tree is greater than the loss threshold, or the number of decision trees in the original model of the gradient boosting decision tree is less than the number threshold, it is considered that the current model has not finished training and another decision tree needs to be generated. After generating the next decision tree, calculate the loss value of this decision tree, and again determine whether the loss value of the next decision tree is greater than the loss threshold, or whether the number of decision trees in the original model of the gradient boosting decision tree is less than the number threshold. If the loss value of the next decision tree is less than or equal to the loss threshold, or the number of decision trees in the original model of the gradient boosting decision tree is equal to the number threshold, it is considered that the current model training is finished and the gradient boosting decision tree model can be obtained. If the loss value of the next decision tree is greater than the loss threshold, or the number of decision trees in the original model of the gradient boosting decision tree is less than the number threshold, decision trees need to be continuously generated until the loss value of the last decision tree is less than the loss threshold or the number of decision trees in the original model of the gradient boosting decision tree is equal to the number threshold, then the gradient boosting decision tree model can be obtained.
[0087] As an alternative embodiment, a decision tree is generated through the following steps:
[0088] (A) According to each sample scenario parameter of each sample scenario in the sample data, a splitting parameter and a splitting point corresponding to the splitting parameter are determined.
[0089] It should be noted that for each sample scenario parameter of each sample scenario in the sample data, the splitting parameter is used to represent the optimal splitting parameter among each sample scenario parameter, and the splitting point is used to represent the critical point of this splitting parameter under the triggering conditions of the sample data, that is, the optimal splitting value of this splitting parameter.
[0090] Regarding the above steps, in specific implementation, for each sample scenario parameter of each sample scenario in this data, a splitting parameter and a splitting point corresponding to the splitting parameter are determined. For example, for one of the sample scenario parameters a, it can be known from the sample data that when the sample scenario parameter a > 50, it belongs to the triggering condition A, and when the sample scenario parameter a ≤ 50, it belongs to the triggering condition B. At this time, it is considered that the sample scenario parameter a is the splitting parameter, and 50 is the splitting point corresponding to this splitting parameter.
[0091] (B) Two node regions are determined based on the splitting parameter and the splitting point corresponding to the splitting parameter.
[0092] It should be noted that the node region is used to represent the value range divided with the splitting point as the critical point. Continuing from the previous embodiment, when the splitting point corresponding to the splitting parameter is 50, the two determined node regions are respectively R1 ≤ 50 and R2 > 50.
[0093] (C) For each node region, determine the first output value corresponding to the node region based on the node region.
[0094] It should be noted that for each node region, the first output value is used to represent the prediction situation of the node region. Specifically, for each node region, the first output value of the node region is calculated through the following formula.
[0095]
[0096] Among them, Cmj is used to represent the first output value, and j is used to represent the splitting parameter variable.
[0097] (D) Based on the first output value corresponding to each node region, determine the squared error corresponding to the splitting point.
[0098] It should be noted that the squared error is used to represent the prediction error between the two node regions divided by the splitting point. Specifically, based on the first output value of each node region, the squared error corresponding to the splitting point is calculated through the following formula.
[0099]
[0100] Among them, C1 is used to represent the first output value of the first node region, C2 is used to represent the second output value of the second node region, and S is used to represent the splitting point of the splitting parameter.
[0101] (E) Adjust the splitting point corresponding to the splitting parameter, and return to execute step (A) until the squared error reaches the error threshold, obtain the optimal target splitting point corresponding to the optimal splitting parameter, and use the optimal target splitting point under the optimal splitting parameter as the node corresponding to the decision tree.
[0102] It should be noted that the error threshold refers to a preset standard. As an optional implementation manner, the error threshold can be set to 0. The optimal splitting parameter refers to the splitting parameter that is continuously adjusted according to the squared error and finally determined. The optimal target splitting point refers to the splitting point corresponding to the optimal splitting parameter that minimizes the squared error.
[0103] For the above steps, in specific implementation, after determining the squared error corresponding to the split point of the split parameter, continuously adjust the split point, and then return to execute the steps of determining the split parameter and the corresponding split point according to each sample scenario parameter in the sample data, determining the node region according to the split point, calculating the corresponding first output value according to the node region, and then calculating the squared error corresponding to the adjusted split point according to the two first output values, until the finally obtained squared error is the smallest. At this time, determine the currently determined split point as the optimal target split point corresponding to the optimal split parameter, and use the optimal target split point under the optimal split parameter as the node corresponding to the decision tree.
[0104] After the gradient boosting decision tree model is trained, based on the final gradient boosting decision tree model, trace back to find the decision boundary corresponding to the trigger condition, then the division of the scenario parameters can be obtained, and the parameter value range belonging to the target trigger condition can be found according to this division. For the above step S102, the step of inputting the target trigger condition into the trained gradient boosting decision tree model to obtain the parameter value range of each scenario parameter corresponding to the target trigger condition includes:
[0105] Step 1021, based on the target trigger condition and the gradient boosting decision tree model, determine at least one scenario parameter corresponding to the target trigger condition.
[0106] For the above step 1021, in specific implementation, after inputting the target trigger condition obtained in step S101 into the trained gradient boosting decision tree model, at least one scenario parameter corresponding to the target trigger condition can be determined.
[0107] Step 1022, for each scenario parameter, determine the value split point corresponding to the scenario parameter based on the decision tree in the gradient boosting decision tree model.
[0108] It should be noted that for each scenario parameter, the value split point is used to represent the critical point of the scenario parameter under the target trigger condition, that is, the optimal split value of this scenario parameter.
[0109] For the above step 1022, in specific implementation, for each determined scenario parameter, use the decision tree in the trained gradient boosting decision tree model to determine the value split point corresponding to the scenario parameter. For example, for one of the scenario parameters a, according to the node composition of the decision tree in the gradient boosting decision tree model, trace back to find the decision boundary corresponding to the scenario parameter, and determine that when the scenario parameter a > 50, it belongs to the trigger condition A, and when the scenario parameter a ≤ 50, it belongs to the trigger condition B. At this time, 50 is considered as the value split point corresponding to the scenario parameter a.
[0110] Step 1023: Determine the parameter value range of the scenario parameter based on the scenario parameter and the value splitting point corresponding to the scenario parameter.
[0111] Regarding the above Step 1023, after determining the value splitting point corresponding to the scenario parameter, based on the division of the parameter space by the decision tree in the gradient boosting decision tree model, determine the parameter value range of the scenario parameter. Because after the gradient boosting decision tree model is trained, the one-to-one correspondence between the divided regions R1, R2, and R3 and the triggering conditions A, B, and C has been obtained. Therefore, after determining the scenario parameter and the value splitting point corresponding to the scenario parameter, the corresponding interval, that is, the parameter value range of the scenario parameter, can be directly returned.
[0112] S103: For each scenario parameter, randomly extract N parameter values from the parameter value range of the scenario parameter.
[0113] It should be noted that the parameter value refers to the specific value existing in the parameter value range of the scenario parameter. According to the embodiments provided in the present application, for each scenario parameter, N parameter values need to be determined from the parameter value range of the scenario parameter, where N is a positive integer greater than or equal to 2.
[0114] Regarding the above Step S103, in specific implementation, for the parameter value ranges of the various scenario parameters determined in Step S102, randomly extract N parameter values from the parameter value range of the scenario parameter for finally generating a test scenario that meets the target triggering condition.
[0115] As an optional implementation manner, regarding the above Step S103, the "for each scenario parameter, randomly extract N parameter values from the parameter value range of the scenario parameter" includes:
[0116] Step 1031: For each scenario parameter, equally spaced divide the parameter value range of the scenario parameter to obtain N sub-parameter value ranges within the parameter value range of the scenario parameter.
[0117] It should be noted that the sub-parameter value range refers to the value range within the parameter value range. Specifically, for each scenario parameter, equally spaced divide the parameter value range of the scenario parameter to obtain N sub-parameter value ranges within the parameter value range. For example, when the parameter value range of a certain scenario parameter is 50 < X < 100, equally spaced dividing this parameter value range can obtain 5 sub-parameter value ranges, namely 50 < X < 60, 60 < X < 70, 70 < X < 80, 80 < X < 90, and 90 < X < 100.
[0118] Step 1032: For N sub-parameter value ranges, randomly sample the parameters within each sub-parameter value range to obtain N parameter values corresponding to the scenario parameters.
[0119] For the above steps, in specific implementation, for each scenario parameter, after obtaining the N sub-parameter value ranges of the scenario parameter, randomly sample the parameters within each sub-parameter value range, and then N parameter values of the scenario parameter can be obtained. Continuing from the previous embodiment, after randomly sampling each sub-parameter value range, 5 parameter values can be obtained, such as 51, 65, 72, 86, and 95.
[0120] S104: Extract one scenario value from each of the N parameter values corresponding to each scenario parameter for combination to obtain a test scenario corresponding to the target trigger condition.
[0121] It should be noted that the scenario value refers to the specific value extracted from the N parameter values and used to construct the final test scenario. For example, when the scenario parameter is "vehicle speed", the scenario value can be "vehicle speed = 65KM / h". The test scenario refers to an autonomous driving simulation test scenario that needs to be simulated. Here, the test scenario can be composed of multiple scenario values.
[0122] For the above step S104, in specific implementation, after obtaining the N parameter values of each scenario parameter, shuffle the N parameter values of each scenario parameter, randomly select a scenario value of one scenario parameter, and combine it with the scenario values of other scenario parameters, then N test scenarios composed of combined scenario values can be obtained.
[0123] In the method for determining a driving test scenario provided by the embodiment of the present application, the target trigger condition for retrieving the test scenario in the autonomous driving function test is obtained. Using the trained gradient boosting decision tree model, the parameter value ranges of each scenario parameter corresponding to the target trigger condition can be obtained. Then, randomly sample the parameter value ranges of each scenario parameter. N parameter values can be obtained for each parameter value range. Finally, randomly combine the N parameter values of each scenario parameter to obtain the test scenario corresponding to the target trigger condition. In this way, the test scenario determined according to the target trigger condition is random, more in line with the real driving situation, and the obtained test scenario is also more accurate.
[0124] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a device for determining a driving test scenario provided by an embodiment of the present application. As shown in Figure 3 the determining device 300 includes:
[0125] A target trigger condition determination module 301, configured to obtain a target trigger condition for retrieving a test scenario in an autonomous driving function test;
[0126] A parameter value range determination module 302, configured to input the target trigger condition into a trained gradient boosting decision tree model to obtain a parameter value range of each scenario parameter corresponding to the target trigger condition;
[0127] A parameter value determination module 303, configured to randomly extract N parameter values from the parameter value range of each scenario parameter, where N is a positive integer greater than or equal to 2;
[0128] A test scenario determination module 304, configured to extract one scenario value from the N parameter values corresponding to each scenario parameter for combination to obtain a test scenario corresponding to the target trigger condition.
[0129] Further, as Figure 4 shown, Figure 4 is a schematic structural diagram of another driving test scenario determination device provided by an embodiment of the present application. As Figure 4 shown in, the determination device 300 further includes a model training module 305, and the model training module 305 is configured to train the gradient boosting decision tree model in the following manner:
[0130] Obtain sample data, where the sample data includes at least one trigger condition and at least one sample scenario corresponding to each trigger condition in the at least one trigger condition;
[0131] Input the sample data into a gradient boosting decision tree original model, and train the gradient boosting decision tree original model to obtain a gradient boosting decision tree model.
[0132] Further, when the model training module 305 trains the gradient boosting decision tree original model to obtain a gradient boosting decision tree model, the model training module 305 is further configured to:
[0133] Generate a first decision tree based on the sample data, where the first decision tree represents a predicted trigger condition corresponding to each sample scenario in the sample data;
[0134] Compare the prediction result of the first decision tree with the trigger condition in the sample data, and calculate the prediction error and loss value of the first decision tree;
[0135] Generate a second decision tree based on the prediction error of the first decision tree;
[0136] Compare the prediction result of the second decision tree with the trigger condition in the sample data, and calculate the prediction error and loss value of the second decision tree;
[0137] If the loss value of the second decision tree is greater than the loss threshold, or the number of decision trees in the original gradient boosting decision tree model is less than the number threshold, generate the next decision tree based on the prediction error of the second decision tree until the loss value of the next decision tree is less than the loss threshold or the number of decision trees in the original gradient boosting decision tree model is equal to the number threshold, to obtain the gradient boosting decision tree model.
[0138] Further, the model training module 305 generates a decision tree through the following steps:
[0139] (A) Determine the splitting parameter and the splitting point corresponding to the splitting parameter according to each sample scenario parameter in the sample data;
[0140] (B) Determine two node regions based on the splitting parameter and the splitting point corresponding to the splitting parameter, where the node region is used to represent the value range divided by the splitting point as the critical point;
[0141] (C) For each node region, determine the first output value corresponding to the node region based on the node region, where the first output value is used to represent the prediction situation of the node region;
[0142] (D) Based on the first output value corresponding to each node region, determine the squared error corresponding to the splitting point, where the squared error is used to represent the prediction error between the two node regions divided by the splitting point;
[0143] (E) Adjust the splitting point corresponding to the splitting parameter, and return to execute step (A) until the squared error reaches the error threshold, to obtain the optimal target splitting point corresponding to the optimal splitting parameter, and use the optimal target splitting point under the optimal splitting parameter as the node corresponding to the decision tree.
[0144] Further, when the parameter value range determination module 302 inputs the target trigger condition into the trained gradient boosting decision tree model to obtain the parameter value range of each scenario parameter corresponding to the target trigger condition, the parameter value range determination module 302 is used for:
[0145] Based on the target trigger condition and the gradient boosting decision tree model, determine at least one scenario parameter corresponding to the target trigger condition;
[0146] For each scenario parameter, a value splitting point corresponding to the scenario parameter is determined based on the decision tree in the gradient boosting decision tree model, where the value splitting point is used to represent the critical point of the scenario parameter under the target trigger condition;
[0147] A parameter value range of the scenario parameter is determined based on the scenario parameter and the value splitting point corresponding to the scenario parameter.
[0148] Further, when the parameter value determination module 303 randomly extracts N parameter values from the parameter value range of each scenario parameter for each scenario parameter, the parameter value determination module 303 is configured to:
[0149] For each scenario parameter, the parameter value range of the scenario parameter is equally spaced divided to obtain N sub-parameter value ranges within the parameter value range of the scenario parameter;
[0150] For the N sub-parameter value ranges, the parameters within each sub-parameter value range are randomly sampled to obtain N parameter values corresponding to the scenario parameter.
[0151] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 5 shown in, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
[0152] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 runs, the processor 510 communicates with the memory 520 through the bus 530. When the machine-readable instructions are executed by the processor 510, the steps of the method for determining a driving test scenario in the method embodiments as described above Figure 1 and Figure 2 can be executed, solving the problem in the prior art that the test scenarios constructed according to the trigger conditions are all fixed and lack randomness. The specific implementation manner can be referred to the method embodiments and will not be elaborated here.
[0153] An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the method for determining a driving test scenario in the method embodiments as described above Figure 1 and Figure 2 can be executed, solving the problem in the prior art that the test scenarios constructed according to the trigger conditions are all fixed and lack randomness. The specific implementation manner can be referred to the method embodiments and will not be elaborated here.
[0154] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0155] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0156] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0158] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0159] It should be noted that like reference numerals and letters denote like items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used for descriptive distinction and should not be construed as indicating or implying relative importance.
[0160] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit it. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed in the present application can still modify the technical solutions recorded in the foregoing embodiments or can easily conceive of changes, or make equivalent replacements for some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application and should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for determining a driving test scenario, characterized in that The determination method includes: Obtaining a target trigger condition for retrieving a test scenario in an autonomous driving function test; Inputting the target trigger condition into a trained gradient boosting decision tree model to obtain the value range of each scenario parameter corresponding to the target trigger condition; For each scenario parameter, randomly extracting N parameter values from the value range of the scenario parameter, where N is a positive integer greater than or equal to 2; Extracting one scenario value from each of the N parameter values corresponding to each scenario parameter for combination to obtain a test scenario corresponding to the target trigger condition; Training the gradient boosting decision tree model in the following manner: Obtaining sample data, where the sample data includes at least one trigger condition, and each trigger condition in the at least one trigger condition corresponds to at least one sample scenario; Inputting the sample data into a gradient boosting decision tree original model and training the gradient boosting decision tree original model to obtain a gradient boosting decision tree model; The step of inputting the target trigger condition into the trained gradient boosting decision tree model to obtain the value range of each scenario parameter corresponding to the target trigger condition includes: Based on the target trigger condition and the gradient boosting decision tree model, determining at least one scenario parameter corresponding to the target trigger condition; For each scenario parameter, determining a value splitting point corresponding to the scenario parameter based on the decision tree in the gradient boosting decision tree model, where the value splitting point is used to represent the critical point of the scenario parameter under the target trigger condition; Determining the value range of the scenario parameter based on the scenario parameter and the value splitting point corresponding to the scenario parameter.
2. The determination method according to claim 1, characterized in that The step of training the gradient boosting decision tree original model to obtain a gradient boosting decision tree model includes: Generating a first decision tree based on the sample data, where the first decision tree represents the predicted trigger condition corresponding to each sample scenario in the sample data; Comparing the prediction result of the first decision tree with the trigger condition in the sample data and calculating the prediction error and loss value of the first decision tree; Generating a second decision tree based on the prediction error of the first decision tree; Comparing the prediction result of the second decision tree with the trigger condition in the sample data and calculating the prediction error and loss value of the second decision tree; If the loss value of the second decision tree is greater than the loss threshold, or the number of decision trees in the gradient boosting decision tree original model is less than the number threshold, generating the next decision tree based on the prediction error of the second decision tree until the loss value of the next decision tree is less than the loss threshold or the number of decision trees in the gradient boosting decision tree original model is equal to the number threshold, to obtain a gradient boosting decision tree model.
3. The determination method according to claim 2, characterized in that Generating a decision tree through the following steps: (A) According to each sample scenario parameter of each sample scenario in the sample data, determining a splitting parameter and the splitting point corresponding to the splitting parameter; (B) Determine two node regions based on the segmentation parameter and the segmentation point corresponding to the segmentation parameter, where the node region is used to represent the value range divided by the segmentation point as the critical point; (C) For each node region, determine the first output value corresponding to the node region based on the node region, where the first output value is used to represent the prediction situation of the node region; (D) Based on the first output value corresponding to each node region, determine the squared error corresponding to the segmentation point, where the squared error is used to represent the prediction error between the two node regions divided by the segmentation point; (E) Adjust the segmentation point corresponding to the segmentation parameter, return to execute step (A), until the squared error reaches the error threshold, obtain the optimal target segmentation point corresponding to the optimal segmentation parameter, and use the optimal target segmentation point under the optimal segmentation parameter as the node corresponding to the decision tree.
4. The determination method according to claim 1, wherein The randomly extracting N parameter values from the parameter value range of each scenario parameter includes: For each scenario parameter, equally spaced divide the parameter value range of the scenario parameter to obtain N sub-parameter value ranges within the parameter value range of the scenario parameter; For the N sub-parameter value ranges, randomly sample the parameters within each sub-parameter value range to obtain N parameter values corresponding to the scenario parameter.
5. A device for determining a driving test scenario, characterized in that, The determining device includes: A target trigger condition determining module, configured to obtain the target trigger condition for retrieving the test scenario in the autonomous driving function test; A parameter value range determining module, configured to input the target trigger condition into the trained gradient boosting decision tree model to obtain the parameter value ranges of the respective scenario parameters corresponding to the target trigger condition; A parameter value determining module, configured to randomly extract N parameter values from the parameter value range of each scenario parameter, where N is a positive integer greater than or equal to 2; A test scenario determining module, configured to extract one scenario value from the N parameter values corresponding to each scenario parameter for combination to obtain a test scenario corresponding to the target trigger condition; The determining device further includes a model training module, and the model training module is configured to train the gradient boosting decision tree model in the following manner: Obtain sample data, where the sample data includes at least one trigger condition, and each trigger condition in the at least one trigger condition corresponds to at least one sample scenario; Input the sample data into the original gradient boosting decision tree model, and train the original gradient boosting decision tree model to obtain the gradient boosting decision tree model; When the parameter value range determining module inputs the target trigger condition into the trained gradient boosting decision tree model to obtain the parameter value ranges of the respective scenario parameters corresponding to the target trigger condition, the parameter value range determining module is configured to: Based on the target trigger condition and the gradient boosting decision tree model, determine at least one scenario parameter corresponding to the target trigger condition; For each scenario parameter, a value splitting point corresponding to the scenario parameter is determined based on the decision tree in the gradient boosting decision tree model, where the value splitting point is used to represent the critical point of the scenario parameter under the target triggering condition; Based on the scenario parameter and the value splitting point corresponding to the scenario parameter, a parameter value range of the scenario parameter is determined.
6. An electronic device, characterized in that, Including: A processor, a memory, and a bus, where the memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are run by the processor, the steps of the method for determining a driving test scenario according to any one of claims 1 to 4 are executed.
7. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is run by the processor, the steps of the method for determining a driving test scenario according to any one of claims 1 to 4 are executed.
Citation Information
Patent Citations
Scene complexity evaluation method based on gradient boosting decision tree model
CN111797000A
Simulation test method and device of automatic driving system and storage medium
CN112364439A