A natural autonomous driving scene generation method and device based on reinforcement learning
Through the natural autonomous driving scene generation method based on reinforcement learning, using the multi-agent model and the CARLA simulation platform, the problem that the test scenarios in the existing technology cannot fully simulate the unpredictability and diversity of human drivers has been solved, and the problem of the unpredictability and diversity of human drivers has been solved. Accurate simulation of real driving scenarios and safety verification of autonomous driving systems.
Patent Information
- Application Number
- CN202410650181.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-24
AI Technical Summary
Existing autonomous driving test scenario simulation methods are too idealistic or simplified and fail to fully simulate the unpredictability and diversity of human drivers, causing the autonomous driving system to encounter untested situations in real road environments, causing safety issues. .
A natural automatic driving scene generation method based on reinforcement learning is used to generate multiple multi-agent models. Each model includes multiple virtual vehicles with a driving style. The virtual vehicles adjust their driving strategies according to their own driving styles and external information. Use the CARLA simulation platform to generate natural autonomous driving scenarios to verify the safety of the autonomous driving system.
It realizes the simulation of real human driver driving situations with a variety of different driving styles, accurately restores real driving scenes, provides reliable support for the human-like behavior test of the automatic driving system, and improves the performance of the automatic driving system in complex traffic environments. safety and reliability.
Smart Images

