A Forecasting Model of Short-term Traffic Flow on Expressways During Holidays Based on ETC Data and A-BiLSTM Neural Network Models
-
摘要: 电子不停车收费(electronic toll collection,ETC)门架系统为节假日高速公路短时交通流预测提供了数据支撑。针对节假日场景下高速公路交通流的非线性和复杂性特征,基于ETC门架数据研究了由注意力机制(attention)和双向长短期记忆(bidirectional long/short-term memory,BiLSTM)神经网络组成的Attention-BiLSTM(A-BiLSTM)组合模型。通过对ETC门架数据进行预处理,保证模型输入的可靠性;采用滑动窗口方法构建监督学习样本,提高模型学习效率。在模型中,使用BiLSTM神经网络,实现对交通流数据前向和后向时间依赖性特征的深入提取;引入注意力机制动态地权衡网络提取信息的重要程度,增强隐藏层特征的非线性表达能力;利用贝叶斯优化方法对模型进行超参数调优,提高模型的预测性能。采集大理-丽江高速公路白汉场至拉市镇的门架数据,处理成时间粒度为5,10,15 min的交通流数据进行模型验证。实验结果表明:①相比于自回归移动平均模型、支持向量机的预测结果,A-BiLSTM组合模型的均方根误差(root mean square error,RMSE)分别降低了73.3%和49.1%,平均绝对误差(mean absolute error,MAE)分别降低了76.0%和56.3%,预测效果好,可应用于实际的交通运营管理。②相比于未引入注意力机制的BiLSTM,A-BiLSTM组合模型的RMSE降低了41.9%,MAE降低了46.0%。③A-BiLSTM组合模型在5 min的时间粒度下表现最好,与输入数据时间粒度为10,15 min情况下所构建的模型预测误差相比,RMSE分别降低34.5%和42.1%,MAE分别降低39.9%和46.3%。Abstract: Data collected from the electronic toll collection (ETC) gantry system can be used to support the short-term traffic flow forecasting for expressways during holidays. An Attention-BiLSTM (A-BiLSTM) hybrid model, composed of the attention mechanism and bidirectional long/short-term memory (BiLSTM) neural network, is proposed to address the issues of high nonlinearity and complexity within traffic flow forecasting tasks for holidays based on ETC gantry data. The input data is preprocessed to improve the effectiveness of model training. A sliding window method is used to generate samples of supervised learning to improve the efficiency of model training. Forward and backward time-dependent features of traffic flow data is extracted based on the BiLSTM neural network. An attention mechanism is introduced to dynamically weigh the importance of the information extracted from the neural network, enhancing the ability of nonlinear expression of features in hidden layers. A Bayesian optimization method is applied to tune hyperparameters of the model, which can improve the performance of the proposed model. The gantry data is collected from Baihanchang to Lashi on the Dali-Lijang Expressway, and is divided into the data with a time granularities of 5, 10, and 15 min for model development and validation. Experiment results show that: ①Compared with the prediction results of autoregressive moving average (ARIMA) model and support vector machine (SVM) model, the root mean square error (RMSE) of A-BiLSTM hybrid model is reduced by 73.3% and 49.1%, and mean absolute error (MAE) is reduced by 76.0% and 56.3% respectively, which shows that the proposed A-BiLSTM hybrid model has a better prediction capability and can be applied to real-world traffic operation and management. ②Compared with the BiLSTM model without the attention mechanism, the RMSE and MAE of A-BiLSTM hybrid model is reduced by 41.9% and 46.0%, respectively. ③Compared with the models developed using the traffic flow data with a time granularity of 10 and 15 min, the RMSE of the model developed with the data with a time granularity of 5 minutes decreases by 34.5% and 42.1%, respectively; and the MAE decreases by 39.9% and 46.3%, respectively. Therefore, it can be concluded that the A-BiLSTM model performs best with the input data with a time granularity of 5 min.
-
表 1 ETC交易数据部分字段
Table 1. Part fields of ETC transaction
序号 字段名称 字段说明 1 通行标识ID 车辆当次通行的唯一ID 2 门架编号 ETC门架的编号 3 门架hex字符串 ETC门架的hex值 4 行驶方向 1:上行;2:下行 5 门架类型 1:路段;2:省界入口;3:省界出口 6 通过时间 计费交易时间 7 OBU序号编码 不超过20个字符 8 计费车辆车牌号 计费车辆的车牌号码及颜色 9 计费车型代码 计费车辆的车型 10 入口站hex字符串 入口站的hex值 11 入口日期及时间 入口交易发生的时间 12 交易后累计里程 本次交易后标签累计里程 表 2 超参数约束条件与结果
Table 2. Constraints and results of hyperparameters
超参数 约束条件 结果 batch size [2, 128] 96 units [2, 256] 96 epochs [100, 500] 435 optimizer [Adam,SGD,RMSprop] Adam 表 3 不同窗口下的误差
Table 3. Error under different windows
窗口大小ΔX值/h 时间粒度:5 min 时间粒度:10 min 时间粒度:15 min ERMSE EMAE ERMSE EMAE ERMSE EMAE 0.5 5.046 3.406 7.906 6.022 9.717 8.016 1 5.216 3.525 7.707 5.668 9.352 7.519 3 5.419 3.662 7.860 5.678 8.743 6.678 6 5.493 3.887 8.894 6.476 8.708 6.338 表 4 预测误差对比
Table 4. Comparsion of the prediction error
数据 ERMSE EMAE 加入4月30日的交通流数据 5.046 3.406 不加入4月30日的交通流数据 5.451 3.822 表 5 8种模型预测误差对比
Table 5. Comparison of prediction errors of 8 models
模型 ERMSE EMAE ARIMA 18.867 14.189 SVM 9.908 7.789 BiLSTM 8.685 6.303 LSTM 6.846 4.885 TCC-LSTM 5.401 3.598 1DCNN-LSTM-Attention 5.292 3.686 LSTM-BP 5.084 3.475 A-BiLSTM 5.046 3.406 -
[1] 韩直, 徐冲聪, 韩嵩乔. 基于短时交通流预测的广域动态交通路径诱导方法[J]. 交通运输系统工程与信息, 2020, 20(1): 117-123+129. https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202001020.htmHAN Z, XU C C, HAN S Q. Wide-area dynamic traffic path guidance method based on short-term traffic flow prediction[J]. Journal of Transportation Systems Engineering and Information Technology, 2020, 20(1): 117-123+129. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202001020.htm [2] 郭嘉宸, 杨宇燊, 王研, 等. 精细化短时交通流预测模型及迁移部署方案[J]. 计算机应用, 2022, 42(6): 1748-1755. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJY202206014.htmGUO J C, YANG Y S, WANG Y, et al. Refined short-term traffic flow prediction model and migration deployment plan[J]. Journal of Computer Applications, 2022, 42(6): 1748-1755. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JSJY202206014.htm [3] 白伟华, 张传斌, 张塽旖, 等. 基于异常值识别卡尔曼滤波器的短期交通流预测[J]. 计算机应用研究, 2021, 38(3): 817-821. https://www.cnki.com.cn/Article/CJFDTOTAL-JSYJ202103034.htmBAI W H, ZHANG C B, ZHANG S Y, et al. Short-term traffic flow prediction based on outlier recognition Kalman filter[J]. Application Research of Computers, 2021, 38(3): 817-821. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JSYJ202103034.htm [4] WILLIAMS B M, HOEL L A. Modeling and forecasting vehicular traffic flow as a seasonal ARIMA process: Theoretical basis and empirical results[J]. Journal of Transportation Engineering, 2003, 129(6): 664-672. doi: 10.1061/(ASCE)0733-947X(2003)129:6(664) [5] 吴晋武, 张海峰, 冉旭东. 基于数据约减和支持向量机的非参数回归短时交通流预测算法[J]. 公路交通科技, 2020, 37(7): 129-134. https://www.cnki.com.cn/Article/CJFDTOTAL-GLJK202007017.htmWU J W, ZHANG H F, RAN X D. Nonparametric regression short-term traffic flow prediction algorithm based on data reduction and support vector machine[J]. Journal of Highway and Transportation Research and Development, 2020, 37(7): 129-134. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-GLJK202007017.htm [6] ZHENG W Z, LI D H, SHI Q X. Short-term freeway traffic flow prediction: Bayesian combined neural network approach[J]. Journal of Transportation Engineering, 2006, 132(2): 114-121. doi: 10.1061/(ASCE)0733-947X(2006)132:2(114) [7] 谢海红, 戴许昊, 齐远. 短时交通流预测的改进K近邻算法[J]. 交通运输工程学报, 2014, 14(3): 87-94. https://www.cnki.com.cn/Article/CJFDTOTAL-JYGC201403015.htmXIE H H, DAI X H, QI Y. Improved K-nearest neighbor algorithm for short-term traffic flow prediction[J]. Journal of Traffic and Transportation Engineering, 2014, 14(3): 87-94. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JYGC201403015.htm [8] 温惠英, 张东冉. 基于Bi-LSTM模型的高速公路交通量预测[J]. 公路工程, 2019, 44(6): 51-56. https://www.cnki.com.cn/Article/CJFDTOTAL-ZNGL201906009.htmWEI H Y, ZHANG D R. Highway traffic forecast based on Bi-LSTM model[J]. Road Construction, 2019, 44(6): 51-56. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-ZNGL201906009.htm [9] 罗文慧, 董宝田, 王泽胜. 基于CNN-SVR混合深度学习模型的短时交通流预测[J]. 交通运输系统工程与信息, 2017, 17(5): 68-74. https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT201705010.htmLUO W H, DONG B T, WANG Z S. Short-term traffic flow prediction based on CNN-SVR hybrid deep learning model[J]. Journal of Transportation Systems Engineering and Information Technology, 2017, 17(5): 68-74. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT201705010.htm [10] 戢晓峰, 戈艺澄. 基于深度学习的节假日高速公路交通流预测方法[J]. 系统仿真学报, 2020, 32(6): 1164-1171. https://www.cnki.com.cn/Article/CJFDTOTAL-XTFZ202006020.htmJI X F, GE Y C. Method for forecasting holiday expressway traffic flow based on deep learning[J]. Journal of System Simulation, 2020, 32(6): 1164-1171. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-XTFZ202006020.htm [11] 刘群, 杨濯丞, 蔡蕾. 基于ETC门架数据的高速公路短时交通流预测[J]. 公路交通科技, 2022, 39(4): 123-130. https://www.cnki.com.cn/Article/CJFDTOTAL-GLJK202204014.htmLIU Q, YANG Z C, CAI L. Prediction of short-term traffic flow on expressways based on ETC gantry data[J]. Journal of Highway and Transportation Research and Development, 2022, 39(4): 123-130. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-GLJK202204014.htm [12] 贾兴利, 李双庆, 杨宏志, 等. 基于ATT-LSTM模型的高速公路交通事件持续时长预测[J]. 交通信息与安全, 2022, 40(5): 61-69. doi: 10.3963/j.jssn.1674-4861.2022.05.007JIA X L, LI S Q, YANG H Z, et al. Prediction of the duration of freeway traffic incidents based on an ATT-LSTM model[J]. Journal of Transport Information and Safety, 2022, 40(5): 61-69. (in Chinese) doi: 10.3963/j.jssn.1674-4861.2022.05.007 [13] 李桃迎, 王婷, 张羽琪. 考虑多特征的高速公路交通流预测模型[J]. 交通运输系统工程与信息, 2021, 21(3): 101-111. https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202103013.htmLI T Y, WANG T, ZHANG Y Q. Highway traffic flow forecast model considering multiple features[J]. Journal of Transportation Systems Engineering and Information Technology, 2021, 21(3): 101-111. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202103013.htm [14] CAI L, LEI M, ZHANG S, et al. A noise-immune lstm network for short-term traffic flow forecasting[J]. Chaos, 2020, 30(2): 1-11. [15] LIU H, ZHANG X Y, YANG Y X, et al. Hourly traffic flow forecasting using a new hybrid modeling method[J]. Journal of Central South University, 2022, 29(4): 1389-1402. [16] FANG W, ZHUO W, YAN J, et al. Attention meets long short-term memory: a deep learning network for traffic flow forecasting[J]. Physica A: Statistical Mechanics and its Applications, 2022(587): 126485 [17] SHI R, XU X Y, LI J M, et al. Prediction and analysis of train arrival delay based on XGBoost and Bayesian optimization[J]. Applied Soft Computing, 2021, 109: 107538. [18] KULSHRESTHA A, KRISHNASWAMY V, SHARMA M. Bayesian BILSTM approach for tourism demand forecasting[J]. Annals of tourism research, 2020, 83: 102925. [19] 陆文琦, 芮一康, 冉斌, 等. 智能网联环境下基于混合深度学习的交通流预测模型[J]. 交通运输系统工程与信息, 2020, 20(3): 47-53. https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202003008.htmLU W Q, RUI Y K, RAN B, et al. Traffic flow prediction model based on hybrid deep learning in intelligent network environment[J]. Journal of Transportation Systems Engineering and Information Technology, 2020, 20(3): 47-53. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-YSXT202003008.htm [20] 曾宪堂, 孙昊. 高速公路短时交通流预测方法对比分析[J]. 公路, 2022, 67(2): 366-370. https://www.cnki.com.cn/Article/CJFDTOTAL-GLGL202202059.htmZENG X T, SUN H. Comparative analysis of short-term traffic flow forecasting methods on expressways[J]. Highway, 2022, 67(2): 366-370. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-GLGL202202059.htm [21] 张维, 袁绍欣, 陶建军, 等. 基于多元因素的Bi-LSTM高速公路交通流预测[J]. 计算机系统应用, 2021, 30(6): 184-190. https://www.cnki.com.cn/Article/CJFDTOTAL-XTYY202106026.htmZHANG W, YUAN S X, TAO J J, et al. Bi-LSTM highway traffic flow prediction based on multiple factors[J]. Computer Systems & Applications, 2021, 30(6): 184-190. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-XTYY202106026.htm [22] 陈治亚, 王小军. 基于多维度LSTM模型的短时交通流预测[J]. 铁道科学与工程学报, 2020, 17(11): 2946-2952. https://www.cnki.com.cn/Article/CJFDTOTAL-CSTD202011028.htmCHEN Z Y, WANG X J. Short-term traffic flow prediction based on multidimensional LSTM model[J]. Journal of Railway Science and Engineering, 2020, 17(11): 2946-2952. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-CSTD202011028.htm [23] LU H, GE Z, SONG Y, et al. A temporal-aware LSTM enhanced by loss-switch mechanism for traffic flow forecasting[J]. Neurocomputing, 2021(427): 169-178. [24] WANG K, MA C, QIAO Y, et al. A hybrid deep learning model with 1DCNN-LSTM-Attention networks for short-term traffic flow prediction[J]. Physica A: Statistical Mechanics and its Applications, 2021(583): 126293. [25] 李明明, 雷菊阳, 赵从健. 基于LSTM-BP组合模型的短时交通流预测[J]. 计算机系统应用, 2019, 28(10): 152-156. https://www.cnki.com.cn/Article/CJFDTOTAL-XTYY201910021.htmLI M M, LEI J Y, ZHAO C J. Short-term traffic flow forecasting based on LSTM-BP hybrid model[J]. Computer Systems Application, 2019, 28(10): 152-156. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-XTYY201910021.htm