Urban Traffic Flow Prediction Based on Spatio-Temporal Convolution Networks ()
1. Introduction
Advanced intelligent transportation system cannot be separated from basic traffic data processing [1] [2] . At present, there are a variety of data acquisition and processing methods in the field of intelligent transportation, which also provides multidimensional traffic data for ITS. How to effectively apply these data to ITS has become a hot research topic at present [3] [4] . Traffic flow prediction is a way of traffic data processing [5] [6] . Accurate traffic prediction information can provide a powerful basis for traffic decision making for traffic managers, and also enable drivers to choose a more smooth road to travel, so as to avoid or alleviate traffic congestion [7] [8] .
Traffic flow prediction is a typical spatio-temporal data prediction problem. Traffic data records the traffic flow, occupancy, speed, etc., at a fixed point in time at a fixed location. Obviously, the traffic flows observed at adjacent locations and time stamps are not independent of each other, and the traffic flow at the previous location will affect the traffic flow at the next node after a period of time, showing a strong temporal and spatial correlation [9] . At the same time, the traffic flow is also cyclical. For example, the morning and evening peak traffic flow on weekdays shows great similarity [10] . Figure 1 shows the traffic flow of a street in Chengdu for five consecutive working days. We can see the same trend in their traffic flow. How to explore complex spatiotemporal data to find its inherent spatiotemporal patterns and make accurate traffic flow prediction is a very challenging problem.
Fortunately, with the development of the transportation industry, many information collection devices have been deployed on urban roads. Each device has unique spatial GPS coordinates that continuously generate time series data about traffic. These devices have accumulated a large number of rich traffic time series data and geographic information, which provides a solid data basis for traffic prediction. Many researchers have made great efforts to solve these problems.
Earlier, time series analysis model was applied to traffic prediction problems. In practice, however, they do not work well with unstable and non-linear data. Later, traditional machine learning methods have been developed to model more complex data, but they are still difficult to consider the spatio-temporal correlation of high-dimensional traffic data at the same time. Moreover, the predictive
Figure 1. Traffic flow of No. 255 grid in Chengdu for five consecutive working days.
performance of these methods relies heavily on feature engineering and heavily on expertise. In recent years, many researchers have used deep learning methods to process high-dimensional spatio-temporal data, that is, convolutional neural networks (CNN) to effectively extract spatial features of grid-based data. However, these methods are still unable to simultaneously model the temporal and spatial characteristics and dynamic correlation of traffic data.
To address the above challenges, a new deep learning model, the spatio-temporal Convolutional Network (ST-CNN), is proposed in this paper to predict the traffic flow at each location on the traffic network. The model can capture dynamic temporal and spatial characteristics effectively. The main work of this paper is summarized as follows:
· In this paper, the map is divided into 30 * 30 grids for Chengdu and 32 * 32 grids for Beijing.
· In this paper, a spatiotemporal convolution module is designed, which mines information from adjacent grid blocks from the traffic network structure.
· Experiments on real-world highway traffic data sets show that our model has the best predictive performance compared with existing baseline models.
2. Related Work
Zhang [11] proposes a short-term traffic flow prediction model based on the deep learning framework of convolutional neural networks (CNN). The spatial-temporal feature selection algorithm (STFSA) is used to determine the optimal input data, extract the selected spatial-temporal traffic flow features from the actual data, and use CNN to learn these features to construct the prediction model. However, this model does not deal well with time characteristics. Zhao [12] proposes a CNN-LTSM model IL-TFNet based on incremental learning for traffic flow prediction. The K-means clustering algorithm is used as the uncertainty feature to extract unknown traffic accident information. The model can process the characteristics of time and space and external environment at the same time, ensuring the prediction accuracy of the model. Y. Tian [13] believes that the input of many current models is static, and uses three multiplication elements in memory block to dynamically determine the optimal time delay, and proposes a model called long and short term memory cyclic neural network (LSTM RNN).However, this model does not consider the dynamic temporal and spatial correlation of traffic data. Inspired by the above research, considering the spatial topology of traffic network and the dynamic spatio-temporal pattern of traffic data, we simultaneously use convolutional neural network and cyclic neural network to construct spatio-temporal feature extraction blocks to mine spatio-temporal information.
3. Preliminaries
3.1. Raster Data
Raster data is a data form that divides space into regular grids, each grid is called a cell, and assigns corresponding attribute values to each cell to represent entities. Figure 2 shows the specific method of raster partitioning.
3.2. Traffic Flow Forecasting
The task of traffic flow prediction is to learn a mapping relationship f for a given traffic network spatial graph G and multiple consecutive traffic flow data of the same time segment, and use this relationship to predict the traffic flow in the following continuous period of time. The mathematical definition of traffic flow prediction task is as follows:
(1)
where, the former represents the historical data required by the prediction model, the latter is the output of the model, and f is the traffic flow prediction model.
3.3. Evaluation
In this paper, root mean square error (MSE) and mean absolute error (MAE) are used to evaluate the performance of the model. The calculation formula is as follows:
· RMSE
(2)
· MAE
(3)
4. Spatio-Temporal Convolution Networks
The proposed model is composed of Time-block and Spati-block. As shown in Figure 3, the Time-block is composed of two fully connected layers and a cyclic unit. The nonlinear characteristics of data can be learned to the maximum extent through the fusion of gated layers composed of three different activation functions. Spatil-Block consists of three convolution layers and one fully connected layer. Time-block blocks and Spati-block blocks together form ST-Block blocks. ST-block can fully extract the spatio-temporal characteristics of data, and skip connection is adopted to avoid gradient explosion problem. As shown in Figure 4, the predicted value is obtained through multiple St-blocks.
Figure 3. The structure of ST-CNN Model.
Figure 4. The process of ST-CNN model prediction.
5. Experiments
The experiment was carried out in Windows10 system, using Anaconda Navigator (Jupyter notebook) and Python3.7 as experimental platforms, and using the neural network model provided by pytorch framework to simulate the experiment.
5.1. Datasets
We tested our model on two highway traffic data sets: Chengdu taxi and Beijing taxi [10] . The details of the datasets are shown in Table 1.
· TaxiCD. The dataset collected more than 1.4 billion taxi GPS data from more than 14,000 taxis in Chengdu from 8/1, 2014 to 8/30, 2014.
· TaxiBJ. This data set is a taxi trajectory data set collected by Microsoft Research, including the trajectory of 10,357 taxis in Beijing during the week from February 02, 2008 to February 08, 2008.
5.2. Baseline
The baseline model we selected is shown in Table 2.
5.3. Comparison and Result Analysis
Using the early stop method for training, Table 2 shows how the different models perform on the two datasets.
It can be seen from Table 3 that the performance of HA model is at the bottom of the two data sets. This is because HA model is a traditional statistical method and it is difficult for it to learn the complex nonlinear relationship between data. RNN models outperform CNN on TaxiCD data sets, but CNN performs better on TaxiBJ data sets. This may be because Beijing’s traffic structure is more complex than Chengdu’s, so the TaxiBJ dataset contains more spatial structure information.
Table 1. Traffic flow dataset (Table caption is indispensable).
Table 2. Traffic flow dataset (Table caption is indispensable).
Table 4. Ablation experiment result.
5.4. Ablation Experiment
Cancel some modules and replace the Spati-block module with the full connection layer in ST-CNN_noCNN, and replace the Time-block module with the full connection layer in ST-CNN_noRNN. From Table 4, we can see that the experimental results are consistent with Table 3: ST-CNN_noCNN performs better in TaxiCD data set and ST-CNN_noRNN performs better in TaxiBJ data set. Moreover, ST-CNN performance is optimal on both data sets, which proves that Spati-block and Time-Block blocks play a role in improving model performance.
6. Conclusion and Future Work
In this paper, a new spatio-temporal convolution model ST-CNN is proposed and successfully applied to traffic flow prediction. The model combines cyclic neural networks and convolutional neural networks to capture dynamic spatio-temporal characteristics of traffic data. Experiments on two real-world data sets show that the prediction accuracy of the proposed model is better than that of the baseline model. There are still some shortcomings in this paper. For example, it does not consider the influence of weather factors on traffic flow. Sometimes there are similar traffic flow patterns in places that are far apart. For example, the traffic flow of two overpasses that are far apart is similar. This similarity is called semantic similarity.