RepositoryPython
wengwenchao123

wengwenchao123/DDGCRN

[Pattern Recognition] Decomposition Dynamic Graph Conolutional Recurrent Network for Traffic Forecasting

103stars
15forks
0issues
2views

[Pattern Recognition] Decomposition Dynamic Graph Conolutional Recurrent Network for Traffic Forecasting

This is a PyTorch implementation of Decomposition Dynamic Graph Conolutional Recurrent Network for Traffic Forecasting, as described in our paper: Weng, Wenchao, Fan Jin ,Wu Huifeng and Hu Yujie ,Tian Hao, Zhu Fu, Wu Jia, A Decomposition Dynamic Graph Convolutional Recurrent Network for Traffic Forecasting,Pattern Recognition 2023.

Update

(2024/3/22)

  • Added a hyperparameter days_per_week for easy adjustment of the index quantity of time embeddings.

  • Added instructions for using the hyperparameters days_per_week and steps_per_day.

(2024/1/29)
  • Optimized the data processing part of the model by changing the normalization process from using the mean and variance of the entire dataset to using the mean and variance of the training set.

  • Improved the normalization operation when reading data, no longer normalizing the prediction target to avoid the abnormal MAPE issue on the PEMS03 dataset.

  • Enhanced the dataset splitting operation, changing from initially dividing the dataset and then segmenting samples to first segmenting samples and then dividing the dataset. This has increased the number of training and testing samples.

Table of Contents

Usage Instructions for Hyperparameters

days_per_week: The time intervals for data collection vary across different datasets. Adjust this hyperparameter based on the time intervals of the dataset being used. For example, in the PEMS04 dataset with a time interval of 5 minutes, set this parameter to 14400/5=288. Similarly, in the NYC-Bike dataset with a time interval of 30 minutes, set this parameter to 14400/30=48.

steps_per_day: The data collection scope varies across different datasets. For instance, PEMS04 collects data from Monday to Sunday, so set this parameter to 7. Conversely, for the PEMS07(M) dataset, data is collected only from Monday to Friday, so set this parameter to 5.

Data Preparation

For convenience, we package these datasets used in our model in Google Drive.

Unzip the downloaded dataset files to the main file directory, the same directory as run.py.

Requirements

Python 3.6.5, Pytorch 1.9.0, Numpy 1.16.3, argparse and configparser

Model Training

python run.py --dataset {DATASET_NAME} --mode {MODE_NAME}

Replace {DATASET_NAME} with one of PEMSD3, PEMSD4, PEMSD7, PEMSD8, PEMSD7(L), PEMSD7(M)

such as python run.py --dataset PEMSD4

There are two options for {MODE_NAME} : train and test

Selecting train will retrain the model and save the trained model parameters and records in the experiment folder.

With test selected, run.py will import the trained model parameters from {DATASET_NAME}.pth in the pre-trained folder.

Cite

If you find the paper useful, please cite as following:

@article{weng2023decomposition,
  title={A Decomposition Dynamic Graph Convolutional Recurrent Network for Traffic Forecasting},
  author={Weng, Wenchao and Fan, Jin and Wu, Huifeng and Hu, Yujie and Tian, Hao and Zhu, Fu and Wu, Jia},
  journal={Pattern Recognition},
  pages={109670},
  year={2023},
  publisher={Elsevier}
}

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
LibCity/Bigscity-LibCity

LibCity: An Open Library for Urban Spatial-temporal Data Mining

1.2k
Dec 18, 2024
RepositoryPython
BUAABIGSCity/PDFormer

[AAAI2023] A PyTorch implementation of PDFormer: Propagation Delay-aware Dynamic Long-range Transformer for Traffic Flow Prediction.

305
Oct 13, 2023
Repository
lixus7/Time-Series-Works-Conferences

Time-Series Work Summary in CS Top Conferences (NIPS, ICML, ICLR, KDD, AAAI, WWW, IJCAI, CIKM, ICDM, ICDE, etc.)

1.0k
Nov 18, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryPython
Coolgiserz/Awesome-Traffic-Prediction

Useful resources for traffic prediction, including popular papers, datasets, tutorials, toolkits, and other helpful repositories.

167
Nov 24, 2026
RepositoryPython
deepkashiwa20/MegaCRN

[AAAI23] This it the official github for AAAI23 paper "Spatio-Temporal Meta-Graph Learning for Traffic Forecasting"

151
Dec 23, 2023
RepositoryPython
LMissher/PatchSTG

[SIGKDD'2025] Efficient Large-Scale Traffic Forecasting with Transformers: A Spatial Data Management Perspective

88
Nov 30, 2025
RepositoryPython
Comfy-Org/ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

149.6k
Dec 2, 2026
Repository
LMissher/Awesome-Spatio-Temporal-Foundation-Models

A survey and paper list of current Spatio-Temporal Foundation Models from the pipeline perspective with awesome resources (paper, code, survey, etc.).

172
Jun 10, 2025