Ling Deng , Chengcheng Xu , Pan Liu , Yuxuan Wang , Yanli Jiao , Kequan Chen
{"title":"Spatial-temporal gated transformer network for freeway secondary crash prediction considering the impact of class imbalance","authors":"Ling Deng , Chengcheng Xu , Pan Liu , Yuxuan Wang , Yanli Jiao , Kequan Chen","doi":"10.1016/j.aap.2025.108387","DOIUrl":null,"url":null,"abstract":"<div><div>The primary objective of this paper is to improve the prediction accuracy of freeway secondary crashes by jointly modeling spatiotemporal dynamics and addressing the challenge of class imbalance. Using secondary-crash data from Interstate 5 (I-5) in California, we develop a Spatial-Temporal Gated Transformer Network (STGT-Net). STGT-Net employs a tri-branch encoder to model upstream, downstream, and differential traffic flows, and dual Transformer modules with a gated fusion mechanism to capture temporal and inter-feature dependencies. To address data rarity, we employ an LSTM-based Wasserstein GAN with gradient penalty (LSTM-WGAN-GP) to generate realistic, sequence-aware crash samples. Comparative results show that the secondary crash data generated by our method aligns more closely with real-world conditions than those produced by existing approaches. STGT-Net achieves substantial relative improvements of 13.08% in F1-score and 13.95% in Matthews Correlation Coefficient (MCC) compared with the best baseline. Finally, SHapley Additive exPlanations (SHAP)-based analysis reveals that upstream traffic variables contribute most strongly to the model’s predictions, with downstream and upstream–downstream differential indicators also providing informative cues.</div></div>","PeriodicalId":6926,"journal":{"name":"Accident; analysis and prevention","volume":"227 ","pages":"Article 108387"},"PeriodicalIF":7.4000,"publicationDate":"2026-03-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Accident; analysis and prevention","FirstCategoryId":"5","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0001457525004750","RegionNum":1,"RegionCategory":"工程技术","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/12/31 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"ERGONOMICS","Score":null,"Total":0}
引用次数: 0
Abstract
The primary objective of this paper is to improve the prediction accuracy of freeway secondary crashes by jointly modeling spatiotemporal dynamics and addressing the challenge of class imbalance. Using secondary-crash data from Interstate 5 (I-5) in California, we develop a Spatial-Temporal Gated Transformer Network (STGT-Net). STGT-Net employs a tri-branch encoder to model upstream, downstream, and differential traffic flows, and dual Transformer modules with a gated fusion mechanism to capture temporal and inter-feature dependencies. To address data rarity, we employ an LSTM-based Wasserstein GAN with gradient penalty (LSTM-WGAN-GP) to generate realistic, sequence-aware crash samples. Comparative results show that the secondary crash data generated by our method aligns more closely with real-world conditions than those produced by existing approaches. STGT-Net achieves substantial relative improvements of 13.08% in F1-score and 13.95% in Matthews Correlation Coefficient (MCC) compared with the best baseline. Finally, SHapley Additive exPlanations (SHAP)-based analysis reveals that upstream traffic variables contribute most strongly to the model’s predictions, with downstream and upstream–downstream differential indicators also providing informative cues.
本文的主要目标是通过对高速公路二次碰撞的时空动态建模和解决类别不平衡的挑战,提高高速公路二次碰撞的预测精度。利用加州5号州际公路(I-5)的二次事故数据,我们开发了一个时空门控变压器网络(STGT-Net)。STGT-Net采用三分支编码器对上游、下游和差分流量进行建模,并采用带门控融合机制的双Transformer模块来捕获时间和特征间的依赖关系。为了解决数据稀缺性问题,我们采用了基于lstm的带梯度惩罚的Wasserstein GAN (LSTM-WGAN-GP)来生成真实的、序列感知的崩溃样本。对比结果表明,我们的方法产生的二次碰撞数据比现有方法产生的数据更接近真实情况。与最佳基线相比,STGT-Net在f1评分和马修斯相关系数(MCC)方面取得了13.08%和13.95%的实质性相对改善。最后,基于SHapley加性解释(SHAP)的分析表明,上游交通变量对模型的预测贡献最大,下游和上下游差异指标也提供了信息线索。
期刊介绍:
Accident Analysis & Prevention provides wide coverage of the general areas relating to accidental injury and damage, including the pre-injury and immediate post-injury phases. Published papers deal with medical, legal, economic, educational, behavioral, theoretical or empirical aspects of transportation accidents, as well as with accidents at other sites. Selected topics within the scope of the Journal may include: studies of human, environmental and vehicular factors influencing the occurrence, type and severity of accidents and injury; the design, implementation and evaluation of countermeasures; biomechanics of impact and human tolerance limits to injury; modelling and statistical analysis of accident data; policy, planning and decision-making in safety.