Automatic driving vehicle interaction control method based on reinforcement learning
By combining supervised learning and deep reinforcement learning, human driving experience and adaptive balanced sampling methods are used to solve the problem of low exploration efficiency of deep reinforcement learning in interactive control of autonomous driving vehicles, and improve the vehicle's decision-making ability and adaptability.
Patent Information
- Application Number
- CN202410671137.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-17
AI Technical Summary
Deep reinforcement learning has low exploration efficiency when the state space is continuous or large, resulting in slow learning of autonomous vehicle interactive control and difficulty in learning strategies with good performance. Traditional methods require a large amount of human driving data and human resources.
Combining supervised learning and deep reinforcement learning, human driving experience is used for model pre-training, and the proportion of human driving experience and self-exploration experience in the learning sample is adjusted through the adaptive balanced sampling method, and a reward function is designed to guide autonomous vehicles to learn interactions. control strategy.
It improves the decision-making ability, safety and adaptability of autonomous vehicles, reduces ineffective exploration during the learning process, and improves performance in complex traffic environments.
Smart Images

Figure CN118657190A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision, and in particular to an interactive control method for an autonomous driving vehicle based on reinforcement learning. Background Art
[0002] In today's rapidly developing field of autonomous driving technology, interactive control of driverless cars has become one of the key technical challenges for achieving a safe and efficient transportation system. Researchers and engineers are exploring how to solve the interactive control problem of driverless vehicles through efficient algorithms. Due to the complexity of the environment and the diversity of traffic participants, it is very challenging to achieve interactive control of vehicles in complex and changing traffic scenarios. Traditional methods usually rely on pre-defined rules, which are difficult to adapt to various driving scenarios. Therefore, rule-based methods are limited in practical applications. With the advancement of artificial intelligence (AI) technology, especially the development of machine learning and deep learning, methods based on deep reinforcement learning provide new ideas for solving the interactive control problem of autonomous vehicles.
[0003] Deep reinforcement learning is a technique that combines deep learning and reinforcement learning. It uses the learning ability of deep neural networks to understand complex, high-dimensional input data (such as images, videos, etc.), and uses reinforcement learning methods to guide how to make decisions based on these inputs to achieve a certain goal. Common deep reinforcement learning algorithms include deep Q-network, actor-critic, deep deterministic policy gradient, etc.
[0004] However, when the state space of deep reinforcement learning is continuous or large enough, one problem it faces is low exploration efficiency. Usually, reinforcement learning requires a lot of trial and error and interaction to learn the best strategy, which leads to slow learning speed and difficulty in learning strategies with good performance.
[0005] The Chinese invention patent application with application publication number CN116394968A discloses a method for controlling autonomous vehicles based on multi-agent reinforcement learning. It first considers the personalized needs of passengers and formulates different driving styles for AVs for use in the subsequent decision modeling process. By using coalition games and V2V communications, the multi-agent system is divided around each connected autonomous vehicle CAV to construct a cooperative decision-making area. Then, based on the rolling time domain in model predictive control, a deep reinforcement learning decision-making framework is constructed to realize the motion decision of CAV in the cooperative area. The disadvantage of this method is that it requires the collection of human driving data in advance, and the real-time participation of human drivers is required during the training process, which may require a certain amount of human resources. Summary of the invention
[0006] In order to solve the above-mentioned technical problems, the present invention proposes an interactive control method for autonomous driving vehicles based on reinforcement learning, which combines supervised learning and deep reinforcement learning and adds human driving experience to the learning samples. Human driving experience is used in the learning process to enable the unmanned vehicle to learn the optimal strategy. At the same time, an adaptive balanced sampling method is adopted to enable the autonomous driving vehicle to automatically adjust the sampling ratio of self-exploration experience and human driving experience at different learning stages, and a reward function is designed for different evaluation indicators to further guide the autonomous driving vehicle to better learn the interactive control strategy.
[0007] The present invention provides an interactive control method for an autonomous driving vehicle based on reinforcement learning, comprising obtaining data for model training, and further comprising the following steps:
[0008] Step 1: Pre-train the decision network;
[0009] Step 2: Formulate a reward function for reinforcement learning;
[0010] Step 3: Reinforcement learning model training;
[0011] Step 4: Test the learning model to verify the training effect;
[0012] Step 5: Apply the tested model to the interactive control system of the autonomous vehicle.
[0013] Preferably, the data used for model training includes self-exploration experience of autonomous driving vehicles and human driving experience.
[0014] In any of the above solutions, preferably, the self-exploration experience of the autonomous driving vehicle is expressed as Among them, s t is the current external environment state, is the driving action finally executed by the autonomous vehicle, r t is the current reward, s t+1 It is the state of the external environment at the next moment.
[0015] In any of the above solutions, preferably, the human driving experience is expressed as (s t ,a t ,r t ,s t+1 ), where a t The action currently being executed.
[0016] In any of the above solutions, preferably, the method for acquiring human driving experience is that the human driver observes the external environment state s t , and then perform the corresponding action a t , the environment transitions to the next state s t+1 , and feedback in state st Next, perform action a t The corresponding reward r t , and then from state s t+1 Start and repeat the above steps to collect human driving experience exceeding the threshold, where a t Including steering wheel angle and throttle / brake values.
[0017] In any of the above solutions, it is preferred that the decision network uses human driving experience (s t ,a t ,r t ,s t+1 ) in the state s t As training data, a t is the corresponding state s t The decision network is pre-trained with labels.
[0018] In any of the above solutions, preferably, the currently executed action a t By binary Indicates that each value ranges from -1 to 1;
[0019] Indicates the vehicle's steering wheel angle. A value less than 0 indicates a left turn, a value greater than 0 indicates a right turn, and a value equal to 0 indicates that the vehicle is in the return-to-center state, and the steering wheel is neither right nor left.
[0020] Indicates the accelerator and brake. A value less than 0 indicates braking, a value greater than 0 indicates accelerator, and a value equal to 0 indicates that both the accelerator and brake are in a no-load state, that is, neither the accelerator nor the brake is pressed.
[0021] In any of the above solutions, preferably, the loss function updated by the neural network during the pre-training process is:
[0022]
[0023] Where i = 1 or 2, θ is the parameter of the decision network, represents the i-th component of the action output by the decision network, It represents the i-th component of the action in human driving experience, and N represents the number of components of the driving action.
[0024] In any of the above solutions, preferably, after the pre-training is completed, a set of parameters with the smallest loss function is saved.
[0025] In any of the above solutions, preferably, step 2 includes formulating a reward function r based on the driving safety, driving efficiency and comfort of the autonomous driving vehicle. t , the formula is
[0026] rt =r speed +r collision +r mindis +r acc +r closse
[0027] Among them, r speed represents driving efficiency, r collision A parameter indicating whether the vehicle has collided, r mindis Represents the minimum distance to surrounding vehicles, r acc is the comfort measurement parameter, r closse A measurement parameter to determine whether the autonomous vehicle is approaching the destination.
[0028] In any of the above solutions, preferably, the driving efficiency r speed The calculation formula is
[0029]
[0030] Among them, v car is the vehicle speed,
[0031] When the vehicle speed is lower than 5 m / s, the driving efficiency r speed is a negative value;
[0032] When the vehicle speed is greater than 5m / s and less than or equal to 10m / s, the driving efficiency r speed is a positive value;
[0033] When the vehicle speed is greater than 10 m / s, the driving efficiency r speed Is a negative value.
[0034] In any of the above solutions, it is preferred that the parameter r indicating whether the vehicle has collided is collision The calculation formula is
[0035]
[0036] When a vehicle collides during driving, collision The value is -1000, which means r when no collision occurs. collision is 1.
[0037] In any of the above solutions, preferably, the minimum distance r from the surrounding vehicles is mindis The calculation formula is
[0038] r mindis =d min -5
[0039] Among them, d minIt represents the minimum distance between the center of the autonomous driving vehicle and other surrounding vehicles. When the minimum distance d min When the vehicle is less than 5 meters, the minimum distance r from the surrounding vehicles mindis is a negative value;
[0040] When the minimum distance d min When it is equal to 5 meters, the minimum distance r from the surrounding vehicles mindis is 0;
[0041] When the minimum distance d min When the vehicle is greater than 5 meters, the minimum distance r from the surrounding vehicles mindis In any of the above solutions, preferably, the comfort measurement parameter r acc The calculation formula is
[0042] r acc =min(0,2-|acc|)
[0043] Among them, acc is used to represent the acceleration of the autonomous driving vehicle.
[0044] When the absolute value of the acceleration acc of the autonomous driving vehicle is greater than 2, the comfort measurement parameter r acc is a negative value;
[0045] When the absolute value of the acceleration acc of the autonomous driving vehicle is less than or equal to 2, the comfort measurement parameter r acc is 0.
[0046] In any of the above solutions, it is preferred that the measurement parameter r for determining whether the autonomous driving vehicle is approaching the destination is closse The calculation formula is
[0047] r closse =distance t -distance t-1
[0048] Among them, distance t Indicates the distance between the current autonomous driving vehicle and the target location, distance t-1 Indicates the distance between the autonomous driving vehicle and the target position at the last moment;
[0049] When the autonomous driving vehicle approaches the target location, the measurement parameter r for determining whether the autonomous driving vehicle is approaching the destination closse is a positive value,
[0050] When the autonomous driving vehicle is far away from the target location, the measurement parameter r used to determine whether the autonomous driving vehicle is approaching the destination closse Is a negative value.
[0051] In any of the above schemes, it is preferred that the evaluation network includes a target network and a value network, the architectures of the two networks are completely consistent, the parameters of the value network are updated once each time they are learned, and the parameters of the target network are copies of the value network after a fixed number of learnings.
[0052] In any of the above schemes, preferably, step 3 includes the following sub-steps:
[0053] Step 31: Load the previously saved pre-trained decision network, and initialize the parameters of the target network and the value network using the default method;
[0054] Step 32: The autonomous vehicle observes the current environment state s t , through feature extraction and fusion as the input of the decision network;
[0055] Step 33: The decision network outputs the corresponding action according to the input feature vector Introducing real-time human guidance during training to supervise the learning process, that is, At the same time, the human driver also outputs corresponding actions based on the observed state. The driving action ultimately performed by the autonomous driving vehicle It's action and actions The weighted sum of
[0056] Step 34: The autonomous driving vehicle performs the driving action that is ultimately performed by the autonomous driving vehicle The environment transitions to a new state s according to this action t+1 , and give the corresponding reward r through the reward function t ;
[0057] Step 35: After the autonomous vehicle completes an interaction with the environment, it will gain a self-exploration experience And store it in the experience pool. When enough self-exploration experience is collected, the decision network and the judgment network can be learned and the parameters can be updated.
[0058] In any of the above solutions, preferably, the driving action finally performed by the autonomous driving vehicle The calculation formula is
[0059]
[0060] in, is the average reward value of human driving experience, r t-1For the reward of the previous moment, For Action The weight of .
[0061] In any of the above schemes, preferably, step 35 includes learning and updating parameters of the decision network and the judgment network when the self-exploration experience exceeding the quantity threshold is collected.
[0062] In any of the above solutions, preferably, the learning data of the decision network is the data used for model training, and the formula for sampling learning is:
[0063] B=(p~D H )∪(1-p~D E )
[0064] Among them, B represents a batch of learning samples, and p represents the human driving experience D in this batch of learning samples. H The proportion of D E It represents the exploration experience of the autonomous vehicle.
[0065] In any of the above schemes, preferably, the calculation formula of the ratio p is:
[0066]
[0067] Among them, r t represents the current reward of the autonomous vehicle during exploration, is the average reward value of human driving experience, the minimum value of p is 0 and the maximum value is 1.
[0068] In any of the above schemes, it is preferred that when the average reward of the autonomous driving vehicle exceeds the improvement threshold, the proportion of self-exploration experience in the learning sample is increased accordingly, and the loss function The calculation formula is
[0069]
[0070] in, represents the mathematical expectation, represents the data sample used for value network learning, γ is the attenuation factor, and are the parameters of the value network and the target network, μ(s t+1 ; θ′) is the next state s determined by the decision network t+1 The next action, is the target network's estimate of the value of the next state and the next action, It is the value network's estimate of the value of the current state and action.
[0071] In any of the above schemes, it is preferred that after the value network completes a certain number of learnings, the parameters of the value network are completely assigned to the target network. At this time, the loss function of the decision network is the negative value of the action value generated by the current strategy evaluated by the target network, that is:
[0072]
[0073] Among them, μ(s t ; θ)μ is the decision network to determine the state s t The next action a t , is the action value given the state and action.
[0074] The present invention proposes an interactive control method for autonomous driving vehicles based on reinforcement learning. Through an innovative interactive control strategy, it combines supervised learning with the actor-critic model in deep reinforcement learning and introduces human driving experience into learning samples, thereby improving the decision-making ability, safety and adaptability of driverless cars. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 The present invention is a flowchart of a preferred embodiment of the interactive control method of an autonomous driving vehicle based on reinforcement learning according to the present invention.
[0076] Figure 2 The figure is a schematic diagram of the input and output of the Actor network according to a preferred embodiment of the interactive control method of an autonomous driving vehicle based on reinforcement learning of the present invention.
[0077] Figure 3 A schematic diagram of a reinforcement learning framework according to a preferred embodiment of the reinforcement learning-based autonomous driving vehicle interactive control method of the present invention.
[0078] Figure 4 A schematic diagram of a simulation environment according to a preferred embodiment of the interactive control method of an autonomous driving vehicle based on reinforcement learning of the present invention.
[0079] Figure 5 A schematic diagram of a new test scenario according to a preferred embodiment of the reinforcement learning-based autonomous driving vehicle interactive control method of the present invention. DETAILED DESCRIPTION
[0080] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0081] Embodiment 1
[0082] like Figure 1As shown, step 100 is executed to obtain data for model training, where the data for model training includes the self-exploration experience of the autonomous driving vehicle and the driving experience of humans.
[0083] The self-exploration experience of the autonomous vehicle is expressed as The human driving experience is expressed as (s t ,a t ,r t ,s t+1 ), where s t is the current external environment state, for..., a t is the currently executed action, r t is the current reward, s t+1 It is the state of the external environment at the next moment.
[0084] The method for acquiring human driving experience is that the human driver observes the external environment state s t , and then perform the corresponding action a t , the environment transitions to the next state s t+1 , and feedback in state s t Next, perform action a t The corresponding reward r t , and then from state s t+1 Start and repeat the above steps to collect human driving experience exceeding the threshold, where a t Including the steering wheel angle and throttle / brake value, the quantity threshold in this embodiment is 10,000.
[0085] Step 110 is executed to pre-train the decision network, wherein the decision network uses human driving experience (s t ,a t ,r t ,s t+1 ) in the state s t As training data, a t is the corresponding state s t The decision network is pre-trained with the label of t By binary Indicates that each value ranges from -1 to 1; Indicates the vehicle's steering wheel angle. A value less than 0 indicates a left turn, a value greater than 0 indicates a right turn, and a value equal to 0 indicates that the vehicle is in the return-to-center state, and the steering wheel is neither right nor left. Indicates the accelerator and brake. A value less than 0 indicates braking, a value greater than 0 indicates accelerator, and a value equal to 0 indicates that both the accelerator and brake are in a no-load state, that is, neither the accelerator nor the brake is pressed.
[0086] The loss function of the neural network update during the pre-training process is
[0087]
[0088] Where i = 1 or 2, θ is the parameter of the decision network, represents the i-th component of the action output by the decision network, represents the i-th component of the action in human driving experience, N represents the number of components of the driving action, in this implementation, N=2, representing action a t There are two components and
[0089] After the pre-training is completed, a set of parameters with the smallest loss function is saved.
[0090] Execute step 120 to formulate a reward function for reinforcement learning, including formulating a reward function r based on the driving safety, driving efficiency and comfort of the autonomous driving vehicle. t , the formula is
[0091] r t =r speed +r collision +r mindis +r acc +r closse
[0092] Among them, r speed represents driving efficiency, r collision A parameter indicating whether the vehicle has collided, r mindis Represents the minimum distance to surrounding vehicles, r acc is the comfort measurement parameter, r closse A measurement parameter to determine whether the autonomous vehicle is approaching the destination.
[0093] The driving efficiency r speed The calculation formula is
[0094]
[0095] Among them, v car is the vehicle speed,
[0096] When the vehicle speed is lower than 5m / s, the reward is negative;
[0097] When the vehicle speed is greater than 5m / s and less than or equal to 10m / s, the reward is positive;
[0098] When the vehicle speed is greater than 10m / s, the reward is negative;
[0099] In this embodiment, in reinforcement learning, the reward is related to the driving efficiency r speed It's the same.
[0100] The parameter r of whether the vehicle has collided collision The calculation formula is
[0101]
[0102] When a vehicle collides during driving, collision The value is -1000, which means r when no collision occurs. collision is 1.
[0103] The minimum distance r from surrounding vehicles mindis The calculation formula is
[0104] r mindis =d min -5
[0105] Among them, d min It represents the minimum distance between the center of the autonomous driving vehicle and other surrounding vehicles. When the minimum distance d min When the vehicle is less than 5 meters, the minimum distance r from the surrounding vehicles mindis is a negative value;
[0106] When the minimum distance d min When it is equal to 5 meters, the minimum distance r from the surrounding vehicles mindis is 0;
[0107] When the minimum distance d min When the vehicle is greater than 5 meters, the minimum distance r from the surrounding vehicles mindis The comfort measurement parameter r acc The calculation formula is
[0108] r acc =min(0,2-|acc|)
[0109] Among them, acc is used to represent the acceleration of the autonomous driving vehicle.
[0110] When the absolute value of the acceleration acc of the autonomous driving vehicle is greater than 2, the comfort measurement parameter r acc is a negative value;
[0111] When the absolute value of the acceleration acc of the autonomous driving vehicle is less than or equal to 2, the comfort measurement parameter r acc is 0.
[0112] The measurement parameter r for determining whether the autonomous driving vehicle is approaching the destination closse The calculation formula is
[0113] r closse =distance t -distance t-1
[0114] Among them, distance t Indicates the distance between the current autonomous driving vehicle and the target location, distance t-1 Indicates the distance between the autonomous driving vehicle and the target position at the last moment;
[0115] When the autonomous driving vehicle approaches the target location, the measurement parameter r for determining whether the autonomous driving vehicle is approaching the destination closse is a positive value,
[0116] When the autonomous driving vehicle is far away from the target location, the measurement parameter r used to determine whether the autonomous driving vehicle is approaching the destination closse Is a negative value.
[0117] Step 130 is executed to strengthen the learning model training. The evaluation network includes a target network and a value network, and the architectures of the two networks are completely the same. The parameters of the value network are updated once each time they are learned, and the parameters of the target network are copies of the value network after a fixed number of learnings.
[0118] The training method includes the following sub-steps:
[0119] Execute step 131 to load the previously saved pre-trained decision network as the Actor network, and initialize the parameters of the target network and the value network in a default manner.
[0120] Execute step 132, the autonomous driving vehicle observes the current environment state s t , through feature extraction and fusion as the input of the decision network.
[0121] Execute step 133, the decision network outputs the corresponding action according to the input feature vector Introducing real-time human guidance during training to supervise the learning process, that is, At the same time, the human driver also outputs corresponding actions based on the observed state. The driving action to be performed It's action and actions The weighted sum of is calculated as
[0122]
[0123] in, is the average reward value of human driving experience, r t-1 For the reward of the previous moment, For Action The weight of .
[0124] Execute step 134, the autonomous driving vehicle performs the selected action The environment transitions to a new state s according to this action t+1 , and give the corresponding reward r through the reward function t .
[0125] Execute step 135. After the autonomous driving vehicle completes one interaction with the environment, it can obtain a self-exploration experience. And store it in the experience pool. When the self-exploration experience exceeds the quantity threshold (the quantity threshold is 10,000), the decision network and the judgment network are learned and the parameters are updated.
[0126] The learning data of the decision network is the data used for model training, and the formula for sampling learning is:
[0127] B=(p~D H )∪(1-p~D E )
[0128] Among them, B represents a batch of learning samples, and p represents the human driving experience D in this batch of learning samples. H The proportion of D E It represents the exploration experience of the autonomous vehicle.
[0129] The calculation formula of the ratio p is:
[0130]
[0131] Among them, r t represents the current reward of the autonomous vehicle during exploration, is the average reward value of human driving experience, the minimum value of p is 0 and the maximum value is 1.
[0132] When the average reward of the autonomous vehicle exceeds the improvement threshold, the proportion of self-exploration experience in the learning sample is increased accordingly, and the loss function The calculation formula is
[0133]
[0134] in, represents the mathematical expectation, represents the data sample used for value network learning, γ is the attenuation factor, and are the parameters of the value network and the target network, μ(s t+1 ; θ′) is the next state s determined by the decision network t+1 The next action, is the target network's estimate of the value of the next state and the next action, It is the value network's estimate of the value of the current state and action.
[0135] When the value network completes a certain number of learnings, the parameters of the value network are completely assigned to the target network. At this time, the loss function of the decision network is the negative value of the action value generated by the current strategy evaluated by the target network, that is:
[0136]
[0137] Among them, μ(s t ; θ)μ is the decision network to determine the state s t The next action a t , is the action value given the state and action.
[0138] Execute step 140 to test the learning model and verify the training effect.
[0139] Execute step 150 to apply the tested model to the interactive control system of the autonomous driving vehicle.
[0140] Embodiment 2
[0141] This paper proposes a reinforcement learning control method for unmanned vehicles based on human driving behavior and adaptive balanced sampling supervision. Unlike traditional reinforcement learning, it combines supervised learning with deep reinforcement learning and adds human driving experience to the learning samples. Human driving experience is used in the learning process to enable unmanned vehicles to learn the optimal strategy. In addition, an adaptive balanced sampling method is designed to enable the autonomous driving vehicle to automatically adjust the sampling ratio of self-exploration experience and human driving experience at different learning stages, and a reward function is designed for different evaluation indicators to further guide the autonomous driving vehicle to better learn interactive control strategies.
[0142] The present invention is dedicated to solving the main challenges faced by driverless cars in complex and changing traffic environments. Through an innovative interactive control strategy, combined with supervised learning and the actor-critic model in deep reinforcement learning and the introduction of human driving experience in learning samples, the aim is to improve the decision-making ability, safety and adaptability of driverless cars. The objectives of the present invention include but are not limited to the following:
[0143] 1) Learn from human driving experience and enhance emergency response capabilities: By deeply analyzing and imitating the decision-making process and behavior patterns of human drivers in complex traffic environments, the present invention intends to build an intelligent system that can make human-like decisions in unknown or emergency situations. This will not only help improve the response speed and decision-making quality of unmanned vehicles in the face of emergencies, but also make their behavior more in line with human driving habits, thereby improving safety and harmony when sharing the road with human drivers.
[0144] 2) Apply supervised learning to improve exploration efficiency: Utilize a large amount of labeled driving data and pre-train the decision model through supervised learning methods to improve the exploration efficiency of the model in the reinforcement learning stage and reduce its ineffective exploration. This process will enable driverless cars to understand their surroundings more accurately and improve driving safety and efficiency under normal road conditions.
[0145] 3) Using deep reinforcement learning to improve autonomous learning and decision-making capabilities: The present invention uses deep reinforcement learning to improve the autonomous learning ability of driverless cars in complex environments without training, allowing the vehicle to continuously interact with the environment and continuously optimize its behavior strategy to adapt to new or changing road conditions, thereby enhancing its adaptability and flexibility in unknown environments.
[0146] 4) Achieve efficient interaction in multiple environments and optimize traffic flow: The present invention uses advanced collaborative control strategies to enable driverless cars to work efficiently in multiple environments, including urban streets, highways, and complex natural environments. This helps to improve the versatility and reliability of driverless vehicles, optimize overall traffic flow, reduce congestion, and improve road use efficiency.
[0147] This paper proposes a new interactive control strategy for unmanned vehicles, aiming to comprehensively improve the performance of unmanned vehicles in complex traffic environments and ensure that they can operate safely, efficiently and intelligently in future road traffic systems. The specific technical solutions are as follows:
[0148] 1. Data acquisition for model training
[0149] In the present invention, the data used for model training includes two parts, namely, the self-exploration experience of the autonomous driving vehicle and the human driving experience. The human driving experience needs to be collected first.
[0150] Human driving experience is obtained by human drivers controlling vehicles in traffic environments. Human driving experience consists of the current state, current action, current reward, and next state (s t ,a t ,r t ,s t+1 ) means that human drivers observe the external environment state st , and then perform the corresponding action a t , a t It indicates the steering wheel angle and throttle / brake value, and the environment transitions to the next state s t+1 , and feedback in state s t Next, perform action a t The corresponding reward r t , and then from state s t+1 Start and repeat the above steps to collect enough human driving experience. The driving action of the vehicle's self-exploration experience is derived from the algorithm model, and the vehicle's self-exploration experience is expressed as
[0151] 2. Pre-training of decision network
[0152] The basic model of reinforcement learning of the present invention is composed of a decision network and a judgment network. The decision network selects actions according to the current environmental state, that is, the input is the state and the output is the action, and it is responsible for decision-making. The judgment network evaluates the quality of the action selected by the decision network by estimating the state value function under the current strategy, that is, it is responsible for evaluation.
[0153] Before training the entire model, it is necessary to pre-train the decision network using human driving experience so that the driverless car can learn some basic driving skills to a certain extent. The decision network of the present invention is named Actor. Actor uses the collected human driving experience (s t ,a t ,r t ,s t+1 ) in the state s t As training data, a t is the corresponding state s t The decision network is pre-trained with labels. t By binary Indicates that each value ranges from -1 to 1. Indicates the vehicle steering wheel angle. A value less than 0 indicates a left turn, and a value greater than 0 indicates a right turn. Indicates accelerator and brake, less than 0 indicates brake, greater than 0 indicates accelerator. The loss function of the neural network update during pre-training is
[0154]
[0155] i=1, 2, θ is the parameter of the network Actor, represents the i-th component of the action output by the Actor network, It represents the i-th component of the action in human driving experience, that is, it represents the steering wheel angle and the accelerator / brake value respectively. The training is completed when the loss function is minimized. After the training is completed, the set of parameters with the minimum loss function is saved for subsequent use.
[0156] 3. Reward Function Formulation for Reinforcement Learning
[0157] Each time the autonomous vehicle is in state s t Next action After that, the environment transitions to the next state s t+1 And return the corresponding reward r t , when the vehicle performs a good action, the reward is positive; when r t When it is a negative penalty, it means that the action performed by the vehicle is not desirable. Based on the driving safety, driving efficiency and comfort of the autonomous driving vehicle, the following reward function is designed:
[0158] r t =r speed +r collision +r mindis +r acc +r closse (2)
[0159] r speed Represents driving efficiency,
[0160]
[0161] v car Represents the speed of the vehicle in m / s. When the vehicle speed is less than 5m / s, the reward is negative; when the vehicle speed is greater than 5m / s, a positive reward is given; for safety reasons, when the vehicle speed is greater than 10m / s, the reward is also negative. collision and r mindis Represents whether the vehicle has collided and the minimum distance from surrounding vehicles.
[0162]
[0163] r mindis =d min -5(5)
[0164] , when a vehicle collides during driving, r collision The value is -1000, and the training ends; r collision The value is 1. mindis The reward d represents the distance between the center of the autonomous vehicle and other surrounding vehicles. min Represents the minimum distance between the center of the autonomous vehicle and other surrounding vehicles. When the minimum distance is less than 5 meters, a corresponding penalty will be given.acc To measure comfort:
[0165] r acc =min(0,2-|acc|)(6)
[0166] acc is used to represent the acceleration of the autonomous vehicle. When the absolute value of the acceleration of the autonomous vehicle is greater than 2m / s 2 , will receive a penalty, otherwise the term is 0. closse Used to measure whether the autonomous vehicle is approaching its destination.
[0167] r closse =distance t -distance t-1 (7)
[0168] distance t and distance t-1 Represents the distance between the autonomous driving vehicle and the target position at the current moment and the previous moment, respectively, in meters (m). That is, when the autonomous driving vehicle approaches the target position, the reward is positive, and when the vehicle is far away from the target position, the reward is negative.
[0169] 4. Reinforcement Learning Model Training
[0170] After the decision network Actor is pre-trained, the entire model is trained using the reinforcement learning method. The judgment network consists of two networks called target and value. The architecture of the two networks is exactly the same, but the parameters of the value network are updated every time they are learned, and the parameters of the target network are a copy of the value network after a fixed number of learning, so as to ensure the stability of learning. The steps are as follows:
[0171] a. Initialization. Before loading the Actor, the decision network is pre-trained to complete the network parameters, and the target and value network parameters are initialized using the default method.
[0172] b. Observe the environment state: The autonomous vehicle observes the current environment state s t , through feature extraction and fusion as the input of the Actor network.
[0173] c. Select an action. The Actor network outputs the corresponding action based on the input feature vector. Introduce real-time human guidance during the training process to supervise the learning process, that is, when the Actor outputs an action At the same time, the human driver also outputs corresponding actions based on the observed state. The driving action that is ultimately to be performed is the weighted sum of the two.
[0174]
[0175] is the average reward value of human driving experience, that is, all human driving experience collected before (s t ,a t ,r t ,s t+1 ) t The mean of The minimum value is 0 and the maximum value is 1. That is, if the autonomous vehicle performs well in the previous moment, it is believed that the Actor decision of the autonomous vehicle can bring good benefits. The decision result of the next moment The weight of the decision will increase accordingly; when its performance at the previous moment is poor, the weight of the autonomous driving car's decision needs to be reduced and the weight of the human driver's decision needs to be increased.
[0176] d. Execute action, environmental feedback. The autonomous vehicle executes the selected action The environment transitions to a new state s according to this action t+1 , and give the corresponding reward r through the reward function t .
[0177] e. Learning and strategy updating. After an autonomous vehicle completes an interaction with the environment, it can gain a self-exploration experience. The data is stored in the experience pool (the experience pool also stores the previously collected human driving experience). When enough self-exploration experience is collected, the decision network and the judgment network can be learned and the parameters updated. t ,a t ,r t ,s t+1 ) and vehicle self-exploration experience Together, sampling learning is performed through the following formula:
[0178] B=(p~D H )∪(1-p~D E )(9)
[0179] B represents a batch of learning samples, and p represents the human driving experience D in this batch of learning samples. H The proportion of D E represents the exploration experience of the autonomous vehicle, where:
[0180]
[0181] r trepresents the current reward of the autonomous vehicle during exploration, represents the average reward of human drivers, the minimum value of p is 0 and the maximum value is 1. When the average reward of autonomous vehicles is low, the sampling ratio of human driving experience will be increased. When the average reward of autonomous vehicles has increased to a certain extent, the proportion of self-exploration experience in learning samples will increase accordingly. The loss function is as follows:
[0182]
[0183] Represents the data samples used for value network learning, which are derived from human driving experience (s t ,a t ,r t ,s t+1 ) and ego vehicle exploration experience Together, γ is the attenuation factor with a value between 0 and 1. and are the parameters of the value network and the target network, r t is the current reward, μ(s t+1 ; θ′) is the next state s determined by the Actor network t+1 The next action, is the target network's estimate of the value of the next state and the next action, It is the value network's estimate of the value of the current state and action. When the value network completes a certain number of learnings, the parameters of the value network are completely assigned to the target network. The loss function of the actor network can be the negative value of the action value generated by the current strategy evaluated by the target network, that is:
[0184]
[0185] μ(s t ; θ) is the state s determined by the Actor network t The next action a t , is the action value given the state and action.
[0186] f. Repeat steps be until the maximum number of steps is met, the training ends, and the set of network parameters with the highest average reward value is saved.
[0187] 5. Model Testing
[0188] After training is complete, the performance of the learned policy is evaluated in new environments.
[0189] Embodiment 3
[0190] This embodiment discloses the pre-training process of the decision network Actor, such as Figure 2 Shown are the inputs and outputs of the Actor network.
[0191] The autonomous driving vehicle control method proposed in the present invention is experimentally verified in a virtual simulation environment. The simulation software is the CARLA simulator used for autonomous driving research and development, and its version number is 0.9.13.
[0192] Before the entire deep reinforcement learning model is trained, the decision network actor needs to be pre-trained first, so that it can learn some collaborative control skills first to avoid collisions at the beginning of deep reinforcement learning. The pre-training stage only involves the input and output of the decision network actor, such as Figure 1 This stage uses supervised learning for training, that is, input s t Output a for image, radar, self and other vehicle information t Represents the vehicle's own steering wheel angle and throttle / brake value, the data used for pre-training s t and a t Derived from human driving experience (s t ,a t ,r t ,s t+1 ), a t is the corresponding state s t Action label. Human driving experience (s t ,a t ,r t ,s t+1 ) is obtained by human drivers controlling vehicles to drive in a virtual simulation environment. Taking the town scene in CARLA as the simulation environment, 32,673 data were collected and screened by human drivers controlling vehicles to drive in the town. 26,138 data were randomly selected as the data set, and the rest were used as the validation set to complete the pre-training of the decision network. In the pre-training stage, the loss function was calculated by formula (1) and the network parameters were updated by gradient descent.
[0193]
[0194] i=1,2, θ is the parameter of the network Actor, represents the i-th component of the action output by the Actor network, It represents the i-th component of the action in human driving experience, that is, it represents the steering wheel angle and the accelerator / brake value respectively. The training is completed when the loss function is minimized. After the training is completed, the set of parameters with the minimum loss function is saved for subsequent use.
[0195] Embodiment 4
[0196] This embodiment discloses the pre-training process of the decision network Actor, such as Figure 3 The figure shows the theoretical framework of the interactive control method for unmanned vehicles. The basic process is as follows: the autonomous driving vehicle observes the environment state s at time t. t , state s t It is represented by three parts: the RGB image collected by the vehicle's front camera, the 16-line laser radar point cloud data, and the status information of itself and other vehicles. For the RGB image, Unet is used to perform semantic segmentation on the original image, so that the key features in the image (such as the relative position of surrounding vehicles) can be better extracted, and then feature extraction is performed on the semantic segmentation image. The point cloud data is extracted using the PointNet network. The information of itself and other vehicles includes steering wheel angle, throttle / brake value, vehicle speed, acceleration, steering angular velocity, steering angular acceleration, distance from the destination, and the vehicle's own position. After being represented by a one-dimensional vector, feature encoding is performed. In this way, vehicles can share information and better complete the interactive control of themselves and other vehicles. Then the three features of image, point cloud and vehicle information are fused, and the fused and summed features are used as the input of the decision network Actor, and the action is output according to the strategy. At the same time, RGB images, point clouds and the vehicle's own status can also be observed by human drivers, who output vehicle control actions in real time based on this information. right and Perform weighted summation to obtain This is the steering wheel angle and throttle / brake value that the autonomous vehicle will eventually output. After that, the environment returns the corresponding reward r t and transition to the next state s t+1 After completing an exploration, a vehicle self-exploration experience is collected. And store it in, and also store the previously collected human driving experience (s t ,a t ,r t ,s t+1 ). After collecting enough self-exploration experience, each time the exploration is completed, the value network performs sampling learning according to formula (9) and calculates the loss function according to formula (11) to update the gradient descent of the neural network parameters. Whenever the value network completes a certain number of learning, its parameters are completely assigned to the target network. The actor network calculates the loss function according to formula (12) to update the parameters by gradient ascent. Through continuous exploration, the model algorithm is continuously updated and optimized.
[0197] B=(p~DH )∪(1-p~D E ) (9)
[0198] B represents a batch of learning samples, and p represents the human driving experience D in this batch of learning samples. H The proportion of D E represents the exploration experience of the autonomous vehicle, where:
[0199]
[0200] r t represents the current reward of the autonomous vehicle during exploration, represents the average reward of human drivers, the minimum value of p is 0 and the maximum value is 1. When the average reward of autonomous vehicles is low, the sampling ratio of human driving experience will be increased. When the average reward of autonomous vehicles has increased to a certain extent, the proportion of self-exploration experience in learning samples will increase accordingly. The loss function is as follows:
[0201]
[0202] Represents the data samples used for value network learning, which are derived from human driving experience (s t ,a t ,r t ,s t+1 ) and ego vehicle exploration experience Together, γ is the attenuation factor with a value between 0 and 1. and are the parameters of the value network and the target network, r t is the current reward, μ(s t+1 ; θ′) is the next state s determined by the Actor network t+1 The next action, is the target network's estimate of the value of the next state and the next action, It is the value network's estimate of the value of the current state and action.
[0203] like Figure 4 The following is a schematic diagram of the simulation environment. The scene is a town scene in CARLA. 40 traffic participants are randomly initialized in the scene, including vehicles, pedestrians, etc. Figure 3 As shown in (a), in the scene, two points are randomly selected as the starting point and destination of the autonomous driving vehicle (the distance between the starting point and the destination is the same each time initialization is performed), and the autonomous driving vehicle is initialized at the starting point. The autonomous driving vehicle needs to make a decision according to the control method proposed in the present invention and control itself to drive from the starting point to the destination. Figure 3 The red vehicle in (b) is one of the autonomous driving vehicles controlled by the method of the present invention. In the scene, three vehicles controlled by the method of the present invention are set at the same time. The method of the present invention has relevant information about the vehicle itself and other vehicles in the model input, based on which information sharing and vehicle communication between vehicles are completed. The three vehicles need to complete the autonomous driving task from the starting point to the destination under the interactive control method proposed by the present invention, and ensure their safety and traffic efficiency as much as possible.
[0204] Embodiment 5
[0205] This embodiment discloses a new test scenario process. After the training is completed, two other scenarios in CARLA, the city scenario and the town scenario, are selected as new verification scenarios. Figure 5 As shown. The verification method is also to generate 3 vehicles controlled by the algorithm and 40 traffic participants (including vehicles, pedestrians, etc.), randomly select the starting point and destination for these 3 vehicles in the scene, and output the steering wheel angle and throttle / brake value of the vehicle through the algorithm to control the vehicle to drive to the destination safely and efficiently. By verifying the trained model in an unfamiliar environment, the robustness of the present invention in the face of more complex traffic environments is demonstrated.
[0206] In order to better understand the present invention, the above is described in detail in conjunction with the specific embodiments of the present invention, but it is not intended to limit the present invention. Any simple modifications made to the above embodiments based on the technical essence of the present invention still fall within the scope of the technical solution of the present invention. Each embodiment in this specification focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referenced to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. An interactive control method for an autonomous driving vehicle based on reinforcement learning, comprising obtaining data for model training, characterized in that: The following steps are also included: Step 1: Pre-train the decision network; Step 2: Formulate a reward function for reinforcement learning; Step 3: Reinforcement learning model training; Step 4: Test the learning model to verify the training effect; Step 5: Apply the tested model to the interactive control system of the autonomous vehicle.
2. The interactive control method for an autonomous driving vehicle based on reinforcement learning according to claim 1, characterized in that: The data used for model training includes the self-exploration experience of the autonomous driving vehicle and the human driving experience. The self-exploration experience of the autonomous driving vehicle is represented as The human driving experience is expressed as (s t ,a t ,r t ,s t+1 ), where s t is the current external environment state, is the driving action finally performed by the autonomous vehicle, a t is the currently executed action, r t is the current reward, s t+1 It is the state of the external environment at the next moment.
3. The interactive control method for an autonomous driving vehicle based on reinforcement learning as claimed in claim 2, characterized in that: The method for acquiring human driving experience is that the human driver observes the external environment state s t , and then perform the corresponding action a t , the environment transitions to the next state s t+1 , and feedback in state s t Next, perform action a t The corresponding reward r t , and then from state s t+1 Start and repeat the above steps to collect human driving experience exceeding the threshold, where a t Including steering wheel angle and throttle / brake values.
4. The interactive control method for an autonomous driving vehicle based on reinforcement learning as claimed in claim 3, characterized in that: The decision network uses human driving experience (s t ,a t ,r t ,s t+1 ) in the state s t As training data, a t is the corresponding state s t The decision network is pre-trained with the label of t By binary Indicates that each value ranges from -1 to 1; Indicates the vehicle's steering wheel angle. A value less than 0 indicates a left turn, a value greater than 0 indicates a right turn, and a value equal to 0 indicates that the vehicle is in the return-to-center state, and the steering wheel is neither right nor left. Indicates the accelerator and brake. A value less than 0 indicates braking, a value greater than 0 indicates accelerator, and a value equal to 0 indicates that both the accelerator and brake are in a no-load state, that is, neither the accelerator nor the brake is pressed.
5. The interactive control method for an autonomous driving vehicle based on reinforcement learning as claimed in claim 4, characterized in that: The loss function of the neural network update during the pre-training process is Where i = 1 or 2, θ is the parameter of the decision network, represents the i-th component of the action output by the decision network, It represents the i-th component of the action in human driving experience, and N represents the number of components of the driving action.
6. The interactive control method for an autonomous driving vehicle based on reinforcement learning as claimed in claim 5, characterized in that: The step 2 includes formulating a reward function r based on the driving safety, driving efficiency and comfort of the autonomous driving vehicle. t , the formula is r t =r speed +r collision +r mindis +r acc +r closse Among them, r speed represents driving efficiency, r collision A parameter indicating whether the vehicle has collided, r mindis Represents the minimum distance to surrounding vehicles, r acc is the comfort measurement parameter, r closse A measurement parameter to determine whether the autonomous vehicle is approaching the destination; The driving efficiency r speed The calculation formula is Among them, v car is the vehicle’s speed, When the vehicle speed is lower than 5 m / s, the driving efficiency r speed is a negative value; When the vehicle speed is greater than 5m / s and less than or equal to 10m / s, the driving efficiency r speed is a positive value; When the vehicle speed is greater than 10 m / s, the driving efficiency r speed is a negative value; The parameter r of whether the vehicle has collided collision The calculation formula is When a vehicle collides during driving, collision The value is -1000, which means r when no collision occurs. collision is 1; The minimum distance r from surrounding vehicles mindis The calculation formula is r mindis =d min -5 Among them, d min It represents the minimum distance between the center of the autonomous driving vehicle and other surrounding vehicles. When the minimum distance d min When the vehicle is less than 5 meters, the minimum distance r from the surrounding vehicles mindis is a negative value; When the minimum distance d min When it is equal to 5 meters, the minimum distance r from the surrounding vehicles mindis is 0; when the minimum distance d min When the vehicle is greater than 5 meters, the minimum distance r from the surrounding vehicles mindis is a positive value; The comfort measurement parameter r acc The calculation formula is r acc =min(0,2-|acc|) Among them, acc is used to represent the acceleration of the autonomous driving vehicle. When the absolute value of the acceleration acc of the autonomous driving vehicle is greater than 2, the comfort measurement parameter r acc is a negative value; When the absolute value of the acceleration acc of the autonomous driving vehicle is less than or equal to 2, the comfort measurement parameter r acc is 0; The measurement parameter r for determining whether the autonomous driving vehicle is approaching the destination closse The calculation formula is r closse =distance t -distance t-1 Among them, distance t Indicates the distance between the current autonomous driving vehicle and the target location, distance t-1 Indicates the distance between the autonomous driving vehicle and the target position at the last moment; When the autonomous driving vehicle approaches the target location, the measurement parameter r for determining whether the autonomous driving vehicle is approaching the destination closse is a positive value; When the autonomous driving vehicle is far away from the target location, the measurement parameter r used to determine whether the autonomous driving vehicle is approaching the destination closse Is a negative value.
7. The interactive control method for an autonomous driving vehicle based on reinforcement learning according to claim 6, characterized in that: The evaluation network includes a target network and a value network. The architectures of the two networks are exactly the same. The parameters of the value network are updated every time they are learned, and the parameters of the target network are copies of the value network after a fixed number of learnings.
8. The interactive control method for an autonomous driving vehicle based on reinforcement learning as claimed in claim 7, characterized in that: The step 3 includes the following sub-steps: Step 31: Load the previously saved pre-trained decision network, and initialize the parameters of the target network and the value network using the default method; Step 32: The autonomous vehicle observes the current environment state s t , through feature extraction and fusion as the input of the decision network; Step 33: The decision network outputs the corresponding action according to the input feature vector Introducing real-time human guidance during training to supervise the learning process, that is, At the same time, the human driver also outputs corresponding actions based on the observed state. The driving action ultimately performed by the autonomous driving vehicle It's action and actions The weighted sum of is calculated as in, is the average reward value of human driving experience, r t-1 For the reward of the previous moment, For Action The weight of Step 34: The autonomous driving vehicle performs the driving action that is ultimately performed by the autonomous driving vehicle The environment transitions to a new state s according to this action t+1 , and give the corresponding reward r through the reward function t ; Step 35: After the autonomous vehicle completes an interaction with the environment, it will gain a self-exploration experience And store it in the experience pool. When the self-exploration experience exceeding the quantity threshold is collected, the decision network and the judgment network are learned and the parameters are updated.
9. The interactive control method for an autonomous driving vehicle based on reinforcement learning as claimed in claim 8, characterized in that: The learning data of the decision network is the data used for model training, and the formula for sampling learning is: B=(p~D H )∪(1-p~D E ) Among them, B represents a batch of learning samples, and p represents the human driving experience D in this batch of learning samples. H The proportion of D E It represents the exploration experience of the autonomous vehicle; The calculation formula of the ratio p is: Among them, r t Represents the current reward of the autonomous vehicle while exploring.
10. The interactive control method for an autonomous driving vehicle based on reinforcement learning according to claim 9, characterized in that: When the average reward of the autonomous vehicle exceeds the improvement threshold, the proportion of self-exploration experience in the learning sample is increased accordingly, and the loss function The calculation formula is in, represents the mathematical expectation, represents the data sample used for value network learning, γ is the attenuation factor, and are the parameters of the value network and the target network, μ(s t+1 ; θ′) is the next state s determined by the decision network t+1 The next action, is the target network's estimate of the value of the next state and the next action, It is the value network's estimate of the value of the current state and action.
Citation Information
Cited By
Autonomous driving decision near-end strategy optimization method based on distributed exploration enhancement
CN119142371A
Automatic driving federal reinforcement learning method based on meta learning and empirical vector
CN119442908A
Automatic driving reinforcement learning method based on automatic manual guidance
CN119761223A
Priori knowledge fused end-to-end automatic driving decision-making method
CN119975417A
