SafeRL-Lab / Safe-MARL-in-Autonomous-Driving

Safe Multi-Agent Reinforcement Learning to Make decisions in Autonomous Driving.
Apache License 2.0
25 stars 5 forks source link
autonomous-driving multi-agent-reinforcement-learning reinforcement-learning safe-reinforcement-learning

Safe MARL in Autonomous Driving

This is a pytorch implementation of Constrained Stackelberg Q-learning(discrete action) and Constrained Stackelberg MADDPG(continuous action). These algorithms are proposed by incorporating the Stackelberg model into Deep Q-learning and MADDPG, and leveraging the Lagrangian multiplier method to deal with the safety constraints. The highway environments used in our experiments are modified from highway-env.

1. Installation

# create conda environment
conda create -n env_name python==3.9
conda activate env_name
pip install -r requirements.txt

2. Quick Start

python main_bilevel.py --file-path ./merge_env_result/exp2

3. Demos

3.1 Safe Highway environment

animated animated

3.2 Safe Merge environment

animated

3.3 Safe Roundabout environment

animated

3.4 Safe Intersection environment

animated

3.5 Safe Racetrack environment

animated

4. Results

4.1 Safe Highway Environment

Reward and Training curve
Alt text

4.2 Safe Merge Environment

Leader reward Follower reward Total reward
Alt text Alt text Alt text
Training curve
Alt text

4.3 Safe Roundabout Environment

Leader reward Follower reward Total reward
Alt text Alt text Alt text
Training curve
Alt text

4.4 Safe Intersection Environment

Leader reward Follower reward Total reward
Alt text Alt text Alt text
Training curve
Alt text

4.5 Safe Racetrack Environment

Leader reward Follower reward Total reward
Alt text Alt text Alt text
Training curve
Alt text

Citation

If you find the repository useful, please cite the study

@article{zheng2024safe,
  title={Safe Multi-Agent Reinforcement Learning with Bilevel Optimization in Autonomous Driving},
  author={Zheng, Zhi and Gu, Shangding},
  journal={arXiv preprint arXiv:2405.18209},
  year={2024}
}