Deciphering Movement: Unified Trajectory Generation Model for Multi-Agent

Yi Xu, Yun FuarXiv 2024 · arXiv · OpenReview

Abstract

Understanding multi-agent behavior is critical across various fields. The conventional approach involves analyzing agent movements through three primary tasks: trajectory prediction, imputation, and spatial-temporal recovery. Considering the unique input formulation and constraint of these tasks, most existing methods are tailored to address only one specific task. However, in real-world applications, these scenarios frequently occur simultaneously. Consequently, methods designed for one task often fail to adapt to others, resulting in performance drops. To overcome this limitation, we propose a Unified Trajectory Generation model, UniTraj, that processes arbitrary trajectories as masked inputs, adaptable to diverse scenarios. Specifically, we introduce a Ghost Spatial Masking (GSM) module embedded within a Transformer encoder for spatial feature extraction. We further extend recent successful State Space Models (SSMs), particularly the Mamba model, into a Bidirectional Temporal Mamba to effectively capture temporal dependencies. Additionally, we incorporate a Bidirectional Temporal Scaled (BTS) module to comprehensively scan trajectories while maintaining the temporal missing relationships within the sequence. We curate and benchmark three practical sports game datasets, Basketball-U, Football-U, and Soccer-U, for evaluation. Extensive experiments demonstrate the superior performance of our model.

Introduction

In the fields of sports analytics and autonomous systems, understanding how multiple agents move and interact is vital. However, current research is often fragmented into specialized models designed for single tasks:

  1. Trajectory Prediction: Forecasting future paths based on historical data.
  2. Imputation: Filling in missing data points when an agent is temporarily obscured.
  3. Spatial-Temporal Recovery: Reconstructing complete paths from sparse or noisy observations.

In real-world scenarios, such as sports broadcasts, these challenges often occur simultaneously—for instance, when a player runs off-camera and then reappears. Standard benchmarks like the ETH/UCY pedestrian datasets often lack the intensity and strategic depth found in professional sports. To address this, we introduce UniTraj, a unified framework that treats all these tasks as a generalized "masked input" problem.

Visualizing the three core trajectory tasks: Prediction, Imputation, and Spatial-Temporal Recovery.

Methods

UniTraj is a generative model based on the Conditional Variational Autoencoder (CVAE) framework. It processes arbitrary trajectories as masked inputs, making it adaptable to diverse scenarios. The architecture incorporates three primary technical innovations:

  • Ghost Spatial Masking (GSM): Instead of using complex graph neural networks, GSM abstracts the "spatial structure of missingness." It creates "ghost" tokens that summarize agent visibility, allowing a standard Transformer encoder to better understand the social context of the scene.
  • Bidirectional Temporal Mamba (BTM): We adapt the Mamba model—a recent, efficient alternative to Transformers for long sequences—into a bidirectional architecture. While standard Mamba is causal, BTM processes trajectories in both forward and backward directions to capture long-term dependencies.
  • Bidirectional Temporal Scaled (BTS) Module: This module explicitly calculates how long an agent has been "missing," allowing the model to account for the natural decay of observational influence over time.
The UniTraj architecture, featuring the Ghost Spatial Masking (GSM) module and Bidirectional Temporal Mamba blocks.

Datasets and Evaluation

To reflect the complexity of professional sports, we curated three new benchmarks:

  • Basketball-U: Derived from NBA tracking data (10 players, 1 ball).
  • Football-U: Derived from NFL Next Gen Stats (22 players, 1 ball).
  • Soccer-U: Derived from the SoccerTrack dataset (22 players, 1 ball).

We applied five different masking strategies to these datasets, simulating everything from random sensor dropouts to long-term occlusions.

Key Results

UniTraj consistently outperformed advanced baselines, such as GC-VRNN and SSSD, across all three sports datasets. Key findings include:

  • Improved Accuracy: On the Basketball-U dataset, UniTraj improved the minADE₂₀ (minimum Average Displacement Error) by 17.9% compared to previous state-of-the-art methods.
  • Physical Reliability: The model showed a significantly lower "Out-of-Boundary" (OOB) rate, indicating a better grasp of the physical constraints of the playing field.
  • Qualitative Smoothness: Visualizations demonstrate that UniTraj produces smoother, more realistic paths than baseline models, which often generate jittery or physically impossible movements when data is sparse.

Conclusion and Future Work

UniTraj demonstrates the power of a unified approach to multi-agent trajectory generation. By treating missingness as a valuable signal and leveraging bidirectional state-space models, it achieves superior performance in complex environments. Future work will focus on enhancing the decoder complexity and making the architecture agnostic to the number of agents, further improving its applicability to real-world computer vision scenarios.

Summary updated

Abstract

Understanding multi-agent behavior is critical across various fields. The conventional approach involves analyzing agent movements through three primary tasks: trajectory prediction, imputation, and spatial-temporal recovery. Considering the unique input formulation and constraint of these tasks, most existing methods are tailored to address only one specific task. However, in real-world applications, these scenarios frequently occur simultaneously. Consequently, methods designed for one task often fail to adapt to others, resulting in performance drops. To overcome this limitation, we propose a Unified Trajectory Generation model, UniTraj, that processes arbitrary trajectories as masked inputs, adaptable to diverse scenarios. Specifically, we introduce a Ghost Spatial Masking (GSM) module embedded within a Transformer encoder for spatial feature extraction. We further extend recent successful State Space Models (SSMs), particularly the Mamba model, into a Bidirectional Temporal Mamba to effectively capture temporal dependencies. Additionally, we incorporate a Bidirectional Temporal Scaled (BTS) module to comprehensively scan trajectories while maintaining the temporal missing relationships within the sequence. We curate and benchmark three practical sports game datasets, Basketball-U, Football-U, and Soccer-U, for evaluation. Extensive experiments demonstrate the superior performance of our model. To the best of our knowledge, this is the first work that addresses this unified problem through a versatile generative framework, thereby enhancing our understanding of multi-agent movement. Our datasets, code, and model weights are available at https://github.com/colorfulfuture/UniTraj-pytorch.
BibTeX
@misc{xu2024deciphering,
  author = {Yi Xu and Yun Fu},
  title = {{Deciphering Movement: Unified Trajectory Generation Model for Multi-Agent}},
  year = {2024},
  eprint = {2405.17680},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.17680},
}
Figure