# Adaptive Correction Forecasting Approach for Urban Traffic Flow Based on Fuzzyc-Mean Clustering and Advanced Neural Network

Authors: He Huang; Qifeng Tang; Zhen Liu
Journal: Journal of Applied Mathematics
 (2013)

---

## Abstract

Forecasting of urban traffic flow is important to intelligent transportation system (ITS) developments and implementations. The precise forecasting of traffic flow will be pretty helpful to relax road traffic congestion. The accuracy of traditional single model without correction mechanism is poor. Summarizing the existing prediction models and considering the characteristics of the traffic itself, a traffic flow prediction model based on fuzzyc-mean clustering method (FCM) and advanced neural network (NN) was proposed. FCM can improve the prediction accuracy and robustness of the model, while advanced NN can optimize the generalization ability of the model. Besides these, the output value of the model is calibrated by the correction mechanism. The experimental results show that the proposed method has better prediction accuracy and robustness than the other models.


---

## Body

## 1. Introduction

Real-time forecasting of traffic flow is an important issue in advanced traffic management [1]. The traffic simulation is correspondingly needed to make these forecasting models reliable way, which aim to influence travel behavior, reduce traffic congestion, improve mobility, and enhance air quality. Traffic forecasting models can be used to provide urban traffic control centers with an automated tool for anticipating the congestion that may arise on road facilities and its expected duration [2].The urban traffic flow forecasting models rely on historical and current flow data. The problem of traffic flow forecasting belongs to a standard time series prediction task and the purpose is to fetch the function which can relates future values of traffic flow to previous and current measurement of traffic flow [3]. A variety of forecasting techniques has been applied to forecast the urban traffic flow. In [4], Danech-Pajouh and Aron designed a layered statistical method with a mathematical clustering technique to group the traffic flow data and a separately tuned linear regression model for each cluster. The ARIMA model, initially developed by Kim et al., is one of the most popular approaches in traffic flow forecasting [5–7]. However, the limitation of ARIMA models is that their natural tendency, concentrated on the mean values of the past series data, seems unable to capture the rapid varying process changes underlying of traffic flow. The artificial neural network (ANN) is widely applied in traffic flow forecasting. Yin et al. [8] developed a fuzzy-neural model (FNM) to predict traffic flow in an urban street network. The empirical results showed that the FNM model provides more accurate forecasting results than the BPNN model. These researches are committed to improve the performance of the algorithms. However, there are many factors which can affect the traffic flow, the traditional single model can hardly improve the prediction accuracy and no online correction mechanism was considered. This motivates the paper.In this paper, the traffic flow forecasting model has 3 techniques: first, the input data of the model is divided into several categories according to FCM, and different categories have different model. Second, a training model based on a well-defined part-connected neural network (NN) was proposed and the cooperative quantum-particle swarm evolutionary algorithm (CQGAPSO) is used to train the model. Last, the error between predicted value and real value is used to compensate the output of the model. These methods can improve the accuracy and generalization of the forecasting model can also overcome the model mismatch.This paper is organized as follows. The forecasting methodology is introduced in Section2. Cases of studying of urban traffic flow forecasting are given in Section 3. Conclusions are finally made in Section 4.


## 2. Forecasting Methodology

### 2.1. The Framework of the Proposed Method

