交通预测是智能交通系统的基础组成部分,但在实际应用中仍面临挑战,主要源于传感器分布不规则以及建模大规模时空依赖关系所带来的高计算开销。在现实交通网络中,传感器在地理空间上分布不均,导致空间结构非均匀,从而限制了现有基于图和基于注意力机制模型的有效性与可扩展性。为应对这些挑战,我们提出 PatchSTG——一种面向不规则传感器网络、基于图像块(patch)的时空图变换器,旨在实现高效交通预测。其核心思想是引入分层空间表征,依据地理信息将传感器划分为规模均衡且保持局部邻近性的图像块。在此结构之上,采用双注意力编码器交替执行块内注意力(捕获局部交互)与块间注意力(建模全局依赖),将计算复杂度从二次方降低至近似线性。我们在罗德岛真实交通数据及多个大规模数据集上对 PatchSTG 进行评估。实验结果表明,该模型在多步预测任务中展现出稳定且具竞争力的性能,同时显著提升了计算效率。消融实验进一步验证了空间划分策略与双注意力机制在刻画局部与长程交通动态方面的有效性。结果表明,基于图像块的时空建模方法为不规则空间设置下的交通预测提供了一种可扩展且有效的框架。
Traffic forecasting is a fundamental component of intelligent transportation systems, yet remains challenging in real-world settings due to irregular sensor distributions and the high computational cost of modeling large-scale spatiotemporal dependencies. In practical traffic networks, sensors are unevenly distributed across regions, leading to non-uniform spatial structures that limit the effectiveness and scalability of existing graph-based and attention-based models. To address these challenges, we propose PatchSTG, a patch-based spatiotemporal graph Transformer designed for efficient forecasting on irregular sensor networks. The key idea is to introduce a hierarchical spatial representation that partitions sensors into balanced, locality-preserving patches based on geographic information. On top of this structure, a dual attention encoder alternates between intra-patch attention for capturing local interactions and inter-patch attention for modeling global dependencies, reducing computational complexity from quadratic to near-linear scaling. We evaluate PatchSTG on real-world traffic data from Rhode Island and additional large-scale datasets. Experimental results demonstrate that the proposed model achieves stable and competitive forecasting performance across multiple horizons, while significantly improving computational efficiency. Ablation studies further validate the effectiveness of spatial partitioning and dual attention in capturing both local and long-range traffic dynamics. These results suggest that patch-based spatiotemporal modeling provides a scalable and effective framework for traffic forecasting under irregular spatial settings.