Computer Science
Computer Science-2021.gz:143313
Computer Science
cd4f26d784c48788425d1f74bcd71ac70bbe9f71
Meta Reinforcement Learning-Based Lane Change Strategy for Autonomous Vehicles

Recent advances in supervised learning and reinforcement learning have provided new opportunities to apply related methodologies to automated driving. However, there are still challenges to achieve automated driving maneuvers in dynamically changing environments. Supervised learning algorithms such as imitation learning can generalize to new environments by training on a large amount of labeled data, however, it can be often impractical or cost-prohibitive to obtain sufficient data for each new environment. Although reinforcement learning methods can mitigate this data-dependency issue by training the agent in a trial-and-error way, they still need to re-train policies from scratch when adapting to new environments. In this paper, we thus propose a meta reinforcement learning (MRL) method to improve the agent's generalization capabilities to make automated lane-changing maneuvers at different traffic environments, which are formulated as different traffic congestion levels. Specifically, we train the model at light to moderate traffic densities and test it at a new heavy traffic density condition. We use both collision rate and success rate to quantify the safety and effectiveness of the proposed model. A benchmark model is developed based on a pretraining method, which uses the same network structure and training tasks as our proposed model for fair comparison. The simulation results shows that the proposed method achieves an overall success rate up to 20% higher than the benchmark model when it is generalized to the new environment of heavy traffic density. The collision rate is also reduced by up to 18% than the benchmark model. Finally, the proposed model shows more stable and efficient generalization capabilities adapting to the new environment, and it can achieve 100% successful rate and 0% collision rate with only a few steps of gradient updates.


