ST-TAR: An Efficient Spatio-Temporal Learning Framework for Traffic Accident Risk Forecasting

Hongyu Wang, Lisi Chen, Shuo Shang, Peng Han, Christian S. Jensen

Traffic accidents are often described as "black swan" events—rare, devastating, and notoriously difficult to model. In the context of artificial intelligence, this rarity creates a significant "zero-inflation" problem: if 99% of data points show zero accidents, a model can achieve 99% accuracy simply by predicting that nothing will ever happen. However, such a model is useless for public safety and emergency resource allocation.

In the paper "ST-TAR: An Efficient Spatio-Temporal Learning Framework for Traffic Accident Risk Forecasting," researchers from the University of Electronic Science and Technology of China and Aalborg University introduce a novel framework designed to solve the twin challenges of data scarcity and computational efficiency in urban safety modeling.

The Challenge of Urban Risk Forecasting

Predicting traffic accidents is a massive challenge for three primary reasons:

  1. Zero-Inflated Data: Accidents are rare. Most city "grids" at any given hour have a label of 0, making it difficult for standard deep learning models to learn from such imbalanced distributions.
  2. Spatio-Temporal Heterogeneity: Different parts of a city behave differently. A school zone has high risk at 3:00 PM, while a nightlife district peaks at midnight. "One-size-fits-all" models often fail to capture these local nuances.
  3. Efficiency Bottlenecks: Many state-of-the-art models are computationally heavy, combining complex Grid-based (CNN) and Graph-based (GCN) modules, making them too slow for real-time forecasting.

The ST-TAR Framework

ST-TAR (Spatio-Temporal Traffic Accident Risk) introduces several architectural innovations to address these bottlenecks. Instead of a single map, the model analyzes multiple "views" of the city—road similarity, Point of Interest (POI) similarity, and historical risk similarity.

The ST-TAR architecture includes hierarchical multi-view GCNs, long short-term cross-attention, and spatio-temporal contrastive learning modules.

Key components of the framework include:

  • Hierarchical Multi-view GCN: This module aggregates city views at different granularities (from fine-grained to coarse-grained) to reduce the proportion of zero-labels and capture multi-level spatial dependencies.
  • Long Short-term Cross-attention: ST-TAR treats long-term periodicity (e.g., weekly patterns) and short-term proximity (e.g., the last hour) as separate inputs, using an attention mechanism to weigh their relative influence on future risk.
  • Spatio-Temporal Contrastive Learning: To handle heterogeneity, the model uses contrastive learning to force the system to recognize unique local "signatures," distinguishing between specific regions at specific times.

Mining the "Zeros": LSH-based Adaptive Loss

A core contribution of the paper is the realization that not all zero-labels are equal. The researchers utilized Locality-Sensitive Hashing (LSH) to efficiently identify "high-risk" zero-label regions—areas that share features with actual accident zones but did not record an accident in a specific window.

By using LSH, the framework identifies high-risk areas within the zero-label data, providing more signal for the model to learn from than binary accident/non-accident labels.

By treating these "near misses" as soft targets in the loss function, the model learns from potential risks rather than treating every zero as a "safe" zone. This effectively increases the signal-to-noise ratio in sparse datasets.

Experimental Results and Efficiency

The model was evaluated on massive real-world datasets from New York City (2013) and Chicago (2016), including auxiliary data like weather, POI distribution, and taxi mobility. ST-TAR outperformed eight state-of-the-art baselines (including GSNet and MGHSTN) across several metrics:

  • Accuracy: It achieved the lowest Root Mean Square Error (RMSE) and the highest Mean Average Precision (MAP), particularly during high-stakes rush hour periods.
  • Computational Speed: ST-TAR demonstrated a 28% to 39% reduction in training time and a 32% to 45% reduction in inference time compared to top-performing baselines.
  • Memory Efficiency: By focusing on an optimized graph-only architecture and avoiding heavy CNN-GCN hybrids, the model uses substantially less GPU memory, making it viable for deployment on standard server hardware for real-time city monitoring.

Conclusion

ST-TAR represents a significant step forward in making urban safety AI both more accurate and fast enough for practical application. By intelligently mining zero-label data and optimizing the spatio-temporal learning architecture, the framework provides a scalable solution for predicting the "unpredictable" in complex urban environments.

Summary updated

Abstract

Traffic accidents represent a significant concern due to their devastating consequences. The ability to predict future traffic accident risks is of key importance to accident prevention activities in transportation systems. Although existing studies have made substantial efforts to model spatio-temporal correlations, they fall short when it comes to addressing the zero-inflated data issue and capturing spatio-temporal heterogeneity, which reduces their predictive abilities. In addition, improving efficiency is an urgent requirement for traffic accident forecasting. To overcome these limitations, we propose an efficient Spatio-Temporal learning framework for Traffic Accident Risk forecasting (ST-TAR). Taking long-term and short-term data as separate inputs, the ST-TAR model integrates hierarchical multi-view GCN and long short-term cross-attention mechanism to encode spatial dependencies and temporal patterns. We leverage long-term periodicity and short-term proximity for spatio-temporal contrastive learning to capture spatio-temporal heterogeneity. A tailored adaptive risk-level weighted loss function based on efficient locality-sensitive hashing is introduced to alleviate the zero-inflated issue. Extensive experiments on two real-world datasets offer evidence that ST-TAR is capable of advancing state-of-the-art forecasting accuracy with improved efficiency. This makes ST-TAR suitable for applications that require accurate real-time forecasting.
BibTeX
@inproceedings{wang2025st,
  author = {Hongyu Wang and Lisi Chen and Shuo Shang and Peng Han and Christian S. Jensen},
  title = {{ST-TAR: An Efficient Spatio-Temporal Learning Framework for Traffic Accident Risk Forecasting}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/865},
}
Figure