According to the change rule of traffic flow time series, there is an essential linkage between the future and the previous flow [9]. Thus, the previous traffic flow value can be used to forecast the future flow. Set f(t) as the traffic flow at time t, f(t-1) as the value at time t-1. In this paper, f(t), f(t-1),…,  and f(t-s) are the input values of the model at time t and f(t+p) is the predicted value at time t+p. The input values are denoted as x(i) and the predicted value is denoted y(i). The traffic flow forecasting model is made to build the relationship between y(i) and x(i). Therefore, once the relationship is obtained, the model can be used to predict the future traffic flow based on the real-time measured data in practice.In the previous studies, the single prediction model mentioned above was adopted to forecast the urban traffic flow. However, it is not universally applicable for all the traffic scenarios. Since the urban traffic system is an unstable system, which exhibits significant variation in different periods, it is necessary to establish different prediction models to forecast the future traffic state accurately. According to the measured data from the float car, Guo et al. [10] analyzed the degree of traffic congestion on different days in a week. The results showed that the traffic congestion of Monday is more serious than the other days, especially in the morning peak hour, and the most serious traffic congestion of evening peak hour occurred in Friday. Moreover, the degree of traffic congestion during commuting time on the weekend is less than the degree on weekdays. It can be concluded that by observing the traffic flow data, the travel modes and travel demand are different on each day of a week, and the data characteristic of the same day for every week is similar. Therefore, in order to improve the accuracy of prediction for traffic flow or travel speed on the road, it is necessary to classify the traffic flow pattern and apply a suitable model to forecast each pattern. This classification would guarantee that each prediction model has a good performance in a particular period. As urban traffic flow system is a complicated process influenced by many factors, it is believed that using the multimodel method to predict the traffic flow is appropriate.From the analysis made above, in this paper, for the sake of modeling, the historical traffic data should be divided into seven classes corresponding to each day of a week. Besides, considering the widely variation of traffic flow from morning to night, especially in the rush hour, using a single model to describe a complex nonlinear object usually results in low accuracy and poor generalization. So we use FCM to process the data and choose the reasonable clustering number by the experiments and use the approach based on multiple-input-single-output three-layer feedforward neural network with switches to model each cluster. Meanwhile, in order to overcome the model mismatch, the adaptive correction mechanism is added to our approach. The framework of the proposed method is illustrated in Figure1.Figure 1
The framework of the proposed method.


### 2.2. Fuzzyc-Means Clustering

The model of forecasting traffic flow is a multiinput single-output system; the training sample set can be expressed asD={fi(t+p),[fi(t)fi(t-1),…,fi(t-s)]∣s=1,2…m,i=1,2,…,n}. Here, n is the sample number of training set, m is the number of input variables; [fi(t)fi(t-1),…,fi(t-s)] denotes the ith input vector. Suppose D is divided into c clusters {D1,D2,…Dc}; thus, c submodels {M1,M2,…Mc} should be built for each Di, and the result of the FCM can be expressed as membership matrix U=[uij]i=1,2…c,j=1,2…n={Ui∣i=1,2…c}. uij denotes the degree of the element xj in training sample set belonging to the ith cluster. The value of uij is between 0 and 1. The architecture of FCM method is shown in Figure 2 [11, 12].Figure 2
The architecture of FCM.Clustering numberc is a very important parameter. Here, we do experiments to choose the appropriate clustering number c. Let c increase from 2 to a constant. Then, make models separately based on FCM and calculate the mean square error and the maximum error according to (1). Last, we can obtain the best clustering number c.Consider(1)MSE=(1n1∑i=1n1(yi-yi~)2)0.5,MAXE=maxi=1n1(|yi-yi~|).


### 2.3. The Forecasting Model Based on Neural Network with Switches

In the architecture of FCM method, each model needs a modeling tool. NN, SVM, and Kalman filtering are always used to forecast the traffic flow. Here, we adopt an advanced NN, the multiple-input-single-output three-layer feedforward neural network with switches was proposed and well defined in [13]. A multiple-input-single-output (MISO) three-layer feedforward neural work with switches is shown in Figure 3.Figure 3
The structure of three-layer feedforward NN with switches.Various methods were proposed to train the NN with switches [13–15]. In those methods, the population was partitioned to parameters and structure population. The parameters population was composed of the weight of the links, while the structure population was composed of the link switches. This model could eliminate some ill effects of approximation ability caused by redundant structure of NN.


### 2.4. The Adaptive Correction Mechanism

The traffic flow is the measurable variable, and the real-time data is used to predict the future traffic flow [16]. For example, at current time t, we can obtain the real value f(t) from the sensors and the predicted value f~(t) by forecasting the model. Here is an error e=f(t)-f~(t) because of the model mismatch. At time k, the model should forecast the traffic flow at time k+p; the error can be used to compensate the initial predicted value f′(t+p) according to (2). h is the offline correction coefficient.Consider(2)f~(t+p)=f′(t+p)+h·e.The training setD can be used to fetch h; to fetch h is to find the relationship between f(t)-f~(t) and f(t+p)-f~(t+p), and here, t=1,2…m, m is the sample number of training set. h can be calculated by least square method (SLM).When the model is forecasting the traffic flow online, the correction coefficienth should be refreshed in real time. For example, at current time t, we can calculate Δh using a small piece of historical data to obtain the relationship between f(t-i-p)-f~(t-i-p) and f(t-i)-f~(t-i). Here, i is a small positive integer. The online correction coefficient Δh can be obtained by SLM and (2) should be modified.Consider(3)f~(t+p)=f′(k+p)+(h+Δh)·e.


