#
STGM: Spatio-Temporal Graph Mixformer for Traffic Forecasting

Architecture

LICENCE DOI paper-with-code-pems-bay-metr-la paper-with-code-pemsd7-m paper-with-code-pems-bay Code style: black

This is the original repository for the paper entitled " Spatio-Temporal Graph Mixformer for Traffic Forecasting ".

--- > ## Abstract > > Traffic forecasting is of great importance for intelligent transportation systems (ITS). Because of the intricacy implied in traffic behavior and the non-Euclidean nature of traffic data, it is challenging to give an accurate traffic prediction. Despite that previous studies considered the relationship between different nodes, the majority have relied on a static representation and failed to capture the dynamic node interactions over time. Additionally, prior studies employed RNN-based models to capture the temporal dependency. While RNNs are a popular choice for forecasting problems, they tend to be memory hungry and slow to train. Furthermore, recent studies start utilizing similarity algorithms to better express the implication of a node over the other. However, to our knowledge, none have explored the contribution of node $𝑖$’s past, over the future state of node $𝑗$. In this paper, we propose a Spatio-Temporal Graph Mixformer (STGM) network, a highly optimized model with low memory footprint. We address the aforementioned limits by utilizing a novel attention mechanism to capture the correlation between temporal and spatial dependencies. Specifically, we use convolution layers with a variable field of view for each head to capture long–short term temporal dependency. Additionally, we train an estimator model that express the contribution of a node over the desired prediction. The estimation is fed alongside a distance matrix to the attention mechanism. Meanwhile, we use a gated mechanism and a mixer layer to further select and incorporate the different perspectives. Extensive experiments show that the proposed model enjoys a performance gain compared to the baselines while maintaining the lowest parameter counts. --- ## Performance and Visualization Table Prediction Sample ## Table of Contents ```text datasets ├─pemsbay | ├─distances.csv | ├─speed.h5 ├─metrla | ├─distances.csv | ├─speed.h5 ├─pemsd7m | ├─distances.csv | ├─speed.csv src ├─configs | ├─datasets | | ├─pemsbay.yaml | | ├─metrla.yaml | | ├─pemsd7m.yaml | ├─estimator | | ├─default.yaml | ├─model | | ├─stgm.yaml | | ├─stgm_full.yaml | ├─trainer | | ├─default.yaml | | ├─full.yaml | ├─sweeps | | ├─pemsbay.yaml | | ├─metrla.yaml | ├─paths | | ├─default.yaml | ├─log | | ├─default.yaml | ├─hydra | | ├─default.yaml | ├─config.yaml ├─helpers | ├─__init__.py | ├─dtw.py | ├─metrics.py | ├─utils.py | ├─viz.py ├─datasets | ├─__init__.py | ├─base.py | ├─pems.py | ├─metrla.py | ├─pemsd7m.py ├─models | ├─__init__.py | ├─base.py | ├─estimator.py | ├─stgm.py | ├─stgm_full.py ├─trainers | ├─__init__.py | ├─base.py | ├─default.py | ├─full.py ├─logs -> Run logs | ├─METR-LA -> Dataset name (auto-generated) | ├─ -> Starting date (auto-generated) | ├─