A Method for Predicting Traffic Accidents Based on an Ensemble Empirical Mode Decomposition and an Optimized LSTM Model
-
摘要: 道路交通事故精准预测是有效提升交通安全的重要手段,由于事故数据经常呈现非线性、波动性、无周期性等特征,现有的算法存在预测效果不佳的问题。为此本文提出基于集合经验模态分解降噪算法(ensemble empirical mode decomposition,EEMD)和优化长短时记忆神经网络(long short-term memory,LSTM)的交通事故数量预测模型。在单一模型的基础上,引入降噪算法EEMD对噪声大的交通事故时间序列进行降噪处理,利用EEMD对事故时间序列进行分解得到多个子序列和1个残差项;基于粒子群优化算法(particle swarm optimization,PSO)优化LSTM网络结构参数,并在LSTM的最优网络结构下提取数据中的时间特征信息进行预测,对各子序列及残差的预测结果求和得到最终预测结果。研究结果表明:相对于EMD-PSO-LSTM,PSO-LSTM,EEMD-LSTM,LSTM这4个模型,EEMD-PSO-LSTM的预测效果最好,其对应的预测误差ermse分别降低了8.7%、48.3%、53.1%、57.6%,误差emape分别降低了12.4%、36.9%、50.6%、61.2%。进一步研究表明,运用EEMD对数据进行降噪预处理能提高预测精度,与PSO-LSTM模型相比,EEMD-PSO-LSTM模型的误差ermse降低了60.2%,emape降低了12.4%,判定系数r2提高了0.616 5;引入PSO模型优化神经网络结构同样也能有效提升预测效果,与EEMD-LSTM模型相比,EEMD-PSO-LSTM模型的误差ermse减小了53.1%,emape降低了50.6%,判定系数r2提高了0.807 8。该研究结果能够提高交通事故预测精度,帮助相关部门有效提高道路交通安全水平。Abstract: Accurate prediction of road traffic accidents is essential to improve traffic safety effectively. Due to the frequent non-linear, fluctuating, and nonperiodic characteristics of accident data, existing algorithms have the problem of poor prediction performance. Therefore, a method for traffic prediction that uses a long short-term memory network (LSTM) combined with ensemble empirical mode decomposition (EEMD) and particle swarm optimization (PSO) is proposed. Based on a single model, the EEMD is first used to break down the noise of accident data and obtain multiple subsequences and a residual. Based on LSTM optimized by PSO, the temporal feature information extracted from the data is predicted under the optimal network structure of LSTM. Then, the prediction results of each subsequence and residual are summed to obtain the final prediction result. The results show that, compared with the EMD-PSO-LSTM, PSO-LSTM, EEMD-LSTM, and LSTM, the ermse of EEMD-PSO-LSTM is reduced by 8.7%, 48.3%, 53.1%, and 57.6%, respectively. Meanwhile, the emape is reduced by 12.4%, 36.9%, 50.6%, and 61.2%, respectively. Compared with the PSO-LSTM, the ermse of the EEMD-PSO-LSTM is reduced by 60.2%, the emape is reduced by 12.4%, and the r2 is increased by 0.616 5. The PSO Introduced to optimize neural networks can help improve prediction performance. Compared with the EEMD-LSTM, the ermse of the EEMD-PSO-LSTM is reduced by 53.1%, the emape is diminished by 50.6%, and the r2 is climbed to 0.807 8. The results can improve the prediction accuracy of traffic accidents and help relevant departments effectively improve road traffic safety.
-
表 1 原始事故序列描述统计分析
Table 1. Descriptivestatistical analysis of original accident sequences
统计指标 数值 数量 365 范围 86.0 最小值 0 最大值 86 均值 27.302 方差 408.09 偏度 0.81 峰度 -0.161 表 2 各分量及趋势项分析结果
Table 2. Results of components and trend items
分量 平均周期/d 与原序列相关系数 方差贡献率/% F1 3.47 0.379** 32.336 F2 6.87 0.288** 16.411 F3 19.16 0.280** 13.661 F4 36.40 0.270** 12.201 F5 52 0.374** 10.872 F6 182 0.776** 8.531 F7 364 0.790** 5.223 F8 364 0.548** 0.420 R 0.409** 0.344 注:**表示在0.01水平上显著相关。 表 3 PSO-LSTM参数初始化
Table 3. Initial parameters of the PSO-LSTM model
网络参数 初始值 进化次数 10 种群规模 10 学习因子c1 1.5 学习因子c2 1.5 初始隐层单元数 20 初始学习率 0.001 时间步 10 迭代次数 500 表 4 经PSO算法优化的LSTM模型参数
Table 4. LSTM model parameters optimized by PSO algorithm
分量 学习率 隐含层 F1 0.011 230 F2 0.009 191 F3 0.011 52 F4 0.007 150 F5 0.013 29 F6 0.007 166 F7 0.005 163 F8 0.010 210 R 0.013 251 表 5 模型预测误差对比
Table 5. Model prediction error comparison
模型 ermse emape r2 EEMD-PSO-LSTM 5.5102 0.423 4 0.739 7 EMD-PSO-LSTM 6.033 4 0.483 4 0.7162 PSO-LSTM 10.659 3 0.671 4 0.1232 EEMD-LSTM 11.742 9 0.856 6 -0.068 1 LSTM 12.983 1 1.0909 -0.307 7 BP 13.188 4 2.071 1 -0.203 5 AMRIA 17.415 7 2.1546 -0.232 8 -
[1] PARVAREH M, KARIMIA, REZAEIS, et al. Assessment and prediction of road accident Injuries trend using timeseries models in Kurdistan[J]. Burns & Trauma, 2018, 6(1): 55-62. [2] HUANG T Y, WANG Y. Forecasting model of urban traffic accidents based on Grey Model-GM(1, 1)[C]. Second Workshop on Digital Media and its Application in Museum & Heritages(DMAMH 2007), Chongqing, China: IEEE, 2008. [3] XU CH CH, WANG W, LI Z B, et al. Using support vector machine models for crash injury severity analysis[J]. Accident Analysis & Prevention, 2012, 45 (2): 478-486. [4] 谢学斌, 孔令燕. 基于ARIMA和XGBoost组合模型的交通事故预测[J]. 安全与环境学报, 2021, 21 (1): 277-284.XIE X B, KONG L Y. On the ways to the traffic accident prediction based on the AMRIA and XGBoost combined model[J]. Journal of Safety and Environment, 2021, 21(1): 277-284. (in Chinese) [5] DOGRU N, SUBASI A. Traffic accident detection using random forest classifier[C]. 2018 15th Learning and Technology Conference(L&T), Jeddah, Saudi Arabia: IEEE, 2018. [6] 李文书, 邹涛涛, 王洪雁, 等. 基于双尺度长短期记忆网络的交通事故量预测模型[J]. 浙江大学学报(工学版), 2020, 54 (8): 1613-1619.LI W S, ZOU T T, WANG H Y, et al. Traffic accident quantity prediction model based on dual-scale long short-term memory network[J]. Journal of Zhejiang University(Engineering Science), 2020, 54 (8): 1613-1619. (in Chinese) [7] ZHENG M, LI T, ZHU R, et al. Traffic accident's severity prediction: A deep-learning approach-based CNN network[J]. IEEE Access, 2019, 7: 39897 - 39910. doi: 10.1109/ACCESS.2019.2903319 [8] ZHANG Z H, YANG W Z, WUSHOUR S. Traffic accident prediction based on LSTM-GBRT model[J]. Journal of Control Science and Engineering, 2020, 2020 (20): 1-10. [9] LIN F, XU Y, YANG Y, et al. A spatial-temporal hybrid model for short-term traffic prediction[J]. Mathematical Problems in Engineering, 2019, 2019 (PT. 1): 1-12. [10] HUANG N E, WU Z H. Ensemble empirical mode decomposition: a noise-assisted data analysis method. Advances in Adaptive Data Analysis, 2009 (1): 1-41. [11] KIM N S, CHUNG K, AHN S, et al. Denoising traffic collision data using ensemble empirical mode decomposition (EEMD)and its application for constructing continuous risk profile(CRP)[J]. Accident Analysis & Prevention, 2014, 71 (1), 29-37. [12] 马莹莹, 靳雪振. 基于EEMD和小波阈值的短时交通流预测研究[J]. 重庆交通大学学报(自然科学版), 2022, 41 (6): 22-29.MA Y Y, JIN X Z. Short-term traffic flow forecast method based on EEMD-Wavelet threshold[J]. Journal of Chongqing Jiaotong University(Natural Science), 2022, 41(6): 22-29. (in Chinese) [13] 王盛, 杨信丰. 基于EEMD-GWO-LSSVM的公共交通短期客流预测[J]. 计算机工程与应用, 2019, 55(20): 216-221, 239.WANG S, YANG X F. Short-Term passenger flow forecasting of public transport based on EEMD-GWO-LSSVM[J]. Computer Engineering and Applications, 2019, 55(20): 216-221, 239. (in Chinese) [14] 肖进丽, 李晓磊. 基于集合经验模态分解和差分进化算法优化BP神经网络的船舶交通流预测[J]. 大连海事大学学报, 2018, 44 (2): 9-14. doi: 10.3969/j.issn.1671-7031.2018.02.003XIAO J L, LI X L. Vessel traffic flow prediction method based on ensemble empirical mode decomposition and back propagation neural network optimized with differential evolution algorithm[J]. Journal of Dalian Maritime University, 2018, 44 (2): 9-14. (in Chinese) doi: 10.3969/j.issn.1671-7031.2018.02.003 [15] 殷礼胜, 唐圣期, 李胜, 等. 基于EEMD-IPSO-LSSVM的交通流组合预测模型[J]. 电子测量与仪器学报, 2019, 33 (12): 126-133.YIN S L, TANG S Q, LI S, et al. Combined model based on EEMD-IPSO-LSSVM for short-term flow traffic prediction[J]. Journal of Electronic Measurement and Instrumentation, 2019, 33 (12): 126-133. (in Chinese) [16] 刘东辉, 肖雪, 张珏. 基于粒子群和LSTM模型的变区间短时停车需求预测方法[J]. 交通信息与安全, 2021, 39 (4): 77-83. doi: 10.3963/j.jssn.1674-4861.2021.04.010LIU D H, XIAO X, ZHANG J. A prediction method for short-term parking demands in variable interval based on particle swarm optimization and LSTM model[J]. Journal of Transport Information and Safety, 2021, 39(4): 77-83. (in Chinese) doi: 10.3963/j.jssn.1674-4861.2021.04.010 [17] 史宇辰, 晏松, 姚丹亚, 等. 基于SVM-LSTM的车辆跟驰行为识别与信息可信甄别[J]. 交通运输工程学报, 2022, 22 (3): 115-125.SHI Y C, YAN S, YAO D Y. SVM-LSTM-based car-following behavior recognition and information credibility discirmination[J]. Journal of Traffic and Transportation Engineering, 2022, 22 (3): 115-125. (in Chinese) [18] 熊晓夏, 刘擎超, 沈钰杰, 等. 基于LSTM-BF的高速公路交通事故风险模型[J]. 中国安全科学学报, 2022, 32(5): 170-176.XIONG X X, LIU Q C, SHEN Y J, et al. Study on risk model of highway traffic accidents based on LSTM-BF[J], China Safety Science Journal, 2022, 32(5): 170-176. (in Chinese) [19] 陈华伟, 邵毅明, 敖谷昌, 等. 面向在线地图的GCN-LSTM神经网络速度预测[J]. 交通运输工程学报, 2021, 21(4): 183-196.CHEN H W, SHAO Y M, AO G C, at al. Speed prediction by online map-based GCN-LSTM neural network[J], Journal of Traffic and Transportation Engineering, 2021, 21(4): 183-196. (in Chinese) [20] HOCHREITER S, SCHMIDHUBER J. Long short-term memory[J]. Neural Computation, 1997, 9 (8): 1735-1780.