## 2.1. The Framework of the Proposed Method

According to the change rule of traffic flow time series, there is an essential linkage between the future and the previous flow [9]. Thus, the previous traffic flow value can be used to forecast the future flow. Set f(t) as the traffic flow at time t, f(t-1) as the value at time t-1. In this paper, f(t), f(t-1),…,  and f(t-s) are the input values of the model at time t and f(t+p) is the predicted value at time t+p. The input values are denoted as x(i) and the predicted value is denoted y(i). The traffic flow forecasting model is made to build the relationship between y(i) and x(i). Therefore, once the relationship is obtained, the model can be used to predict the future traffic flow based on the real-time measured data in practice.In the previous studies, the single prediction model mentioned above was adopted to forecast the urban traffic flow. However, it is not universally applicable for all the traffic scenarios. Since the urban traffic system is an unstable system, which exhibits significant variation in different periods, it is necessary to establish different prediction models to forecast the future traffic state accurately. According to the measured data from the float car, Guo et al. [10] analyzed the degree of traffic congestion on different days in a week. The results showed that the traffic congestion of Monday is more serious than the other days, especially in the morning peak hour, and the most serious traffic congestion of evening peak hour occurred in Friday. Moreover, the degree of traffic congestion during commuting time on the weekend is less than the degree on weekdays. It can be concluded that by observing the traffic flow data, the travel modes and travel demand are different on each day of a week, and the data characteristic of the same day for every week is similar. Therefore, in order to improve the accuracy of prediction for traffic flow or travel speed on the road, it is necessary to classify the traffic flow pattern and apply a suitable model to forecast each pattern. This classification would guarantee that each prediction model has a good performance in a particular period. As urban traffic flow system is a complicated process influenced by many factors, it is believed that using the multimodel method to predict the traffic flow is appropriate.From the analysis made above, in this paper, for the sake of modeling, the historical traffic data should be divided into seven classes corresponding to each day of a week. Besides, considering the widely variation of traffic flow from morning to night, especially in the rush hour, using a single model to describe a complex nonlinear object usually results in low accuracy and poor generalization. So we use FCM to process the data and choose the reasonable clustering number by the experiments and use the approach based on multiple-input-single-output three-layer feedforward neural network with switches to model each cluster. Meanwhile, in order to overcome the model mismatch, the adaptive correction mechanism is added to our approach. The framework of the proposed method is illustrated in Figure1.Figure 1
The framework of the proposed method.


## 2.2. Fuzzyc-Means Clustering

The model of forecasting traffic flow is a multiinput single-output system; the training sample set can be expressed asD={fi(t+p),[fi(t)fi(t-1),…,fi(t-s)]∣s=1,2…m,i=1,2,…,n}. Here, n is the sample number of training set, m is the number of input variables; [fi(t)fi(t-1),…,fi(t-s)] denotes the ith input vector. Suppose D is divided into c clusters {D1,D2,…Dc}; thus, c submodels {M1,M2,…Mc} should be built for each Di, and the result of the FCM can be expressed as membership matrix U=[uij]i=1,2…c,j=1,2…n={Ui∣i=1,2…c}. uij denotes the degree of the element xj in training sample set belonging to the ith cluster. The value of uij is between 0 and 1. The architecture of FCM method is shown in Figure 2 [11, 12].Figure 2
The architecture of FCM.Clustering numberc is a very important parameter. Here, we do experiments to choose the appropriate clustering number c. Let c increase from 2 to a constant. Then, make models separately based on FCM and calculate the mean square error and the maximum error according to (1). Last, we can obtain the best clustering number c.Consider(1)MSE=(1n1∑i=1n1(yi-yi~)2)0.5,MAXE=maxi=1n1(|yi-yi~|).


