cs.LGApr 14, 2026

Forecasting the Past: Gradient-Based Distribution Shift Detection in Trajectory Prediction

Authors: Michele De Vita, Julian Wiederer, Vasileios Belagiannis

Organizations: Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany · Mercedes-Benz AG, Germany

Abstract

Trajectory prediction models often fail in real-world automated driving due to distributional shifts between training and test conditions. Such distributional shifts, whether behavioural or environmental, pose a critical risk by causing the model to make incorrect forecasts in unfamiliar situations. We propose a self-supervised method that trains a decoder in a post-hoc fashion on the self-supervised task of forecasting the second half of observed trajectories from the first half. The L2 norm of the gradient of this forecasting loss with respect to the decoder's final layer defines a score to identify distribution shifts. Our approach, first, does not affect the trajectory prediction model, ensuring no interference with original prediction performance and second, demonstrates substantial improvements on distribution shift detection for trajectory prediction on the Shifts and Argoverse datasets. Moreover, we show that this method can also be used to early detect collisions of a deep Q-Network motion planner in the Highway simulator. Source code is available at https://github.com/Michedev/forecasting-the-past.

Figures & tables

Explore similar work

CardsList
  1. ControlledShifts: Towards Standardizing Robustness Evaluation in Trajectory Prediction Under Distribution Shifts

    Aug 18, 2026Ingrid Navarro, Pablo Ortega-Kral, Yutong Duan +2Distribution Shift RobustnessTrajectory Prediction

  2. Towards Metric-Agnostic Trajectory Forecasting

    Jul 1, 2026Markus Knoche, Daan de Geus, Bastian LeibeAutonomous Driving BenchmarksMulti-Agent Trajectory Prediction

  3. MetaDAT: Generalizable Trajectory Prediction via Meta Pre-training and Data-Adaptive Test-Time Updating

    Mar 10, 2026Yuning Wang, Pu Zhang, Yuan He +2Trajectory PredictionTest-Time Adaptation