﻿ 基于ANFIS混合模型的短时交通流预测
 计算机系统应用  2019, Vol. 28 Issue (6): 247-253 PDF

Short-Term Traffic Flow Prediction Based on ANFIS Hybrid Model
YAN Bing-Yang, TANG Min-Jia, ZHOU Chang-Geng, LI Yin-Ping
School of Information and Electrical Engineering, Shandong Jianzhu University, Jinan 250101, China
Abstract: Urban short-term traffic flow forecasting can help people choose the optimal route for travel and improve travel efficiency, which is necessary because the traffic congestion increasingly serious today. It is difficult to predict short-term traffic flow accurately because there are various factors can influence short-term traffic flow such as weather. To improve the accuracy of short-term traffic flow prediction, this study proposes a hybrid model based on Adaptive Neuro-Fuzzy Inference System (ANFIS). The hybrid model is combined with the periodicity knowledge model and the ANFIS model which has been driven by residual data. To verify the performance of the proposed hybrid model, it is compared with the Backward Propagating Neural Network (BPNN) model and the normal ANFIS model. The experimental results show that the hybrid model has better applicability and accuracy in traffic flow prediction.
Key words: traffic flow prediction     periodic extraction     Adaptive Neuro-Fuzzy Inference System (ANFIS)     back propagation algorithm     least squares

1 方法介绍

1.1 ANFIS模型

 $\begin{split} &\Big\{ {R\left( s \right):{x_1} = D_1^s,{x_2} = D_2^s, \cdots ,}\\ &{{x_n} = D_n^s \to {y_s}\left( {x} \right) = c_0^s + \sum\limits_{i = 1}^n {c_i^s{x_i}} } \Big\}_{s = 1'}^S \end{split}$ (1)

 $\hat y\left({ x} \right) = \displaystyle\sum\limits_{s = 1}^S {{{\bar f}_s}\left({ x} \right){y_s}\left({ x} \right)} = \dfrac{{\displaystyle\sum\nolimits_{s = 1}^S {{f_s}\left({ x} \right){y_s}\left({ x} \right)} }}{{\displaystyle\sum\nolimits_{s = 1}^S {{f_s}\left({ x} \right)} }}$ (2)

 ${f_s}\left({ x} \right) = \prod\limits_{j = 1}^n {{\mu _{D_j^s}}\left( {{x_j}} \right)}$ (3)
 ${\bar f_s}\left({ x} \right) = \dfrac{{{f_s}\left({ x} \right)}}{{\displaystyle\sum\nolimits_{s = 1}^S {{f_s}\left({ x} \right)} }}$ (4)

ANFIS模型的构建过程, 首先确定输入数据的模糊划分和模糊集合类型, 然后采用反向传播算法和线性最小二乘法的混合算法进行前件参数和后件参数的训练, 前件参数采用反向传播算法进行训练, 后件参数运用最小二乘法进行训练. 输入数据沿ANFIS网络运算到第四层, 固定前件参数, 用最小二乘法训练后件参数, 信号正向传递至输出层, 利用反向传播算法训练前件参数, 循环迭代至全局最优.

 图 1 ANFIS结构图

1.2 BPNN模型

BPNN是迄今应用范围最广泛的人工神经网络之一, 理论上具有无限逼近的能力, 在BPNN中, 通常采用反向传播算法或其变种来确定整个网络的权重. 在本文中考虑一个具有 $L$ 个隐藏层的BPNN, 具体结构如图2所示.

 图 2 BPNN结构图

BPNN的输入输出关系可以表示为:

 $\hat y(x) = f\left(\sum\limits_{s = 1}^{{n_L}} {\alpha _{s1}^{L + 1} \cdots f\left(\sum\limits_{j = 1}^{{n_1}} {\alpha _{jl}^2f\left(\sum\limits_{i = 1}^n {\alpha _{ij}^1{x_i}} \right)} \right)} \right)$ (5)

BP算法会通过最小化平方差公式来获得最优值或者次优值, 如下式所示:

 $E(k) = {(\hat y({x^{(k)}}) - {y^{(k)}})^2}$ (6)

 $\alpha _{ij}^l(k + 1) = \alpha _{ij}^l(k) - \varepsilon \frac{{\partial E(k)}}{{\partial \alpha _{ij}^l}}$ (7)

2 交通流预测混合模型 2.1 混合模型结构

 图 3 交通流ANFIS模型

1) 提取交通流数据周期性信息, 从交通数据中移除提取的周期性信息, 获得交通流残差数据.