Figure CN118228612B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of autonomous driving, and specifically relates to a method and device for generating a natural autonomous driving scene based on reinforcement learning. Background Art
[0002] In the current field of autonomous driving, safety is generally considered to be the primary prerequisite for the implementation of technology. To achieve this goal, it is crucial to create accurate and comprehensive test scenarios. At present, the testing of autonomous driving systems mainly focuses on two aspects: physical testing and simulation testing. Physical tests are usually conducted in closed venues or public roads, but due to cost, safety and efficiency constraints, they cannot cover all potential driving situations. Therefore, simulation testing has become an important supplement that can reproduce various complex and high-risk driving scenarios in a virtual environment. However, in existing autonomous driving test schemes, how to effectively simulate human-like driving styles in the real world is a significant challenge. Traditional test scenarios are often too idealized or simplified, and fail to fully simulate the unpredictability and diversity of human drivers. This situation may cause the autonomous driving system to encounter untested situations in the real road environment, thereby causing safety issues. Summary of the invention
[0003] In order to solve the above-mentioned problems existing in the prior art, the present invention provides a method and device for generating a natural autonomous driving scene based on reinforcement learning.
[0004] The technical problem to be solved by the present invention is achieved through the following technical solutions:
[0005] In a first aspect, the present invention provides a method for generating a natural autonomous driving scene based on reinforcement learning, comprising:
[0006] Generate multiple multi-agent models; each multi-agent model includes multiple virtual vehicles with a driving style; the driving style of each virtual vehicle is specified by a set of natural quantitative indicators; wherein each virtual vehicle adjusts its driving strategy by using reinforcement learning during driving according to its own driving style and external information; the external information includes surrounding traffic equipment information and surrounding virtual vehicle information;
[0007] Generate naturalistic autonomous driving scenarios using at least one multi-agent model.
[0008] Optionally, generating a naturalistic autonomous driving scenario using at least one multi-agent model includes:
[0009] At least one multi-agent model is applied to the CARLA simulation platform so that the CARLA simulation platform generates a naturalistic autonomous driving scenario based on the at least one multi-agent model, and the safety of the autonomous driving system is verified through the naturalistic autonomous driving scenario.
[0010] Optionally, each virtual vehicle can adjust its driving strategy based on its own driving style and external information by using reinforcement learning during driving, including:
[0011] During the driving process, each virtual vehicle uses the self-attention mechanism to aggregate information based on its own driving style and external information to obtain aggregated information:
[0012] For virtual vehicles , calculate the virtual vehicle In time of , , :
[0013] ;
[0014] ;
[0015] ;
[0016] in, Represents a virtual vehicle In time of ; Represents the driving style and current dynamic state of the virtual vehicle; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time The status of Represents a virtual vehicle In time of ; Represents a virtual vehicle The surrounding traffic equipment information and the information of other virtual vehicles; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time of ; Detailed information required to represent specific actions of the other virtual vehicles or detailed description of surrounding traffic equipment information; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of
[0017] use and Calculate the attention weights:
[0018] ;
[0019] in, Represents a virtual vehicle In time For virtual vehicles The attention weight of Represents a virtual vehicle In time of ; Represents a continuous time series The cumulative variable of Indicates the offset of the time step;
[0020] according to and The aggregate information is calculated:
[0021] ;
[0022] in, Represents a virtual vehicle In time Aggregate information; Represents a virtual vehicle In time of ; Indicates the total number of virtual vehicles;
[0023] Based on the aggregated information, the driving strategy is adjusted using reinforcement learning.
[0024] Optionally, based on the aggregated information, adjusting the driving strategy by using reinforcement learning includes:
[0025] During the driving process, each virtual vehicle estimates the cumulative rewards corresponding to the adoption of different driving strategies by itself using reinforcement learning based on the aggregated information; wherein any driving strategy is a speed adjustment strategy, a lane keeping and changing strategy, a traffic rule compliance strategy, an emergency obstacle avoidance strategy, or a navigation and path planning strategy; each driving strategy includes multiple actions; the cumulative reward is the sum of the feedback rewards obtained by the virtual vehicle after the driving strategy is estimated to be adopted for each action included in the driving strategy;
[0026] Each virtual vehicle adjusts its driving strategy based on the strategy to achieve the expected reward through the accumulated reward.
[0027] Optionally, the set of natural quantitative indicators includes: trajectory smoothness index, dynamic decision continuity index, traffic rule compliance index, safety boundary compliance index, collaborative consistency index and conflict resolution efficiency index.
[0028] Optionally, any of the driving styles is defensive driving, aggressive driving, hesitant driving, confident driving, experienced driving, rule-following driving or situation-adaptive driving.
[0029] Optionally, a set of naturalness quantitative indicators for any virtual vehicle is obtained by:
[0030] Setting weights corresponding to various driving parameters of the virtual vehicle; the weights corresponding to various driving parameters are obtained by evaluating real-world vehicle driving data;
[0031] The driving parameters and the weights corresponding to the driving parameters are set in a reward function part of reinforcement learning, and the weights corresponding to the driving parameters are adjusted by reinforcement learning to obtain the adjusted weights corresponding to the driving parameters, so as to simulate the driving style of a real-world vehicle based on the adjusted weights corresponding to the driving parameters;
[0032] Obtaining a set of naturalness quantitative indicators of the virtual vehicle according to the weights corresponding to the adjusted driving parameters and the driving parameters of the virtual vehicle;
[0033] Among them, the expression of the reward function is:
[0034] ;
[0035] Indicates the accumulated rewards; Indicates the current time point; Indicates the offset of the time step; Indicates the preset discount factor; Indicates driving parameters; Indicates The weights corresponding to the driving parameters; Represents positive infinity.
[0036] In a second aspect, the present invention provides a natural autonomous driving scene generation device based on reinforcement learning, the device comprising:
[0037] A multi-agent model generation module is used to generate multiple multi-agent models; each multi-agent model includes multiple virtual vehicles with a driving style; the driving style of each virtual vehicle is specified by a set of natural quantitative indicators; wherein each virtual vehicle adjusts its driving strategy in a reinforcement learning manner according to its own driving style and external information during driving; the external information includes surrounding traffic equipment information and surrounding virtual vehicle information;
[0038] A natural autonomous driving scene generation module is used to generate a natural autonomous driving scene using at least one multi-agent model.
[0039] Optionally, the natural autonomous driving scenario generation module is specifically used to apply at least one multi-agent model to the CARLA simulation platform, so that the CARLA simulation platform generates a natural autonomous driving scenario based on the at least one multi-agent model, and performs safety verification of the autonomous driving system through the natural autonomous driving scenario.
[0040] Optionally, in the multi-agent model generation module, each virtual vehicle adjusts its driving strategy according to its own driving style and external information by using reinforcement learning during driving, including:
[0041] During the driving process, each virtual vehicle uses the self-attention mechanism to aggregate information based on its own driving style and external information to obtain aggregated information:
[0042] For virtual vehicles , calculate the virtual vehicle In time of , , :
[0043] ;
[0044] ;
[0045] ;
[0046] in, Represents a virtual vehicle In time of ; Represents the driving style and current dynamic state of the virtual vehicle; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time The status of Represents a virtual vehicle In time of ; Represents a virtual vehicle The surrounding traffic equipment information and the information of other virtual vehicles; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time of ; Detailed information required to represent specific actions of the other virtual vehicles or detailed description of surrounding traffic equipment information; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of
[0047] use and Calculate the attention weights:
[0048] ;
[0049] in, Represents a virtual vehicle In time For virtual vehicles The attention weight of Represents a virtual vehicle In time of ; Represents a continuous time series The cumulative variable of Indicates the offset of the time step;
[0050] according to and The aggregate information is calculated:
[0051] ;
[0052] in, Represents a virtual vehicle In time Aggregate information; Represents a virtual vehicle In time of ; Indicates the total number of virtual vehicles;
[0053] Based on the aggregated information, the driving strategy is adjusted using reinforcement learning.
[0054] Optionally, in the multi-agent model generation module, based on the aggregated information, the self-driving strategy is adjusted by using reinforcement learning, including:
[0055] During the driving process, each virtual vehicle estimates the cumulative rewards corresponding to the adoption of different driving strategies by itself using reinforcement learning based on the aggregated information; wherein any driving strategy is a speed adjustment strategy, a lane keeping and changing strategy, a traffic rule compliance strategy, an emergency obstacle avoidance strategy, or a navigation and path planning strategy; each driving strategy includes multiple actions; the cumulative reward is the sum of the feedback rewards obtained by the virtual vehicle after the driving strategy is estimated to be adopted for each action included in the driving strategy;
[0056] Each virtual vehicle adjusts its driving strategy based on the strategy to achieve the expected reward through the accumulated reward.
[0057] Optionally, the set of natural quantitative indicators includes a trajectory smoothness index, a dynamic decision continuity index, a traffic rule compliance index, a safety boundary compliance index, a collaborative consistency index and a conflict resolution efficiency index.
[0058] Optionally, any of the driving styles is defensive driving, aggressive driving, hesitant driving, confident driving, experienced driving, rule-following driving or situation-adaptive driving.
[0059] Optionally, a set of naturalness quantitative indicators for any virtual vehicle is obtained by:
[0060] Setting weights corresponding to various driving parameters of the virtual vehicle; the weights corresponding to various driving parameters are obtained by evaluating real-world vehicle driving data;
[0061] The driving parameters and the weights corresponding to the driving parameters are set in a reward function part of reinforcement learning, and the weights corresponding to the driving parameters are adjusted by reinforcement learning to obtain the adjusted weights corresponding to the driving parameters, so as to simulate the driving style of a real-world vehicle based on the adjusted weights corresponding to the driving parameters;
[0062] Obtaining a set of naturalness quantitative indicators of the virtual vehicle according to the weights corresponding to the adjusted driving parameters and the driving parameters of the virtual vehicle;
[0063] Among them, the expression of the reward function is:
[0064] ;
[0065] Indicates the accumulated rewards; Indicates the current time point; Indicates the offset of the time step; Indicates the preset discount factor; Indicates driving parameters; Indicates The weights corresponding to the driving parameters; Represents positive infinity.
[0066] The present invention provides a method for generating a natural autonomous driving scene based on reinforcement learning, which generates multiple multi-agent models; each multi-agent model includes multiple virtual vehicles with a driving style; the driving style of each virtual vehicle is specified by a set of natural quantitative indicators; wherein each virtual vehicle adjusts its own driving strategy by reinforcement learning during driving according to its own driving style and external information; the external information includes surrounding traffic equipment information and surrounding virtual vehicle information; and at least one multi-agent model is used to generate a natural autonomous driving scene.
[0067] Compared with the existing automatic driving test scene simulation methods, which are too idealized or simplified and fail to fully simulate the unpredictability and diversity of human drivers, the present invention generates multiple multi-agent models, each of which includes multiple virtual vehicles with a driving style, and then uses at least one multi-agent model to generate a natural automatic driving scene, thereby achieving the simulation of the driving conditions of real human drivers with different driving styles. In the present invention, the driving style of the virtual vehicle can be specified by a set of natural quantitative indicators, and each virtual vehicle can also adjust its driving strategy according to its own driving style and external information during driving, thereby accurately restoring the real driving scene and providing reliable support for the human-like behavior test scene of the automatic driving system.
[0068] The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 It is a flowchart of a method for generating a natural autonomous driving scene based on reinforcement learning provided by an embodiment of the present invention;
[0070] Figure 2 is a flowchart of a process of applying a multi-agent model to a CARLA simulation platform provided by an embodiment of the present invention;
[0071] Figure 3 This is a schematic diagram of an exemplary scenario in which the self-attention mechanism is applied;
[0072] Figure 4 It is a structural schematic diagram of a natural autonomous driving scene generation device based on reinforcement learning provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0073] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.
[0074] The real-world driving environment is extremely varied and complex, and contains a variety of unpredictable human behaviors. These behaviors may be driven by unique cultural backgrounds, driving styles, or emotional states. For example, some drivers may tend to make risky maneuvers when merging lanes or speed through intersections when the light is yellow. By simulating these diverse and nonlinear behaviors in test scenarios, the ability of autonomous driving systems to handle the complexity of the real world can be greatly improved. Test scenarios with human-like behaviors enable autonomous driving systems to better predict and understand the behavior of human drivers. For example, by analyzing human reaction patterns under specific road conditions (such as emergency braking, obstacle avoidance, etc.), autonomous driving systems can learn to predict these behaviors and adjust their driving strategies accordingly, such as maintaining a safe distance, slowing down, or changing routes. The real-world driving environment is not only affected by the physical environment, but also involves social and psychological factors. Test scenarios with human-like behaviors can simulate factors such as road rage, driving habits, and even cultural differences, helping autonomous driving systems to be trained and validated under a wider range of and more realistic conditions.
[0075] Current autonomous driving technology is developing rapidly, but it still needs to be fully tested in complex real-world traffic environments. Among them, test scenarios that include human-like behavior are key to achieving this goal, as they help ensure the reliability and maturity of the technology. Statistical authenticity refers to the extent to which test results can accurately reflect real-world conditions. In order for the test results of autonomous driving systems to have statistical authenticity, the test scenarios must reflect real-world driving styles, which directly affects the performance and safety of the system in real road environments.
[0076] In view of this, an embodiment of the present invention provides a method and device for generating natural autonomous driving scenarios based on reinforcement learning, which can better reflect the driving style in the real world and solve the problem that traditional test scenarios are often too idealized or simplified and fail to fully simulate the unpredictability and diversity of human drivers.
[0077] First, a natural autonomous driving scene generation method based on reinforcement learning provided by an embodiment of the present invention is described in detail. Figure 1 , Figure 1 : is a flow chart of a method for generating a natural autonomous driving scene based on reinforcement learning provided by an embodiment of the present invention, and the steps are as follows:
[0078] Step S101, generate multiple multi-agent models; each multi-agent model includes multiple virtual vehicles with a driving style; the driving style of each virtual vehicle is specified by a set of natural quantitative indicators; wherein each virtual vehicle adjusts its own driving strategy by reinforcement learning during driving according to its own driving style and external information; the external information includes surrounding traffic equipment information and surrounding virtual vehicle information.
[0079] In the embodiment of the present invention, each multi-agent model includes multiple virtual vehicles with one driving style. Therefore, the multi-agent model generated based on multiple virtual vehicles with one driving style can simulate a human vehicle driving behavior in a real scene. On this basis, multiple human vehicle driving behaviors in real scenes can be simulated through virtual vehicles in multiple agent models with different driving styles.
[0080] In an embodiment of the present invention, the driving style of each virtual vehicle is specified by a set of natural quantitative indicators, which include trajectory smoothness indicator, dynamic decision continuity indicator, traffic rule compliance indicator, safety boundary compliance indicator, collaborative consistency indicator and conflict resolution efficiency indicator.
[0081] The trajectory smoothness index is used to measure whether the driver's driving trajectory is smooth, which is affected by vehicle dynamics, road conditions and weather conditions. Among them, vehicle dynamics include instantaneous acceleration, instantaneous speed and steering sensitivity, among which steering sensitivity refers to the speed at which the vehicle's actual steering action occurs after the driver turns the steering wheel. A highly sensitive steering system will respond to the driver's input faster; road conditions include factors such as road surface quality (such as potholes, slippery roads), road types (such as straight roads, curves) and road slopes; weather conditions include rain, snow, fog and other weather conditions. When the weather conditions are bad, the driver will make adjustments more frequently during driving, thus affecting the trajectory smoothness index.
[0082] The dynamic decision continuity index is used to measure the continuity of the driver's different dynamic decisions; specifically, dynamic decisions include vehicle acceleration and deceleration, steering control, lane change, speed control and braking decisions.
[0083] Traffic rule compliance indicators can be used to measure whether drivers comply with traffic signals, traffic signs, speed limits, etc. Specifically, traffic rule compliance includes but is not limited to traffic light compliance, speed limit compliance, and traffic sign compliance.
[0084] The safety margin compliance index is specifically used to measure whether the driver tends to keep a safe distance from other vehicles, pedestrians, and cyclists. Specifically, safety margin compliance can include maintaining a safe distance between vehicles, maintaining a safe distance when changing lanes or merging, and maintaining a safe distance from pedestrians and non-motor vehicles.
[0085] The collaboration consistency index is used to describe the consistency and coordination of the driver when collaborating with other road users (such as merging or alternating traffic interactions). For example, high collaboration consistency means that the driver can effectively cooperate with others to ensure smooth and safe traffic. Other road users can refer to pedestrians and other vehicle drivers, etc.
[0086] The conflict resolution efficiency index is used to measure the speed at which drivers respond and resolve potential conflicts (such as emergency avoidance and traffic congestion). For example, efficient conflict resolution means that drivers can quickly identify and resolve problems, thereby reducing traffic disruptions and potential safety risks.
[0087] In an embodiment of the present invention, the driving style of a virtual vehicle can be specified by a set of natural quantitative indicators. Each multi-agent model includes multiple virtual vehicles with a driving style. Through multiple agent models, simulation of drivers with various different driving styles in the real world can be achieved, wherein any driving style can be defensive driving, aggressive driving, hesitant driving, confident driving, experienced driving, rule-following driving, or situation-adaptive driving.
[0088] For example, if each naturalness quantitative index of a virtual vehicle is set at a relatively high or high level, the driving style of the virtual vehicle is experienced driving; or if each naturalness quantitative index of a virtual vehicle is set at a relatively low or low level, the driving style of the virtual vehicle is aggressive driving.
[0089] The following will illustrate how to specify the driving style of a vehicle based on a set of naturalness quantitative indices through a set of examples. First, the range of naturalness quantitative indices corresponding to different driving styles is set.
[0090] 1) Defensive driving:
[0091] Trajectory smoothness index: 0.8-1.0 (high); defensive driving tends to avoid sudden movements, so the trajectory smoothness index is at a high level;
[0092] Decision continuity index: 0.8-1.0 (high); Defensive driving behavior is usually predictable and the driving behavior is often consistent in similar situations; higher decision continuity indicates that the autonomous driving system of the virtual vehicle can make continuous and consistent decisions based on the current driving environment and predicted future environmental changes, and higher decision continuity also means that the driving behavior made by the autonomous driving system is consistent in similar situations. For example, in similar traffic situations and environmental conditions, the virtual vehicle will repeatedly make similar driving decisions. This consistency is important for improving the predictability of the behavior of autonomous vehicles by other road users, which can reduce confusion and potential safety risks on the road.
[0093] Traffic rules compliance index: 0.9-1.0 (very high); defensive driving style emphasizes driving safety and compliance with traffic rules;
[0094] Safety Margin Compliance Index: 0.8-1.0 (high); Keeping a safe distance from other road users is the core of defensive driving;
[0095] Collaboration consistency index: 0.7-1.0 (high); defensive driving often includes effective collaboration with other drivers, such as giving way to other virtual vehicles;
[0096] Conflict resolution efficiency index: 0.7-1.0 (high); Defensive drivers can usually quickly identify potential conflicts and take actions to avoid them.
[0097] 2) Aggressive driving:
[0098] Trajectory smoothness index: 0.2-0.5 (low); Aggressive driving may include driving decisions such as rapid acceleration and sharp turns;
[0099] Decision-making consistency index: 0.3-0.6 (medium to low); aggressive driving will result in frequent and sudden changes in decision-making;
[0100] Traffic rules compliance indicator: 0.0-0.4 (low); aggressive driving of virtual vehicles may involve speeding or other violations;
[0101] Safety margin compliance index: 0.2-0.5 (low); drivers may pay less attention to maintaining a safe distance;
[0102] Collaborative consistency index: 0.0-0.3 (low); aggressive driving may result in competition with other vehicles rather than cooperation.
[0103] Conflict resolution efficiency index: 0.4-0.6 (medium); Aggressive drivers may respond quickly to situations, but their behavior may increase the risk of conflict.
[0104] 3) Indecisive driving:
[0105] Trajectory smoothness index: 0.4-0.6 (medium); driver indecision may lead to incoherent driving actions;
[0106] Decision continuity index: 0.2-0.5 (low); drivers may change their minds repeatedly when making decisions, resulting in low decision continuity;
[0107] Traffic rules compliance index: 0.5-0.7 (medium); although the driver may comply with traffic rules, his hesitation in decision-making may cause problems;
[0108] Safety margin compliance index: 0.5-0.7 (medium); A safety margin compliance index at a medium level means that hesitant driving can generally adapt to the environment and maintain an appropriate safety margin, but in some cases the driver may exhibit overly cautious or overly aggressive driving behavior due to indecision.
[0109] Collaboration consistency index: 0.4-0.6 (medium); driver indecision may lead to inconsistency in collaboration with other road users.
[0110] Conflict resolution efficiency index: 0.2-0.4 (low); indecisive drivers may react more slowly when conflicts occur.
[0111] 4) Confident Driving:
[0112] Trajectory smoothness index: 0.7-0.9 (high); confident drivers tend to perform smooth driving actions, including stable acceleration, deceleration and steering, which will reduce potential safety risks caused by sharp driving actions;
[0113] Decision continuity index: 0.7-0.9 (high); confident drivers can make consistent and continuous decisions when encountering different driving situations. They have a high ability to analyze road conditions and predict traffic flow, and can develop reasonable and coherent driving strategies.
[0114] Traffic rules compliance index: 0.6-0.8 (medium to high); Confident drivers usually comply with traffic rules, but may also appropriately use the flexibility of the rules to optimize the driving path or improve efficiency in specific situations, which reflects the confidence of confident drivers in their deep understanding of traffic rules;
[0115] Safety Margin Compliance Index: 0.6-0.8 (Medium to High); Confident drivers are able to maintain a smooth driving flow while maintaining an appropriate safety distance. They are able to adjust their driving style according to the surrounding traffic conditions to ensure safety in various situations.
[0116] Collaboration consistency index: 0.7-0.9 (high); confident drivers are generally able to cooperate effectively with other road users.
[0117] Conflict resolution efficiency index: 0.7-0.9 (high); confident drivers are usually able to quickly identify and effectively resolve conflicts.
[0118] 5) Experienced driving:
[0119] Track smoothness index: 0.8-1.0 (higher); experienced drivers tend to have smooth operation;
[0120] Decision-making continuity index: 0.8-1.0 (high); experienced drivers will have relatively consistent decision-making behavior and are usually able to make quick and consistent decisions;
[0121] Traffic rules compliance index: 0.7-0.9 (high); experienced drivers can perform certain active operations on the basis of ensuring safety and compliance with traffic rules;
[0122] Safety Margin Compliance Index: 0.8-1.0 (high); experienced drivers can usually effectively assess and maintain a safe distance from other road users;
[0123] Collaboration consistency index: 0.8-1.0 (very high); experienced drivers are usually able to maintain good cooperation with other virtual vehicles in various situations;
[0124] Conflict Resolution Efficiency Index: 0.8-1.0 (very high); experienced drivers can accurately predict and quickly respond to potential conflicts.
[0125] 6) Driving in compliance with the rules:
[0126] Trajectory smoothness index: 0.7-0.9 (high); strict rule-abiding driving usually has predictable and smooth operation;
[0127] Decision continuity index: 0.7-0.9 (high); rule-following drivers tend to make consistent decisions, so their decision continuity index is at a high level;
[0128] Traffic rules compliance index: 0.9-1.0 (very high); Very high traffic rules compliance index is the core feature of this driving style;
[0129] Safety Margin Compliance Index: 0.9-1.0 (very high); following traffic rules usually includes maintaining a safe distance;
[0130] Collaborative consistency index: 0.7-1.0 (high); following traffic rules helps to maintain consistent interactions with other road users;
[0131] Conflict resolution efficiency index: 0.7-0.9 (high); compliance with traffic rules helps prevent and quickly resolve conflicts.
[0132] 7) Situational Adaptive Driving:
[0133] Track smoothness index: 0.6-0.8 (medium to high); the driver will flexibly adjust according to different situations;
[0134] Decision continuity index: 0.6-0.8 (medium to high); although the driver's operation and response are flexible, their response to environmental changes is usually coherent, so the decision continuity index will be at a medium to high level;
[0135] Traffic rules compliance index: 0.6-0.8 (medium to high); drivers adjust their behavior in a timely manner according to different situations;
[0136] Safety Margin Compliance Index: 0.6-0.8 (medium to high); the driver can adjust the safety distance according to the current conditions;
[0137] Collaboration consistency index: 0.6-0.8 (high); drivers are able to adjust their behavior according to different situations to better collaborate with others;
[0138] Conflict resolution efficiency index: 0.6-0.8 (high); the driver can flexibly adapt to various situations and effectively resolve conflicts.
[0139] In the embodiment of the present invention, the driving style of the virtual vehicle may be determined based on which driving style's naturalness quantification index range the specific value of each indicator in a set of naturalness quantification indicators of the virtual vehicle falls within.
[0140] For example, when the trajectory smoothness index of virtual vehicle A is 0.92, the dynamic decision continuity index is 0.95, the traffic rule compliance index is 0.99, the safety boundary compliance index is 0.83, the collaborative consistency index is 0.75 and the conflict resolution efficiency index is 0.82, all indicators of the virtual vehicle A fall within the range of defensive driving indicators, so the driving style of the virtual vehicle A is defensive driving.
[0141] For example, when the trajectory smoothness index of virtual vehicle B is 0.31, the dynamic decision continuity index is 0.52, the traffic rule compliance index is 0.21, the safety boundary compliance index is 0.35, the collaborative consistency index is 0.21 and the conflict resolution efficiency index is 0.53, all indicators of the virtual vehicle B fall within the range of aggressive driving indicators, so the driving style of the virtual vehicle B is aggressive driving.
[0142] The specific numerical ranges shown above are for example only and can be adjusted according to the usage scenario and are not limited here.
[0143] In the embodiment of the present invention, the driving strategy refers to the adaptive adjustment made by the virtual vehicle to its driving behavior according to its own driving style and external information during driving, for example, the acceleration, deceleration, lane change or emergency obstacle avoidance strategies of the virtual vehicle.
[0144] Step S102: Generate a natural autonomous driving scenario using at least one multi-agent model.
[0145] Since a multi-agent model includes multiple virtual vehicles with a driving style, and each virtual vehicle can adjust its own driving strategy using reinforcement learning according to its own driving style and external information during driving, a natural autonomous driving scenario that reflects complex real-world conditions can be generated based on the multi-agent model.
[0146] It is understandable that since multiple multi-agent models are generated, a natural autonomous driving scenario can be generated based on each multi-agent model. Therefore, by using multiple multi-agent models, multiple natural autonomous driving scenarios can be generated, thereby simulating complex real-world situations and providing a basis for safety testing of autonomous driving systems.
[0147] Specifically, whether to use one or more multi-agent models to conduct safety testing of the autonomous driving system can be chosen by technicians based on needs and is not restricted here.
[0148] In the embodiment of the present invention, compared with the existing automatic driving test scene simulation method, which is too idealized or simplified and fails to fully simulate the unpredictability and diversity of human drivers, the embodiment of the present invention generates multiple multi-agent models, each of which includes multiple virtual vehicles with a driving style, and then uses at least one multi-agent model to generate a natural automatic driving scene, thereby achieving the simulation of the driving conditions of real human drivers with multiple different driving styles. In the embodiment of the present invention, the driving style of the virtual vehicle can be specified by a set of natural quantitative indicators, and each virtual vehicle can also adjust the driving strategy according to its own driving style and external information during driving, thereby accurately restoring the real driving scene and providing reliable support for the human-like behavior test scene of the automatic driving system.
[0149] In an embodiment of the present invention, generating a naturalistic autonomous driving scenario using at least one multi-agent model includes:
[0150] At least one multi-agent model is applied to the CARLA simulation platform (Car Learning to Act, an open source autonomous driving simulation platform) so that the CARLA simulation platform generates natural autonomous driving scenarios based on at least one multi-agent model, and verifies the safety of the autonomous driving system through the natural autonomous driving scenarios.
[0151] In the embodiment of the present invention, the main purpose of applying at least one multi-agent model to the CARLA simulation platform is to test the safety of the autonomous driving system. A multi-agent model can simulate the behavior of a class of other vehicles (NPC, non-player characters) in the real world. Since multiple multi-agent models are generated, a comprehensive, dynamic and realistic traffic environment can be generated by applying multiple multi-agent models to the CARLA simulation platform.
[0152] In an embodiment of the present invention, after multiple multi-agent models are generated, at least one multi-agent model can be integrated into the CARLA simulation platform. The integration process needs to ensure that each virtual vehicle in the multi-agent model can receive input from the simulation environment (such as road conditions, the status of nearby vehicles, etc.) and make corresponding behavioral decisions accordingly. In the CARLA simulation platform, the generated virtual vehicles can be used to simulate various driving styles and behaviors that may be encountered in the real traffic environment. By running these virtual vehicles in the CARLA simulation environment, the automatic driving system of the main vehicle can be comprehensively tested for safety. The safety test can include evaluating the responsiveness of the automatic driving system in various traffic situations, such as how to deal with vehicles with emergency brakes, pedestrians who suddenly insert, or other complex traffic scenes. In addition, these safety tests can also include simulating traffic scenes under different weather conditions and traffic densities at different times, as well as simulating traffic scenes under special circumstances such as road closures and traffic accidents.
[0153] Figure 2 This is a flowchart of the process of applying the multi-agent model to the CARLA simulation platform, which includes the following steps:
[0154] Step S201, connecting the multi-agent model to the simulation platform interface.
[0155] In an embodiment of the present invention, the step of docking the multi-agent model with the simulation platform interface specifically includes two aspects: interface integration and data conversion.
[0156] 1a) Interface integration: Integrate the multi-agent model with the API (Application Programming Interface) of the CARLA simulation platform to ensure that the virtual vehicle in the multi-agent model can receive input from the simulation environment and make corresponding driving strategies.
[0157] 1b) Data conversion: Convert the input / output format of the multi-agent model to match the data provided by the CARLA simulation platform and the requirements of the simulation environment.
[0158] Step S202, testing in a simulation platform.
[0159] In the embodiment of the present invention, the steps of testing in the simulation platform include three aspects: preliminary testing, performance adjustment and scenario coverage.
[0160] 2a) Preliminary testing: The multi-agent model is applied to the CARLA simulation platform for preliminary testing to observe whether the behavior of the multi-agent model meets expectations.
[0161] 2b) Performance Tuning: Fine-tune the multi-agent model based on safety test results to make it more adaptable to complex real-world driving scenarios.
[0162] 2c) Scenario coverage: Test the multi-agent model in a variety of driving scenarios, including urban road scenarios, highway scenarios, and scenarios under different weather conditions.
[0163] Step S203: advanced verification.
[0164] In the embodiment of the present invention, the step of advanced verification includes two aspects: virtual vehicle interaction and performance evaluation of the virtual vehicle, wherein the performance of the virtual vehicle includes its safety and robustness.
[0165] 3a) Multi-agent interaction: Test the interaction of virtual vehicles in the same environment to ensure that the virtual vehicles can handle complex traffic scenarios.
[0166] 3b) Safety and robustness evaluation: Evaluate the safety and robustness of the virtual vehicle in the face of various emergencies.
[0167] Step S204, iterative improvement.
[0168] In the embodiment of the present invention, the iterative improvement step includes two aspects: continuous iteration and long-term evaluation.
[0169] 4a) Continuous iteration: Continuously optimize the multi-agent model based on feedback from simulation tests.
[0170] 4b) Long-term evaluation: Long-term monitoring of the performance of the multi-agent model to ensure its adaptability and reliability.
[0171] In the simulation test process, the collection and analysis of test data is crucial. These data cover many aspects, including traffic accident rates, traffic violations, the driving efficiency and decision-making time of the main vehicle, and the interaction with other virtual vehicles. By deeply analyzing these data and comparing them with the data in the real driving scene, we can better understand the performance of the autonomous driving system in the actual driving environment, and further optimize and improve the natural quantitative indicators of the virtual vehicles in the multi-agent model, so that their performance is closer to the driving vehicles in the real driving scene.
[0172] In addition, a key aspect of simulation testing is to evaluate the robustness of the autonomous driving system, that is, the ability of the autonomous driving system to adapt to different driving behaviors and unexpected situations. By observing the performance of the autonomous driving system in the face of complex and dynamic traffic scenarios, its safety and reliability in the real world can be effectively evaluated.
[0173] In an embodiment of the present invention, deploying at least one multi-agent model to the CARLA simulation platform can create a highly realistic test environment, which is essential for evaluating and verifying the safety of autonomous driving systems. Through simulation testing, researchers and engineers can collect key performance data and optimize and adjust the autonomous driving system accordingly to improve its safety and reliability in the real world.
[0174] It is understandable that in the embodiment of the present invention, the autonomous driving system can be tested according to one multi-agent model among multiple multi-agent models, or the autonomous driving system can be tested according to multiple multi-agent models. Specifically, it can be selected by those skilled in the art according to actual usage, and is not limited here.
[0175] In the embodiment of the present invention, each virtual vehicle adjusts its driving strategy by using reinforcement learning according to its own driving style and external information during driving, including:
[0176] During driving, each virtual vehicle aggregates information using the self-attention mechanism based on its own driving style and external information to obtain aggregated information;
[0177] Based on the aggregated information, the vehicle adjusts its driving strategy using reinforcement learning.
[0178] Since the self-attention mechanism has efficient parallel processing capabilities and the ability to effectively capture long-distance dependencies, it is applied to a multi-agent model in an embodiment of the present invention to utilize the powerful self-attention mechanism to enhance the efficiency of information processing and communication between virtual vehicles.
[0179] After obtaining aggregate information through the self-attention mechanism, each virtual vehicle can consider its own observations and experiences based on the aggregate information. Here, observations and experiences specifically refer to the virtual vehicle’s own driving style, physical parameters such as speed and acceleration, or other road information collected, and empirical decisions when facing different road conditions. In addition, based on the aggregate information, each virtual vehicle can also consider information from other virtual vehicles. The use of the self-attention mechanism enables each virtual vehicle to effectively understand and predict the behavior of other virtual vehicles even in complex and dynamic environments, thereby improving the overall decision-making quality.
[0180] Specifically, in the scenario of autonomous driving, a virtual vehicle can adjust its driving strategy based on the information of surrounding traffic equipment and surrounding virtual vehicles. Using the self-attention mechanism, each virtual vehicle can more accurately predict the dynamic changes in traffic flow, thereby making safer and more efficient driving strategies.
[0181] In the embodiment of the present invention, since each virtual vehicle needs to make a driving strategy based on its own driving style and external information, in order to efficiently process a large amount of information and long-distance temporal dependencies in a complex driving environment, the self-attention mechanism is used in the embodiment of the present invention to handle this.
[0182] The following will explain how each virtual vehicle uses the self-attention mechanism to aggregate information based on its own driving style and external information during driving, thereby obtaining aggregated information:
[0183] definition An intelligent agent, virtual vehicles, called The input of the self-attention mechanism is a virtual vehicle In time The state is represented by , It can be comprehensive input information of the virtual vehicle’s surroundings, such as the position, speed, direction, and acceleration of the virtual vehicle under its own driving style, as well as external information. Specifically, this comprehensive input information can be obtained through the virtual vehicle’s own sensors. The self-attention mechanism can be used to calculate the virtual vehicle In time Contextual awareness , that is, aggregate information, the following will be The calculation method of is explained below.
[0184] First, we need to calculate the virtual vehicle in the process of the self-attention mechanism In time of (Query), (key), (value corresponding to the key):
[0185] ;
[0186] in, Represents a virtual vehicle In time of ; Represents the driving style and current dynamic state of the virtual vehicle. For example, the dynamic state can be the virtual vehicle Current speed, location, direction of travel, etc.; is used to input the virtual vehicle In time The state representation is converted to The weight of .
[0187] ;
[0188] in, Represents a virtual vehicle In time of ; Represents information about surrounding traffic equipment and other virtual vehicles, such as the position, speed, acceleration, etc. of other virtual vehicles; is used to input the virtual vehicle In time The state representation is converted to The weight of .
[0189] ;
[0190] in, Represents a virtual vehicle In time of , can be used to provide specific information to make the virtual vehicle Make the next move; It can be understood as detailed information required for the specific actions of other virtual vehicles or detailed descriptions of surrounding traffic equipment information in the context of autonomous driving. The specific actions of other virtual vehicles may refer to steering, acceleration or deceleration, etc., and the detailed information required may refer to specific steering angles and speeds, acceleration and deceleration distances and times, and when and where to change lanes, etc.; is used to input the virtual vehicle In time The state representation is converted to The weight of .
[0191] Secondly, in order to determine the importance of each piece of external information to the behavior of the virtual vehicle, the attention weight needs to be calculated:
[0192] ;
[0193] in, Represents a virtual vehicle In time For virtual vehicles The attention weight is used to measure The influence of external information at that moment on the behavior of the virtual vehicle; for example, if a certain external information is the sudden deceleration of the virtual vehicle in front, and the weight of the external information is Very high, then the virtual vehicle This information is considered very important for virtual vehicles. The impact is high and you may need to be prepared to slow down or take other risk-avoiding measures. Represents a virtual vehicle In time of . For a continuous time series The cumulative variable.
[0194] Finally, calculate :
[0195] ;
[0196] in, Represents a virtual vehicle In time Aggregate information, Represents a virtual vehicle In time of .
[0197] In the embodiments of the present invention, see Figure 3 , Figure 3 This is an exemplary scenario diagram of the application of the self-attention mechanism. The virtual vehicle can determine the current state according to the given state. Then, use and Match and use the attention score function Calculate an attention score. By calculating the attention score, each virtual vehicle can determine which information is most relevant in the current behavior decision, thereby effectively filtering out important information. Then apply the softmax (normalized exponential) function based on the attention score to obtain the final attention weight The attention score determines the importance of external information to the current decision of the virtual vehicle, thus forming a weight distribution. Dot product can generate a weighted The combination of these is summed up to finally output the aggregated information extracted from surrounding traffic devices and other virtual vehicles. .
[0198] In an embodiment of the present invention, adjusting the driving strategy based on the aggregated information by using reinforcement learning includes:
[0199] During the driving process, each virtual vehicle estimates the cumulative rewards corresponding to different driving strategies based on the aggregated information using reinforcement learning. Any driving strategy is a speed adjustment strategy, a traffic rule compliance strategy, an emergency obstacle avoidance strategy, or a navigation and path planning strategy. Each driving strategy includes multiple actions. The cumulative reward is the sum of the feedback rewards obtained by the virtual vehicle after it is estimated that a driving strategy is adopted and each action included in the driving strategy is executed.
[0200] Each virtual vehicle adjusts its driving strategy based on the strategy to achieve the expected reward through the accumulated reward.
[0201] In the embodiment of the present invention, any driving strategy is a speed adjustment strategy, a lane keeping and changing strategy, a traffic rule compliance strategy, an emergency obstacle avoidance strategy or a navigation and path planning strategy.
[0202] Specifically, the speed adjustment strategy may be a strategy for a virtual vehicle to adjust its own speed according to the speed of other virtual vehicles in front and the distance between it and the virtual vehicle in front to maintain a safe distance. The lane keeping and changing strategy may be a strategy for a virtual vehicle to keep itself in the center of the lane or to make safe lane changes when necessary, such as changing lanes to overtake or avoid obstacles. The traffic rule compliance strategy may be a strategy for a virtual vehicle to recognize and obey traffic signs and signals, such as recognizing and obeying stop signs and traffic lights. The emergency obstacle avoidance strategy may be a strategy for a virtual vehicle to automatically perform emergency braking or obstacle avoidance actions when it detects an impending collision. The navigation and path planning strategy may be a strategy for a virtual vehicle to calculate the optimal driving route based on the destination and current traffic conditions.
[0203] In an embodiment of the present invention, each virtual vehicle can select an action based on aggregated information through a certain strategy, such as Q learning, deep reinforcement learning algorithm or other decision-making process, during driving, and the virtual vehicle will select a driving strategy based on the expected reward. Specifically, after the virtual vehicle estimates that a driving strategy will be adopted, each action included in the driving strategy will be executed, and the feedback reward obtained by executing each action included in the driving strategy will be summed to obtain the cumulative reward. Each virtual vehicle adjusts its own driving strategy according to the strategy in which the cumulative reward reaches the expected reward.
[0204] For example, if the driving strategy is a speed adjustment strategy, then the actions included in the speed adjustment strategy may be a series of actions such as braking and shifting gears. The speed adjustment strategy can be completed through this series of actions. Each action can get a feedback reward. By summing the feedback rewards obtained from these actions, the estimated cumulative reward after the speed adjustment strategy is adopted can be obtained. Similarly, the estimated emergency obstacle avoidance strategy can also obtain the corresponding cumulative reward. Finally, each virtual vehicle can adjust its own driving strategy according to the strategy that the cumulative reward reaches the expected reward.
[0205] In an embodiment of the present invention, a set of naturalness quantitative indicators of any virtual vehicle is obtained in the following manner:
[0206] The weights corresponding to the various driving parameters of the virtual vehicle are set; the weights corresponding to the various driving parameters are obtained by evaluating the real-world vehicle driving data.
[0207] First, a large amount of real-world vehicle driving data is collected, which often includes vehicle behavior data, traffic environment data, and driver reactions and decision-making processes under different driving conditions. Then, a data-driven approach can be used to preliminarily estimate the importance of various driving parameters.
[0208] Data-driven specifically means using existing open source datasets for autonomous driving, such as KITTI, CityScapes, Synthia, BDD100K, etc., to collect data in as many dimensions as possible. The collected data can include highway traffic monitoring, on-board sensors, such as GPS (Global Positioning System), accelerometers and cameras, as well as data under different weather conditions, different time periods, such as daytime or nighttime, and different traffic densities, as well as vehicle motion data, such as speed, acceleration, etc., driver operation data, such as steering, acceleration and braking, and environmental data, such as traffic signals, road types and traffic rules. Then the collected data is cleaned, that is, noise and outliers in the data are removed to ensure data quality. Important events are annotated, such as when the driver performs emergency braking, lane changes or other key actions. At the same time, features meaningful for driving behavior analysis are extracted from the data, such as speed changes, acceleration and steering angles. In this process, clustering algorithms can be used to identify typical driving behavior patterns and analyze the causal relationship between specific driving behaviors and their results, such as the relationship between sudden acceleration and traffic accidents. Then, based on the results of the data analysis, the importance of different driving parameters is evaluated and the weights of each driving parameter are preliminarily set.
[0209] In addition, the initially obtained weights may be adjusted based on the experience of technicians in the field.
[0210] The driving parameters and the weights corresponding to the driving parameters are set in the reward function part of the reinforcement learning, and the weights corresponding to the driving parameters are adjusted by the reinforcement learning method to obtain the adjusted weights corresponding to the driving parameters, so as to simulate the driving style of the real-world vehicle based on the adjusted weights corresponding to the driving parameters. According to the adjusted weights corresponding to the driving parameters and the driving parameters of the virtual vehicle, a set of natural quantitative indicators of the virtual vehicle is obtained.
[0211] In the embodiment of the present invention, the reward in the reward function is composed of multiple driving parameters and their corresponding weights. , whose expression is:
[0212] ;
[0213] Accordingly, the expression of the reward function is:
[0214] ;
[0215] in, Indicates the accumulated rewards; Indicates the current time; Indicates the offset of the time step; Indicates the preset discount factor; Indicates driving parameters; Indicates The weights corresponding to the driving parameters; Indicates positive infinity. Specifically, the preset discount factor can be between 0 and 1.
[0216] In the process of adjusting the weights corresponding to various driving parameters by using reinforcement learning, and obtaining a set of natural quantitative indicators of the virtual vehicle according to the weights corresponding to the adjusted driving parameters and the driving parameters of the virtual vehicle, considering the correlation between some natural quantitative indicators, the natural quantitative indicators can be integrated into indicators within the virtual vehicle dimension and indicators outside the virtual vehicle dimension for adjustment, so that the indicators within a certain dimension can be considered as a whole to more comprehensively evaluate the natural behavior of the autonomous driving test system. Among them, the indicators outside the virtual vehicle dimension can be further divided into safety dimension indicators and interaction dimension indicators.
[0217] The calculation method of the indicators in the virtual vehicle dimension is as follows:
[0218] ;
[0219] in, Represents the index in the virtual vehicle dimension, represents the trajectory smoothness of the virtual vehicle, Indicates that the virtual vehicle is Dynamic decision making at each moment; express The weight of express The weight of represents the trajectory smoothness index of the virtual vehicle; Represents the decision continuity indicator of the virtual vehicle.
[0220] Virtual vehicle The calculation method of the dynamic decision at the moment is as follows:
[0221] ;
[0222] in, represents the trajectory smoothness of the virtual vehicle, Represents a time point, which is used to index a specific time node in the entire trajectory analysis process; Indicates time point The trajectory data points can be, for example, the virtual vehicle position, acceleration or velocity, etc. Indicates time point The trajectory data points are Indicates the offset of the time step; Indicates all The average value of is used to represent the average position or state of the entire trajectory data point. The calculation formula of the dynamic decision is a variation of the autocorrelation function, which is used to obtain the virtual vehicle in the time series data by evaluating the correlation between adjacent trajectory data points. Dynamic decision making at the moment.
[0223] The calculation method of the security dimension indicator is as follows:
[0224] ;
[0225] in, Represents security dimension indicators; Indicates the traffic rules compliance of the virtual vehicle; Indicates the safety boundary compliance of the virtual vehicle; express The weight of express The weight of Indicates the traffic rules compliance index of the virtual vehicle; Represents the safety boundary compliance indicator of the virtual vehicle.
[0226] The calculation method of the interaction dimension indicator is as follows:
[0227] ;
[0228] in, Indicates the interaction dimension indicator; Used to represent the collaborative consistency of virtual vehicles; Used to represent the conflict resolution efficiency of virtual vehicles; express The weight of express The weight of represents the collaborative consistency index of the virtual vehicles; Represents the conflict resolution efficiency index of the virtual vehicle.
[0229] In the evaluation of autonomous driving systems, the interaction dimension metric can be used to measure whether the virtual vehicle can interact with other road users as effectively as a human driver. This dimension can be used to identify areas for improvement in driving skills, especially in urban and complex traffic environments.
[0230] In the embodiment of the present invention, the driving parameters of the virtual vehicle include the above , , , , and .
[0231] Specifically, the weights corresponding to various driving parameters are adjusted by using a reinforcement learning method, and the process of obtaining the adjusted weights corresponding to various driving parameters may include: setting the weights corresponding to various driving parameters in the reward function part of the reinforcement learning, and realizing the continuous optimization of the weights corresponding to various driving parameters by interacting with the virtual vehicle and the external environment. For example, for a virtual vehicle set to a defensive driving style, its actions such as keeping a safe distance from surrounding virtual vehicles, not changing lanes frequently, or maintaining a stable speed will bring positive feedback. On the contrary, if some behaviors in the driving style violate the setting, that is, if one of its indicators exceeds the numerical range of the indicator under the driving style defined above, it will bring negative feedback. The virtual vehicle will select an action based on its own driving style to interact with the external environment. The action can be acceleration, deceleration, steering or lane change, etc., and a corresponding reward will be generated according to the new state of the virtual vehicle after the interaction. If this state follows the setting of the virtual vehicle under the driving style, a positive reward will be obtained, otherwise a negative reward will be obtained. The rewards obtained after each action of the virtual vehicle are summed up to obtain a cumulative reward. According to the accumulated rewards, the weights corresponding to the driving parameters of the virtual vehicle can be updated. The reinforcement learning algorithm will adjust the weights of the driving parameters according to the feedback rewards of the reward function, so that the real-world driving behavior can be more accurately reflected during the training process. By repeating this process, the reward function will eventually converge after a large number of iterations, and the weights at this time will be relatively stable. Then, by normalizing and evaluating the importance of the weights corresponding to the driving parameters, the final weights of the driving parameters can be determined, and the virtual vehicle will gradually learn how to drive according to different driving styles. Among them, the purpose of normalization is to ensure that each driving parameter can play its due role in training, and to avoid some driving parameters from having too much or too little impact on the model training results due to improper setting of the corresponding weights.
[0232] Based on the same inventive concept, the embodiment of the present invention also provides a natural autonomous driving scene generation device based on reinforcement learning, see Figure 4 , Figure 4: is a structural schematic diagram of a natural autonomous driving scene generation device based on reinforcement learning provided by an embodiment of the present invention, comprising:
[0233] The multi-agent model generation module 401 is used to generate multiple multi-agent models; each multi-agent model includes multiple virtual vehicles with a driving style; the driving style of each virtual vehicle is specified by a set of natural quantitative indicators; each virtual vehicle adjusts its driving strategy in a reinforcement learning manner according to its own driving style and external information during driving; the external information includes surrounding traffic equipment information and surrounding virtual vehicle information;
[0234] The natural autonomous driving scene generation module 402 is used to generate a natural autonomous driving scene using at least one multi-agent model.
[0235] In the embodiment of the present invention, compared with the existing automatic driving test scene simulation method, which is too idealized or simplified and fails to fully simulate the unpredictability and diversity of human drivers, the present invention generates multiple multi-agent models through a multi-agent model generation module 401, wherein each multi-agent model includes multiple virtual vehicles with a driving style, and then the natural automatic driving scene generation module 402 can use at least one model to generate a natural automatic driving scene, thereby achieving the simulation of the driving conditions of real human drivers with multiple different driving styles. In the present invention, the driving style of the virtual vehicle can be specified by a set of natural quantitative indicators, and each virtual vehicle can also adjust the driving strategy according to its own driving style and external information during driving, thereby accurately restoring the real driving scene, and providing reliable support for the human-like behavior test scene of the automatic driving system.
[0236] Optionally, the natural autonomous driving scenario generation module is specifically used to apply at least one multi-agent model to the CARLA simulation platform, so that the CARLA simulation platform generates a natural autonomous driving scenario based on the at least one multi-agent model, and performs safety verification of the autonomous driving system through the natural autonomous driving scenario.
[0237] Optionally, in the multi-agent model generation module, each virtual vehicle adjusts its driving strategy according to its own driving style and external information by using reinforcement learning during driving, including:
[0238] During the driving process, each virtual vehicle uses the self-attention mechanism to aggregate information based on its own driving style and external information to obtain aggregated information:
[0239] For virtual vehicles , calculate the virtual vehicle In time of , , :
[0240] ;
[0241] ;
[0242] ;
[0243] in, Represents a virtual vehicle In time of ; Represents the driving style and current dynamic state of the virtual vehicle; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time The status of Represents a virtual vehicle In time of ; Represents a virtual vehicle The surrounding traffic equipment information and the information of other virtual vehicles; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time of ; Detailed information required to represent specific actions of the other virtual vehicles or detailed description of surrounding traffic equipment information; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of
[0244] use and Calculate the attention weights:
[0245] ;
[0246] in, Represents a virtual vehicle In time For virtual vehicles The attention weight of Represents a virtual vehicle In time of ; Represents a continuous time series The cumulative variable of Indicates the offset of the time step;
[0247] according to and The aggregate information is calculated:
[0248] ;
[0249] in, Represents a virtual vehicle In time Aggregate information; Represents a virtual vehicle In time of ; Indicates the total number of virtual vehicles;
[0250] Based on the aggregated information, the driving strategy is adjusted using reinforcement learning.
[0251] Optionally, in the multi-agent model generation module, adjusting the driving strategy based on the aggregated information by using reinforcement learning includes:
[0252] During the driving process, each virtual vehicle estimates the cumulative rewards corresponding to the adoption of different driving strategies by itself using reinforcement learning based on the aggregated information; wherein any driving strategy is a speed adjustment strategy, a lane keeping and changing strategy, a traffic rule compliance strategy, an emergency obstacle avoidance strategy, or a navigation and path planning strategy; each driving strategy includes multiple actions; the cumulative reward is the sum of the feedback rewards obtained by the virtual vehicle after the driving strategy is estimated to be adopted for each action included in the driving strategy;
[0253] Each virtual vehicle adjusts its driving strategy based on the strategy to achieve the expected reward through the accumulated reward.
[0254] Optionally, the set of natural quantitative indicators includes a trajectory smoothness index, a dynamic decision continuity index, a traffic rule compliance index, a safety boundary compliance index, a collaborative consistency index and a conflict resolution efficiency index.
[0255] Optionally, any of the driving styles is defensive driving, aggressive driving, hesitant driving, confident driving, experienced driving, rule-following driving or situation-adaptive driving.
[0256] Optionally, a set of naturalness quantitative indicators for any virtual vehicle is obtained by:
[0257] Setting weights corresponding to various driving parameters of the virtual vehicle; the weights corresponding to various driving parameters are obtained by evaluating real-world vehicle driving data;
[0258] The driving parameters and the weights corresponding to the driving parameters are set in a reward function part of reinforcement learning, and the weights corresponding to the driving parameters are adjusted by reinforcement learning to obtain the adjusted weights corresponding to the driving parameters, so as to simulate the driving style of a real-world vehicle based on the adjusted weights corresponding to the driving parameters;
[0259] Obtaining a set of naturalness quantitative indicators of the virtual vehicle according to the weights corresponding to the adjusted driving parameters and the driving parameters of the virtual vehicle;
[0260] Among them, the expression of the reward function is:
[0261] ;
[0262] Indicates the accumulated rewards; Indicates the current time point; Indicates the offset of the time step; Indicates the preset discount factor; Indicates driving parameters; Indicates The weights corresponding to the driving parameters; Represents positive infinity.
[0263] It should be noted that, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0264] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.
[0265] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art can understand and implement other changes to the disclosed embodiments by viewing the drawings and the disclosed content. In the description of the present invention, the term "comprising" does not exclude other components or steps, "one" or "an" does not exclude multiple situations, and "multiple" means two or more, unless otherwise clearly and specifically limited. In addition, certain measures are recorded in different embodiments, but this does not mean that these measures cannot be combined to produce good results.
[0266] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A method for generating natural autonomous driving scenarios based on reinforcement learning, characterized in that: The method comprises: Generate multiple multi-agent models; each multi-agent model includes multiple virtual vehicles with a driving style; the driving style of each virtual vehicle is specified by a set of natural quantitative indicators; wherein each virtual vehicle adjusts its own driving strategy by reinforcement learning according to its own driving style and external information during driving; the external information includes information about surrounding traffic equipment and surrounding virtual vehicles; the set of natural quantitative indicators includes: trajectory smoothness index, dynamic decision continuity index, traffic rule compliance index, safety boundary compliance index, collaboration consistency index and conflict resolution efficiency index; the dynamic decision continuity index is used to measure the continuity between different dynamic decisions of the driver of the virtual vehicle; the safety boundary compliance index is used to measure whether the driver of the virtual vehicle tends to keep a safe distance from other vehicles, pedestrians and cyclists; the collaboration consistency index is used to describe the consistency and coordination of the driver of the virtual vehicle when cooperating with other road users; the conflict resolution efficiency index is used to measure the response and resolution speed of the driver of the virtual vehicle when encountering potential conflicts; During the driving process, each virtual vehicle adjusts its driving strategy by using reinforcement learning according to its own driving style and external information, including: During the driving process, each virtual vehicle uses the self-attention mechanism to aggregate information based on its own driving style and external information to obtain aggregated information: For virtual vehicles , the virtual vehicle is calculated in the process of the self-attention mechanism In time Query ,key , the value corresponding to the key : ; ; ; in, Represents a virtual vehicle In time of ; Represents the driving style and current dynamic state of the virtual vehicle; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time The status of Represents a virtual vehicle In time of ; Represents a virtual vehicle The surrounding traffic equipment information and the surrounding virtual vehicle information; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time of ; Detailed information required to represent specific actions of the surrounding virtual vehicles or a detailed description of surrounding traffic equipment information; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of use and Calculate the attention weights: ; in, Represents a virtual vehicle In time For virtual vehicles The attention weight of Represents a virtual vehicle In time of ; Represents a continuous time series The cumulative variable of Indicates the offset of the time step; according to and The aggregate information is calculated: ; in, Represents a virtual vehicle In time Aggregate information; Represents a virtual vehicle In time of ; Indicates the total number of virtual vehicles; Based on the aggregated information, adjusting the driving strategy using reinforcement learning; The adjusting the driving strategy based on the aggregated information by using reinforcement learning includes: During the driving process, each virtual vehicle estimates the cumulative rewards corresponding to the adoption of different driving strategies by itself using reinforcement learning based on the aggregated information; wherein any driving strategy is a speed adjustment strategy, a lane keeping and changing strategy, a traffic rule compliance strategy, an emergency obstacle avoidance strategy, or a navigation and path planning strategy; each driving strategy includes multiple actions; the cumulative reward is the sum of the feedback rewards obtained by the virtual vehicle after the driving strategy is estimated to be adopted for each action included in the driving strategy; Each virtual vehicle adjusts its driving strategy based on the strategy of achieving the expected reward through accumulated rewards; Generate naturalistic autonomous driving scenarios using at least one multi-agent model.
2. The method according to claim 1, characterized in that Generate naturalistic autonomous driving scenarios using at least one multi-agent model, including: At least one multi-agent model is applied to the CARLA simulation platform so that the CARLA simulation platform generates a natural autonomous driving scenario based on the at least one multi-agent model, and the safety of the autonomous driving system is verified through the natural autonomous driving scenario.
3. The method according to claim 1, characterized in that: Any of the driving styles are defensive driving, aggressive driving, hesitant driving, confident driving, experienced driving, rule-following driving or situation-adaptive driving.
4. The method according to claim 1, characterized in that: A set of quantitative naturalness indicators for any virtual vehicle is obtained in the following way: Setting weights corresponding to various driving parameters of the virtual vehicle; the weights corresponding to various driving parameters are obtained by evaluating real-world vehicle driving data; The driving parameters and the weights corresponding to the driving parameters are set in a reward function part of reinforcement learning, and the weights corresponding to the driving parameters are adjusted by reinforcement learning to obtain the adjusted weights corresponding to the driving parameters, so as to simulate the driving style of a real-world vehicle based on the adjusted weights corresponding to the driving parameters; Obtaining a set of naturalness quantitative indicators of the virtual vehicle according to the weights corresponding to the adjusted driving parameters and the driving parameters of the virtual vehicle; Among them, the expression of the reward function is: ; Indicates the accumulated rewards; Indicates the current time point; Indicates the offset of the time step; Indicates the preset discount factor; Indicates driving parameters; Indicates The weights corresponding to the driving parameters; Represents positive infinity.
5. A natural autonomous driving scene generation device based on reinforcement learning, characterized in that: The device comprises: A multi-agent model generation module is used to generate multiple multi-agent models; each multi-agent model includes multiple virtual vehicles with a driving style, and the driving style of each virtual vehicle is specified by a set of natural quantitative indicators; wherein each virtual vehicle adjusts its own driving strategy by reinforcement learning according to its own driving style and external information during driving; the external information includes information about surrounding traffic equipment and surrounding virtual vehicles; the set of natural quantitative indicators includes: trajectory smoothness index, dynamic decision continuity index, traffic rule compliance index, safety boundary compliance index, collaboration consistency index and conflict resolution efficiency index; the dynamic decision continuity index is used to measure the continuity between different dynamic decisions of the driver of the virtual vehicle; the safety boundary compliance index is used to measure whether the driver of the virtual vehicle tends to keep a safe distance from other vehicles, pedestrians and cyclists; the collaboration consistency index is used to describe the consistency and coordination of the driver of the virtual vehicle when cooperating with other road users; the conflict resolution efficiency index is used to measure the response and resolution speed of the driver of the virtual vehicle when encountering potential conflicts; During the driving process, each virtual vehicle adjusts its driving strategy by using reinforcement learning according to its own driving style and external information, including: During the driving process, each virtual vehicle uses the self-attention mechanism to aggregate information based on its own driving style and external information to obtain aggregated information: For virtual vehicles , the virtual vehicle is calculated in the process of the self-attention mechanism In time Query ,key , the value corresponding to the key : ; ; ; in, Represents a virtual vehicle In time of ; Represents the driving style and current dynamic state of the virtual vehicle; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time The status of Represents a virtual vehicle In time of ; Represents a virtual vehicle The surrounding traffic equipment information and the surrounding virtual vehicle information; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of Represents a virtual vehicle In time of ; Detailed information required to represent specific actions of the surrounding virtual vehicles or a detailed description of surrounding traffic equipment information; It is used to transfer the virtual vehicle In time The state representation is converted to The weight of use and Calculate the attention weights: ; in, Represents a virtual vehicle In time For virtual vehicles The attention weight of Represents a virtual vehicle In time of ; Represents a continuous time series The cumulative variable of Indicates the offset of the time step; according to and The aggregate information is calculated: ; in, Represents a virtual vehicle In time Aggregate information; Represents a virtual vehicle In time of ; Indicates the total number of virtual vehicles; Based on the aggregated information, adjusting the driving strategy using reinforcement learning; The adjusting the driving strategy based on the aggregated information by using reinforcement learning includes: During the driving process, each virtual vehicle estimates the cumulative rewards corresponding to the adoption of different driving strategies by itself using reinforcement learning based on the aggregated information; wherein any driving strategy is a speed adjustment strategy, a lane keeping and changing strategy, a traffic rule compliance strategy, an emergency obstacle avoidance strategy, or a navigation and path planning strategy; each driving strategy includes multiple actions; the cumulative reward is the sum of the feedback rewards obtained by the virtual vehicle after the driving strategy is estimated to be adopted for each action included in the driving strategy; A natural autonomous driving scene generation module is used to generate a natural autonomous driving scene using at least one multi-agent model.
6. The device according to claim 5, characterized in that The natural autonomous driving scenario generation module is specifically used to apply at least one multi-agent model to the CARLA simulation platform, so that the CARLA simulation platform generates a natural autonomous driving scenario based on the at least one multi-agent model, and verifies the safety of the autonomous driving system through the natural autonomous driving scenario.
Citation Information
Patent Citations
Multi-time-scale self-learning lane changing method considering personalized driving experience
CN112498354A
Automatic driving test scene generation method based on personalized driver model
CN114896869A
Self-driving automobile decision planning method based on character selection
CN116432454A
Vehicle intrusion coping method and device based on opposite vehicle driving behavior style
CN118025224A
Method and device for optimized resource allocation in autonomous driving on the basis of reinforcement learning using data from lidar, radar, and camera sensor
US10503174B1
