This is an implementation of TMLR 2025 paper Spatio-temporal Partial Sensing Forecast of Long-term Traffic.
In this paper, we propose SLPF, a Spatial-temporal Long-term Partial sensing Forecast model for long-term traffic forecasting. SLPF introduces a rank-based node embedding to improve robustness against noise and better capture complex spatio-temporal correlations. We further design a spatial transfer module that leverages both rank-based embeddings and spatial adjacency to extract dynamic traffic patterns, enhancing adaptability and prediction accuracy. Finally, a multi-step training strategy is used for progressive model refinement. Experiments on real-world datasets show that SLPF achieves state-of-the-art accuracy in partial sensing long-term forecasting.
T: historical input length, T': future output length, M: sensed locations, M': unsensed locations (during inference)
Model training consists of three sequential steps:
- Dynamic adaptive step: Trains a module with X_M,T as input and X_M',T as output.
- Long-term forecasting step: Trains a module with X_M,T and the previous module's output as input, and X_M,T' as output.
- Aggregation step: Trains a module with X_M,T and outputs from the previous two modules as input, and X_M',T' as output.
These three modules are trained in sequence and together form the proposed SLPF. We require data from all locations during training, but only the data from sensed locations during inference.
- torch
- numpy
- easydict
- tqdm
- pandas
PEMS03, PEMS04, and PEMS08 already downloaded and preprocessed in data folder
PEMS-BAY and METR-LA can be downloaded here this repo and this Google Drive
Also, we provide the all data in the Baidu Netdisk with the passcode 1234
- training process
cd model
python run_SLPF.py --dataset=PEMS08 --seed=6 --num_unsensed_locs=150 --lr_init=0.001 # add arguments you want or alter model/configs/{dataset}.conf- inference process
cd model
python run_SLPF.py \
--dataset=LA \
--seed=6 \
--num_unsensed_locs=150 \
--mode=test \
--adp_model_path=../runs/LA/08-07-12h34m47s_LA_embed32_lyr3_lr0.001_wd0.0003_s_6_m_150/adp_best_model.pth \
--forecast_model_path=../runs/LA/08-07-12h34m47s_LA_embed32_lyr3_lr0.001_wd0.0003_s_6_m_150/forecast_best_model.pth \
--agg_model_path=../runs/LA/08-07-12h34m47s_LA_embed32_lyr3_lr0.001_wd0.0003_s_6_m_150/agg_best_model.pthIf you find the paper or the repo useful, please cite it with
@article{
liu2025spatiotemporal,
title={Spatio-temporal Partial Sensing Forecast of Long-term Traffic},
author={Zibo Liu and Zhe Jiang and Zelin Xu and Tingsong Xiao and Zhengkun Xiao and Yupu Zhang and Haibo Wang and Shigang Chen},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2025},
url={https://openreview.net/forum?id=Ff08aPjVjD},
note={}
}
