All models

STFGNN

Traffic-flow forecaster fusing road adjacency with a DTW-built temporal graph and gated dilated convolutions.

Time series · 793 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (36 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
1.3M
Operations
793
Framework
PyTorch
Recurrent
No
Published
AAAI 2021
Cited by
71 (as of 5 October 2026)
Authors
Mengzhang Li, Zhanxing Zhu
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m14413
Graph hash
73f018d1f0cfa4db7f5db094b44f8f63b01040022790785a25da4b1c32f16949
Skeleton hash
693e53f8dc66a6f5f43707e15067b1a53eb08dbef703a2da636686fcb92bd168
Architecture hash
ae184d408056b4a5efa3c4585653b1f7d77e113d0c2c0e4730fc44f0621406a9
Diagram SHA-256
a55e081d6aea5af13c4b39553d786a9f15a57d5c7a9bb71b93cd49887c4ff762
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

STFGNN is a traffic forecaster: it reads an hour of readings from every sensor on a road network and predicts the next hour, sensor by sensor. Its complaint about earlier models is that the given road-adjacency graph misses roads that behave alike without being neighbours, like business-district streets that all jam at rush hour. So it builds a second, data-driven temporal graph that links sensors whose time series look alike.

Similarity comes from dynamic time warping, and because plain DTW is quadratic in sequence length the authors restrict the warping path to a band around the diagonal, which they call fast-DTW. The spatial graph, the temporal graph and a temporal-connectivity graph that joins each node to itself at adjacent time steps are assembled into one fusion graph, so a few matrix multiplications aggregate all three kinds of dependency at once. Each layer runs several of these fusion-graph modules in parallel with a gated convolution module built from two dilated 1D convolutions, which widen the receptive field along time. Inside the graph modules the gating uses gated linear units. Training uses Huber loss.

The paper's configuration stacks 3 layers, each with 8 fusion-graph modules and 1 gated convolution module with dilation rate 3. Every convolution has 64 filters. The traced member is the PEMS08 setting with 170 sensors, where traffic flow is aggregated into 5-minute windows, so 288 points per day. The authors evaluated on PEMS03, PEMS04, PEMS07 and PEMS08 and report that STFGNN outperforms the baselines consistently on every dataset. The official code is an MXNet implementation, and a third-party PyTorch re-implementation exists as well. A January 2021 note in the README says the results on PEMS-BAY, METR-LA, PeMSD7(M) and PeMSD7(L) are not correct because of a different loss metric, and that the PEMS0X results are kept.

Key idea. A data-driven temporal graph built from fast-DTW similarity between sensor time series is fused with the spatial graph and a temporal-connectivity graph, and processed in parallel with gated dilated convolutions to learn hidden spatial-temporal dependencies.

  • STFGNN
  • Spatial-Temporal Fusion Graph Neural Networks
  • traffic flow forecasting
  • traffic forecasting
  • spatial-temporal graph
  • temporal graph
  • DTW
  • fast-DTW
  • PEMS08
  • PEMS04
  • STSGCN

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{li2021spatialtemporalfusiongraphneural,
      title={Spatial-Temporal Fusion Graph Neural Networks for Traffic Flow Forecasting}, 
      author={Mengzhang Li and Zhanxing Zhu},
      year={2021},
      eprint={2012.09641},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2012.09641}, 
}