I. INTRODUCTION
Automated and semi-automated vehicles are gaining popularity in their potential use in transportation. Considerable developments have focused on autonomous driving applications during the past decade. [1]- [6]. Particularly noticeable in the last few years, the advancements in machine learning have prompted the application of such methodologies to the field of automated driving.
Supervised learning approaches, such as imitation learning, rely heavily on large amounts of labeled data [7]. For example, [8] uses imitation learning to learn from human demonstrations and introduces perturbations to discourage undesirable behaviors. Each task in supervised learning is trained separately, so the trained agent is often not able to generalize to other tasks. Furthermore, acquiring and labeling a sufficient amount of data for each individual task in autonomous driving can be costly and time-consuming, and it is also challenging to cover all of the real-world driving scenarios.
In comparison, reinforcement learning (RL) offers an alternative approach by training the agent in a trial-anderror way, and it does not require explicit human labeling or supervision on each data sample. Recently, RL methods have been increasingly applied to the decision making and control of autonomous vehicles [9]- [12]. For example, the Deep Q Network (DQN) was introduced to solve high-level decisionmaking problems with automated speed control for highway driving [10], [13]. A DQN model was established by Hoel et al. [10] in a simulation environment to make driving behavioral commands (e.g. change lanes to the right/left, cruise on the current lane, etc.), and the study also compare the influence of different neural network structures on the agent's performance. More recent work [14] introduced a hierarchical architecture to train two separate policies for both high-level decision making and low-level control execution.
Despite the rapid progress, classical reinforcement learning methods still need to re-train new policies from scratch for new tasks, which fails to exploit the learned properties from similar tasks. To truly achieve autonomous driving in the diverse and complex real-world environment, it will be essential for the autonomous driving agent to handle newly encountered situations from past experiences [15]. This motivates us to introduce in this work a meta reinforcement learning (MRL) approach, which integrates meta-learning into deep reinforcement learning.
To illustrate our proposed approach, we apply the MRL method to develop a decision-making strategy for lane changing situations in highway driving. Decision-making for automated driving in a dynamically changing environment can be challenging due to the complex interactions and uncertain behaviors of other road users. With the proposed framework, the learned model can quickly adapt to new driving conditions, which may include environmental variations such as different traffic congestion levels, different road geometries, and different driving habits in different living regions. The MRL method enables the creation of a generic model that can be generalized to make automated lane-changing maneuvers for vehicles running in different traffic environments.
Therefore, to improve the policy's generalization capability, this paper adopts a framework of model-agnostic meta learning (MAML) [16]. Beyond adapting and generalizing to new tasks more efficiently, MAML is agnostic both to the architecture of the neural network and also to the loss function. MAML is explicitly designed to train the model's initial parameters such that the model can reach the optimal performance on a new task after just a few gradient updates. Apply MAML in the context of RL also requires two loops of optimization. A meta policy parameterized by θ is updated in the outer loop by minimizing the total expected loss over all of the training tasks. The inner loop performs task-specific policy update and computes the expected loss using the updated policy. More specifically, for each task we collect trajectories using the meta initialization, and then we'll update the task-specific policy parameters by applying gradient descent to obtain the adapted policy. These trajectories collected using the adapted policy are later used to compute the meta objective, which will be sent back the outer-loop for updating the meta policy parameter θ.
Safety is an issue of paramount concern for autonomous vehicles. We also propose a novel method of tackling driving safety in conjunction with the MRL framework. In the inner loop task learner, a safety module is incorporated into the proximal policy optimization (PPO) [17] algorithm for learning each driving task. To further enhance safety in both learning and execution phases, a safety intervention module [18] is added to reduce the chance of taking catastrophic actions in a complex interactive environment. Moreover, we introduce a novel option of aborting lane change when the agent is making a decision of lateral action, which enables our ego-vehicle to avoid potential collisions by aborting and changing back to the original lane at any point while undertaking the lane change action. In the longitudinal direction, the ego vehicle chooses which leading vehicle to follow, so it can perform speed adjustments even before making the actual lane change.
The rest of the paper is organized as follows: Section II describes the underlying principle of meta reinforcement learning. In section III, we the proposed meta-reinforcement learning frameworks for learning an adaptable lane change strategy, with the detailed descriptions on establishing the reward design and model implementation. Section IV describes the simulation environment, meta-learning system architecture, state and action design in details. The simulation benchmark design, evaluation metrics, and results are presented in Section V. Section VI concludes the paper by highlighting the effectiveness of the proposed model. II. META REINFORCEMENT LEARNING Reinforcement learning can teach how an agent to act by interacting with its environment in order to maximize the expected cumulative rewards for a certain task. However, reinforcement learning methods are often suffer from datainefficiency and limited generalization. Meta learning, or learning to learn, refers to the methods can enable agents adapt quickly to new tasks using the prior knowledge or inductive biases learned from the previously seen related tasks. Recent efforts have explored the Meta-learning algorithms in the context of reinforcement learning, i.e. meta reinforcement learning [16], [19]- [21]. The existing meta reinforcement learning algorithms can be generally categorized into two principal families. The first category of methods leverage the prior experience through the learned structure such as recurrent neural networks [19], [22]. The second set of methods is gradient-based meta reinforcement learning which attempts to optimize the parameters of the network during the meta-training such that they provide a good initialization point for adapting to new tasks with gradient descent [16], [20]. We extend our prior work [23] that developed a policy gradient based lane change strategy for improving model generalization and task performance, and focus on the a very influential gradient-based meta reinforcement learning method which was referred to as model-agnostic meta learning (MAML) [16].
The MAML algorithm is model-agnostic. More specifically, it is agnostic both to the architecture of the neural network and also to the loss function. The backbone of MAML is to optimize for meta parameters θ with gradient descent in two loops -an inner loop task learner and an outer loop meta learner as shown in Fig. 1. MAML aims to learn a good parameter initialization and use gradient descent for updating both task learner and meta learner update. These features provide many flexibilities for MAML, making it applicable to reinforcement learning problems that maximize the expected cumulative reward function through policy gradient.
Formally, we consider MAML as a neural network f θ parameterized by θ, which can conduct task-specific fine tuning using gradient descent when adapting to a new task. During the meta-training stage as shown in Figure 1, MAML operates in an inner loop and an outer loop. In the inner loop, task learner initializes with the meta parameter θ and computes the updated parameter φ i of the task learner for each task T i using training data D tr Ti collected from meta-policy. And then it evaluates the loss term on the validation data D vd i sampled from collected trajectories using the updated model parameters φ i . The evaluated loss for each task T i can be written as i ) is the updated model parameter for task T i . The loss function for updating a RL policy has the general form as where E t is the expectation operator, π θ is a stochastic RL policy,Â t is an estimator of the advantage function at time step t.
In the outer loop, meta learner aggregates the per-task post-update losses L φ i , D vd i and performs a meta-gradient update on the original model parameter θ as where β is the learning rate of the outer loop. MAML optimizes the meta-policy parameter θ such that the expected loss across all the training tasks after inner-loop update is minimized.
At meta-test time, MAML is able to adapt the meta parameters based on a few iterations of gradient updates on the rollout trajectories collected from the new task. The adaptation process is represented as a few steps of gradient descent with the collected rollouts. In practice, the policy must be able to read in the state for each of the tasks, which typically requires them to at least have the same dimensionality.
In summary, the essential idea of MAML is trying to find a good set of parameters of a neural network that does not necessarily have the optimal performance for different tasks at the meta-training stage, but can quickly adapt to new (unseen) tasks by fine-tuning with gradient descent.

