Real-time Traffic Flow Forecasting based on Wavelet Neural Network

—Real-time traffic flow forecasting is the core of Intelligent Transportation System (ITS), and the foundation of multi-subsystem’s implementation in ITS. Traffic flow, which is highly time-relevant, with the features of high non-linear and non-determinism, can be treated as the time sequence forecast. On the basis of these features of traffic flow, this paper tries to deal with this issue based on Wavelet Neural Network (WNN) specially. At the same time, the paper realizes the analogue simulation through the Matlab software programming, by taking a road for example. And the simulation results show that the traffic flow can be precisely forecasted using Wavelet Neural Network, and its value is close to the expectations.


I. INTRODUCTION
In recent years, traffic flow guidance and traffic planning have been focused of traffic research field with the rapid development of intelligent transportation. The key factor to achieve the advanced traffic flow guidance and planning system is the accurate real-time traffic flow forecasting [1]. Actual traffic system is a complex, timevarying large system of strong random interference. Thus, a group of complex and accurate forecasting methods were born to realize the short-term rolling prediction of traffic flow. They are defined to three parts based on different features: Time Series Model [2][3][4], Nonparametric Regression Model [5][6][7][8] and Neural Network Model [9][10][11][12].
The time series model can get a high accurate forecasting result when a large number of continuous data are calculated, but it requires complex parameter estimation, at the same time the calculated parameters can not be transplanted. Thus, it will lead to the data losing and reduce model accuracy. So the model is often applied to stable traffic flow prediction, when the traffic conditions are dramatically changed, due to the excessive calculation it will reveal obvious deficiencies in predicting latency [2]. Kalman Filter Method has several advantages in traffic flow forecasting: a flexible arguments selection, high accuracy, good robustness. However the model is based on a linear estimation model, when the forecast interval is less than 5min, there will be a greater probability for the traffic flow changes in the randomness and shows a nonlinear feature, hence the forecasting performance will degrade. In addition, the calculation must adjust the right value at each time, a lot of matrix and vector operations are used, therefore the algorithm are very complex, so it is difficult for being used in the real-time and online forecasting [6,11].
Wavelet Neural Network based on wavelet analysis theory is a new branch of neural networks in recent years [13]. With a nice performance in non-linear mapping and owning good locality characteristics, the wavelet neural network can make a supplement to the traditional BP network in convergence and timeliness of the network. It's a good application in the non-linear approach and nonlinear parameter estimation.
This paper sets the Wavelet Neural Network model, allow for the traffic flow of non-linear and time-related, combines a wavelet transform time-domain localization good nature and traditional neural network self-learning ability. When used in dealing with complex non-linear function relations and other issues, it shows better than the traditional neural network in convergence speed, fault tolerance, and owns a broad application prospect [13][14].

A. Wavelet Theory
Wavelet transform is a branch of Applied Mathematics developed in the late 1980s in international. It's a powerful tool for analyzing and processing non-stationary signal, and has been widely used in signal processing, automatic control engineering. Wavelet transform was evolved by the mother function that form by localized form of the function as which began as a fixed window size but the shape of the local variable time-frequency domain analysis method, which has many unique properties and advantages.
Wavelet analysis was developed for insufficient of Fourier transform, Fourier transform is typical analysis method that has been used extensively in signal processing field. However, it has a serious shortage that the transform abandoned time information, therefore results can't tell the occurring time of signal, which means that Fourier transform hasn't time-resolving function. The basic idea of wavelet transform is breaking original signal to some sub-band signals by scaling and translating, these subband signal have different spatial resolution, different frequency and different directional characteristics, so they have a good time and frequency domain characteristics. These features can be used to represent the local characteristics of the original signal, thus achieving local analysis of time and frequency for the signal.
Wavelet is a finite length, mean value of waveform is 0, and its features include: PAPER REAL-TIME TRAFFIC FLOW FORECASTING BASED ON WAVELET NEURAL NETWORK 1. The time domain has compact support or similar compact support; 2. DC component is zero.
Wavelet function is obtained by translation and expansion of a mother wavelet function, wavelet analysis meaning to decompose the signal into a superposition of a series of wavelet functions.
Wavelet transform refers to take basic wavelet function ( ) t ! do inner product calculation with the signal ( ) x t that need to be analyzed in different a scale, before which the ( ) t ! should be translated with a ! level.
Equivalent time-domain expression, In the formulas above, ! and a are inside parameters, ! means to make lens to relative parallel shift for the target, a is equivalent to make lens away from or advancing to the goal.
In (1) and (2) , one can see that wavelet analysis can analyze the local characteristics of signal by transforming wavelet base, and has capacity of selecting the signaldirection in two-dimensional, so the method has garnered a lot of attention.

