Spatio-Temporal Road-aware Adaptive Mapping for Graph Neural Network Prediction.
STRAM converts raw urban event data (e.g., crashes, 311 requests) into an adaptive, data-driven graph by ranking road-network nodes through centrality, time-decayed event density, and spatial coverage, then constructing weighted Voronoi regions. The resulting graph is consumed by standard STGNN backbones for next-step urban event forecasting.
We use uv for fast, reproducible installs.
pip install uv
uv venv
source .venv/bin/activate
uv pip install -r requirements.txtThe pinned versions assume CUDA 11.8 and PyTorch 2.4. For other hardware,
adjust the torch* and nvidia-* entries before installing.
Two NYC datasets from NYC OpenData are used:
- Motor Vehicle Collisions – Crashes
- 311 Service Requests
Place the raw CSVs under data/raw/ (or set STRAM_DATA_DIR), then clean them:
python data_preprocessing/preprocess_crash.py
python data_preprocessing/preprocess_311.pyAdministrative shapefiles for the baselines belong in data/in/ (paths are
configurable via --*_districts_file flags in config.py).
Train a model end-to-end with a chosen mapping:
python main.py \
--mapping stram \
--model dcrnn \
--dataset crash_df_cleaned.csv \
--time_col crash_datetime \
--task classificationmapping/ Spatial mapping methods
graph_construction/ Graph and temporal-feature construction
features/ OSM-based static feature extraction
models/ GNN backbones
training/ Training, evaluation, spatial-precision metrics
visualization/ Mapping visualizations
data_preprocessing/ Raw dataset cleaning scripts
config.py Command-line configuration
main.py Training entry point
If you find this code or our work useful in your research, please consider citing us:
@article{GHAFFARI2026134161,
title = {STRAM: Spatio-temporal road-aware mapping for graph neural network prediction},
journal = {Neurocomputing},
volume = {696},
pages = {134161},
year = {2026},
issn = {0925-2312},
doi = {https://doi.org/10.1016/j.neucom.2026.134161},
url = {https://www.sciencedirect.com/science/article/pii/S0925231226015596},
author = {Amirhossein Ghaffari and Huong Nguyen and Lauri Lovén and Ekaterina Gilman},
}