TrafficGen: Learning to Generate Diverse
and Realistic Traffic Scenarios

IEEE International Conference on Robotics and Automation (ICRA) 2023

Lan Feng1*, Quanyi Li2*Zhenghao Peng3*,   Shuhan Tan4,   Bolei Zhou3 
1ETH Zurich, 2University of Edinburgh
3University of California, Los Angeles, 4The University of Texas at Austin
Webpage | Video | Code | Paper

Fig. 1 Overview of the proposed method

This work introduces a data-driven method called TrafficGen for traffic scenario generation. It learns from the fragmented human driving data collected in the real world and then can generate realistic traffic scenarios. TrafficGen is an autoregressive generative model with an encoder-decoder architecture. In each autoregressive iteration, it first encodes the current traffic context with the attention mechanism and then decodes a vehicle's initial state followed by generating its long trajectory.

Fig. 2: The autoregressive sampling process for vehicle placement.

TrafficGen synthesizes a complete traffic scenario in an autoregressive way. The first step is to place vehicles on the given map. At each iteration, a vehicle is placed by sampling the spatial probability distribution over all the regions in the scene. We visualize current spatial distribution through the iteration-varying heatmap in the above figure. At the end of sampling, a set of N vehicles are placed at the map and forms the traffic snapshot.

We then use a motion forecasting model as the trajectory generator since it can output multi-mode diverse samples. However, motion forecasting models cannot be directly used for long trajectory generation, since they are brittle to distributional shift. We sample one possible future trajectory for each vehicle. To mitigate the long-term cumulative error, only the first several steps of the trajectory are used. Then the long trajectories of a vehicle are generated by several rollouts.

Generating diverse traffic scenarios

With different HD maps and traffic light signals as input, TrafficGen can generate diverse traffic scenarios in the video below.

The following video shows that by sampling many times on the same map, TrafficGen can generate diverse traffic flows.

Demo Video
This video shows scenarios generated by TrafficGen exhibits complex social behaviors. The generated scenarios can have many downstream applications, such as RL training and SDV testing.
The project is partially supported by Samsung Global Collaboration Award and Cisco Faculty Award.
  title={Trafficgen: Learning to generate diverse and realistic traffic scenarios},
  author={Feng, Lan and Li, Quanyi and Peng, Zhenghao and Tan, Shuhan and Zhou, Bolei},
  booktitle={2023 IEEE International Conference on Robotics and Automation (ICRA)},