AgentFormer: Agent-Aware Transformers for Socio-Temporal Multi-Agent Forecasting

Ye Yuan, Xinshuo Weng, Yanglan Ou, Kris Kitani
3/25/2021
818 citations
cs.AIcs.CVcs.LG
transformer-attention

Official code: Khrylx/AgentFormer (317 stars, Python, MIT, PyTorch, last commit 2023-10-27).

Abstract

Predicting accurate future trajectories of multiple agents is essential for autonomous systems, but is challenging due to the complex agent interaction and the uncertainty in each agent's future behavior. Forecasting multi-agent trajectories requires modeling two key dimensions: (1) time dimension, where we model the influence of past agent states over future states; (2) social dimension, where we model how the state of each agent affects others.

Show full abstract

Most prior methods model these two dimensions separately, e.g., first using a temporal model to summarize features over time for each agent independently and then modeling the interaction of the summarized features with a social model. This approach is suboptimal since independent feature encoding over either the time or social dimension can result in a loss of information. Instead, we would prefer a method that allows an agent's state at one time to directly affect another agent's state at a future time. To this end, we propose a new Transformer, AgentFormer, that jointly models the time and social dimensions. The model leverages a sequence representation of multi-agent trajectories by flattening trajectory features across time and agents. Since standard attention operations disregard the agent identity of each element in the sequence, AgentFormer uses a novel agent-aware attention mechanism that preserves agent identities by attending to elements of the same agent differently than elements of other agents. Based on AgentFormer, we propose a stochastic multi-agent trajectory prediction model that can attend to features of any agent at any previous timestep when inferring an agent's future position. The latent intent of all agents is also jointly modeled, allowing the stochasticity in one agent's behavior to affect other agents. Our method substantially improves the state of the art on well-established pedestrian and autonomous driving datasets.

View on arXivView PDF

Code Implementations(1)

Khrylx/AgentFormerOfficial100%
PyTorchMIT

[ICCV 2021] Official PyTorch Implementation of "AgentFormer: Agent-Aware Transformers for Socio-Temporal Multi-Agent Forecasting".

31769PythonMar 24, 20213 years agoMIT
autonomous-drivingdeep-learningiccv2021multi-agent-forecastingpytorch+3 more

Similar Papers

Cite this paper

@article{yuan2021agentformer,
  title  = {AgentFormer: Agent-Aware Transformers for Socio-Temporal Multi-Agent Forecasting},
  author = {Ye Yuan and Xinshuo Weng and Yanglan Ou and Kris Kitani},
  year   = {2021},
  eprint = {2103.14023},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.14023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.14023.svg)](https://codeofpaper.com/paper/2103.14023)

Discussion