2) 将交通流残差数据输入混合模型, 利用混合训练方法训练前件、后件参数以取得最优结果.

3) 将训练完的交通流残差数据和交通流周期性信息重新结合, 得到最优交通流预测值.

2.2 周期性知识模型构建

 $\left\{\begin{array}{*{20}{c}} {{Y_1} = [{y_1}(1),{y_1}(2), \cdots ,{y_1}(T)]}\\ \vdots \\ {{Y_M} = [{y_M}(1),{y_M}(2), \cdots ,{y_M}(T)]} \end{array} \right.$ (8)

 ${\bar Y_{\rm{Ave}}} = [\frac{1}{M}\sum\limits_{z = 1}^M {{y_z}(1)} ,\frac{1}{M}\sum\limits_{z = 1}^M {{y_z}(2)} , \cdots ,\frac{1}{M}\sum\limits_{z = 1}^M {{y_z}(T)} ]$ (9)

 ${Y_{{\rm{Res}}}} = \{ {Y_1} - {\bar Y_{\rm{Ave}}},{Y_2} - {\bar Y_{\rm{Ave}}}, \cdots ,{Y_M} - {\bar Y_{\rm{Ave}}}\}$ (10)
3 交通流预测实验

3.1 实验数据

 图 4 原始交通流数据图

3.2 性能指标

 $\left\{\begin{split} &{\rm{RMSE = }}\sqrt {\frac{1}{N}\sum\limits_{i = 1}^N {{{\left| {\hat y({{{x}}^i}) - {y^{(i)}}} \right|}^2}} } , \\ & {\rm{MAE = }}\frac{1}{N}\sum\limits_{i = 1}^N {\left| {\hat y({{{x}}^i}) - {y^{(i)}}} \right|} , \\ & {\rm{APE = }}\frac{1}{N}\sum\limits_{i = 1}^N {\frac{{\left| {\hat y({{{x}}^i}) - {y^{(i)}}} \right|}}{{\left| {{y^{(i)}}} \right|}}} \times 100\% , \end{split}\right.$ (11)

3.3 实验结果 3.3.1 交通流预测(10分钟间隔)

 图 5 交通流数据(10分钟间隔)

 图 6 交通流预测结果(10分钟间隔)

3.3.2 交通流预测(15分钟间隔)

15分钟间隔的交通流预测, 交通流训练数据有2016个点, 1728个测试点, 原始数据如图7(a)所示, 周期性数据如图7(b), 残差数据如图7(c).

3.4 实验结果分析

1) RMSE、MAE、APE三个性能衡量参数越小, 证明模型的预测性能越好. 从表1和表2中可以发现本文提出的混合模型同ANFIS模型和BPNN模型相比表现是最好的, 充分表明交通流周期性的提取, 进而利用残差数据训练模型这一方法对与提高交通流预测精度的重要性. 预测准确率提升情况如表3所示.

 图 7 交通流数据(15分钟间隔)

 图 8 交通流预测结果(15分钟间隔)

2) 图9为交通流数据和二次交通流预测实验的预测值之间的散点图. 图中可以看出交通流混合模型的预测值和实际交通流数据有着很小的差别, 反映了混合模型突出的预测准确度.

 图 9 交通流散点图

