TrACT: A Training Dynamics Aware Contrastive Learning Framework for Long-Tail Trajectory Prediction

Junrui Zhang, Mozhgan Pourkeshavarz, Amir Rasouli

Abstract

Trajectory prediction is a cornerstone of safe autonomous driving, yet current models struggle with the "long-tail" problem—rare and complex scenarios that deviate from common driving patterns. This paper introduces TrACT (Training dynamics Aware ContrasTive learning), a framework that leverages the internal learning behavior of models to identify and prioritize difficult samples. By categorizing data based on training dynamics and employing prototypical contrastive learning with scene-aware features, TrACT significantly enhances prediction accuracy and safety in challenging environments.

Introduction

Predicting the future paths of road users is essential for the decision-making systems of autonomous vehicles. While deep learning models have achieved high average performance, their reliability often plummets when encountering "long-tail" events. These are rare occurrences, such as erratic maneuvers or complex intersection geometries, that are underrepresented in standard datasets.

Traditional approaches to this problem involve data balancing or motion-based contrastive learning. However, these methods often overlook the environmental context (e.g., lane layouts) and rely on manual heuristics to define sample difficulty. TrACT addresses these limitations by using the model's own training history to objectively identify difficult samples and incorporating rich contextual information into a contrastive learning framework.

Methodology

The TrACT framework is implemented in two primary stages: Dataset Mapping and Prototypical Contrastive Learning.

1. Dataset Mapping and 4-Quarter Clustering

TrACT begins by training a baseline model and tracking the "training dynamics" of every sample in the dataset. Specifically, it records the prediction error at the final epoch and the variance of that error throughout the training process. These metrics are used to plot a "Dataset Map," which segments the data into four distinct difficulty clusters:

  • Easy: Low error and low variance; the model learns these quickly and consistently.
  • Trained: Low error but high variance; the model eventually masters these after initial difficulty.
  • Hard: High error and low variance; the model consistently fails to learn these patterns.
  • Confusing: High error and high variance; the model's performance on these samples is highly unstable.

2. Prototypical Contrastive Learning (PCL)

In the second stage, TrACT extracts latent features that encode not just motion, but also map layouts and social interactions between agents. The framework calculates a "prototype" (an average feature vector) for each of the four difficulty clusters. During retraining, a contrastive loss is applied to encourage the model to align a sample's features with its corresponding difficulty prototype while distancing it from prototypes of other clusters. This "scene-aware" approach ensures that the model distinguishes between different types of challenging scenarios based on their environmental context.

Experimental Results

TrACT was evaluated on the nuScenes and ETH-UCY datasets, which are industry standards for urban driving and pedestrian interaction, respectively.

Quantitative Performance

The framework demonstrated significant improvements, particularly on the most challenging 5% of scenarios in the nuScenes dataset:

  • Prediction Accuracy: TrACT improved the Kernel Density Estimate-Negative Log-Likelihood (KDE-NLL) by 22.48% compared to existing contrastive learning methods. This metric indicates a much more accurate estimation of the probability distribution of future paths.
  • Safety and Compliance: The model achieved a 13.11% improvement in the Hard Off-Road Rate (HOR). This reduction in off-road predictions suggests that TrACT-trained models are better at respecting lane boundaries and drivable area constraints in complex scenes.

Qualitative Insights

Qualitative analysis shows that while baseline models often predict trajectories that cut across lanes or exit the roadway in complex roundabouts, TrACT maintains high lane discipline. Furthermore, the researchers discovered an "easy data bias": removing the easiest 20% of samples (as identified by the Dataset Map) actually improved baseline performance on hard cases by over 30%, highlighting how redundant simple data can hinder the learning of long-tail nuances.

Discussion and Conclusion

TrACT represents a shift toward using a model's own learning behavior as a diagnostic tool for data difficulty. By focusing on the long tail through scene-aware contrastive learning, it achieves state-of-the-art results in both accuracy and safety metrics.

One observed trade-off is a slight decrease in performance on "easy" samples when the model is heavily weighted toward "hard" and "confusing" clusters. Future research will explore more granular clustering and dynamic loss weighting to maintain peak performance across the entire data distribution. Despite the computational overhead of its two-stage training, TrACT provides a robust path forward for making autonomous systems safer in the unpredictable environments of the real world.

Summary updated

BibTeX
@inproceedings{zhang2024tract,
  author = {Junrui Zhang and Mozhgan Pourkeshavarz and Amir Rasouli},
  title = {{TrACT: A Training Dynamics Aware Contrastive Learning Framework for Long-Tail Trajectory Prediction}},
  booktitle = {IV},
  year = {2024},
  url = {https://openreview.net/forum?id=Xfwj8wYqki},
}
Figure