Skip to content
/ SLPF Public

Code for the TMLR 2025 paper "Spatio-temporal Partial Sensing Forecast of Long-term Traffic"

Notifications You must be signed in to change notification settings

zbliu98/SLPF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SLPF

This is an implementation of TMLR 2025 paper Spatio-temporal Partial Sensing Forecast of Long-term Traffic.

Overview

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:

  1. Dynamic adaptive step: Trains a module with X_M,T as input and X_M',T as output.
  2. 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.
  3. 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.

Requirements

  • torch
  • numpy
  • easydict
  • tqdm
  • pandas

Dataset

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

Usage

In terminal

  • 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.pth

Reference

If 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={}
}

About

Code for the TMLR 2025 paper "Spatio-temporal Partial Sensing Forecast of Long-term Traffic"

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published