B. Wavelet Neural Network
Wavelet neural network is based on a kind of topology of BP neural network, taking the wavelet basis function as the transfer function for hidden layer nodes, while the signal propagates forward, the error propagates opposite direction. Wavelet neural network topology shown in

1, 2, ,
In the formulas above, ( ) h j is the jth hidden node output value; ij ! is the weight of input and hidden layer; j b is translation factor of wavelet function; j a is expansion factor of wavelet function; j h is wavelet function.
The wavelet function in this paper is the one of Morlet wavelet function. The mathematical formula is, The calculation formula of output layer about wavelet neural network is, Where ik ! is the weight from the hidden to the output layer; ) (i h is the ith hidden node output; l is the hidden node number; m is the output layer's node number. Wavelet neural network weights parameters correction algorithm is similar to the BP neural network weights correction algorithm, using gradient correction method to correct network weights and wavelet function parameters, so as to make the wavelet neural network model output to approach approximation expected output constantly. The emendation of wavelet neural network is as follows. (1) Computing network forecasting errors, In the formula above, ) (k yn is expected output, ) (k y is Wavelet Neural Network Model output. (2) Wavelet neural network weights and wavelet function coefficients are amended according to the forecasting error e , iJOE -Volume 9, Issue 3, July 2013 PAPER REAL-TIME TRAFFIC FLOW FORECASTING BASED ON WAVELET NEURAL NETWORK ! is learning rate.
The training procedures of Wavelet Neural Network algorithm is as follows: 1. Network initialization. The wavelet function expansion factor k a , the translation factor k b and the net-

C. Model Building
Research shows that real-time traffic data tends to be a strong time-varying non-stationary time series. In the urban road network, the traffic flow of one time is related to the one that happened few times before, and it has a cycle of 24 hours. Depending on the features of traffic flow, Wavelet Neural Network is divided into three layers: input layer, hidden layer and output layer. Among them, the entry of the input layer is traffic flow over the past several time points; the nodes of the hidden layer are made up of wavelet neural network; output layer give a current traffic flow. The real-time traffic flow forecasting algorithm procedure based on Wavelet Neural Network is shown in Figure 2.
To initialize data and transform the data into tree between 0 and 1, the goal is to clear the difference of magnitudes among the various dimension data, thus we can avoid large network forecasting error for different magnitudes between input and output data. In the end, genetic algorithm was used to ensure the numbers of best hidden layer, and then ensure the final structure of Wavelet Neural Network.
Training Wavelet Neural Network: Setting up network learning parameters and training the wavelet neural network with training data, this makes it has the ability to forecast the traffic flow.
Testing Wavelet Neural Network: using the trained wavelet neural network to forecast the short-time traffic flow and normalizing the forecasted data, then evaluating the forecasting results.

III. NUMERICAL APPLICATION
In the following section, we give an application example to show the feature of WNN. At first, we collected traffic flow data of four days on a certain road. The data is recorded by every 15 min and total number of time points is 468. Secondly, trains the Wavelet Neural Network with the 276 pairs of data which recorded in the early 3 days, then forecasting the fourth day traffic flow with the trained WNN. At last, we use the rest 92 pares of data to check the accuracy of traffic flow prediction.
The WNN structure applied in the example is 4-6-1. The input layer has 4 nodes, meaning that before prediction time exists 4 time points; hidden layer have 6 nodes; output layer have one node that stands for the prediction traffic flow. Network weights and wavelet function can be gotten in parameters initialing by randomly. Experiments have been done with the following parameter setting: the network learning rate is 0.01, error precision is 0.001, and iterative learning number is 100.
According to the WNN theory, we brought out the realtime traffic flow forecasting result. The code was written in MATLAB. The results were showed in Figure 3, we look the prediction result in comparison to real-time traffic flow, and they are very close to each other.
In following Figures, a comparison has given to BP Neural Network Forecasting based on a same group data. Figure 4 gives the forecasting result that BP neural network trained 15,000 times. Figure 5 and Figure 6 are the absolute error curve of WNN and BP Neural Network forecasting results. Table 1 shows a forecasting result based on the two major evaluation index. We can figure out that the wavelet neural network gives a more accurate forecasting result to the real-time traffic flow, and the forecasting values are very close to expectations. In the experiment, we can see the WNN has obvious advantages: its convergence rate is faster, the error is also smaller to the conventional BP neural network. PAPER REAL-TIME TRAFFIC FLOW FORECASTING BASED ON WAVELET NEURAL NETWORK

IV. CONCLUSION
This paper analysis the features of traffic flow, and then builds the real-time road traffic flow forecasting model based on wavelet neural network. This method has both merits of time series forecasting method and neural network model. And it took the advantage of wavelet dealing with the non-stationary signal, and has a well nonlinear mapping when forecasting traffic flow. The simulation results show that the algorithm has pretty high precision and good convergence; it's a fast and effective way for intelligent transportation system to achieve the real-time control and traffic flow guidance.