A. Overview
The framework of the proposed MAML model to perform automated lane change maneuver is illustrated in Fig. 2.
1) Task Learner (Inner-Loop): The task learner learns a decision-making strategy for automated mandatory lane change maneuvers that feature safety, efficiency, and comfort. Instead of using the vanilla MAML inner-loop optimization, the REINFORCE [24] algorithm as in [16], we further improve the learning efficiency and driving safety by implementing a proximal policy optimization (PPO) [17] method.
We further combine PPO with a safety module for innerloop optimization. PPO algorithm is built upon an actor-critic structure, where the parameterized actor of PPO can enforce a trust region with clipped objectives, which has promising computation efficiency and learning stability. Moreover, the merit of the critic is to supply the actor with the knowledge of performance in low variance. All of these nice properties of PPO can improve its capability in real-life applications. The safety module can modify the exploration process of the task learner through the incorporation of a risk metric to further improve driving safety.
2) Meta-Learner (Outer-Loop): Meta-learner enables efficient model adaption of the lane change to new situations (i.e. different traffic density, different road geometries, different driving habits in different living regions). In the outer loop, the meta policy parameterized with θ is updated given the expected return based on trajectories collected over all the training tasks using the adapted inner-loop policy.
B. Inner-level Task-learner Design via PPO 1) Inner level objective: Clipped surrogate loss objective has shown better performance when compared to the REFIN-FORCE loss used in the vanilla MAML algorithm.
The clipped surrogate loss function of PPO combines the policy surrogate and a value function error term, which is defined as [17] where L CLIP is the clipped surrogate objective, c 1 , c 2 are coefficients, L V F t is the squared-error loss of the value function (V θ (s t ) − V targ t ) 2 , and S denotes the entropy loss. Specifically, the clipped surrogate objective L CLIP t takes the following form where is a hyperparameter, and r t (θ) denotes the probability ratio r t (θ) = π θ (a t |s t ) /π θold (a t |s t ). In this manner, the probability ratio r is clipped at 1 − or 1 + depending on whether the advantage is positive or negative, which forms the clipped objective after multiplying the advantage approximatorÂ t . The final value of L CLIP t takes the minimum of this clipped objective and the unclipped objective r t (θ)Â t , which can effectively avoid taking a large policy update compared to the unclipped version [17], which is also known as the loss function of the conservative policy iteration algorithm [25].
3) Parameter Settings: In terms of PPO hyper-parameters, we choose to use Adam and learning rate annealing with a step size of 1 × 10 −4 , and we set the horizon T = 512, the mini-batch size as 64, the discount factor γ = 0.99, and the clipped parameter = 0.2. More detailed simulation parameter setting is shown in Table I.

4) Reward Function:
The reward function is designed to incorporate key objectives of vehicle maneuvers, which is to develop an automated lane change strategy centered around the evaluation metrics of safety, efficiency, and comfort. More specifically, these ideas are explained as follows: a. Comfort: this reward is introduced to avoid sudden acceleration and deceleration of the vehicle that may cause vehicle occupant discomfort. Here, the comfort reward is an evaluation of jerks in both lateral and longitudinal direction. b. Efficiency: the ego-vehicle should manage to move to the target lane as soon as possible without exceeding the speed limit. Thus, the efficiency reward is an evaluation of relative lateral distance to the target lane, time cost and vehicle speed. c. Safety: the ego-vehicle should avoid collisions with surrounding vehicles. Thus, the safety reward is an evaluation of the risk of collisions and near-collisions.
Here, we introduce near-collision penalty and a safety module to modify the exploration process by incorporation of external knowledge to further improve the driving safety during learning and execution phases. The near-collision penalty R near collision and risk metric are both conditioned on the action-state space, rather than only penalizing a collision that actually takes place. In this case, an ego-vehicle C e can learn to abort the lane-change maneuver if its relative distances to the surrounding vehicles C i are smaller than a predefined threshold, indicating a collision is likely to happen. The specific form of this near-collision penalty term R near collision in terms of their relative positions is shown in TABLE II, in which F (C e , C i ) is defined as F (C e , C i ) = −1/(|P y e − P y i | + 0.1) where P y e represents the longitudinal position of the egovehicle C e ; and P y i represents the longitudinal position of the surrounding vehicle C i . The safety module works in a reactive way that it can evaluate the collision risk and correct the learner when the chosen action causes a catastrophic result (i.e. collision with other vehicle) [27]. The main idea is to distinguish the real "catastrophic" actions and "sub-optimal" actions in the automated lane changing process. The safety module can evaluate the risk of collision based on the relative distance with the surrounding vehicles in both lateral and longitudinal directions, and output a binary label to classify if the current chosen action is "catastrophic" or not and which vehicle is associated with the risk. Then, the safety module will select a different safe actions based on the current state and returned label to replace the "catastrophic" action.
More details on the formulation of reward functions that explicitly quantify the aforementioned evaluation metrics can be found in [23].

