A new method for short-term traffic congestion forecasting based on LSTM

Traffic congestion in metropolitan areas such as shenzhen, has become more and more serious. Over the past decades, many academic and industrial efforts have been made to alleviate this issue. In this paper, we propose a novel approach to predicting short-term traffic congestion. At first, we pre-process the data to get the speed, traffic, lane number of these parameters. Second, we carry out statistical data and create training samples. Third, We establish a hybrid neural network prediction model based on LSTM and substitute the generated samples into training. Finally, we use the model to predict the future congestion situation. The experimental results show that our model achieves good predictive results.


Introduction
With the steadily growth number of vehicles, road traffic congestion has become an increasingly important problem [1]. In the USA, for example, there were 835 vehicles per 1000 persons in 2015.
There are many problems related with this increase, such as noise, pollution, and traffic jams, which lead to time being wasted in travel and productivity loss. Therefore, traffic forecasting, especially 5 short-term traffic forecasting has been paid more and more attention, and has become a key research topic in traffic engineering field.
The rest of the paper is organized as follows. Section 2 reviews the background and related work. Section 3 proposes a new Short-Term Traffic Congestion Forecasting Model. Results and Evaluation is described in Section 4. Finally, Section 5 presents the conclusion.

Background and Related Work
As we all know, we can build various models to predict traffic congestion. And we introduce the development of short-term traffic flow forecasting from neural networks and non-neural networks. For non-neural networks, we introduce several representative articles. At first, Lee et al. [2] attempt to find new knowledge between traffic congestion and weather by using big data processing technology. Second, Surya et al. [3] proposed the design of a system that utilizes and efficiently manages traffic light controllers according to the congestion predicted at each line using real time data. At last, Kong et al. [4] proposed a novel approach to estimate and predict the urban traffic congestion using floating car trajectory data efficiently. In this method, floating cars are regarded as mobile sensors, which can probe a large scale of urban traffic flows in real time. As to neural networks, Rohan et al. [ the significance of Jordan sequential network for prediction of future values, depending upon the current value and aggregate past values. In addition, Fouladgar et al. [6] proposed a decentralized deep learning-based method where each node accurately predicts its own congestion state in realtime based on the congestion state of the neighboring stations. While the related works presented above focus on neural networks and traditional congestion prediction methods, we are the first to combine the advantages of LSTM in timing prediction and the advantages of general neural networks, and using it for congestion prediction.

LSTM
In this section, the LSTM model [7], as a particular type of Recurrent Neural Network (RNN), is introduced. LSTM is a special type of RNN that can learn long-term dependency information. It has achieved considerable success and has been widely used. Another variation of the RNN is the Gated Recurrent Unit (GRU), which is proposed by Cho et al. [8].

Short-Term Traffic Congestion Forecasting Model
We make congestion predictions for each crossroads. The prediction model is shown in figure 1.
Step 1: Clean the original traffic data, and then read the traffic flow P, speed V, lane number data N, and use these data to produce the sample set.
Step 2: we define congestion coefficient C = k * P / (V * N), and k is the constant. According to the congestion coefficient C, the traffic situation could be divided into A: very congested B: congestion C: general congestion D: slightly congested E: not congested.
Step 3: For the designated crossroads, lane number data N is constant. So we model the speed and traffic flow in time and space. For example: we can get the p t+1 according to the in front of several moments p t ,p t−1 ,p t−2 ,p t−3 ,p t−4 and the p s+1 according to the near the crossroads p s ,p s−1 ,p s−2 ,p s− 3 ,p s−4 . In the same way we can get v t+1 and v s+1 .
Step 5: The model has two layers of hidden layers which use the sigmoid activation function, with 64 and 128 neurons, respectively.
Step 6: The output layer uses the softmax activation function, and the loss function uses the cross entropy function.
Step 7: Use the batch gradient drop method to training.

Experimental Setting
In this paper, we use HUAWEI Official Data set to verify the validity of our proposed model. The data set is collected by the camera at all crossroads in Shenzhen, and consists of 36 fields. Among them, the field includes the license plate number, speed, car color, lane number and other information, which originates from 2017 Huawei Developer Contest [9]. We have uploaded all the experimental code to this site [10] . We use Tensorflow and python to realize our model.

Experimental Results and Evaluation
The data in the data set is provided with data from all the intersections of Shenzhen May 11 to May 20, 2017. We have to predict the traffic jam at the crossroads numbered 10300202. So, we only need to deal with the designated intersection and its adjacent five junctions of information. We divided the data for 10 days into the first eight days and the next two days. The first eight days of data we used to make samples, and then used to train the model. Two days after the data used to calculate the accuracy rate and other indicators, and to verify our model. The analysis in figure 2 is based on data from May 11 to 18. The leftmost graph (Traffic Flow) describes the traffic at the intersection 10300202, and the y-axis represents the number of vehicles, and the time indicated by the x-axis. We sampling in every 15 minutes, so the time 200 on the x-axis means 200 * 15 min, that is, the third day (May 13) 02:00. In the same way, we can get the 4 meaning of graph (Speed) and graph (congestion index). We can see that in the moment 200 the traffic flow can reach about 50 km/h and the congestion coefficient is about 0.3, so we can judge the road is not congested. Figure 3 shows the predicted value for May 19 and 20 based on our model. The time 80 on behalf of 80 * 15 min, that is, 20:00 May 19. In this time, the speed of is 20km/h below, and congestion coefficient of 11 or so. Thus, the road is very congested, since it is the get off work late peak. According to the predicted value and the original value, we can calculate the values of Precision, Recall and F1-Measure are 0.984, 0.975, and 0.979 respectively. The experimental results show that our model achieves good predictive results.

Conclusion
In this paper, we propose a novel approach to predicting short-term traffic congestion. At first, we pre-process the data to get the speed, traffic, lane number of these parameters. Second, we carry out statistical data and create training samples. Third, We establish a hybrid neural network prediction model based on LSTM and substitute the generated samples into training. Finally, we use the model to predict the future congestion situation. The experimental results show that our model achieves good predictive results.