An automatic driving safety critical scene generation method based on accident data driving
By generating safety-critical scenarios using a genetic algorithm driven by accident data, the problem of insufficient generation of safety-critical scenarios in existing technologies is solved, thereby improving the safety and testing efficiency of autonomous driving systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DALIAN UNIV OF TECH
- Filing Date
- 2023-06-28
- Publication Date
- 2026-05-08
AI Technical Summary
Existing autonomous driving scene generation technologies lack research on safety-critical scenarios, making it difficult to detect defects in autonomous driving systems. The quality of scenes generated by existing methods is difficult to guarantee, and the role of real-world accident scenarios in the generation process is not fully utilized.
Based on real-world accident scenarios, a genetic algorithm is used to mine risk factors. By constructing a risk assessment function and searching with a genetic algorithm, the optimal solution problem is generated to create a safety-critical scenario.
It improved the efficiency of generating safety-critical scenarios, discovered potential defects in autonomous driving systems, and enhanced the safety of autonomous driving systems.
Smart Images

Figure CN116880235B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of autonomous driving testing and relates to a technology for generating scenarios that lead to violations in autonomous driving systems, specifically a method for generating critical safety scenarios for autonomous driving based on accident data. Background Technology
[0002] In recent years, with the development of artificial intelligence technology, autonomous driving technology has also made breakthrough progress. To ensure the safety and reliability of autonomous vehicles, it is necessary to conduct thorough testing of autonomous driving systems. Currently, autonomous driving simulation testing has become an important technology for ensuring the safety and reliability of autonomous driving systems. Autonomous driving simulation testing refers to modeling scenarios and using software simulation to test and verify autonomous driving systems. Automated testing of tens of thousands of autonomous driving scenarios has improved testing efficiency and reduced testing costs, and solved the problems of difficult scenario reproduction and difficulty in testing dangerous scenarios in real-world testing. However, the quality of autonomous driving simulation testing is highly dependent on the test scenarios; the higher the scenario coverage, the more likely it is to detect defects in the autonomous driving system. To this end, many countries and companies have established scenario libraries for autonomous driving simulation, which contain a large number of test scenarios. However, the vast majority of scenarios in the scenario library cannot detect problems in the autonomous driving system; only a few scenarios can cause the autonomous driving system to violate regulations. These scenarios that cause autonomous driving violations are called safety-critical scenarios.
[0003] Existing invention patents related to scene generation technology focus on the quantity and efficiency of scene generation, lacking research on generating safety-critical scenes. For example, the patented autonomous driving scene generation method (patent application number: CN202210296383.6) extracts key parameters of a scene and then generalizes these parameters to obtain new scenes. While this method can quickly obtain a batch of new scenes through parameter generalization, it does not perform further processing on the generalized scenes, thus the quality of the new scenes is difficult to guarantee. Furthermore, most existing methods generalize new scenes based on randomly sampled scenes, which may be far removed from safety-critical scenarios, making it difficult to detect defects in autonomous driving systems. For instance, the patented autonomous driving scene generation method, device, and system (patent application number: CN202010711287.4) uses scenes sampled from real vehicles to generate new scenes, ignoring the crucial role of accident scenarios in scene generation.
[0004] The basic scenarios are already relatively complete. However, critical safety scenarios are key to further discovering defects in autonomous driving systems. Therefore, there is an urgent need to develop a technology specifically for efficiently generating critical safety scenarios. Real-world traffic accidents involving human-driven vehicles are likely to lead to accidents involving autonomous vehicles, providing a data foundation for generating critical safety scenarios. Summary of the Invention
[0005] To address the aforementioned problems, this invention proposes a method for generating critical safety scenarios for autonomous driving based on accident data. This invention has two key aspects: First, it uses real-world accident scenarios as a foundation to identify potential hazards within these scenarios that could lead to violations by autonomous driving systems. Second, it models the scenario generation problem as an optimization problem, using a genetic algorithm as the solution algorithm to efficiently generate critical safety scenarios. This invention can be used to generate higher-value but difficult-to-discover critical safety scenarios, thereby improving testing efficiency and detecting defects in autonomous driving systems.
[0006] The technical solution of the present invention is as follows:
[0007] A method for generating critical safety scenarios for autonomous driving based on accident data, comprising the following steps:
[0008] Step 1: Initialize the Scene Set. A scene set is a collection of simulation scene files. Initializing the scene set refers to selecting a batch of scene files to form the scene set. In this invention, scene set O must include hazardous scenes and normal scenes. Hazardous scenes refer to traffic accident scenes. These scenes are extracted from real-world traffic accidents and stored in the hazardous scene library component of this invention. A batch of scenes is randomly selected from this component as the hazardous scenes for the scene set. Normal scenes refer to general scenes that do not lead to traffic accidents. These scenes can be randomly selected from the normal scene library component or scenes input by the user.
[0009] Step 2: Collect key scenario information. Key information includes the acceleration of the master vehicle at each moment during scenario execution and the distance to the nearest NPC vehicle. In this invention, the master vehicle refers to the vehicle controlled by the autonomous driving system in the test scenario, and its behavior is controlled by the decision module of the autonomous driving system. NPC vehicles are vehicles defined in the scenario file, and their behavior is specified by the scenario file. The collected scenario is run using an autonomous driving simulation simulator, with a time step of t0. Scenario information is collected every t0, and the total number of time steps for scenario execution is T, where t represents the end time of the t-th time step of scenario execution.
[0010] Acceleration reflects the vehicle's driving state; the greater the acceleration, the more likely it is to encounter unexpected situations. Therefore, it is necessary to statistically analyze the vehicle's acceleration during driving. t v represents the acceleration of the main vehicle at time t. t This represents the speed of the main vehicle at time t. t Acceleration 'a' is obtained from the interface provided by the simulator. t The result is obtained using formula (1):
[0011] a t=(v t -v t-1 ) / t0 (1)
[0012] The closer vehicles are traveling together, the greater the probability of a collision and the higher the level of danger. When the distance is zero, it indicates that a collision has occurred. Therefore, it is necessary to calculate the distance between the main vehicle and the nearest NPC vehicle during the journey. This represents the lateral distance of the nearest NPC vehicle to the main vehicle at time t. This represents the longitudinal distance between the NPC vehicle closest to the main vehicle at time t. This distance information can be obtained through the interface provided by the simulator.
[0013] Step 3: Construct the hazard assessment function. Scene hazard θ o This quantifies the probability of a collision between the main vehicle and an NPC vehicle in the scene. Specific numerical values represent the level of danger in the scene, facilitating scene assessment: a higher level of danger indicates a greater probability of a collision between the main vehicle and an NPC vehicle. The danger level is calculated using the information collected in step 2.
[0014] First, calculate the danger level θ reflected by the distance. t l .pass and Calculate the Euclidean distance l between the main vehicle and the nearest NPC vehicle at time t. t If l t =0 indicates that the main vehicle collided with an NPC vehicle in this scene; this scene is directly added to the result set and removed from the scene set. If l t If the distance is greater than 0, continue calculating the hazard level reflected by the distance: the hazard level increases as the distance decreases, but the relationship is not a simple linear one. A non-linear function is used to calculate the hazard level reflected by the distance. t and θ t l The calculation formula is as follows:
[0015]
[0016]
[0017] Acceleration reflects the degree of danger θ t a It increases with increasing acceleration, and also exhibits a non-linear relationship, θ t a The calculation formula is as follows:
[0018]
[0019] The danger level θ of the scene at time t tThe danger level at time t is calculated by combining the danger levels reflected by distance and acceleration at the current moment. Since the danger levels reflected by the distance to the nearest NPC vehicle and the acceleration of the main vehicle are different, different weights r1 and r2 are applied when summing the two, and r1 + r2 = 1. Therefore, the formula for calculating the scene danger level at time t is as follows:
[0020] θ t =r1θ t l +r2θ t a (5)
[0021] The danger level of a scenario depends on the maximum danger level at all moments during the entire scenario execution process; the danger level θ of the scenario is... o The calculation formula is as follows:
[0022] θ o =maxθ t (0<t≤T) (6)
[0023] Step 4: Execute the search algorithm. This invention uses a hazard metric to measure the proximity between hazardous and safety-critical scenarios, transforming the problem of generating safety-critical scenarios into a problem of searching for the optimal solution. A genetic algorithm is used as the search algorithm. The steps of the genetic algorithm used in this invention are as follows:
[0024] a: Parent initialization. Initialize the parent population P(0) using the scene set obtained in step 1 as the parent population.
[0025] b: Construct the fitness function. Using the risk assessment function defined in step 3, construct the fitness function for the genetic algorithm.
[0026] c: Generating new individuals. This invention generates new individuals by performing crossover and mutation operations on existing individuals in the population.
[0027] In genetic algorithms, crossover is the operation of exchanging chromosome sequences among individuals in the population, and it is the primary source of new individuals. In this invention, individuals represent the scene, and chromosomes represent the behavioral sequences of NPC vehicles within that scene. Considering the continuity of vehicle behavior, this invention defines crossover as the operation of exchanging NPC behavioral sequences within the scene, with a probability of P. c The specific process is as follows: First, a random number is generated. The magnitude of the random number determines whether to perform a crossover operation, thus controlling the probability of crossover execution to be P. c If the crossover operation is performed, then randomly select one NPC vehicle from each of the two scenes in the population, and denote their action sequences as M. x and M y ; Exchange M x and M yThis leads to new scenarios, or new individuals.
[0028] In genetic algorithms, mutation is the operation of modifying genes on chromosomes, and the probability of mutation is much lower than the probability of crossover. In this invention, genes represent actions at a specific time point in the NPC behavior sequence; therefore, mutation is the operation of modifying the actions at that specific time point in the NPC behavior sequence, and the probability of mutation is P. m Modifying NPC actions includes replacement and insertion. Replacement refers to selecting an action from the action library component to replace the NPC's action, while insertion refers to selecting an action from the action library component and inserting it into the NPC's action sequence. The action library is a component of this invention, defining possible vehicle operations in the simulation scenario, including acceleration, deceleration, following other vehicles, and lane changing. The specific mutation process is as follows: First, the probability of mutation execution is controlled using the same method as in crossover; if it is determined that mutation will be executed, then an NPC vehicle i from the scenario is randomly selected from the population, and time t is selected using a random number method. The action of the NPC vehicle at that time is denoted as... By inserting or replacing Modifications are made to create new scenarios, or new individuals.
[0029] d: Construct a temporary population. Merge the new individuals obtained in the previous step with the original population to obtain a temporary population.
[0030] e: Calculate the fitness score. Run the scenarios in the temporary population one by one using the simulator. When running a scenario, if the main vehicle collides with an NPC in the scenario, it indicates that a safety-critical scenario has been found. Add the scenario to the result set and remove it from the temporary scenario set. For non-safety-critical scenarios, input the information collected in step 2 into the fitness function to calculate the fitness score of each individual in the population.
[0031] f: Generate the next generation population. For the temporary population containing both new and original individuals, a roulette wheel algorithm is used to select a subset of individuals to form the next generation population.
[0032] g: Termination condition judgment. If the current population generation k is equal to the preset maximum population generation K, or the number of scenarios in the result set has reached a predetermined amount C, the search algorithm terminates; otherwise, step cf is repeated until the termination condition is met. The values of K and C can be set according to actual needs.
[0033] Step 5: Report security-critical scenarios. Return the scenarios from the result set as the results, and the algorithm terminates.
[0034] The beneficial effects of this invention are as follows: This invention uses real-world traffic accident scenarios as a driving force, employs a genetic algorithm to discover hazardous factors within these scenarios, and mutates these hazardous factors. In each iteration, the genetic algorithm retains positively mutated individuals from the population. As the population iterates and gradually approaches the target scenario, it ultimately identifies safety-critical scenarios. The discovered safety-critical scenarios can help autonomous driving system developers uncover vulnerabilities in their systems, contributing to the improvement of autonomous driving systems and enhancing system safety. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the overall process of the present invention.
[0036] Figure 2 This is a schematic diagram of the genetic algorithm process in this invention. Detailed Implementation
[0037] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and technical solutions.
[0038] This invention discloses a method for generating critical safety scenarios for autonomous driving based on accident data. Deployed on a Linux host with a GPU, it uses OpenSCENARIO 1.0 as the scenario description language and requires an emulator supporting this language. This invention uses the open-source CARLA emulator, but users can choose other supported emulators as needed. Additionally, a Python environment is required to support method execution.
[0039] The first step is preparation, which involves initializing the parameters in the method. These parameters include the scene set size N, the ratio r of normal scenes to dangerous scenes in the scene set, the result set size C, and the probability P of crossover in the genetic algorithm. c and the probability P of mutation m The number of iterations in the genetic algorithm, K. This invention sets default values for the above parameters, as shown in Table 1. Users can also adjust these parameter values as needed.
[0040] Table 1 Initialization Parameters Table
[0041]
[0042] The following steps are as follows: Figure 1 As shown, the specific process is as follows:
[0043] Step 1: Initialize the scene set. The scene set consists of regular scenes and dangerous scenes. The number of scenes is determined by the size N of the scene set and the ratio r between the two types of scenes. For example, under the default parameters, the number of regular scenes is 16 and the number of dangerous scenes is 4. The parameters N and r can be modified as needed to adjust the number of scenes. Users can input their own scenes as regular scenes; these scenes can come from open-source or commercial scene libraries. Alternatively, users can choose not to input scenes and use the invention's built-in scene library.
[0044] This invention uses user-input scenarios or randomly selects a batch of scenarios from a regular scenario library component as the regular scenarios in the initial scenario set. Additionally, it selects a batch of scenarios from a hazardous scenario library component as the hazardous scenarios in the initial scenario set. At this point, the scenario set initialization is complete.
[0045] Step 2: Collect key scene information. In this invention, the distance l between the main vehicle and the NPC vehicle at time t is used. t And the acceleration a of the main vehicle t Consider it as reflecting the danger level θ of the scene at the current moment. t Two important features of the vehicle are the distance information, which can be obtained directly through the interface provided by the CARLA simulator. The acceleration information needs to be calculated. The specific process is as follows: use the simulator interface to read the speed of the main vehicle at each time step t, with a preset time step t0 = 0.5 seconds, and finally use formula (1) to calculate the acceleration of the main vehicle at each time step.
[0046] Step 3: Constructing a Hazard Assessment Function. Hazard is a key aspect of this invention. By introducing a hazard assessment function, the previously difficult-to-assess level of scene danger is transformed into a quantifiable value. Combined with a genetic algorithm, the scene is iterated towards higher hazard levels, ultimately identifying safety-critical scenes. This invention uses two references for hazard assessment: distance and acceleration, mentioned in Step 2. These reflect different levels of danger, so different weights r1 and r2 are assigned to them when calculating the hazard. Experiments have shown that when r1 is 0.75 and r2 is 0.25, the hazard accurately reflects the scene's danger level. Considering that the hazard reflected by distance and acceleration is not a simple linear relationship with their magnitudes, nonlinear functions are used to calculate the hazard reflected by distance and acceleration. The hazard level θ of the scene. o The scenario hazard assessment function depends on the maximum value of the hazard level at each moment, and is therefore as follows:
[0047]
[0048] Step 4: Execute the search algorithm. The search algorithm is one of the key aspects of this invention; a genetic algorithm is used as the search algorithm. The main steps are as follows: Figure 2As shown, the process includes parental population initialization, fitness function construction, new individual generation, temporary population construction, fitness score calculation, next generation population generation, and termination condition determination. The specific process is as follows:
[0049] a: Parental population initialization. The scenario set O obtained in step 1 is used as the parental population. Scenario set O is a combination of N scenarios, including dangerous and normal scenarios, with a ratio of r between dangerous and normal scenarios. The size N of the scenario set can be user-defined or use the default size; the ratio r between the two types of scenarios is obtained through experiments.
[0050] Introducing hazardous scenarios into the parent population is based on the insight that scenarios that lead to traffic accidents involving human-driven vehicles in the real world are also likely to lead to traffic accidents involving autonomous vehicles. Therefore, this invention adds real-world traffic accident scenarios, i.e., hazardous scenarios, to the parent population to introduce the dangerous factors from accident scenarios, thereby improving the generation efficiency of critical safety scenarios. These dangerous factors mutate with each population iteration, and each iteration retains positively mutated individuals in the population, ultimately generating critical safety scenarios that could lead to traffic accidents involving autonomous vehicles.
[0051] b: Construct the fitness function. The fitness function is crucial in the genetic algorithm, used to calculate the fitness score of an individual. The fitness score is a standard for measuring the quality of individuals in the population; the higher the fitness score, the closer the individual is to the target result, and the more likely it is to be retained. In this invention, scene danger reflects scene quality; therefore, the danger assessment function in step 3 is used as the fitness function of the genetic algorithm.
[0052] c: Generating new individuals. This invention uses crossover and mutation operations to generate new individuals.
[0053] Crossover: In this invention, crossover is the operation of exchanging NPC behavior sequences in a scene, and it is the main source of new scenes. Therefore, a crossover probability P is set. c =0.95. The specific process of crossover is as follows: First, determine whether to perform the crossover operation: Generate a random number d between 0 and 1. c When d c ≤P c At this time, a crossover operation is performed, which involves randomly selecting two scenes from the population, and selecting one NPC vehicle x and y from each scene, and denoting their action sequences as M. x and M y Exchange M x and M y Conversely, if d c >P c No crossover operation is performed.
[0054] Mutation: In this invention, mutation refers to the operation of modifying the action of an NPC at a certain time point in the behavior sequence of the scene. When the probability of mutation is too high, the genetic algorithm will degenerate into a random algorithm; therefore, the probability of mutation is set to P. m =0.05. The specific mutation process is as follows: first, determine whether to perform the mutation operation, and generate a random number d between 0 and 1. m When d m ≤P m If the mutation occurs at a certain time, the mutation operation is performed; otherwise, it is not performed. The mutation operation process is as follows: randomly select an NPC vehicle i from a scene in the population, and perform a mutation on its behavior sequence M. i Actions at time t Modifications are made or new actions are added before the current action to generate a new scenario, where t is an integer between 0 and T, randomly generated using the Python API. Considering the coherence of the car behavior sequence, the mutation operations in this invention mainly include insertion and replacement. Both operations are randomly selected with a probability of 0.5, and the probability of each operation is controlled using the same method of generating random numbers. The specific meanings of insertion and replacement are as follows:
[0055] Insert: in Insert an action m randomly selected from the action library before it;
[0056] Replace: Replace it with an action m randomly selected from the action library;
[0057] d: Construct a temporary population. Merge the new individuals obtained in the previous step with the original population to obtain a temporary population.
[0058] e: Calculate the fitness score. Run each scenario in the temporary population using the CARLA simulator. During scenario execution, if the master vehicle collides with an NPC vehicle, the scenario is added to the result set and removed from the temporary population. For scenarios without collisions, obtain the distance to the nearest NPC vehicle to the master vehicle at each time step and the speed of the master vehicle at each time step, and calculate the acceleration information. Input the distance and acceleration information into the fitness function to calculate the fitness score of the scenario.
[0059] f: Generate the next generation population. Use the roulette wheel algorithm to select individuals from the temporary population based on their fitness scores. The reason is that the fitness score reflects how closely a scene resembles the target scene, but it doesn't guarantee that a scene with higher fitness will necessarily produce a safe and critical scene; it's just more probabilistically likely. In the roulette wheel algorithm, the probability of an individual being retained is directly proportional to its fitness score. This ensures that scenes with higher fitness scores are more likely to be retained, while also providing a chance for scenes with lower fitness scores to be retained. The N scenes selected are used as the next generation population.
[0060] g: Termination condition judgment. If the number of population iterations has reached the predetermined number of generations K, or the number of scenarios in the result set has reached the predetermined number C, then the search algorithm terminates.
[0061] Step 5: Report security-critical scenarios. Return the scenarios from the result set as the results, and the algorithm terminates.
Claims
1. A method for generating critical safety scenarios for autonomous driving based on accident data, characterized in that, The specific steps are as follows: Step 1: Initialize the scene set; The scene set is a collection of simulation scene files. Initializing the scene set means selecting a batch of scene files to form the scene set; Scene set O contains dangerous scenes and normal scenes; Dangerous scenes refer to traffic accident scenes. These scenes are extracted from real-world traffic accidents and stored in the dangerous scene library component. A batch of scenes is randomly selected from this component as dangerous scenes of the scene set. Regular scenarios refer to general scenarios that do not lead to traffic accidents. These scenarios are randomly selected from the regular scenario library components or are scenarios input by the user. Step 2: Collect key information about the scene; Key information includes the acceleration of the master vehicle at each moment during the scenario execution and the distance to the nearest NPC vehicle; the master vehicle refers to the vehicle controlled by the autonomous driving system in the test scenario, and its behavior is controlled by the decision-making module in the autonomous driving system; NPC vehicles are vehicles defined in the scenario file, and their behavior is specified by the scenario file. The collected scenarios are run using an autonomous driving simulation simulator. A time step t0 is set, and scenario information is collected every t0. The total number of time steps for scenario execution is T, where t represents the end time of the t-th time step of scenario execution. Acceleration reflects the vehicle's driving state; the greater the acceleration, the more likely it is to encounter sudden situations. Therefore, it is necessary to statistically analyze the vehicle's acceleration during driving. t v represents the acceleration of the main vehicle at time t. t v represents the speed of the main vehicle at time t; t Acceleration 'a' is obtained from the interface provided by the simulator. t The result is obtained using formula (1): a t =(v t -v t-1 ) / t0 (1) The closer the vehicles are traveling, the greater the probability of a collision and the higher the level of danger. When the distance is 0, it means that a collision has occurred. Therefore, it is necessary to calculate the distance between the main vehicle and the nearest NPC vehicle during the driving process; This represents the lateral distance of the nearest NPC vehicle to the main vehicle at time t. This represents the longitudinal distance between the nearest NPC vehicle and the main vehicle at time t. This distance information can be obtained through the interface provided by the simulator. Step 3: Construct the hazard assessment function; scenario hazard θ o It quantifies the probability of a collision between the main vehicle and an NPC vehicle in the scene; it uses specific values to represent the danger level of the scene, making it easier to assess the scene: a higher scene danger level means a greater probability of a collision between the main vehicle and an NPC vehicle; the danger level is calculated using the information collected in step 2. First, calculate the danger level θ reflected by the distance. t l ;pass and Calculate the Euclidean distance l between the main vehicle and the nearest NPC vehicle at time t. t If l t =0 indicates that the main vehicle collided with an NPC vehicle in this scene; this scene is directly added to the result set and removed from the scene set. If l t If the value is >0, continue calculating the hazard level reflected by distance: the hazard level increases as the distance decreases, but the relationship is not a simple linear one. A nonlinear function is used to calculate the hazard level reflected by distance. t and θ t l The calculation formula is as follows: Acceleration reflects the degree of danger θ t a It increases with increasing acceleration, and also exhibits a non-linear relationship, θ t a The calculation formula is as follows: The danger level θ of the scene at time t t The danger level at time t is calculated by combining the danger levels reflected by distance and acceleration at the current moment. Since the danger levels reflected by the distance to the nearest NPC vehicle and the acceleration of the main vehicle are different, different weights r1 and r2 are applied when summing the two, and r1 + r2 = 1. Therefore, the formula for calculating the scene danger level at time t is as follows: i t =r1θ t l +r2θ t a (5) The danger level of a scenario depends on the maximum danger level at all moments during the entire scenario execution process; the danger level θ of the scenario is... o The calculation formula is as follows: i o =maxθ t ,0 <t≤T (6) Step 4: Execute the search algorithm; use the hazard metric to measure the proximity between the scenario and the safety-critical scenario, transforming the problem of generating the safety-critical scenario into a problem of searching for the optimal solution, and use a genetic algorithm as the search algorithm; the specific steps are as follows: a: Parent initialization; Initialize the parent population P(0), using the scene set obtained in step 1 as the parent population; b: Construct the fitness function; using the risk assessment function defined in step 3, construct the fitness function for the genetic algorithm; c: Generate new individuals; generate new individuals by performing crossover and mutation operations on existing individuals in the population; In genetic algorithms, crossover is the operation of exchanging chromosome sequences among individuals in the population, and it is the primary source of new individuals. Individuals represent the scene, and chromosomes represent the behavioral sequences of NPC vehicles within that scene. Considering the continuity of vehicle behavior, crossover is defined as the operation of exchanging NPC behavioral sequences within the scene, with a probability P of occurrence. c The specific process is as follows: First, a random number is generated. The magnitude of the random number determines whether to perform the crossover operation, thus controlling the probability of crossover execution to be P. c If the crossover operation is performed, then randomly select one NPC vehicle from each of the two scenes in the population, and denote their action sequences as M. x and M y ; Exchange M x and M y This leads to new scenarios, or new individuals. In genetic algorithms, mutation is the operation of modifying genes on chromosomes, and the probability of mutation is much lower than the probability of crossover. Genes represent actions at a specific time point in the NPC behavior sequence; therefore, mutation is the operation of modifying the action at that specific time point in the NPC behavior sequence, and the probability of mutation is P. m Modifying NPC actions includes replacement and insertion. Replacement involves selecting an action from the action library component to replace the NPC's action, while insertion involves selecting an action from the action library component and inserting it into the NPC's action sequence. The action library is a component that defines the possible operations a vehicle may perform in the simulation scenario, including acceleration, deceleration, following other vehicles, and lane changing. The specific mutation process is as follows: First, the probability of mutation execution is controlled using the same method as in crossover. If it is determined that a mutation operation will be executed, an NPC vehicle i is randomly selected from the population in the scenario. Time t is selected using a random number method, and the action of the NPC vehicle at that time is denoted as... By inserting or replacing Modifications are made to create new scenarios, or new individuals. d: Construct a temporary population; merge the new individuals obtained in the previous step with the original population to obtain a temporary population; e: Calculate fitness score; run the scenarios in the temporary population one by one using the simulator. When running the scenario, if the main vehicle collides with an NPC in the scenario, it indicates that a safety critical scenario has been found. Add the scenario to the result set and remove it from the temporary scenario set. For non-critical safety scenarios, the information collected in step 2 is input into the fitness function to calculate the fitness score of each individual in the population. f: Generate the next generation population; For a temporary population containing both new individuals and individuals from the original population, use the roulette wheel algorithm to select a portion of individuals to form the next generation population; g: Termination condition judgment: If the current population generation k is equal to the preset maximum population generation K, or the number of scenarios in the result set has reached the predetermined amount C, terminate the search algorithm; otherwise, repeat step cf until the termination condition is met; where the size of K and C can be set according to actual needs. Step 5: Report security-critical scenarios; return the scenarios from the result set as the results, and the algorithm terminates.
Citation Information
Patent Citations
Automatic driving scene generation method, device and system
CN113968242A
Automatic driving scene generation method
CN114647582A
Solver performance defect detection method based on multi-target genetic algorithm
CN113377676A
Automatic driving test data generation method and system, electronic equipment and storage medium
CN115080450A