5) Acton Space:
We design the action space in both lateral and longitudinal directions, so that an agent can learn when and how to perform a lane change.
In a real-world scenario, a drivers execution of the lane change decision can also be affected by the interactions between the ego vehicle and other vehicle. Therefore, we introduce an aborting-lane-change action to the lateral action space, which enables the vehicle to abort taking a lane change action to avoid a potential collision at any point while undertaking the lane change maneuver.
In the longitudinal direction, the ego vehicle needs to choose which leading vehicle to follow, so it can perform speed adjustments even before making the actual lane change.

C. Outer-Level Meta-learner Design
The meta-learner is an optimization-based meta-RL agent that can learn a prior parameter over a distribution of tasks that transfer via fine-tuning and gradient descent. Specifically, the process of meta-optimization in this study is updated with the following objective: L Ti (f θ−α∇ θ L τi (f θ )) (7) 6where T i ∼ p(T ) represents each training task drawn from a task distribution p(T ). The model parameters θ are trained by optimizing for the performance of across all the training tasks. The network structure of the outer-level meta-learner is the same as the inner-level task-learner. Similar to the general meta-RL formulations, we assume both training and test tasks are drawn from the same task distribution p(T ), where each task is a Markov decision process (MDP), consisting of a set of actions, states, stochastic dynamics, and reward functions.  In this study, different tasks are formulated as performing lane change maneuvers at different traffic densities. At the training phase, the training tasks are drawn from those with mild to moderate traffic. At the testing phase, we evaluate our model in a new environment featuring in heavy dense traffic. An illustration of the outer-level meta-leaner interacting with different tasks of traffic conditions in the SUMO environment is illustrated in Fig. 3.

IV. SIMULATION EXPERIMENT
In this section, we show how we evaluate the performance of our proposed model on more challenging and unseen tasks for lane changing scenarios on highway driving, and the goal of our experiment is to demonstrate the effectiveness of the high-level meta learner combined with a low-level, safetyenhanced learner to achieve more reliable and more adaptive learning capabilities in the complex environment.

A. Simulation Setup
The simulation network is modeled using a real-world 3lane highway segment with on-ramps and off-ramps as shown in Fig. 4, which is implemented on SUMO [28]. The highway segment length to the ramp exit is 800 m and width of each lane is 3.75 m.
The low-level vehicle control is implemented through Traffic Control Interface (TraCI). Specifically, we implemented an intelligent driver model (IDM) [29] for car-following behavior for the other vehicles in the simulation. For the ego vehicle, we adapted the IDM for low-level longitudinal control that can adjust the vehicle speed when following different leaders. More details regarding IDM settings can be found in [23].
In SUMO, the vehicle counts are generated from a probability factor f ∈ [0, 1], which represents the probability of a vehicle release in a second. We can simulate the highway exit behavior at light (f ∈ [0, 0.33)), moderate (f ∈ [0.33, 0.67)), and heavy traffic conditions (f ∈ [0.67, 1]). The meta agent uses the trained metalearners network weights as initialization parameters. When adapting to new tasks, a meta agent can fine-tune its policy on meta-testing tasks from meta-learners weights, which are obtained from the meta-learning process that involves different meta-training tasks.
At the meta training stage, three training tasks with light to moderate traffic density (traffic probability factor f = {0.3, 0.4, 0.5}) will be drawn from the distribution p(T ) for meta optimization during training process. At the meta testing stage, we'll use more challenge tasks than the training tasks to evaluate the performance of the trained meta-learner. Specifically, the heavy traffic density scenario with traffic probability factor f = 0.7 is selected as the meta testing task, and it is obvious that this task has never been seen before in the training process.
2) Pretrained agent (Benchmark): To make a fair comparison, a benchmark is created based on a pretrained agent that uses the same network structure and training tasks as the meta agent. When adapting to new tasks, the pretrained agent can fine-tune its policy on meta-testing tasks based on the pretrained model, which is trained on mixed data sampled from all the training tasks.