## 2.3. The Forecasting Model Based on Neural Network with Switches

In the architecture of FCM method, each model needs a modeling tool. NN, SVM, and Kalman filtering are always used to forecast the traffic flow. Here, we adopt an advanced NN, the multiple-input-single-output three-layer feedforward neural network with switches was proposed and well defined in [13]. A multiple-input-single-output (MISO) three-layer feedforward neural work with switches is shown in Figure 3.Figure 3
The structure of three-layer feedforward NN with switches.Various methods were proposed to train the NN with switches [13–15]. In those methods, the population was partitioned to parameters and structure population. The parameters population was composed of the weight of the links, while the structure population was composed of the link switches. This model could eliminate some ill effects of approximation ability caused by redundant structure of NN.


## 2.4. The Adaptive Correction Mechanism

The traffic flow is the measurable variable, and the real-time data is used to predict the future traffic flow [16]. For example, at current time t, we can obtain the real value f(t) from the sensors and the predicted value f~(t) by forecasting the model. Here is an error e=f(t)-f~(t) because of the model mismatch. At time k, the model should forecast the traffic flow at time k+p; the error can be used to compensate the initial predicted value f′(t+p) according to (2). h is the offline correction coefficient.Consider(2)f~(t+p)=f′(t+p)+h·e.The training setD can be used to fetch h; to fetch h is to find the relationship between f(t)-f~(t) and f(t+p)-f~(t+p), and here, t=1,2…m, m is the sample number of training set. h can be calculated by least square method (SLM).When the model is forecasting the traffic flow online, the correction coefficienth should be refreshed in real time. For example, at current time t, we can calculate Δh using a small piece of historical data to obtain the relationship between f(t-i-p)-f~(t-i-p) and f(t-i)-f~(t-i). Here, i is a small positive integer. The online correction coefficient Δh can be obtained by SLM and (2) should be modified.Consider(3)f~(t+p)=f′(k+p)+(h+Δh)·e.


## 3. Experimental Results

