In this study, we present an graph-attention-based approach for air quality prediction at multiple monitoring stations termed the Multi-scale Spatio-Temporal Graph Attention Network (MSTGAN). Experiments with two real-world datasets showed the proposed MSTGAN achieved the highest prediction accuracies for 12,18 and 24-hour prediction time lengths, compared to several state-of-the-art methods.
MSTGAN uses the following dependencies
- Pytorch 1.12.1 and its dependencies
- Numpy and Pandas
- CUDA 11.8 or latest version
We list the code of the major modules as follows:
- The main function to train/test our model: click here
- The source code of our model: click here
- Train and test data preporcessing are located at: click here
- Metric computations: click here
We introduce some major arguments of our main function here.
Training settings:
- train_rate: rate of train set
- test_rate: rate pf test set
- lag: time length of hidtorical steps
- pre_len: time length of future steps
- num_nodes: the number of stations
- batch_size: training or testing batch size
- input_dim: the feature dimension of inputs
- output_dim: the feature dimension of outputs
- learning_rate: the learning rate at the beginning
- epochs: training epochs
- early_stop_patience: the patience of early stopping
- device: using which GPU to train our model
- seed: the random seed for experiments
Model hyperparameters:
- d_model: position encoding embedding dimension
- cheb_k: Chebyshev polynomials order
- block1_hidden: number of hidden layers in the first block
- block2_hidden: number of hidden layers in the second block
- time_strides: time resolution
- nb_block: number of Multi-Spatio-Temporal_Block (MST_Block)
- dropout: dropout rate
- If you find our work useful in your research, please cite:
Zhou, X., Wang, J., Wang, J. & Guan, Q.* (2024) Predicting air quality using a multi-scale spatiotemporal graph attention network, Information Sciences, 680: 121072. DOI: 10.1016/j.ins.2024.121072