基于自适应时序剖分与KNN的短时交通流量预测
祁 朵(1995— ),男,安徽阜阳人,硕士生,主要从事智能算法、交通流预测等研究。 E-mail: qiduo1996@163.com |
收稿日期: 2021-07-14
要求修回日期: 2021-07-30
网络出版日期: 2022-04-25
基金资助
国家自然科学基金项目(41471333)
福建省自然科学基金面上项目(2018J01619)
版权
Short-term Traffic Flow Prediction based on Adaptive Time Slice and KNN
Received date: 2021-07-14
Request revised date: 2021-07-30
Online published: 2022-04-25
Supported by
National Natural Science Foundation of China(41471333)
Project of Science and Technology of Fujian Province(2018J01619)
Copyright
在智能交通系统中,准确和高效的短时交通流量预测是交通诱导、管理和控制的前提。由于交通流量动态变化中表现出的时变性和非平稳性特征,其预测难度较大,是交通领域中亟待解决的难题。为提高短时交通流量的预测精度,本文设计与实现了基于自适应时序剖分与KNN(A-TS-KNN)的短时交通流量预测算法。① 基于动态时间规整(Dynamic Time Warping,DTW)动态剖分单日时序为不同的交通模式;② 在不同交通模式,采用互信息法求解每个预测时刻时间延迟的最大阈值,构造不同时间延迟的状态向量,生成交通流量历史数据库;③ 采用十次十折交叉验证的方法求解每个时刻不同时间延迟与不同K值的正交误差结果分布,提取误差最小的正交结果,得到自适应时间延迟与K值的参数组合;④ 采用K个最相似的近邻的距离倒数加权值作为预测结果。对比K近邻(K-nearest neighbors, KNN)、支持向量回归(Support vector regression,SVR)、长短期记忆神经网络(Long-short term memory neural network,LSTM)以及门控递归单元神经网络(Gate recurrent unit neural network,GRU)共4种主流预测模型,A-TS-KNN算法预测精度显著提升;将A-TS-KNN算法用于福州市城市路网中其他交叉路口的短时交通流量预测,结果表现出良好的泛化能力。
祁朵 , 毛政元 . 基于自适应时序剖分与KNN的短时交通流量预测[J]. 地球信息科学学报, 2022 , 24(2) : 339 -351 . DOI: 10.12082/dqxxkx.2022.210392
Short-term traffic flow prediction with high accuracy and efficiency plays an important role in Intelligent Transportation Systems, which is a prerequisite for traffic guidance, management, and control. Due to the time-varying and non-stationary characteristics of the dynamic change of traffic flow, it is difficult to predict traffic flow with high accuracy, which needs to be resolved urgently in the transportation field. In order to improve the accuracy and efficiency of short-term traffic flow prediction, the paper develops a short-term traffic flow predicting algorithm based on adaptive time slice and the improved KNN model (A-TS-KNN), which is then implemented successfully in short-term traffic flow predicting experiments. In the first, the Dynamic Time Warping (DTW) algorithm is used to dynamically slice the daytime sequence of traffic flow into different traffic patterns. Secondly, the mutual information method is used to solve the maximum threshold of the time delays of traffic flow at each time in different traffic patterns. Then the traffic flow state vectors of different time delays is constructed, which generates a history database of traffic flow. Thirdly, the method of ten times ten-fold cross-validation is used to solve the orthogonal error distribution of different time delays and K values of traffic flow at each time. The orthogonal result with the smallest error is selected, and the parameters combination of adaptive time delay and K value are obtained. In the end, the weighted value of the reciprocal Euclidean distance of the K most similar neighbors is used for predicting traffic flow of next time. The forecasting accuracies of the improved A-TS-KNN and other four models including K-Nearest Neighbors (KNN) model, Support Vector Regression (SVR) model, Long-Short Term Memory (LSTM) neural networks, and Gate Recurrent Unit (GRU) neural networks are compared. The experimental results indicate that the improved A-TS-KNN model is more appropriate for short-term traffic flow forecasting than the other models. In addition, the A-TS-KNN algorithm is used for short-term traffic flow predicting at other four different intersections in the urban road network of Fuzhou, which has been shown good generalization ability.
|
算法1 基于DTW的单日交通模式动态剖分算法 |
---|
输入:日交通流量序列 ,模板交通流量序列 ,时间延迟参数 |
输出:日交通流量模式区间分隔点 |
Step 1 |
Step 2 |
Step 2.1 //计算测试序列与模板序列间DTW |
Step 2.2 //获取DTW相似度最小值对应时间序列 |
Step 2.3 //获取该序列交通模式起始和结束时刻 |
表1 动态剖分时序结果Tab.1 Results of dynamic slice of time |
模式名称 | 模式类型 | 模式时间区间 |
---|---|---|
a | 缓慢下降模式 | [00:00, 03:00) |
b | 畅通平稳模式 | [03:00, 06:00) |
c | 迅速增长模式 | [06:00, 07:30) |
d | 早高峰模式 | [07:30, 11:00) |
e | 次高峰模式 | [11:00, 13:00) |
f | 平稳下降模式 | [13:00, 14:00) |
g | 平稳增长模式 | [14:00, 17:00) |
h | 晚高峰模式 | [17:00, 19:20) |
i | 畅通平稳模式 | [19:20, 21:40) |
j | 畅通稳降模式 | [21:40, 23:59) |
表2 预测结果误差表Tab. 2 Errors table of prediction results |
算法 | MAE | RMSE | MAPE/% | EC |
---|---|---|---|---|
KNN | 24.70 | 33.75 | 10.97 | 0.88 |
AK-KNN | 19.88 | 29.63 | 8.88 | 0.89 |
AD-KNN | 18.10 | 26.31 | 8.00 | 0.91 |
TS-KNN | 13.12 | 20.62 | 5.85 | 0.93 |
A-TS-KNN | 12.69 | 20.21 | 5.52 | 0.94 |
图12 早高峰时段不同预测算法可视化结果Fig. 12 Visualization results of different prediction algorithms during morning peak hours |
[1] |
|
[2] |
|
[3] |
|
[4] |
|
[5] |
|
[6] |
|
[7] |
梁艳平, 毛政元, 邹为彬, 等. 基于相似数据聚合与变K值KNN的短时交通流量预测[J]. 地球信息科学学报, 2018, 20(10):1403-1411.
[
|
[8] |
姚卫红, 方仁孝, 张旭东. 基于混合人工鱼群优化SVR的交通流量预测[J]. 大连理工大学学报, 2015, 55(6):632-637.
[
|
[9] |
|
[10] |
李明晓, 张恒才, 仇培元, 等. 一种基于模糊长短期神经网络的移动对象轨迹预测算法[J]. 测绘学报, 2018, 47(12):1660-1669.
[
|
[11] |
|
[12] |
|
[13] |
|
[14] |
|
[15] |
|
[16] |
|
[17] |
|
[18] |
|
[19] |
|
/
〈 |
|
〉 |