Spatial Temporal Attention-Based Target Vehicle Trajectory Prediction for Internet of Vehicles

Ouhan Huang, Huanle Rao, Xiaowen Cai, Tianyun Wang, Aolong Sun, Sizhe Xing, Yifan Sun, Gangyong JiaIEEE Trans Autom. Sci. Eng 2025

Abstract

Accurate vehicle trajectory prediction is a fundamental requirement for the Internet of Vehicles (IoV) and autonomous driving. Traditional methods often overlook the physical constraints of road networks or struggle with long-range temporal dependencies. This paper introduces STATVTPred, a spatial-temporal attention-based model that combines Graph Attention Networks (GATs) and Transformers. By integrating a dedicated Filter layer to enforce road connectivity constraints, the model significantly improves prediction accuracy. Experimental results on two large-scale real-world datasets demonstrate that STATVTPred outperforms state-of-the-art methods, including LSTMs, by a substantial margin.

1. Introduction

Predicting the future path of a vehicle in a complex urban environment is essential for safety and efficiency. However, vehicles do not move freely; their trajectories are strictly governed by the topology of the road network. Standard time-series models like LSTMs often fail to account for these spatial correlations and can produce "illegal" trajectories that deviate from actual road paths, especially in areas with poor GPS signals. To address this, we propose a model that treats the city as a living, directed graph, capturing both the rhythm of driving behavior and the rules of the road.

2. Methodology

The STATVTPred architecture is designed to fuse spatial and temporal features through a multi-stage pipeline.

The STATVTPred architecture, integrating Transformer components with Graph Attention Networks and a final Filter Layer for constraint enforcement.

2.1 Graph Representation and Spatial Attention

The road network is modeled as a directed graph $G = (V, E)$, where each road segment is represented as a node and intersections are edges. This representation allows the model to leverage Graph Attention Networks (GATs) to weigh the importance of neighboring segments, providing the necessary spatial context for prediction.

Graph representation of road segments ($n$) and edges ($e$) illustrating the connectivity used for spatial modeling.

2.2 Temporal Modeling and the Filter Layer

To capture long-term driving patterns, the model employs a Transformer architecture. Unlike recurrent models, Transformers use self-attention to process sequences in parallel, identifying dependencies across the entire trajectory.

A critical innovation is the Filter Layer. This post-processing step uses the road network's connectivity matrix to mask impossible transitions. By ensuring the predicted sequence follows a physically continuous path, the Filter layer grounds the deep learning model in real-world constraints.

3. Datasets and Experimental Setup

The model was validated using two extensive real-world taxi datasets:

  • T-Drive (Beijing): One week of data from 10,357 taxis, covering over 109,000 road segments.
  • Chengdu Taxi Dataset: Eleven days of data from 13,605 drivers, covering over 203,000 road segments.

These datasets provide a rigorous testbed due to the high density of intersections and complex urban driving patterns.

4. Results and Discussion

STATVTPred demonstrated superior performance across all key metrics:

  • Average Match Rate (AMR): In Beijing, the model achieved an AMR of 73.07%, representing a 37.45% improvement over LSTM Encoder-Decoder models and a 6.38% improvement over standard Transformers.
  • Distance Error (DE): The model significantly reduced spatial error, with a DE of 26.93% in Beijing and 20.95% in Chengdu, outperforming baseline methods like Markov Chains and NetTraj.

Ablation studies confirmed that both the GAT component and the Filter layer are essential for achieving these results, proving the value of combining spatial-temporal attention with physical constraints.

5. Conclusion

STATVTPred offers a robust framework for vehicle trajectory prediction by treating road networks as directed graphs and applying dual-attention mechanisms. Future work will explore extending this architecture to 3D trajectories for Unmanned Aerial Vehicles (UAVs) and achieving lane-level precision in multi-agent scenarios.

Summary updated

BibTeX
@inproceedings{huang2025spatial,
  author = {Ouhan Huang and Huanle Rao and Xiaowen Cai and Tianyun Wang and Aolong Sun and Sizhe Xing and Yifan Sun and Gangyong Jia},
  title = {{Spatial Temporal Attention-Based Target Vehicle Trajectory Prediction for Internet of Vehicles}},
  booktitle = {IEEE Trans Autom. Sci. Eng},
  year = {2025},
}
Figure