SafeShift: Safety-Informed Distribution Shifts for Robust Trajectory Prediction in Autonomous Driving

Benjamin Stoler, Ingrid Navarro, Meghdeep Jana, Soonmin Hwang, Jonathan Francis, Jean Oh

Introduction: The Curse of Rarity in Autonomous Driving

Trajectory prediction—the ability to forecast the future movements of agents like vehicles and pedestrians—is fundamental to the safety of autonomous driving (AD) systems. Modern models are typically trained on massive real-world datasets, such as the Waymo Open Motion Dataset (WOMD). However, these datasets suffer from the "curse of rarity": safety-critical events like collisions or near-misses are extremely infrequent in everyday driving.

While a lack of accidents is ideal for road safety, it creates a significant challenge for machine learning. Models trained predominantly on "benign" data often fail to generalize to high-risk edge cases. Existing attempts to solve this, such as simulation or heuristic filtering, often fall short due to the "sim-to-real" gap or by missing subtle but dangerous interactions. SafeShift introduces a novel framework to bridge this gap by using counterfactual reasoning to identify hidden safety-critical scenarios within existing real-world data.

The SafeShift Framework

The core innovation of SafeShift lies in its ability to uncover scenarios that appear safe on the surface but contain high latent risk. This is achieved through a two-stage process: Scenario Characterization and Counterfactual Probing.

Overview of the SafeShift framework, showing the pipeline from scenario identification to downstream tasks.

1. Hierarchical Scenario Scoring

SafeShift first calculates "Safety-Relevance" scores using a combination of individual and social features. Individual features include kinematics like speed, acceleration, and jerk. Social features focus on interaction metrics such as Time-to-Collision (TTC), Deceleration Rate to Avoid Crash (DRAC), and $\Delta$mTTCP (a metric evaluating time-gaps at potential conflict points).

2. Counterfactual Probing (The "What-If" Engine)

Many scenarios in real-world datasets are safe only because a human driver performed a proactive safety maneuver, such as braking early for a merging vehicle. SafeShift asks: "What if the agent hadn't intervened?" By creating a "counterfactual" version of the scene where the ego-agent continues at a constant velocity along its lane (simulating a distracted or non-proactive driver), the framework can identify if a collision would have occurred. If the "distracted" version results in a crash, the original scenario is flagged as high-risk, revealing the proactive maneuver that masked the underlying danger.

Benchmarking with Safety-Informed Distribution Shifts

By applying these scores, SafeShift creates a "safety-informed" distribution shift. Instead of a standard random split, the authors hold out the top 20% most critical scenarios as an Out-of-Distribution (OOD) test set. This creates a significantly more rigorous benchmark for evaluating model robustness.

Density distribution of safety scores, illustrating how counterfactual extrapolation (FE) identifies higher-risk scenarios compared to ground truth (GT) alone.

As shown in the score distribution, incorporating Future Extrapolation (FE) shifts the density toward higher scores, effectively capturing the "hidden" criticality that standard ground-truth analysis might miss.

Experimental Results and Remediation

The framework was evaluated using a subset of 170,000 scenarios from the WOMD. The results highlight the vulnerability of current state-of-the-art models:

  • Increased Benchmark Difficulty: The ground-truth collision rate in the OOD set was 240% higher than in the training set, confirming the method's success in isolating risky scenarios.
  • Model Performance Drop: Top-tier models like MTR saw their predicted collision rates more than double, jumping from 0.044 on in-distribution data to 0.100 on the OOD set.
  • Effective Remediation: To improve robustness, SafeShift proposes several strategies, including weighted loss functions, feature injection of risk scores, and a collision-aware loss function. These strategies led to an average 10% reduction in predicted collision rates across different model architectures.

Discussion and Future Work

SafeShift demonstrates that "matching average behavior" and "ensuring safety" can sometimes be competing objectives. While remediation strategies significantly improved safety metrics, they occasionally led to slight increases in standard displacement errors (ADE/FDE), suggesting a safety-accuracy trade-off.

Future work will focus on closing the remaining performance gap between easy and hard data splits and improving counterfactual probing in environments without clear lane structures. Additionally, the scoring framework could be used to evaluate simulator realism or integrated into real-time deployment for better uncertainty handling.

Summary updated

BibTeX
@inproceedings{stoler2024safeshift,
  author = {Benjamin Stoler and Ingrid Navarro and Meghdeep Jana and Soonmin Hwang and Jonathan Francis and Jean Oh},
  title = {{SafeShift: Safety-Informed Distribution Shifts for Robust Trajectory Prediction in Autonomous Driving}},
  booktitle = {IV},
  year = {2024},
  url = {https://openreview.net/forum?id=gfewrYMNuR},
}
Figure