Traffic forecasting is a cornerstone of smart city management, enabling efficient resource allocation and transportation planning. Deep learning, with its ability to capture complex nonlinear patterns in spatiotemporal (ST) data, has emerged as a powerful tool for traffic forecasting. While graph neural networks (GCNs) and transformer-based models have shown promise, their computational demands often hinder their application to real-world road networks, particularly those with large-scale spatiotemporal interactions. To address these challenges, we propose a novel spatiotemporal graph transformer (STGformer) architecture. STGformer effectively balances the strengths of GCNs and Transformers, enabling efficient modeling of both global and local traffic patterns while maintaining a manageable computational footprint. Unlike traditional approaches that require multiple attention layers, STG attention block captures high-order spatiotemporal interactions in a single layer, significantly reducing computational cost. In particular, STGformer achieves a 100x speedup and a 99.8\% reduction in GPU memory usage compared to STAEformer during batch inference on a California road graph with 8,600 sensors. We evaluate STGformer on the LargeST benchmark and demonstrate its superiority over state-of-the-art Transformer-based methods such as PDFormer and STAEformer, which underline STGformer's potential to revolutionize traffic forecasting by overcoming the computational and memory limitations of existing approaches, making it a promising foundation for future spatiotemporal modeling tasks.
翻译:交通预测是智慧城市管理的基石,能够实现高效的资源分配与交通规划。深度学习凭借其捕捉时空数据中复杂非线性模式的能力,已成为交通预测的有力工具。尽管图神经网络和基于Transformer的模型已展现出潜力,但其计算需求往往阻碍了它们在实际道路网络(尤其是具有大规模时空交互的网络)中的应用。为应对这些挑战,我们提出了一种新颖的时空图Transformer架构——STGformer。该模型有效平衡了图神经网络与Transformer的优势,能够在保持可控计算开销的同时,高效建模全局与局部交通模式。与传统方法需要多个注意力层不同,STG注意力模块在单层内即可捕获高阶时空交互,从而显著降低计算成本。具体而言,在包含8600个传感器的加州道路图上进行批量推理时,STGformer相比STAEformer实现了100倍的速度提升和99.8%的GPU内存占用降低。我们在LargeST基准数据集上评估了STGformer,并证明了其优于PDFormer、STAEformer等当前最先进的基于Transformer的方法。这些结果凸显了STGformer通过突破现有方法的计算与内存限制来革新交通预测的潜力,使其成为未来时空建模任务的有望基础。