4 结语

 [1] Zheng Y, Capra L, Wolfson O, et al. Urban computing: concepts, methodologies, and applications. ACM Transactions on Intelligent Systems and Technology (TIST), 2014, 5(3): 38. [2] Zheng Y, Liu YC, Yuan J, et al. Urban computing with taxicabs. Proceedings of the 13th International Conference on Ubiquitous Computing. New York, NY, USA. 2011. 89–98. [3] Li YX, Zheng Y, Zhang HC, et al. Traffic prediction in a bike-sharing system. Proceedings of the 23rd Sigspatial International Conference on Advances in Geographic Information Systems. New York, NY, USA. 2015. 33:1–33:10. [4] Sun H, Liu HX. Short-term traffic forecasting using the local linear regression model. Center for Traffic Simulation Studies, 2002. [5] Dang XC, Yan L. Traffic flow prediction based on multivariate linear AR model. Computer Engineering, 2012, 38(1): 84-86. [6] Williams BM, Hoel LA. Modeling and forecasting vehicular traffic flow as a seasonal stochastic time series process. 1999. [7] Williams BM, Hoel LA. Modeling and forecasting vehicular traffic flow as a seasonal ARIMA process: Theoretical basis and empirical results. Journal of Transportation Engineering, 2003, 129(6): 664-671. DOI:10.1061/(ASCE)0733-947X(2003)129:6(664) [8] Tan MC, LI YJ, Xu JM. A hybrid ARIMA and SVM model for traffic flow prediction based on wavelet denoising. Journal of Highway and Transportation Research and Development, 2009, 26(7): 127-132, 138. [9] 朱征宇, 刘琳, 崔明. 一种结合SVM与卡尔曼滤波的短时交通流预测模型. 计算机科学, 2013, 40(10): 248-251, 278. DOI:10.3969/j.issn.1002-137X.2013.10.052 [10] Fu H, Xu LH. SVR prediction method of short-term traffic flow for dynamic navigation system. Microcomputer Information, 2009, 25(8-3): 208-210. [11] Hong WC, Dong YC, Zheng FF, et al. Forecasting urban traffic flow by SVR with continuous ACO. Applied Mathematical Modelling, 2011, 35(3): 1282-1291. DOI:10.1016/j.apm.2010.09.005 [12] Oh SD, Kim YJ, Hong JS. Urban traffic flow prediction system using a multifactor pattern recognition model. IEEE Transactions on Intelligent Transportation Systems, 2015, 16(5): 2744-2755. DOI:10.1109/TITS.2015.2419614 [13] Huang WH, Song GJ, Hong HK, et al. Deep architecture for traffic flow prediction: deep belief networks with multitask learning. IEEE Transactions on Intelligent Transportation Systems, 2014, 15(5): 2191-2201. DOI:10.1109/TITS.2014.2311123 [14] 罗文慧, 董宝田, 王泽胜. 基于CNN-SVR混合深度学习模型的短时交通流预测. 交通运输系统工程与信息, 2017, 17(5): 68-74. [15] Yin HB, Wong SC, Xu JM, et al. Urban traffic flow prediction using a fuzzy-neural approach. Transportation Research Part C Emerging Technologies, 2002, 10(2): 85-98. DOI:10.1016/S0968-090X(01)00004-3 [16] Quek C, Pasquier M, Lim BBS. POP-TRAFFIC: a novel fuzzy neural approach to road traffic analysis and prediction. IEEE Transactions on Intelligent Transportation Systems, 2006, 7(2): 133-146. DOI:10.1109/TITS.2006.874712 [17] Chan KY, Dillon TS. On-road sensor configuration design for traffic flow prediction using fuzzy neural networks and taguchi method. IEEE Transactions on Instrumentation & Measurement, 2012, 62(1): 50-59. [18] Jang JSR. ANFIS: adaptive-network-based fuzzy inference system. IEEE Transactions on Systems, Man, and Cybernetics, 1993, 23(3): 665-685. DOI:10.1109/21.256541