Spatio-temporal transformer traffic prediction network based on multi-level causal attention

H Hengyuan He Z Zhengtao Long Y Yingchao Zhang X Xiaofei Jiang

Abstract

Traffic prediction is a core technology in intelligent transportation systems with broad application prospects. However, traffic flow data exhibits complex characteristics across both temporal and spatial dimensions, posing challenges for accurate prediction. In this paper, we propose a spatiotemporal Transformer network based on multi-level causal attention (MLCAFormer). We design a multi-level temporal causal attention mechanism that captures complex long- and short-term dependencies from local to global through a hierarchical architecture while strictly adhering to temporal causality. We also present a node-identity-aware spatial attention mechanism, which enhances the model’s ability to distinguish nodes and learn spatial correlations by assigning a unique identity embedding to each node. Moreover, our model integrates several input features, including original traffic flow data, cyclical patterns, and collaborative spatio-temporal embedding. Comprehensive tests on four real-world traffic datasets—METR-LA, PEMS-BAY, PEMS04, and PEMS08—show that our proposed MLCAFormer outperforms current benchmark models.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 20, Issue 9
Published September 02, 2025
Pages e0331139
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (4)

H

Hengyuan He

Z

Zhengtao Long

Y

Yingchao Zhang

X

Xiaofei Jiang