Joint Out-of-Distribution Detection and Uncertainty Estimation for Trajectory Prediction

Julian Wiederer, Julian Schmidt, Ulrich Kressel, Klaus Dietmayer, Vasileios Belagiannis

Introduction

Trajectory prediction is a critical component of the autonomous driving stack, responsible for forecasting the future movements of vehicles and pedestrians. While modern deep learning models have achieved high accuracy in standard scenarios, they often lack "self-awareness"—the ability to identify when their predictions are likely to be unreliable. In high-stakes environments, a failure to recognize uncertainty can lead to catastrophic planning decisions.

Reliability in this context is challenged by two distinct phenomena: Out-of-Distribution (OOD) scenarios, where the model encounters environments or weather conditions not seen during training, and In-Distribution (ID) uncertainty, where the scene is familiar but inherently ambiguous (e.g., a complex intersection). Current solutions typically rely on deep ensembles, which are computationally prohibitive for real-time deployment. This paper proposes a lightweight, post-hoc method to address both OOD detection and uncertainty estimation with minimal computational overhead.

Methodology

The authors introduce a model-agnostic framework that can be integrated into existing encoder-decoder trajectory predictors. For their evaluation, they utilize the HiVT (Hierarchical Vector Transformer) architecture as the base model. The proposed approach, dubbed HiVT*, involves freezing the pre-trained encoder and adding two specialized "expert" modules:

1. Latent GMM (lGMM) for OOD Detection

Rather than analyzing the final output, the lGMM module operates on the latent features generated by the scene encoder. By fitting a Gaussian Mixture Model to the feature space of the training data, the system can identify "normal" feature distributions. During inference, if a scene produces a latent representation in a low-probability region of the GMM, it is flagged as OOD. This approach leverages the encoder's internal representation as a sensitive fingerprint for novelty.

2. Error Regression (Ereg) for Uncertainty Estimation

To quantify ID uncertainty, the authors employ a small Multi-Layer Perceptron (MLP) trained to predict the expected error of the primary model. This is treated as a supervised task: given a specific scene encoding, the MLP estimates the likely displacement error in meters. This predicted error serves as a direct proxy for the model's confidence in its own trajectory forecast.

Two-Phase Training

The framework follows a "post-hoc" training pipeline. First, the trajectory predictor is trained to convergence. Subsequently, the predictor's weights are frozen, and the lGMM and Ereg modules are trained on the fixed latent features. This decoupling ensures that the primary task of prediction is not degraded by the secondary task of uncertainty estimation.

Experimental Results

The method was evaluated using the Shifts dataset, a benchmark specifically designed to test distributional shift in motion forecasting. The dataset defines Moscow (clear weather) as In-Distribution, while data from other cities (Ann Arbor, Tel Aviv) and adverse weather conditions (rain, snow) are treated as Out-of-Distribution.

Performance and Efficiency

HiVT* demonstrated significant improvements over baselines, including ensembles and spectral-normalized Gaussian processes (SNGP):

  • OOD Detection: Achieved a 2.8% increase in AUROC (Area Under the Receiver Operating Characteristic).
  • Uncertainty Estimation: Improved R-AUC (Retention Area Under Curve) by 10.1%.
  • Probabilistic Accuracy: Outperformed deterministic models on Negative Log-Likelihood (NLL), indicating more calibrated probability distributions.
  • Computational Overhead: Unlike 5-model ensembles that increase compute requirements by 400%, the joint lGMM and Ereg approach adds only 0.14ms of latency—a mere 5% increase in total runtime.

Discussion and Limitations

The primary advantage of this approach is its efficiency and ease of integration. By performing generative modeling on latent features and using direct error regression, the model achieves state-of-the-art reliability scores without the hardware demands of ensembles.

However, some limitations remain. Because the reliability modules depend on a frozen encoder, their effectiveness is capped by the quality of the features learned during the initial training phase. If the encoder fails to capture a specific environmental nuance, the OOD module may remain blind to it. Furthermore, while the paper provides robust reliability scores, it does not address the downstream "policy" problem: how an autonomous planner should modify its behavior (e.g., slowing down or requesting human intervention) once a high uncertainty score is triggered.

Conclusion

This work demonstrates that reliable trajectory prediction does not require massive computational redundancy. By augmenting existing models with lightweight latent-space experts, autonomous systems can better navigate the transition from familiar training environments to the unpredictable reality of the open road.

Summary updated

BibTeX
@inproceedings{wiederer2023joint,
  author = {Julian Wiederer and Julian Schmidt and Ulrich Kressel and Klaus Dietmayer and Vasileios Belagiannis},
  title = {{Joint Out-of-Distribution Detection and Uncertainty Estimation for Trajectory Prediction}},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=iusRZrcYRX},
}
Figure