In order to explain the effectiveness of the proposed method, we choose the data gathered from Shanghai north-south highway including from August to October. The historical data on August and September is used to build the training set, while the data on October is used to build the testing set. There is a large difference of traffic flow every day in a week, thus we build different models for every day. Here, we use the first two Monday, Wednesday and Sunday on October to verify the proposed model.The number of training sample is 2800 and the testing sample number is 650. There is 2 minutes between each data. Based on the experience, we choose 3 as the dimension of input data. On request, we should predict the traffic flow after 10 minutes. Thus the width of the predictionp is 5. We totally do 3 experiments: (1) the traditional single model; (2) the multimodels based on FCM; (3) the multimodels based on FCM and adaptive correction mechanism.First, all the data should be filtered before modeling and NN with switches is used as the modeling tool. Then we should determine the Clustering numberc by FCM, “CQGAPSO” algorithm is used to train the NN model and the parameter of “CQGAPSO” algorithm is given in [17]. The hidden nodes number is 6. The training accuracy is 1×10-5 and the iteration times of training the NN are 2000. The experiments are implemented for 50 times. Table 1 gives the result of FCM.Table 1
The result of the FCM.
Clustering numberc
Monday 1
Wednesday 1
Sunday 1
MSE
MAXE
MSE
MAXE
MSE
MAXE
1
14.0515
57.5568
14.2659
61.2561
14.1235
57.3078
2
13.3489
51.3476
14.0024
53.1487
13.2149
51.0947
3
10.0456
43.1834
13.4820
48.4621
9.8952
42.1001
4
11.8439
44.9576
11.2106
45.2548
11.7541
44.8259
5
13.2563
47.5963
13.5279
49.3247
13.1589
46.2985
Clustering numberc
Monday 2
Wednesday 2
Sunday 2
MSE
MAXE
MSE
MAXE
MSE
MAXE
1
15.1125
60.9547
14.3762
59.0143
14.4321
60.6465
2
14.5876
54.2154
14.1144
59.9821
14.2547
61.6435
3
11.5248
40.1257
13.5520
50.7234
13.6464
50.9542
4
12.5487
42.2037
11.3017
47.0984
12.3014
48.2549
5
13.6587
44.1023
13.6975
51.2459
13.4164
50.8216Form Table1, we can find MSE and MAXE get better after an initial increase in growth of clustering number c. However, if c continues to grow, MSE and MAXE will get worse. That is because with the increasing of the clustering number, the generalization ability of the model gets poorer. The best clustering number c is at the turning point. Then the model should be added the adaptive correction mechanism. In order to obtain an appropriate correction coefficient, h is a fixed number which is calculated offline while Δh is a changed number which calculated online and we should limit the scope of Δh. Table 2 gives the result of adding the adaptive correction mechanism. From Table 2, we can find if the adaptive correction mechanism parameter value is -0.1≤Δh≤0.1, MSE and MAXE is the best. If the scope of Δh is very wide, MSE and MAXE will get worse because the compensation value is too large. Table 3 gives the comparison of every approach. Model (a) is the traditional single model, model (b) is the model (a) with FCM, model (c) is the model (b) with the correction mechanism. We can find the reasonable clustering number c and correction mechanism can improve the forecasting ability.Table 2
The result of adding the correction mechanism.
h
+
Δ
h
Monday 1
Wednesday 1
Sunday 1
MSE
MAXE
MSE
MAXE
MSE
MAXE
h
+
Δ
h
=
0
10.0456
43.1843
11.2106
45.2548
9.8952
42.1001
-
0.1
≤
Δ
h
≤
0.1
9.9758
42.1285
10.2654
44.1657
9.7561
40.6548
-
0.2
≤
Δ
h
≤
0.2
15.2648
59.2154
16.2299
61.2147
14.3215
57.6519
-
0.3
≤
Δ
h
≤
0.3
99.2154
70.2165
105.2647
85.2594
99.0147
69.2589
h
+
Δ
h
Monday 2
Wednesday 2
Sunday 2
MSE
MAXE
MSE
MAXE
MSE
MAXE
h
+
Δ
h
=
0
11.5248
40.1257
11.3017
47.0984
12.3014
48.2549
-
0.1
≤
Δ
h
≤
0.1
10.4529
38.2489
10.3594
46.2813
11.2497
47.9523
-
0.2
≤
Δ
h
≤
0.2
16.5489
58.2146
17.2016
64.0525
16.2018
58.2687
-
0.3
≤
Δ
h
≤
0.3
103.4269
88.2159
106.2184
86.3468
101.4512
98.1264Table 3
The comparison of 3 different models.
Monday 1
Wednesday 1
Sunday 1
MSE
MAXE
MSE
MAXE
MSE
MAXE
Model (a)
13.4956
46.7109
14.3495
48.3459
12.2304
46.0239
Model (b)
10.0456
43.1834
11.2106
45.2548
9.8952
42.1001
Model (c)
9.9758
42.1285
10.2654
44.1657
9.7561
40.6548
Monday 2
Wednesday 2
Sunday 2
MSE
MAXE
MSE
MAXE
MSE
MAXE
Model (a)
15.2430
49.4545
14.4506
51.4539
16.1356
55.2341
Model (b)
11.5248
40.1257
11.3017
47.0984
12.3014
48.2549
Model (c)
10.4529
38.2489
10.3594
46.2813
11.2497
47.9523The Comparison of every approach is illustrated in Figure3. Figure 4(a) is the traditional single model, Figure 4(b) is the model with FCM, Figure 4(c) is the model with FCM and the correction mechanism. In Figure 4(a), the predictive curve is smooth and cannot track exactly especially at the peak value because the approximation capability of the traditional single model is limited. In Figure 4(b), we can get some submodels by FCM and multimodel can improve the forecasting ability. Without the correction mechanism, the model error cannot be corrected in real time. In Figure 4(c), we use the correction mechanism and it compensates the initial forecasting value with the model error value. From Table 3 and Figure 4, we can find that the predictive accuracy is better than model (a) and (b).the result of forecasting the traffic flow.


## 4. Conclusions

Aiming at solving the problem of forecasting urban traffic flow, this paper proposes a forecasting model by the use of FCM and correction mechanism. The experimental results indicate that the proposed method can perform better than other methods and show the application prospect.



---

*Source: 195824-2013-11-28.xml*