Abstract
Autonomous vehicles (AVs) rely heavily on neural network-based decision-making, which has been shown to be vulnerable to adversarial conditions. Evaluating the robustness of these systems is challenging because safety-critical events are rare in real-world data and often follow multimodal distributions. We propose a flow-based generative framework that creates diverse, physically plausible, and high-risk traffic scenarios. By integrating weighted likelihood maximization with a gradient-based adaptive sampling procedure, our model efficiently identifies multiple distinct failure modes for a given task algorithm. Experiments in the CARLA simulator demonstrate that our approach significantly outperforms uniform sampling in testing efficiency and reveals critical robustness gaps between different reinforcement learning (RL) algorithms.
Introduction
The safety of autonomous systems is a "long-tail" problem. While AVs perform well in standard traffic, rare, high-risk events—such as a cyclist suddenly darting into an intersection—are where they often fail. Collecting sufficient data for these events in the real world is prohibitively expensive and dangerous. Furthermore, traditional adversarial attacks often focus on finding a single "worst-case" scenario, ignoring the fact that risk is inherently multimodal; an AI might learn to avoid a threat from the left while remaining completely vulnerable to one from the right.
The Proposed Framework
To address these challenges, we developed a framework that generates a distribution of scenarios that are both high-risk and physically plausible.
The framework consists of three core components:
- Pre-trained Prior Model: We utilize RealNVP, a type of normalizing flow, trained on the InD dataset (naturalistic road user trajectories recorded by drones). This ensures that generated trajectories, such as those of cyclists, adhere to realistic movement patterns.
- Weighted Maximum Likelihood Estimation (WMLE): Rather than simply maximizing data likelihood, we weight the objective function by a risk metric. This directs the generator's probability mass toward scenarios where collisions or near-misses are likely.
- Adaptive Sampler (NES): To explore the scenario space efficiently in a "black-box" setting (where the simulator's internal math is unknown), we employ the Natural Evolution Strategy (NES). This gradient-based approach steers the search toward unexplored, high-risk regions, preventing the model from getting stuck on a single type of accident.
Experimental Results
We evaluated our generator by testing six popular Reinforcement Learning (RL) algorithms—DQN, A2C, PPO, DDPG, SAC, and Model-Based RL (MBRL)—within the CARLA simulator.
Efficiency and Multimodality
Our adaptive method achieved a 100% collision rate (successfully finding failure cases) in just 3,000 queries, whereas a uniform sampler required 100,000 queries to reach a mere 9% collision rate. Crucially, our method avoids "mode collapse," a common failure in risk-search algorithms where the model only identifies one specific type of failure.
Algorithm Robustness
The results revealed significant disparities in robustness that were invisible under standard uniform testing:
- Model-Based RL (MBRL) emerged as the most robust. By learning a model of the environment's physics, it generalized better to avoid risky scenarios even if they were not encountered during training.
- On-policy methods (PPO and A2C) were the least robust, showing high instability and failing to handle the diverse modes of risk generated by our framework.
Conclusion
Generating multimodal safety-critical scenarios is essential for a comprehensive evaluation of autonomous systems. Our flow-based generative model provides a scalable way to stress-test decision-making algorithms, revealing vulnerabilities that standard testing misses. Future work will explore using these generated scenarios for adversarial training to improve the inherent safety of autonomous agents from the outset.
Summary updated