KING: Generating Safety-Critical Driving Scenarios for Robust Imitation via Kinematics Gradients

Niklas Hanselmann, Katrin Renz, Kashyap Chitta, Apratim Bhattacharyya, Andreas Geiger · DOI

Abstract

Autonomous driving agents trained in simulation often struggle with "long-tail" safety-critical events due to the scarcity of such scenarios in standard training environments. We present KING (Kinematics Gradients), a novel framework for generating adversarial driving scenarios by leveraging a differentiable kinematic bicycle model as a proxy for non-differentiable simulators. By backpropagating through this proxy, KING identifies trajectories that lead to ego-vehicle failures with significantly higher efficiency and success rates than traditional black-box optimization methods. Fine-tuning agents on these generated scenarios leads to a substantial increase in robustness, reducing collision rates on complex benchmarks by over 60%.

Introduction

Training autonomous vehicles (AVs) in high-fidelity simulators like CARLA is a standard practice, yet it is hampered by a significant "content gap." Most simulators utilize background traffic that follows deterministic, law-abiding rules. Consequently, AVs rarely encounter the dangerous, edge-case scenarios—such as sudden cut-ins or aggressive unprotected turns—that are essential for ensuring real-world safety.

While adversarial scenarios can be hand-crafted, this approach does not scale to the complexity of urban driving. Automated methods typically rely on Black-Box Optimization (BBO) to perturb traffic, but these methods are computationally expensive and often fail to find complex collisions in high-dimensional spaces. KING addresses this by introducing a differentiable proxy that allows for gradient-based optimization even when the underlying simulator is a "black box."

Methodology

The Kinematic Proxy

Rather than attempting to differentiate through the complex physics and rendering pipelines of a simulator like CARLA, KING employs a kinematic bicycle model as a differentiable proxy. This model serves as a strong prior for vehicle motion, capturing the fundamental constraints of how agents move in a 2D plane. By using this proxy, the system can estimate how changes in an adversarial agent's trajectory will affect the distance to the ego vehicle.

Gradient Approximation and the "Direct Path"

The authors identify two potential paths for gradients during optimization:

  1. The Direct Path: Gradients flowing through the kinematics of the agents.
  2. The Indirect Path: Gradients flowing through the ego agent’s sensors and internal policy (the AV's reaction).

A key insight of this work is that the direct path alone is sufficient to generate effective adversarial attacks. By ignoring the AV's specific visual perception or policy logic, KING remains applicable even when the AV or the simulator's renderer is entirely opaque. This simplification significantly reduces memory overhead and accelerates convergence.

Optimization Objective

KING optimizes the trajectories of background agents using a multi-objective cost function designed to balance criticality and realism:

  • Criticality: Minimizing the distance between the ego agent and the nearest adversarial agent to induce a collision.
  • Plausibility: Penalizing adversarial agents if they collide with one another or drive off-road, ensuring the generated scenarios remain kinematically feasible and somewhat realistic.

Experimental Setup

Experiments were conducted using the CARLA simulator. Scenarios were generated across four distinct maps (Town03 through Town06). To evaluate the effectiveness of the generated data, the authors compared KING against several BBO baselines, including Random Search, Bayesian Optimization, SimBA, and CMA-ES.

For robustness testing, the authors utilized a "privileged expert" (an algorithm with access to ground-truth data) to solve the generated adversarial scenarios. This expert data was then used to fine-tune the original AV policy, which was tested on the Town10 intersections benchmark—a dense, hand-crafted environment designed to test agent limits.

Key Results and Insights

Superior Generation Performance

KING achieved a Collision Rate (CR) exceeding 80%, outperforming the strongest black-box baseline (CMA-ES) by approximately 20%. Furthermore, KING demonstrated significantly faster convergence, finding successful collisions in fewer iterations, particularly as the number of adversarial agents in the scene increased.

Enhanced Robustness through Fine-Tuning

The ultimate goal of KING is to improve AV safety. After fine-tuning a state-of-the-art vision-based agent (TransFuser) on KING-generated data, its collision rate on the Town10 benchmark dropped from 17.48% to 6.10%. This suggests that the scenarios generated by KING capture fundamental driving weaknesses that, when addressed, generalize to other complex environments.

Cross-Modal Applicability

KING proved effective against multiple types of agents, successfully inducing collisions in both "cheating" agents (those with access to ground-truth maps) and standard vision-based agents. This highlights the method's versatility as a general-purpose stress-testing tool for autonomous systems.

Conclusion and Future Work

KING demonstrates that a simple, differentiable kinematic proxy can effectively bridge the gap between non-differentiable simulators and gradient-based optimization. By focusing on the "direct path" of kinematics, KING generates high-quality, safety-critical data that significantly enhances the robustness of imitation learning policies.

Future research may focus on improving the realism of these adversarial scenarios, as some generated behaviors can appear unnatural. Additionally, integrating Reinforcement Learning (RL) could further diversify the types of edge cases discovered, potentially scaling the framework to even more complex multi-agent interactions.

Summary updated

BibTeX
@inproceedings{hanselmann2022king,
  author = {Niklas Hanselmann and Katrin Renz and Kashyap Chitta and Apratim Bhattacharyya and Andreas Geiger},
  title = {{KING: Generating Safety-Critical Driving Scenarios for Robust Imitation via Kinematics Gradients}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19839-7\_20},
}
Figure