Automatic driving key scene generation method, device and equipment
By establishing the relative safety boundary area of the vehicle and the reinforcement learning algorithm, real and natural confrontation scenarios are generated, which solves the problem of insufficient rationality and diversity of autonomous driving test scenarios, and improves the accuracy of the test and the safety of the system.
Patent Information
- Application Number
- CN202410736221.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
AI Technical Summary
Existing automatic driving test scene generation methods have problems such as unreasonable scene confrontation and unrealistic behavior, resulting in unreasonable test scenarios and insufficient diversity, making it difficult to discover safety issues of the automatic driving system.
By establishing the relative safety boundary area of the vehicle, the vehicle under test and the companion vehicle are guided to produce confrontational behaviors in the test scene, maximizing the overall criticality of the scene, and combining the reinforcement learning algorithm to generate diversified confrontation scenes to improve the authenticity and diversity of the scene.
It generates confrontation scenarios that are close to natural and real driving behaviors, improves the accuracy and credibility of autonomous driving tests, helps understand system limitations and performance, optimizes algorithms and models, and improves system efficiency and safety.
Smart Images

Figure CN118760152A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of autonomous driving technology, and in particular to a method, device and equipment for generating key scenarios for autonomous driving. Background Art
[0002] With the development and application of intelligent technology, self-driving cars are becoming intelligent mobile carriers that understand, help and liberate people. They constitute the foundation of future safe, efficient, intelligent and environmentally friendly transportation systems, and are one of the most powerful driving forces for the development of artificial intelligence and one of the most promising application directions. Although the entire industry is full of expectations for the application prospects of self-driving, the frequent accidents of self-driving and the public's concerns about its safety have cast a thick shadow on the application of self-driving on the road. How to solve the safety problem of self-driving cars and ensure the functional safety of cars, especially the expected functional safety, is a key issue that needs to be solved in self-driving, and the generation of key scenarios for self-driving is an important factor in solving the above-mentioned completeness problem.
[0003] The existing technologies for generating key scenarios for autonomous driving mainly include the following:
[0004] Scene generation method based on sensor data: The surrounding environment data is collected through vehicle-mounted sensors (such as cameras, lidar, millimeter-wave radar, etc.), and then the data is processed and analyzed using technologies such as computer vision and deep learning to generate scenes around the vehicle. This method can provide rich environmental information, but it has high requirements on the accuracy and reliability of the sensors.
[0005] Scene generation method based on map data: The environment around the vehicle is modeled and analyzed by combining pre-built high-precision map data with on-board sensor data. This method can provide more accurate and reliable environmental information, but it has high requirements for updating and maintaining map data.
[0006] Scenario generation method based on simulation technology: Computer simulation technology is used to simulate the driving conditions of vehicles in different scenarios, thereby generating various complex driving scenarios. This method can provide a large amount of scenario data for training and testing autonomous driving systems, but it has high requirements for the accuracy and authenticity of the simulation model.
[0007] There are also some specific technical methods used to generate key scenarios for autonomous driving, such as generative adversarial networks (GANs). GANs generate high-quality samples by training two competing neural networks (generators and discriminators) to model the target distribution. However, GANs have the disadvantages of low diversity of captured samples and poor scalability, and are also difficult to train.
[0008] At present, the test scenario generation technology based on simulation data can efficiently simulate different vehicle models, weather, street scenes and other traffic scene elements, and quickly generate various test scenarios in large quantities. The test scenario generation technology based on simulation data has become the core key technology of autonomous driving testing. Despite this, there are problems with unreasonable scene confrontation and unrealistic behavior in autonomous driving simulation test scenarios, which are mainly reflected in: (1) Most of the existing test scenario generation work takes minimizing the expected collision time as the optimization goal, resulting in the accompanying test vehicle's attack behavior on the autonomous driving vehicle in some scenarios being too deliberate and extreme, such as sudden lane change and breaking the physical braking limit of the vehicle. However, the probability of this scenario occurring on natural roads is extremely low, which is quite different from the actual application scenario of autonomous driving vehicles, and the test scenario is not reasonable enough; (2) The diversity of existing autonomous driving simulation test scenarios is insufficient, and they often only cover a part of common scenarios. When adversarial attacks are introduced in simulation test scenarios, the accompanying test vehicle will deliberately interfere with the behavior of the autonomous driving system. However, in real scenarios, deliberate adversarial attacks are not very common. Therefore, the existing scenarios lack real and natural adversarial behaviors, making it difficult to discover safety problems of the tested vehicle, and have little significance for the testing of the tested vehicle. Summary of the invention
[0009] The present invention proposes a method, device and equipment for generating key scenes of autonomous driving, which can generate real and natural confrontation behaviors.
[0010] According to a first aspect of an embodiment of the present disclosure, a method for generating a key scene for autonomous driving is provided, comprising:
[0011] Establish a vehicle relative safety boundary area centered on the vehicle under test, the vehicle relative safety boundary area includes: a vehicle collision risk area, a vehicle collision boundary area and a vehicle relative safety area, the vehicle collision risk area is an area where a collision between the vehicle under test and the accompanying vehicle is inevitable, the vehicle collision boundary area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking at maximum acceleration within the reaction time of the vehicle under test, and the safety area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking within the reaction time of the vehicle under test;
[0012] Initialize a test scene;
[0013] The test vehicle and the accompanying test vehicle are guided to generate confrontational behavior in the test scenario with the goal of maximizing the overall scene criticality of the test scenario; wherein the overall scene criticality of the test scenario is obtained based on the position of the accompanying test vehicle on the relatively safe boundary area of the vehicle during the guiding process;
[0014] According to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guiding process, it is judged whether the test scenario meets the set requirements.
[0015] Optionally, the establishing of a vehicle collision risk area centered on the detected vehicle includes:
[0016] Obtaining a first distance in the x-axis direction based on the speed of the vehicle under test in the x-axis direction, the maximum braking acceleration of the vehicle under test in the x-axis direction, and the speed of the accompanying vehicle in the x-axis direction;
[0017] Obtaining a first distance in the y-axis direction based on the speed of the vehicle under test in the y-axis direction, the maximum braking acceleration of the vehicle under test in the y-axis direction, and the speed of the accompanying vehicle in the y-axis direction;
[0018] A vehicle collision risk area is obtained according to the first distance in the x-axis direction and the first distance in the y-axis direction.
[0019] Optionally, the establishing of a vehicle collision boundary region centered on the detected vehicle includes:
[0020] Based on the speed of the tested vehicle in the x-axis direction, the maximum brake acceleration of the tested vehicle in the x-axis direction, the maximum throttle acceleration of the tested vehicle in the x-axis direction, the speed of the accompanying test vehicle in the x-axis direction, and the reaction time of the tested vehicle, a second distance in the x-axis direction is obtained;
[0021] Based on the speed of the vehicle under test in the y-axis direction, the maximum brake acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction, and the reaction time of the vehicle under test, a second distance in the y-axis direction is obtained;
[0022] A vehicle collision boundary area is obtained according to the first distance in the x-axis direction, the second distance in the x-axis direction, the first distance in the y-axis direction, and the second distance in the y-axis direction.
[0023] Optionally, the establishing of a vehicle relative safety area centered on the tested vehicle includes:
[0024] A third distance in the x-axis direction is obtained based on the speed of the vehicle under test in the x-axis direction, the minimum brake acceleration of the vehicle under test in the x-axis direction, the maximum throttle acceleration of the vehicle under test in the x-axis direction, the speed of the accompanying vehicle in the x-axis direction, and the reaction time of the vehicle under test;
[0025] A third distance in the y-axis direction is obtained based on the speed of the vehicle under test in the y-axis direction, the minimum brake acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction, and the reaction time of the vehicle under test;
[0026] A relatively safe area of the vehicle is obtained according to the second distance in the x-axis direction, the third distance in the x-axis direction, the second distance in the y-axis direction, and the third distance in the y-axis direction.
[0027] Optionally, the step of guiding the vehicle under test and the accompanying vehicle to generate confrontational behaviors in the test scenario with the goal of maximizing the overall criticality of the test scenario includes:
[0028] Construct the state space, action space and reward function of the test vehicle;
[0029] With the goal of maximizing the overall criticality of the test scenario, an action a at the tth moment is selected for the accompanying test vehicle in the action space. t , so that the state space of the accompanying test vehicle changes from state s t Change to state s t+1 At the same time, get the reward value r at time t t ;
[0030] The action a t , the state s t , the state s t+1 And the reward value r t Save in transfer dictionary;
[0031] In the state t+1 If the state does not correspond to the collision between the tested vehicle and the accompanying test vehicle, and t+1 is less than the set running time, set t=t+1, and return to the state with the goal of maximizing the overall criticality of the test scene, and select an action a at the tth time for the accompanying test vehicle in the action space. t ;
[0032] In the state t+1 Corresponding to the state where the tested vehicle collides with the accompanying test vehicle, or when t+1 is equal to the set running time, the relative position trajectory of the tested vehicle and the accompanying test vehicle is output; wherein the relative position trajectory of the tested vehicle and the accompanying test vehicle is based on all states s of the accompanying test vehicle t get.
[0033] Optionally, constructing a reward function includes:
[0034] After converting the coordinate reference system of the accompanying test vehicle from the world coordinate system to the coordinate system of the vehicle under test, the accompanying test vehicle is modeled as a rectangle according to the vehicle position and the length and width of the vehicle, so as to calculate the overlapping areas of different areas in the relative safety boundary area of the accompanying test vehicle and the vehicle;
[0035] The relatively safe boundary area of the vehicle is gridded, and the probability of the accompanying vehicle appearing in each grid is obtained based on the position of the accompanying vehicle during a collision in a natural driving scenario;
[0036] Based on the probability of the accompanying test vehicle appearing in each grid and the overlapping area between the accompanying test vehicle and the relative safety boundary areas of different vehicles, a scene real-time criticality theoretical model is constructed;
[0037] The scene real-time criticality theoretical model is used as the reward function.
[0038] Optionally, judging whether the test scenario meets set requirements according to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guiding process includes:
[0039] For any scene in the scene library, based on the relative position trajectories of the tested vehicle and the accompanying test vehicle during the guidance process corresponding to the scene and the test scene, obtain the similarity between the scene and the test scene;
[0040] Obtaining a scene similarity threshold according to the number of elements in the relative position trajectory of the tested vehicle and the accompanying test vehicle corresponding to the test scene;
[0041] When the similarity between the scene and the test scene is greater than the scene similarity threshold, determining that the test scene does not meet the set requirements;
[0042] When the similarity between the scene and the test scene is less than the scene similarity threshold, it is determined that the test scene meets the set requirements.
[0043] Optionally, after judging whether the test scenario meets the set requirements according to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guiding process, the method further includes:
[0044] When the test scenario does not meet the set requirements, clear the data in the transfer dictionary;
[0045] When the test scenario meets the set requirements, the accompanying test vehicle is trained using the PPO reinforcement learning algorithm according to the data in the transfer dictionary to optimize the parameters in the reward function.
[0046] According to a second aspect of an embodiment of the present disclosure, there is provided a device for generating a key scene of autonomous driving, comprising:
[0047] An area establishment module is used to establish a vehicle relative safety boundary area centered on the vehicle under test, wherein the vehicle relative safety boundary area includes: a vehicle collision risk area, a vehicle collision boundary area and a vehicle relative safety area, wherein the vehicle collision risk area is an area where a collision between the vehicle under test and the accompanying vehicle is inevitable, wherein the vehicle collision boundary area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking at maximum acceleration within the reaction time of the vehicle under test, and wherein the safety area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking within the reaction time of the vehicle under test;
[0048] A scene initialization module is used to initialize a test scene;
[0049] A test guiding module, used for guiding the tested vehicle and the accompanying test vehicle to generate confrontational behavior in the test scenario with the goal of maximizing the overall scenario criticality of the test scenario; wherein the overall scenario criticality of the test scenario is obtained based on the position of the accompanying test vehicle on the relatively safe boundary area of the vehicle during the guiding process;
[0050] The result output module is used to determine whether the test scenario meets the set requirements according to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guidance process.
[0051] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for generating key scenarios for autonomous driving provided by the first aspect of the present disclosure is implemented.
[0052] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method for generating key scenarios for autonomous driving provided in the first aspect of the present disclosure is implemented.
[0053] The technical solution provided by the embodiments of the present disclosure includes at least the following beneficial effects:
[0054] The present invention establishes a vehicle relative safety boundary model and generates a test vehicle confrontation scenario that is close to natural and real driving behavior. In view of the problem that most existing test scenario generation work uses minimizing the expected collision time as the optimization goal and is prone to generating a large number of extreme test scenarios, the present invention establishes a vehicle relative safety boundary model to make the vehicle confrontation scenario closer to natural and real driving behavior. The generated more realistic key scenarios will help autonomous driving system developers better understand the limitations of autonomous driving systems, and evaluate the performance and safety of autonomous driving technology in different scenarios, thereby optimizing their algorithms and models.
[0055] The present invention combines the probability distribution of natural driving behavior, and constructs a scenario criticality theoretical model under the guidance of real confrontation based on the relative safety boundary model, which enhances the rationality and authenticity of the confrontation behavior of the accompanying test vehicle. The present invention combines the probability distribution of natural driving behavior, and the generated key scenarios are close to the real road conditions, which improves the accuracy and credibility of the autonomous driving test, and can help the autonomous driving system better understand driving habits, thereby optimizing the system's driving strategy and decision-making ability, and improving the efficiency and safety of the system.
[0056] The present invention constructs a diversified adversarial scenario generation framework based on reinforcement learning, which ensures the diversity of key scenarios. The present invention generates key scenarios for autonomous driving based on the reinforcement learning algorithm, and at the same time, through scene similarity calculation and threshold training strategy, the generated key scenarios have better diversity. This method can improve the efficiency and comprehensiveness of autonomous driving tests, and more comprehensively evaluate the performance of autonomous driving systems in various scenarios, thereby proposing directions for system improvement and optimization.
[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0059] Figure 1 The present invention is a flowchart of a method for generating key scenes for autonomous driving based on a scene criticality theory model according to an exemplary embodiment.
[0060] Figure 2 The figure is a schematic diagram of a vehicle collision risk area model according to an exemplary embodiment.
[0061] Figure 3 The figure is a schematic diagram of a vehicle collision boundary area model according to an exemplary embodiment.
[0062] Figure 4 The figure is a schematic diagram of a vehicle safety zone model according to an exemplary embodiment.
[0063] Figure 5 The figure is a schematic diagram of a relative safety boundary area of a vehicle according to an exemplary embodiment.
[0064] Figure 6 The figure is a schematic diagram of a relative safety boundary area of a vehicle from the perspective of autonomous driving according to an exemplary embodiment.
[0065] Figure 7The present invention is a flowchart of a guide for generating a key scenario for autonomous driving according to an exemplary embodiment.
[0066] Figure 8 It is a schematic diagram of scene criticality modeling according to an exemplary embodiment.
[0067] Fig. 9 The figure is a schematic diagram showing the probability estimation of the accompanying test vehicle appearing in different areas in the safety boundary area according to an exemplary embodiment.
[0068] Fig.10 It is a schematic diagram of scene criticality theory modeling according to an exemplary embodiment.
[0069] Fig.11 It is a framework diagram of generating diversified adversarial scenarios based on reinforcement learning according to an exemplary embodiment.
[0070] Fig.12 It is a block diagram of a device for generating key scenes for autonomous driving based on a scene criticality theoretical model according to an exemplary embodiment.
[0071] Fig.13 is a block diagram of an electronic device 1300 according to an exemplary embodiment. DETAILED DESCRIPTION
[0072] Exemplary embodiments will be described in detail below with reference to the accompanying drawings.
[0073] like Figure 1 As shown, the method for generating key scenes of autonomous driving in the present invention may include the following steps (step 1 to step 4).
[0074] Step 1: Establish a relatively safe boundary area of the vehicle centered on the vehicle under test.
[0075] During vehicle driving, it is crucial to maintain a safe distance between vehicles. According to the relative position and real-time speed of the tested vehicle and the accompanying vehicle, based on the collision reaction time and vehicle dynamics model, a three-layer model of vehicle collision danger area, vehicle collision boundary area and vehicle relative safety boundary area is established. Among them, the vehicle collision danger area is the area where the collision between the tested vehicle and the accompanying vehicle is inevitable, the vehicle collision boundary area is the area where the tested vehicle can avoid collision with the accompanying vehicle by braking at maximum acceleration within the reaction time of the tested vehicle, and the safe area is the area where the tested vehicle can avoid collision with the accompanying vehicle by braking within the reaction time of the tested vehicle.
[0076] Step 1.1: Establish a vehicle collision risk area centered on the vehicle under test.
[0077] The process of establishing the vehicle collision danger zone centered on the tested vehicle is to first obtain the first distance d in the x-axis direction based on the speed of the tested vehicle in the x-axis direction, the maximum braking acceleration of the tested vehicle in the x-axis direction, and the speed of the accompanying test vehicle in the x-axis direction. x,dangerous Based on the speed of the vehicle under test in the y-axis direction, the maximum braking acceleration of the vehicle under test in the y-axis direction, and the speed of the accompanying vehicle in the y-axis direction, the first distance d in the y-axis direction is obtained. y,dangerous Finally, the vehicle collision risk area is obtained according to the first distance in the x-axis direction and the first distance in the y-axis direction.
[0078] Take the vehicle following scenario as an example. Figure 2 As shown, the first distance d in the x-axis direction x,dangerous It means that when the accompanying vehicle enters the collision risk zone of the tested vehicle relative to the accompanying vehicle, if the accompanying vehicle remains in its current driving state, a collision will inevitably occur regardless of any emergency action taken by the tested vehicle. With the tested vehicle as the coordinate origin, the front of it is the positive direction of the coordinate x-axis. The accompanying vehicle is traveling at the current speed. Even if the tested vehicle performs emergency braking at the maximum acceleration within 0 reaction time, if the distance between the vehicles is less than this distance, the accompanying vehicle will inevitably collide with the vehicle at a constant speed in its current state. At this time, the distance of the tested vehicle relative to the collision risk zone of the accompanying vehicle in the x-axis direction is:
[0079]
[0080] Among them, v ego,x and v npc,x are the speeds of the tested vehicle and the accompanying test vehicle, respectively, and a ego,x,max,brake is the maximum braking acceleration of the vehicle under test.
[0081] Step 1.2: Establish a vehicle collision boundary area centered on the vehicle under test.
[0082] The process of establishing the vehicle collision boundary area centered on the vehicle under test is to first obtain the second distance d in the x-axis direction based on the speed of the vehicle under test in the x-axis direction, the maximum braking acceleration of the vehicle under test in the x-axis direction, the maximum throttle acceleration of the vehicle under test in the x-axis direction, the speed of the accompanying vehicle in the x-axis direction, and the reaction time of the vehicle under test. x,margin Based on the speed of the vehicle under test in the y-axis direction, the maximum braking acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction and the reaction time of the vehicle under test, the second distance d in the y-axis direction is obtained. y,margin Finally, according to the first distance d in the x-axis direction x,dangerous, the second distance d in the x-axis direction x,margin , the first distance d in the y-axis direction y,dangerous and the second distance d in the y-axis direction y,margin , and obtain the vehicle collision boundary area.
[0083] Take the vehicle following scenario as an example. Figure 3 As shown, the second distance d in the x-axis direction x,margin The definition is: the accompanying vehicle is running at the current speed, the tested vehicle reacts after a certain reaction time, and then performs emergency braking at the maximum acceleration, and the boundary distance of the collision occurs. If the distance between the vehicles is less than this distance, the accompanying vehicle is running at a constant speed according to the current state, and the tested vehicle needs to make an emergency braking reaction within the reaction time, otherwise a collision will occur. At this time, the distance of the tested vehicle relative to the collision boundary area of the accompanying vehicle in the x-axis direction is:
[0084]
[0085] Among them, a ego,x,max,accel is the maximum throttle acceleration of the vehicle under test, and ρ is the reaction time of the vehicle under test.
[0086] Step 1.3: Establish a relative safety area for vehicles centered on the vehicle under test.
[0087] The process of establishing a vehicle relative safety zone centered on the vehicle under test is to first obtain the third distance d in the x-axis direction based on the speed of the vehicle under test in the x-axis direction, the minimum braking acceleration of the vehicle under test in the x-axis direction, the maximum throttle acceleration of the vehicle under test in the x-axis direction, the speed of the accompanying vehicle in the x-axis direction, and the reaction time of the vehicle under test. x,safe ; Based on the speed of the vehicle under test in the y-axis direction, the minimum braking acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction and the reaction time of the vehicle under test, the third distance d in the y-axis direction is obtained. y,safe Finally, according to the second distance d in the x-axis direction x,margin , the third distance d in the x-axis direction x,safe , the second distance d in the y-axis direction y,margin and the third distance d in the y-axis direction y,safe , and obtain the relatively safe area of the vehicle.
[0088] Take the vehicle following scenario as an example. Figure 4 As shown, the third distance d in the x-axis direction x,safeThe definition of is: the accompanying vehicle runs at the current speed, the vehicle under test reacts after ρ time, and then brakes with the minimum acceleration, and the vehicles maintain a relatively safe distance. If the distance is greater than this distance, the accompanying vehicle runs at a constant speed according to the current state. As long as the vehicle under test brakes after ρ time, there will be no collision. At this time, the distance of the vehicle under test relative to the relative safety area of the accompanying vehicle in the x-axis direction is:
[0089]
[0090] Among them, a ego,x,min,brake It is the minimum braking acceleration of the vehicle under test (the vehicle relies on road friction to decelerate).
[0091] Step 1.4: Based on the vehicle collision risk area, the vehicle collision boundary area and the vehicle relative safety area, a three-layer model of the vehicle relative safety boundary area is obtained.
[0092] The three-layer model of the vehicle's relative safety boundary area is as follows Figure 5 As shown in Figure 2, the visualization model of the vehicle safety boundary in the virtual environment is as follows: Figure 6 shown.
[0093] Step 2: Initialize a test scene.
[0094] Initializing the test scenario includes: connecting the vehicle under test, setting the starting and ending points of the vehicle under test, road selection, setting the running time of the scenario, initializing the initial position of the vehicle under test, setting the k value of the scenario similarity threshold, etc.
[0095] Step 3: With the goal of maximizing the overall criticality of the test scenario, guide the vehicle under test and the accompanying vehicle to produce confrontational behavior in the test scenario; wherein the overall criticality of the test scenario is obtained based on the position of the accompanying vehicle on the relatively safe boundary area of the vehicle during the guidance process.
[0096] The overall criticality of the entire scene can be obtained based on the overlapping area between the accompanying test vehicle and the safety boundary area. The higher the criticality, the more effective the adversarial behavior of the accompanying test vehicle is, and the greater the challenge to the safety performance of the tested vehicle. The adversarial scene generation method based on reinforcement learning aims to maximize the criticality of the scene and induce the adversarial vehicle to produce more reasonable and effective adversarial behavior.
[0097] In the process of interacting with the environment and repeated trial and error, the effectiveness of the test vehicle's adversarial strategy can be trained, thereby generating high-quality key scenes for autonomous driving. At the same time, in order to avoid generating overly similar key scenes, the diversity of generated scenes is increased, and scene similarity and threshold training strategies are also added to the scene generation technology. The overall scene generation framework is as follows: Figure 7 shown.
[0098] Step 3.1: Construct the state space, action space and reward function of the test vehicle.
[0099] Constructing the state space, action space, and reward function of the accompanying test vehicle is an environmental modeling behavior. Specifically, the diversified adversarial scenario generation technology based on reinforcement learning establishes the process of the accompanying test vehicle against the tested vehicle as a Markov decision process: the relative position and speed relationship between the accompanying test vehicle and the tested vehicle and the distance of the three-layer safety boundary are used as the state in the decision-making process, the actions that the accompanying test vehicle can choose are used as the decision-making behavior in the process, and the real-time criticality of the scene is used as the reward. Every time the accompanying test vehicle takes an action, the state will change according to the action given by the vehicle. At the same time, the accompanying test vehicle will also obtain a reward according to the reward function, and repeat this process until a collision occurs or the scene reaches a preset running time. The three elements of the established Markov decision process: state, action, and reward are as follows:
[0100] State space: x-axis distance difference, y-axis distance difference, speed difference, collision danger distance, collision boundary distance, and relative safety distance between the accompanying vehicle and the vehicle under test.
[0101] Action space: turn left, turn right, brake at maximum acceleration, maintain constant speed, accelerate at maximum acceleration.
[0102] Reward function: scene real-time criticality J ego (x,t).
[0103] In one embodiment, the reward function is constructed based on the scene criticality model. Figure 8 As shown, the scenario criticality model is obtained based on the natural probability of the accompanying test vehicle appearing in different areas, the overlapping area with different areas and the residence time in different areas. The generation process includes the following steps.
[0104] Step 3.1.1: After converting the coordinate reference system of the accompanying test vehicle from the world coordinate system to the coordinate system of the vehicle under test, model the accompanying test vehicle as a rectangle based on the vehicle position and the length and width of the vehicle to calculate the overlapping area of different areas in the relative safety boundary area between the accompanying test vehicle and the vehicle.
[0105] Since the relative safety boundary area uses the tested vehicle as the coordinate reference system, and the tested vehicle uses the world coordinate system as the coordinate reference system, it is necessary to convert the coordinate reference systems before calculating the overlapping area between the two, and convert the accompanying test vehicle from the world coordinate system to the tested vehicle coordinate system. The conversion formula of the coordinates of the accompanying test vehicle from the world coordinate system to the tested vehicle coordinate system is:
[0106] (x',y',z',1)=(x,y,z,1)·T(-x 0 ,-y0 ,-z 0 )·R
[0107] Among them, (x, y, z) are the coordinates of the test vehicle in the world coordinate system, (x 0 ,y 0 ,z 0 ) is the coordinate of the origin of the vehicle coordinate system relative to the world coordinate system, T is the coordinate translation transformation matrix, and R is the coordinate rotation transformation matrix, which are:
[0108]
[0109] Among them, u' x =(u' x1 ,u' x2 ,u' x3 ),u' y =(u' y1 ,u' y2 ,u' y3 ),u' z =(u' z1 ,u' z2 ,u' z3 ) is the unit coordinate vector of the x, y, and z axes of the measured vehicle coordinate system relative to the world coordinate system.
[0110] After the coordinate system of the accompanying test vehicle is transformed, since the tested vehicle and the accompanying test vehicle can be regarded as being in the same plane, the tested vehicle and the accompanying test vehicle are modeled as rectangles according to the vehicle positions and the length and width of the vehicles to calculate the overlapping area.
[0111] Step 3.1.2: Grid the relatively safe boundary area of the vehicle, and obtain the probability of the accompanying test vehicle appearing in each grid according to the position of the accompanying test vehicle during the collision in the natural driving scene.
[0112] In order to achieve a more realistic anti-attack behavior of the accompanying test vehicle, data was extracted and analyzed from the natural driving scene data. After a collision occurs in a natural driving scene, the safe area where the accompanying test vehicle is located during the collision and its relative position in the area are calculated. Taking the collision type of the tested vehicle rear-ending the accompanying test vehicle as an example, the relative position can be expressed as:
[0113]
[0114] where x dangerous is the relative position of the test vehicle in the collision risk area, x margin is the position of the accompanying vehicle in the collision boundary area, x safe is the relative position of the accompanying vehicle in the relatively safe area, d x,ego ,d x,npcare the coordinates of the tested vehicle and the accompanying test vehicle in the x-axis direction, d x,max is the maximum influence distance set.
[0115] After collecting enough collision data, each of the three-layer safety areas is evenly divided into several small intervals and the number of positions in each small interval is counted to estimate the probability of the accompanying test vehicle appearing in different vehicle safety boundary areas.
[0116] The characteristics of probability distribution are as follows Fig. 9 As shown in the figure, the probability of a vehicle appearing in the collision boundary area is high, and the probability of appearing in the collision risk area and the relatively safe area is low, and the overall distribution is normal. Based on this probability distribution characteristic, the probability coefficients in different areas are estimated and the theoretical modeling of the scene criticality is carried out.
[0117] Step 3.1.3: Based on the probability of the accompanying test vehicle appearing in each grid and the overlapping area between the accompanying test vehicle and the relative safety boundary areas of different vehicles, a theoretical model of the scene real-time criticality is constructed.
[0118] After completing the calculation of the overlapping area between the accompanying test vehicle and the safety boundary area and estimating the probability of the accompanying test vehicle appearing in different safety boundary areas, the theoretical modeling of the scene criticality is as follows: Fig. 9 As shown. The theoretical model of scene real-time criticality is:
[0119] J ego (x,t)=P(A,t)(p dangerous ·s dangerous,t +p margin ·s margin,t +p safe ·s safe,t )
[0120] Among them, x is the behavior state parameter of the accompanying vehicle, P(A,t) is the coefficient used to characterize whether the key event A occurs at time t, and p dangerous ,p margin ,p safe is the probability estimate of the accompanying test vehicle appearing in different safety boundary areas obtained by statistical analysis of natural scenes, s dangerous,t ,s margin,t ,s safe,t Represents the overlapping area between the test vehicle and different safety boundary areas at time t.
[0121] Step 3.2: With the goal of maximizing the overall criticality of the test scenario, select an action a at the tth moment for the accompanying test vehicle in the action space. t , so that the state space of the accompanying test vehicle changes from state s t Change to state s t+1At the same time, get the reward value r at time t t .
[0122] The guiding process of this embodiment aims to maximize the overall criticality of the test scenario. During the entire scenario, the overlapping area between the accompanying test vehicle and the safety boundary area is a continuously changing curve, such as Fig.10 To more accurately measure the criticality of the entire scene, the overall criticality of the entire scene is defined as:
[0123] f ego (x)=h(A)∫(p dangerous ·s dangerous,t +p margin ·s margin,t +p safe ·s safe,t )dt
[0124] Where h(A) is the coefficient used to characterize whether the key event A of the entire scenario process occurs.
[0125] Step 3.3: Change the action a t , the state s t , the state s t+1 And the reward value r t Save in the transfer dictionary.
[0126] The scene data at time t is added to the transfer dictionary to record the data of the accompanying test vehicle in the scene. As shown in Table 1, the scene data at time t includes the current state of the read scene, the action of the accompanying test vehicle, the state of the scene at the next moment, the reward obtained, etc. The scene data is saved in the transfer dictionary.
[0127] Table 1 Transfer dictionary
[0128]
[0129] Step 3.4: In the state s t+1 If the state does not correspond to the collision between the tested vehicle and the accompanying test vehicle, and t+1 is less than the set running time, set t=t+1, and return to the action a of selecting a t-th time for the accompanying test vehicle in the action space. t In the state s t+1 Corresponding to the state where the tested vehicle collides with the accompanying test vehicle, or when t+1 is equal to the set running time, the relative position trajectory of the tested vehicle and the accompanying test vehicle is output; wherein the relative position trajectory of the tested vehicle and the accompanying test vehicle is based on all states s of the accompanying test vehicle t get.
[0130] The termination conditions of the guiding process include: a collision between the tested vehicle and the accompanying test vehicle, and whether the running time reaches the set predetermined time.
[0131] If the vehicle under test does not collide with the accompanying vehicle and the running time does not reach the preset time, return to step 3.2 to select action a at time t+1. t+1 If the tested vehicle collides with the accompanying test vehicle, or the running time reaches the preset predetermined time, the guidance process is considered to be completed and the current round of testing ends.
[0132] Step 4: According to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guidance process, determine whether the test scenario meets the set requirements.
[0133] The present invention determines whether the test scenario meets the set requirements by comparing the similarity between the test scenario and any scenario in the scenario library. Fig.11 As shown, the following steps are included.
[0134] Step 4.1: For any scene in the scene library, based on the relative position trajectories of the tested vehicle and the accompanying test vehicle during the guidance process corresponding to the scene and the test scene, obtain the similarity between the scene and the test scene.
[0135] Once a collision occurs in a scene or the maximum running time is reached, the positional relationship between the tested vehicle and the accompanying vehicle in the scene will be recorded and used in the calculation of scene similarity. Specifically, the relative positional relationship between the accompanying vehicle and the tested vehicle at time t in the i-th scene is defined as:
[0136]
[0137] in They respectively represent the x-axis coordinates and y-axis coordinates of the accompanying test vehicle and the tested vehicle in the i-th scene and at the t-th time.
[0138] Assume that the time of collision is t 1 , the data collection time is t k -t 1 , then in the i-th scenario, the relative position trajectory of the accompanying vehicle and the tested vehicle can be expressed as:
[0139]
[0140] Therefore, the similarity between scene i and scene j is defined as:
[0141]
[0142] Step 4.2: Obtain a scene similarity threshold according to the number of elements in the relative position trajectory of the tested vehicle and the accompanying test vehicle corresponding to the test scene.
[0143] Considering that the running time of the accompanying test vehicles in different scenarios is not completely consistent, and the number of trajectories recorded in the relative position trajectory is also not completely consistent, the threshold of scene similarity is defined as:
[0144]
[0145] Among them, |τ| represents the number of elements in the relative position trajectory of the accompanying test vehicle and the tested vehicle in a scenario, and k is an adjustable parameter. A too low k value will lead to the generation of repeated scenarios, while a too high k value will overemphasize the differentiation of scenarios and will result in an inability to generate a sufficient number of key scenarios. The selection of the k value needs to be fine-tuned according to the actual situation.
[0146] Step 4.3: When the similarity between the scene and the test scene is greater than the scene similarity threshold, it is determined that the test scene does not meet the set requirements; when the similarity between the scene and the test scene is less than the scene similarity threshold, it is determined that the test scene meets the set requirements.
[0147] After a key scene is generated, the scene will be similar to all scenes in the scene library and the maximum similarity index will be recorded. If the maximum similarity of the scene exceeds the preset threshold, it means that the newly generated scene is repeated and the scene will not be retained in the scene library and will not be used for the training of the accompanying test vehicle. If the maximum similarity of the scene does not exceed the threshold, the scene will be put into the scene library.
[0148] In one embodiment, the present invention further includes step 4.4: clearing the data in the transfer dictionary, or training the accompanying test vehicle using the PPO reinforcement learning algorithm based on the data in the transfer dictionary to optimize the parameters in the reward function.
[0149] When the test scenario does not meet the set requirements, the data in the transfer dictionary is cleared; when the test scenario meets the set requirements, the accompanying test vehicle is trained using the PPO reinforcement learning algorithm according to the data in the transfer dictionary to optimize the parameters in the reward function.
[0150] In summary, the present invention establishes a vehicle relative safety boundary model and generates a test vehicle confrontation scenario that is close to natural and real driving behavior. In view of the problem that most of the existing test scenario generation work takes minimizing the expected collision time as the optimization goal and easily generates a large number of extreme test scenarios, the present invention establishes a vehicle relative safety boundary model to make the vehicle confrontation scenario closer to natural and real driving behavior. During the test process, it should be avoided to set overly deliberate and extreme test vehicle behaviors, such as breaking the physical braking limit of the vehicle. Although these behaviors can theoretically test certain performance of autonomous driving vehicles, they are almost impossible to occur in actual road environments, so the reference value of the test results is limited. The more realistic key scenarios generated will help autonomous driving system developers better understand the limitations of autonomous driving systems, and evaluate the performance and safety of autonomous driving technology in different scenarios, thereby optimizing their algorithms and models.
[0151] The present invention combines the probability distribution of natural driving behavior, and constructs a scenario criticality theoretical model under the guidance of real confrontation based on the relative safety boundary model, which enhances the rationality and authenticity of the confrontation behavior of the accompanying test vehicle. The present invention combines the probability distribution of natural driving behavior, and the generated key scenarios are close to the real road conditions, which improves the accuracy and credibility of the autonomous driving test, and can help the autonomous driving system better understand driving habits, thereby optimizing the system's driving strategy and decision-making ability, and improving the efficiency and safety of the system.
[0152] The present invention constructs a diversified adversarial scenario generation framework based on reinforcement learning, which ensures the diversity of key scenario generation. The present invention generates key scenarios for autonomous driving based on the reinforcement learning algorithm, and at the same time, through scene similarity calculation and threshold training strategy, the generated key scenarios have better diversity and improve the coverage of test scenarios. This framework can not only improve the efficiency and comprehensiveness of autonomous driving tests, more comprehensively evaluate the performance of autonomous driving systems in various scenarios, thereby proposing directions for system improvement and optimization, but also cover various scenarios and situations that autonomous driving vehicles may encounter in actual applications, including some potential risk scenarios and abnormal situations. This can be achieved by comprehensively analyzing the driving tasks of autonomous driving vehicles, identifying possible risk scenarios and abnormal situations, and covering and verifying them in tests.
[0153] Exemplary Devices
[0154] Fig.12 is a device for generating a key scene of an autonomous driving according to an exemplary embodiment, referring to Fig.12 The device includes: an area establishment module 1210, a scene initialization module 1220, a test guidance module 1230 and a result output module 1240.
[0155] The area establishment module 1210 is used to establish a vehicle relative safety boundary area centered on the vehicle under test, wherein the vehicle relative safety boundary area includes: a vehicle collision risk area, a vehicle collision boundary area and a vehicle relative safety area. The vehicle collision risk area is an area where a collision between the vehicle under test and the accompanying vehicle is inevitable. The vehicle collision boundary area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking at maximum acceleration within the reaction time of the vehicle under test. The safety area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking within the reaction time of the vehicle under test.
[0156] A scene initialization module 1220 is used to initialize a test scene;
[0157] A test guiding module 1230 is used to guide the vehicle under test and the accompanying vehicle to generate confrontational behavior in the test scenario with the goal of maximizing the overall scenario criticality of the test scenario; wherein the overall scenario criticality of the test scenario is obtained based on the position of the accompanying vehicle on the relatively safe boundary area of the vehicle during the guiding process;
[0158] The result output module 1240 is used to determine whether the test scenario meets the set requirements according to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guiding process.
[0159] Optionally, the area establishment module 1210 is also used to: obtain a first distance in the x-axis direction based on the speed of the vehicle under test in the x-axis direction, the maximum braking acceleration of the vehicle under test in the x-axis direction, and the speed of the accompanying vehicle in the x-axis direction; obtain a first distance in the y-axis direction based on the speed of the vehicle under test in the y-axis direction, the maximum braking acceleration of the vehicle under test in the y-axis direction, and the speed of the accompanying vehicle in the y-axis direction; and obtain a vehicle collision risk area based on the first distance in the x-axis direction and the first distance in the y-axis direction.
[0160] Optionally, the area establishment module 1210 is also used to: obtain a second distance in the x-axis direction based on the speed of the vehicle under test in the x-axis direction, the maximum braking acceleration of the vehicle under test in the x-axis direction, the maximum throttle acceleration of the vehicle under test in the x-axis direction, the speed of the accompanying vehicle in the x-axis direction, and the reaction time of the vehicle under test; obtain a second distance in the y-axis direction based on the speed of the vehicle under test in the y-axis direction, the maximum braking acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction, and the reaction time of the vehicle under test; and obtain a vehicle collision boundary area based on the first distance in the x-axis direction, the second distance in the x-axis direction, the first distance in the y-axis direction, and the second distance in the y-axis direction.
[0161] Optionally, the area establishment module 1210 is also used to: obtain a third distance in the x-axis direction based on the speed of the vehicle under test in the x-axis direction, the minimum braking acceleration of the vehicle under test in the x-axis direction, the maximum throttle acceleration of the vehicle under test in the x-axis direction, the speed of the accompanying vehicle in the x-axis direction, and the reaction time of the vehicle under test; obtain a third distance in the y-axis direction based on the speed of the vehicle under test in the y-axis direction, the minimum braking acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction, and the reaction time of the vehicle under test; obtain a relatively safe area for the vehicle based on the second distance in the x-axis direction, the third distance in the x-axis direction, the second distance in the y-axis direction, and the third distance in the y-axis direction.
[0162] Optionally, the test guiding module 1230 is further used to: construct a state space, an action space and a reward function of the accompanying test vehicle; and select an action a at the tth moment for the accompanying test vehicle in the action space with the goal of maximizing the overall criticality of the test scenario. t , so that the state space of the accompanying test vehicle changes from state s t Change to state s t+1 At the same time, get the reward value r at time t t ; The action a t , the state s t , the state s t+1 And the reward value r t Saved in the transfer dictionary; in the state s t+1 If the state does not correspond to the collision between the tested vehicle and the accompanying test vehicle, and t+1 is less than the set running time, set t=t+1, and return to the state with the goal of maximizing the overall criticality of the test scene, and select an action a at the tth time for the accompanying test vehicle in the action space. t In the state s t+1 Corresponding to the state where the tested vehicle collides with the accompanying test vehicle, or when t+1 is equal to the set running time, the relative position trajectory of the tested vehicle and the accompanying test vehicle is output; wherein the relative position trajectory of the tested vehicle and the accompanying test vehicle is based on all states s of the accompanying test vehicle t get.
[0163] Optionally, the test guidance module 1230 is also used to: after converting the coordinate reference system of the accompanying test vehicle from the world coordinate system to the coordinate system of the vehicle under test, model the accompanying test vehicle as a rectangle according to the vehicle position and the length and width of the vehicle, so as to calculate the overlapping area between the accompanying test vehicle and different areas in the relative safety boundary area of the vehicle; grid the relative safety boundary area of the vehicle, and obtain the probability of the accompanying test vehicle appearing in each grid according to the position of the accompanying test vehicle during a collision in a natural driving scene; construct a scene real-time criticality theoretical model based on the probability of the accompanying test vehicle appearing in each grid and the overlapping area between the accompanying test vehicle and the relative safety boundary areas of different vehicles; and use the scene real-time criticality theoretical model as a reward function.
[0164] Optionally, the result output module 1240 is also used to: for any scene in the scene library, obtain the similarity between the scene and the test scene based on the relative position trajectory of the vehicle under test and the accompanying vehicle during the guidance process corresponding to the scene and the test scene; obtain the scene similarity threshold according to the number of elements in the relative position trajectory of the vehicle under test and the accompanying vehicle corresponding to the test scene; when the similarity between the scene and the test scene is greater than the scene similarity threshold, determine that the test scene does not meet the set requirements; when the similarity between the scene and the test scene is less than the scene similarity threshold, determine that the test scene meets the set requirements.
[0165] Optionally, the result output module 1240 is further used to: when the test scenario does not meet the set requirements, clear the data in the transfer dictionary; when the test scenario meets the set requirements, train the accompanying test vehicle using the PPO reinforcement learning algorithm according to the data in the transfer dictionary to optimize the parameters in the reward function
[0166] The exemplary device is an embodiment of the device corresponding to the above exemplary method. The specific operations of each module can be understood by referring to the description of the method embodiment, which will not be repeated here.
[0167] Exemplary Electronic Devices
[0168] Fig.13 1 is a block diagram of an electronic device 1300 according to an exemplary embodiment. The electronic device 1300 may be a terminal, a notebook computer, a desktop computer, a server, a computer cluster or other types of electronic devices.
[0169] Reference Fig.13, the electronic device 1300 may include at least one processor 1310 and a memory 1320. The processor 1310 may execute instructions stored in the memory 1320. The processor 1310 is communicatively connected to the memory 1320 via a data bus. In addition to the memory 1320, the processor 1310 may also be communicatively connected to an input device 1330, an output device 1340, and a communication device 1350 via a data bus.
[0170] The processor 1310 may be any conventional processor, such as a central processing unit (CPU), a graphic processing unit (GPU), a field programmable gate array (FPGA), a system on chip (SOC), an application specific integrated circuit (ASIC), or a combination thereof.
[0171] Memory 1320 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0172] In the embodiment of the present disclosure, executable instructions are stored in the memory 1320, and the processor 1310 can read the executable instructions from the memory 1320 and execute the instructions to implement all or part of the steps of the method for generating key scenarios for autonomous driving in the above exemplary embodiment.
[0173] Exemplary computer-readable storage media
[0174] In addition to the above methods and devices, the exemplary embodiments of the present disclosure also include a computer program product or a computer-readable storage medium storing the computer program product. The computer product includes computer program instructions that can be executed by a processor to implement all or part of the steps described in the above exemplary embodiments.
[0175] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and also conventional procedural programming languages, such as "C" language or similar programming languages and scripting languages (e.g., Python). The program code may be executed entirely on the user computing device, partially on the user computing device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0176] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of readable storage media include: static random access memory (SRAM) with one or more wires electrically connected, electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk, or any suitable combination of the above.
[0177] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the present disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof.
Claims
1. A method for generating key scenes for autonomous driving, characterized in that: The method comprises: Establish a vehicle relative safety boundary area centered on the vehicle under test, the vehicle relative safety boundary area includes: a vehicle collision risk area, a vehicle collision boundary area and a vehicle relative safety area, the vehicle collision risk area is an area where a collision between the vehicle under test and the accompanying vehicle is inevitable, the vehicle collision boundary area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking at maximum acceleration within the reaction time of the vehicle under test, and the safety area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking within the reaction time of the vehicle under test; Initialize a test scene; The test vehicle and the accompanying test vehicle are guided to generate confrontational behavior in the test scenario with the goal of maximizing the overall scene criticality of the test scenario; wherein the overall scene criticality of the test scenario is obtained based on the position of the accompanying test vehicle on the relatively safe boundary area of the vehicle during the guiding process; According to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guiding process, it is judged whether the test scenario meets the set requirements.
2. The method according to claim 1, characterized in that The step of establishing a vehicle collision risk area centered on the vehicle under test includes: Obtaining a first distance in the x-axis direction based on the speed of the vehicle under test in the x-axis direction, the maximum braking acceleration of the vehicle under test in the x-axis direction, and the speed of the accompanying vehicle in the x-axis direction; Obtaining a first distance in the y-axis direction based on the speed of the vehicle under test in the y-axis direction, the maximum braking acceleration of the vehicle under test in the y-axis direction, and the speed of the accompanying vehicle in the y-axis direction; A vehicle collision risk area is obtained according to the first distance in the x-axis direction and the first distance in the y-axis direction.
3. The method according to claim 2, characterized in that The step of establishing a vehicle collision boundary region centered on the vehicle under test includes: Based on the speed of the tested vehicle in the x-axis direction, the maximum brake acceleration of the tested vehicle in the x-axis direction, the maximum throttle acceleration of the tested vehicle in the x-axis direction, the speed of the accompanying test vehicle in the x-axis direction, and the reaction time of the tested vehicle, a second distance in the x-axis direction is obtained; Based on the speed of the vehicle under test in the y-axis direction, the maximum brake acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction, and the reaction time of the vehicle under test, a second distance in the y-axis direction is obtained; A vehicle collision boundary area is obtained according to the first distance in the x-axis direction, the second distance in the x-axis direction, the first distance in the y-axis direction, and the second distance in the y-axis direction.
4. The method according to claim 3, characterized in that The establishing of a vehicle relative safety area centered on the tested vehicle includes: A third distance in the x-axis direction is obtained based on the speed of the vehicle under test in the x-axis direction, the minimum brake acceleration of the vehicle under test in the x-axis direction, the maximum throttle acceleration of the vehicle under test in the x-axis direction, the speed of the accompanying vehicle in the x-axis direction, and the reaction time of the vehicle under test; A third distance in the y-axis direction is obtained based on the speed of the vehicle under test in the y-axis direction, the minimum brake acceleration of the vehicle under test in the y-axis direction, the maximum throttle acceleration of the vehicle under test in the y-axis direction, the speed of the accompanying vehicle in the y-axis direction, and the reaction time of the vehicle under test; A relatively safe area of the vehicle is obtained according to the second distance in the x-axis direction, the third distance in the x-axis direction, the second distance in the y-axis direction, and the third distance in the y-axis direction.
5. The method according to claim 1, characterized in that The step of guiding the vehicle under test and the accompanying vehicle to generate confrontational behaviors in the test scenario with the goal of maximizing the overall criticality of the test scenario includes: Construct the state space, action space and reward function of the test vehicle; With the goal of maximizing the overall criticality of the test scenario, an action a at the tth moment is selected for the accompanying test vehicle in the action space. t , so that the state space of the accompanying test vehicle changes from state s t Change to state s t+1 At the same time, get the reward value r at time t t ; The action a t , the state s t , the state s t+1 And the reward value r t Save in transfer dictionary; In the state t+1 If the state does not correspond to the collision between the tested vehicle and the accompanying test vehicle, and t+1 is less than the set running time, set t=t+1, and return to the state with the goal of maximizing the overall criticality of the test scene, and select an action a at the tth time for the accompanying test vehicle in the action space. t ; In the state t+1 Corresponding to the state where the tested vehicle collides with the accompanying test vehicle, or when t+1 is equal to the set running time, the relative position trajectory of the tested vehicle and the accompanying test vehicle is output; wherein the relative position trajectory of the tested vehicle and the accompanying test vehicle is based on all states s of the accompanying test vehicle t get.
6. The method according to claim 5, characterized in that The constructing of the reward function comprises: After converting the coordinate reference system of the accompanying test vehicle from the world coordinate system to the coordinate system of the vehicle under test, the accompanying test vehicle is modeled as a rectangle according to the vehicle position and the length and width of the vehicle, so as to calculate the overlapping areas of different areas in the relative safety boundary area of the accompanying test vehicle and the vehicle; The relatively safe boundary area of the vehicle is gridded, and the probability of the accompanying vehicle appearing in each grid is obtained based on the position of the accompanying vehicle during a collision in a natural driving scenario; Based on the probability of the accompanying test vehicle appearing in each grid and the overlapping area between the accompanying test vehicle and the relative safety boundary areas of different vehicles, a scene real-time criticality theoretical model is constructed; The scene real-time criticality theoretical model is used as the reward function.
7. The method according to claim 5, characterized in that The step of judging whether the test scenario meets the set requirements according to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guiding process includes: For any scene in the scene library, based on the relative position trajectories of the tested vehicle and the accompanying test vehicle during the guidance process corresponding to the scene and the test scene, obtain the similarity between the scene and the test scene; Obtaining a scene similarity threshold according to the number of elements in the relative position trajectory of the tested vehicle and the accompanying test vehicle corresponding to the test scene; When the similarity between the scene and the test scene is greater than the scene similarity threshold, determining that the test scene does not meet the set requirements; When the similarity between the scene and the test scene is less than the scene similarity threshold, it is determined that the test scene meets the set requirements.
8. The method according to claim 5, characterized in that After judging whether the test scenario meets the set requirements according to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guiding process, the method further includes: When the test scenario does not meet the set requirements, clear the data in the transfer dictionary; When the test scenario meets the set requirements, the accompanying test vehicle is trained using the PPO reinforcement learning algorithm according to the data in the transfer dictionary to optimize the parameters in the reward function.
9. A device for generating key scenes of autonomous driving, characterized in that: The device comprises: An area establishment module is used to establish a vehicle relative safety boundary area centered on the vehicle under test, wherein the vehicle relative safety boundary area includes: a vehicle collision risk area, a vehicle collision boundary area and a vehicle relative safety area, wherein the vehicle collision risk area is an area where a collision between the vehicle under test and the accompanying vehicle is inevitable, wherein the vehicle collision boundary area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking at maximum acceleration within the reaction time of the vehicle under test, and wherein the safety area is an area where the vehicle under test can avoid a collision with the accompanying vehicle by braking within the reaction time of the vehicle under test; A scene initialization module is used to initialize a test scene; A test guiding module, used for guiding the tested vehicle and the accompanying test vehicle to generate confrontational behavior in the test scenario with the goal of maximizing the overall scenario criticality of the test scenario; wherein the overall scenario criticality of the test scenario is obtained based on the position of the accompanying test vehicle on the relatively safe boundary area of the vehicle during the guiding process; The result output module is used to determine whether the test scenario meets the set requirements according to the relative position trajectory of the tested vehicle and the accompanying test vehicle during the guidance process.
10. An electronic device, characterized in that: The electronic device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the method for generating a key scene of autonomous driving as described in any one of claims 1-8.