C. Evaluation Metrics
Besides evaluating the reward function described earlier that models safety, efficiency and comfort, we also add two performance-based metrics, namely the success rate and the collision rate, to quantify the safety and effectiveness performance of the proposed MAML-based automated lane change method in both meta-training and meta-testing processes. 1) Success Rate: A successful task in a simulation run is defined as the ego-vehicle having successfully changed to the target lane before reaching the highway exit and avoided colliding with other vehicles. The success rate is defined as the ratio of the number of successful tasks over the total number of simulation runs in the policy rollout. The unsuccess rate can be attributes to cases of an autonomous agent failing to make a proper lane change successfully or safely before the highway exit.
2) Collision Rate: This metric evaluates the safety of a vehicle, as it is generally used to account for the occurrence of collision events. The collision rate is defined as the ratio of the number of collision events over the total number of simulation runs in the policy rollout.

D. Results
The training results of the meta agent are demonstrated in Fig. 5, which shows the performance that the meta agent can achieve after one step gradient update in the training process. As discussed earlier, the reward function consists of three metrics: comfort evaluated by the jerk, efficiency, and safety. We can observe from Fig. 5 that both comfort and efficiency have been relatively quickly improved over the course of the training process. The safety reward slops down gradually as the training evolves. At the beginning, the meta agent has hardly made any lane change attempts at the beginning, as both success rate and collision rate are near 0. When the meta agent starts to explore by taking more lane change actions, the safety reward begins to decline. While the safety reward accounts for the occurrence of both collision and near-collision events, it can also be used to quantify the aggressiveness of lane change actions. Finally, the desired performance can be reached after performing a sufficient number of training steps, as the lane change success rate can reach 100% and the collision rate can also be reduced to 0, indicating the meta agent has learned a very safe and effective lane change strategy based on the meta-training tasks. Fig. 6 illustrated the adaptation results of both meta agent and the benchmark pretrained agent. In the meta testing stage, both agents are exposed to the same new environment, and our goal is to evaluate their adaptation capabilities in these unseen environments. Each subfigure of Fig. 6 has two lines, where the orange line represents the pretrained agent, and the green one is the performance of the meta agent. Then, we'll use the same metrics to evaluate their performance first in terms of the total average return, which consists of three parts including comfort, efficiency, and safety. Then we'll compare their task performance in terms of the success rate and the collision rate.
In reinforcement learning, we typically consider the terminology of few-shot adaptation as a few-steps of gradient adaptation. As shown in Fig. 6, our meta agent is obviously performing better than the pretrained agent, or the benchmark. First of all, the meta agent achieved much better safety metrics, as its collision rate of which can quickly drop to zero after around 20 gradient steps. While both the meta agent and the pretrained agent have similar collision rate at the beginning of the meta testing phase, the pretrained agent has an 8% higher collision rate in the end. Secondly, the rapid rise of the success rate up to 100% shows our meta agent can adapt to new environments much quicker than the   pretrained agent. Then, if we look at each reward metric individually, our meta agent and pretrained agent will end up with similar comfort rewards. In terms of efficiency reward, which evaluates how quickly we can switch to the desired highway exit lane, the performance of the meta agent is a bit lower than that of the pretrained agent. However, the main reason for this discrepancy is that the meta agent sacrifices efficiency for better safety, as it learns to be patient in order to avoid unnecessary collisions.
TABLES III and IV present the comparison between the meta agent and the pretrained agent in terms of success rate and collision rate. It can be observed that the meta agent consistently outperforms the pretrained agent as the number of gradient steps evolves. For example, when there are only 5 gradient steps, the meta agent will have 20% and 18% advantage over the pretrained agent in terms of success rate and collision rate. When it reaches 20 gradient steps, the meta agent can reach 100% successful rate, while the pretrained agent can only reach 86%. Additionally, the collision rate of the prepared agent (14%) is also much greater than that of the meta agent, which is already reduced to zero. V. CONCLUSIONS This paper proposes a strategy for automated mandatory lane change based on meta reinforcement learning. The meta agent is trained based on the MAML framework that enables the models quick adaptation to unseen tasks (i.e. a more challenging scenario with heavy traffic). In less than 10 steps of gradient updates, the meta agent can quickly improve the lane change performance to an average successful rate of 99% and reduce the collision rate to less than 0.2%. The meta agent can provide a more stable and efficient starting point for learning a new task and can achieve 100% successful rate and 0% collision rate with a few steps gradient updates. In summary, the meta agent consistently outperforms the pretrained agent in both adaptation speed and task performance.