Abstract

As a transportation way in people’s daily life, highway has become indispensable and extremely important. Traffic flow prediction is one of the important issues for highway management. Affected by many factors, including temporal, spatial, and other external ones, traffic flow is difficult to accurately predict. In this paper, we propose a graph convolutional method. And the name of our model proposed is the hybrid graph convolutional network (HGCN), which comprehensively considers time, space, weather conditions and date type to achieve better predicted results of traffic flow at highway stations. Compared with baselines implemented by various machine learning models, all metrics of our model are reduced dramatically.

1. Introduction

With economic growth and the infrastructure improvement, people’s lives and work are no longer limited to a specific city. The social activities interact with multiple cities have become the most basic requirement of people’s daily life. As a bridge between two cities, highway undoubtedly plays a leading role in people’s lives and work. If a road is closed occasionally or traffic jam happens owing to an accident on the highway or the bad weather conditions, respectively, people’s travel or work plans will be seriously affected [1]. As a mean of traffic management, highway traffic flow prediction can help the government and relevant departments to make road planning and to dispatch vehicle to prevent traffic congestion [2]. Because highway traffic prediction not only has the temporal and spatial characteristics but also is affected by external factors, insufficient consideration of influencing factors is one of the important challenges faced by the traffic flow prediction of highway toll stations. The combination of temporal and spatial can be termed as spatiotemporal characteristics. External factors include weather conditions and date type. For example, people are more willing to take a road trip in fine weather. Especially in weekend or holiday, the demands of folks enjoying travel sharply increase. So, how to effectively use these factors on historical data has become the focus of highway traffic flow prediction.

In this paper, based on deep learning, a graph convolutional method is proposed for highway traffic flow prediction. It that name hybrid graph convolutional network (HGCN) is a combination of the graph convolutional network (GCN) and feedforward neural network (FNN). HGCN can effectively extract the non-Euclidean spatial features of the highway network and comprehensive consideration of the weather type and date type of the toll stations to get better prediction. The rest of this paper is organized as follows. At Section 2, we describe related work with our research. Then, at Section 3, we demonstrate the process of our model building. Next, at Section 4, we introduce several experiments to describe that our model has more accurate prediction effects. Finally, at Section 5, we summarize our work and discuss the direction of future work.

The traffic flow of highway toll stations is a vital metric for people’s daily travel or government decision-making. With the development of Internet of Things (IOT) and big data, people can obtain more types of data for analysis and research on highway traffic tasks [35]. Traffic flow prediction is one of the most important tasks in the Intelligent Transportation System (ITS) [611]. Methods commonly used in traffic flow prediction can be roughly divided into three categories.

The first type of methods is based on traditional statistical perspective. autoregressive integrated moving average model (ARIMA) [12, 13] and vector autoregressive models (VAR) [14] are the representative model of traditional statistical methods. At the same time, KARIMA [15] and SARIMA [16] based on the ARIMA algorithm are also such statistical learning methods. However, these methods have certain limitations. Because these algorithms cannot consider nonlinear factors of traffic flow, they are impossible to accurately estimate the traffic flow of highway toll stations.

The second type of methods is based on machine learning algorithms. By acquiring nonlinear features from the data, these models more conform to the problem of traffic flow prediction of highway toll stations under the real condition. Compared with statistical methods, models based on machine learning can get more accurate prediction results. Many representative models for traffic flow prediction of such methods are proposed like support vector regression (SVR) [17], Bayesian model [18], boosting technology [19], and -nearest neighbor model (KNN) [20, 21]. Although learning nonlinear features, these models have a strong dependence on the processing of input raw data. Good feature processing can bring ideal prediction results and vice versa. Therefore, shallow machine learning models cannot obtain better prediction results.

The third type of methods is based on deep learning. Recently, recurrent neural networks (RNNs) and convolutional neural networks (CNN) are two main adopted models of deep learning algorithms. Among [2227], RNN models are generally used to deal with temporal series, because RNN models can extract temporal feature from data very well. In particular, long short-term memory (LSTM), as a variant of RNN models, effectively avoids the problems of gradient explosion and gradient disappearance during the process of training by adding gating mechanism and is widely used in traffic flow prediction. Works [2833] employ variant RNN models to predict traffic flow. In addition, the CNN network is good at obtaining the spatial characteristics of a two-dimensional matrix in the Euclidean space. So, many studies such as [3436] use CNN models to obtain spatial feature of the highway network to get better prediction for traffic flow. In order to consider more comprehensively, combined CNN and RNN models like [3739] are proposed considering the spatiotemporal characteristics of traffic prediction. On the other hand, because the limitation of the graph convolutional network (CNN) that is not good at dealing with the problems in non-Euclidean space, GCN has become the most popular technology for traffic flow prediction problems. [1, 37] are the typical example of using GCN to learn spatial correlation features to predict traffic flow.

However, in fact, the factors they considered were insufficient. Temporal characteristics and external factors, including weather conditions and date types, have a great influence on the prediction accuracy of traffic flow. Therefore, we propose a graph convolutional method, which belongs to the third type of methods. Our model is a combination of the graph convolutional network (GCN) and feedforward neural network (FNN) and is named hybrid graph convolutional network (HGCN). Our model not only can effectively extract the non-Euclidean spatial features of the highway network but also learn temporal feature of traffic flow and external features of toll stations, and then our model gets a better prediction of traffic flow.

3. HGCN Model and Its Construction

3.1. Feature Engineering

Because the traffic flow prediction problem of highway toll stations is affected by many factors, it is necessary to consider multiple factors extracted from input raw data. These features are defined as follows.

Definition 1(highway network): In this paper, we use to represent the highway network structure. Here, represents highway toll stations, represents the total number of toll stations, , , indicates whether there is an edge between two toll stations, and and are a positive integer.

In our work, we regard highway network as an undirected graph according to actual bidirectional highway roads. In addition, the prediction of highway toll station traffic flow is not only related to the spatial relationship of toll stations but also related to temporal characteristics. For example, the traffic flow of a station has a certain periodicity. In weekdays, it will have relatively similar volumes, and in weekends or holidays, it will increase. Therefore, it is necessary to consider the influence of the temporal features on the traffic flow at the highway toll station. The temporal features can be defined as follows.

Definition 2 (historical traffic flow of highway toll stations): On the day , the temporal features of a certain toll station can be represented by the vector:

where represents the features of highway toll station on the day , represents the length of the historical time window, represents a day in historical time window, and represents the traffic flow of the highway toll station on day .

In addition to spatiotemporal characteristics, the prediction of traffic flow at highway toll stations also faces external factors. According to the analysis for the traffic flow data of highway toll stations, the external factors include weather conditions and date type [19]. For example, in extreme weather conditions such as heavy snow, heavy fog, and downpour, the highway may be closed. Besides, people are more willing to travel or go on a road trip on sunny days. Especially on weekends and holidays, the number of people traveling increases obviously. Therefore, we take external characteristics of traffic flow into the model. Then, the external characteristics can be defined as follows.

Definition 3 (external factors): On the day , external factors can be represented by the vector

represents the weather conditions at the toll station on day , represents the date type of day , and represents the traffic flow of the highway toll station adjacent to the on the day. The calculation of these parameters can refer to our previous work [21]. In order to explain the weather condition type and date type characteristics in more detail, we define them as formula (3) and formula (4).

where represents the weather conditions at the toll station on day , and there are two values for this parameter. When this parameter equals 1, it represents extreme weather condition including heavy snow, heavy fog, downpour, and hurricane. When this parameter equals 0, it represents other weather conditions. In the other hand, we divide the date into three types include holidays, weekends, and others. The specific definition is as follows.

3.2. Graph Construction

How to effectively construct a highway network graph has a great influence on extracting the spatial characteristics of the associated toll stations. Neighborhood will directly affect the prediction effect of traffic flow at highway toll stations. Therefore, we constructed our highway network graph based on the following three principles.

3.2.1. Connectivity Principle

This principle guarantees the completeness and correctness of the highway network graph. It means that there will be no isolated nodes or subgraphs in the highway network graph. That is, there is always a path from any node to any node in the graph. We set this principle because in actual situations, any two toll stations on the highway are always reachable, and there is no isolated toll station.

3.2.2. Neighborhood Principle

This principle explains how to select neighbor nodes. The edge in the graph taken from any toll station to its neighbor toll station does not pass through other toll stations. Because we believe that adjacent toll stations in the highway network have higher spatial correlation, and at the same time, it will have a greater impact on the traffic flow of its adjacent toll stations, we look for the nearest toll stations on the highway network as the neighbor node of toll station .

3.2.3. Bidirection Principle

This principle stipulates that the highway network graph we construct is an undirected graph. That means, toll stations and are connected, and vice versa. This principle is set to conform to the real situation of the highway network.

According to the above three rules, we use the adjacency list to construct our highway network, as shown in Figure 1.

In the example of Figure 1, the arrow represents starting toll station , and its neighboring toll station is connected. For example, Anyang is selected as the starting toll station, and its neighboring toll stations include Anyangbei, Anyangdong, Aanyangnan, and Anyangkaifaqu. However, it is worth noting that the arrow only represents the connection relationship between the starting toll station and its neighboring toll stations.

3.3. Model Structure

After processing features, the traffic flow prediction problem of highway toll stations can be expressed by formula (5).

represents the traffic flow of all highway toll stations on day . represents the historical traffic flow of all highway toll stations on day . represents the external factors on the day . represents the method including feature engineering and graph convolutional method proposed in this paper. The specific structure of the model is shown in Figure 2.

For this method , input is the raw data, and output is the prediction result of traffic flow at highway toll stations. The detailed process of can be divided into three parts, including feature engineering, GCN, and FNN.

In the feature engineering part, raw input data including highway toll stations network and traffic flow of highway toll stations are needed for extracting spatiotemporal and external factors. First, in order to extract spatial features, we construct an undirected graph by using the highway toll station network. Then, we obtain historical traffic flow based on traffic data of highway toll stations and add weather conditions and date type factors. Through the above processing, our feature engineering part finally output the spatial feature and the temporal and external factor matrix .

In the GCN part, we use the GCN model to extract the spatial characteristics of the highway network and to obtain the influence factors of spatial relationship between toll stations. Using the approximated 1st order Chebyshev polynomial expansion, GCN proposed by [40] not only reduces the number of parameters but also increases the prediction accuracy. Using GCN, we can obtain the relationship among neighboring nodes and learn the impact of different nodes on the toll station to be predicted. Considering the influence of neighboring nodes, our model can make more accurate predictions. Therefore, in this part, two layers of GCN are used to extract spatial features. The input feature dimension of the first layer of GCN is the same as that of the feature matrix . The specific formulas of the GCN layer can be defined as follows.

represents feature matrix including the temporal feature of traffic flow at highway toll stations and external factors, , is the adjacency matrix of the highway network , represents identity matrix of size , and . The weight matrix is a learnable parameter. and represent the output of the first layer and the second layer, respectively, and the dimension of their feature is 64.

In the FNN part, the feedforward neural network (FNN) is used to comprehensively consider three influencing factors. Through nonlinear transformation and weighted summation on the input feature matrix extracted by GCN, the FNN part gets the predicted result of highway toll stations. In this part, we use a three-layer neural network structure, corresponding to the input layer, hidden layer, and output layer. The specific structure of the network is shown in Figure 3.

In order to extract more features, the number of neurons in the input layer is 128, and the number of neurons in the hidden layer is the same with the input layer. Finally, the number of neurons in the output layer is one, and the output of the output layer represents prediction result of traffic flow at highway toll stations. In order to clearly illustrate process in the FNN part, we defined some formulas as follows.

Here, represents the output of each layer in FNN part, and represents the result of prediction of traffic flow at highway toll stations. and represent weighted matrix and bias, respectively, and both are learnable parameters.

4. Evaluation

4.1. Settings

The experimental data comes from a real application system, which is the Henan Highway Management System [13]. In the experiment, we used weather and traffic flow data on highway toll stations from May 2017 to September 2017. The total amount of data is approximately more than 20000. From September 16, 2017 to September 30, 2017 as our testing set and the rest of data as our training set, we choose , that means we use 7 days of historical traffic flows of highway toll stations as the temporal feature. Due to the large amount of traffic flow, the system stores the traffic flow in the HBase database. Our system uses three servers to build the HBase database that its version is 1.6.0, each of which server have 4 cores CPU, 22 GB RAM, and 700 GB storage. Meanwhile, the machine configuration used for model training is Intel (R) Core (TM) CPU i7-9750 2.59GHz, 16GB RAM, 1 TB storage, and one NVIDIA GeForce GTX 1660 Ti.

In addition, our experiment is supported by common machine learning software, including python 3.6, pytorch 1.7.0, torch-geometric 1.6.1, and sklearn 0.23.2. In the experiment, we compared HGCN with several other models, including gradient boost regression tree (GBRT) [19] and KNN [21] model on the prediction accuracy of highway toll stations. To evaluate the prediction effect of our model, three metrics, root mean square error (RMSE), mean absolute percentage error (MAPE), and mean absolute error (MAE), are used in our experiments. Their formulas are defined as follows.

Here, represents the predicted value of traffic flow, represents the ground truth value of traffic flow, represents average predicted value, and represents the number of samples.

4.2. Experiments

Two experiments are designed to verify the effectiveness of our feature engineering and the prediction effect of the HGCN model for predicting traffic flow at highway toll stations.

4.2.1. Experiment 1:Feature Engineering Effects

In this experiment, we compare two variant models based on HGCN, HGCNnoE, and HGCNnoT. Here, HGCNnoE means that in the feature Engineering part, the model does not consider external factors (abbr. for ). In addition, HGCNnoT ignores the temporal features in the feature engineering part (abbr. for ). In this case, we use three different models to predict the traffic flow of 269 highway toll stations, and the comparison result of models can refer to Figure 4.

In Figure 4, we use a MAPE distribution chart to compare the prediction effect among different models. First of all, we can see that the distribution chart has the right-skewed attribute as we expect. In the chart, the more concentrated the density is on the left of the chart, the better the prediction accuracy would be. It can be seen from the figure that the density of the HGCN model on the left is more concentrated than other models. This phenomenon indicates that our HGCN model has obtained better prediction results on the problem of highway traffic flow prediction at toll stations; so, weather conditions and date types will affect the prediction accuracy. Therefore, it is very necessary to add weather conditions and date type features to the model to improve the prediction accuracy.

We have carried out traffic predictions on all stations on the highway and constructed Table 1 on the experiment results. From Table 1, we can see that the HGCN model is better than the other two models in RMSE and MAE. While MAPE of HGCN is slightly lower than HGCNnoE, the difference between the two models is less than 1%, and we can regard them as being at the same level. It may be the cause that weather factors mislead our model. Especially for toll stations with a small amount of traffic flow, weather conditions have little effect on the prediction of traffic flow. By comprehensively analyzing RMSE, MAE, and MAPE, our model HGCN brings more accurate predictions.

The result of three metrics also confirmed that it is necessary to consider temporal and external factors to predict the traffic flow of highway toll stations. By considering temporal characteristics and external factors, our model can better learn the historical relationship of traffic flow and the influence of external factors to obtain better prediction results.

4.2.2. Experiment 2: Prediction Effect Comparison with Machine Learning and Deep Learning Models

In this experiment, we use HGCN to predict the traffic flow of all 269 highway toll stations in Henan Province and compare the accuracy with other models. We have selected 2 typical toll stations to show the prediction results of the traffic flow. The traffic flow of the first toll station is about more than 10,000 vehicles per day, and the traffic flow of another toll station is about 4,000 to 8,000 vehicles per day. The experimental comparison results are shown in Figure 5.

From Figure 5, we can clearly see that HGCN can better fit the ground truth of the traffic flow at those highway toll stations than other models. Obviously, by using GCN to obtain the spatial factors of the highway network, our model has a higher prediction accuracy. At the same time, we can see from Table 2 that, in the toll station of Zhengzhouliulin, compared with the LSTM model, our model HGCN has greatly reduced from 5.651 to 3.683 in MAPE metric. And on another toll station, our model is also better than other models including GBRT, KNN, and LSTM in metrics RMSE, MAE, and MAPE. This experiment clearly shows, because our model uses GCN to consider the spatial relationship of toll stations and uses the FNN model to comprehensively consider the characteristics of temporal-spatial and external factors; so, the HGCN model we proposed can get more accurate prediction result of traffic flow.

5. Conclusion

In this paper, we propose a convolutional method HGCN based on a deep learning algorithm to predict the traffic flow of highway toll stations. For solving insufficient consideration of influencing factors of traffic flow, our work can be divided into two parts. First, in order to better fit the traffic flow prediction problem of highway toll stations, we considered spatiotemporal and external factors including weather conditions and date type. Then, by using GCN to extract spatial features, our model fully considers the non-Euclidean attributes of the highway network. Our model obtains a more accurate prediction of the traffic flow at highway toll stations. In the future, we will dynamically adjust the graph structure of GCN and take the distance between toll stations into the highway network structure as an edge attribute in order to comprehensively consider the influence of different distance among toll stations for traffic flow prediction.

Data Availability

The traffic flow data used to support the findings of this study have not been made available because the data were supplied by local management Henan Transport Department under license with certain confidentiality level and so cannot be made freely available. Requests for access to these data should be made to the corresponding author for an application of joint research.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

We would like to thank Mengda Xing, Jindon Xu, Bo Lv, and Ji Liu who are classmates in our laboratory to optimize our model and improve the quality of this paper. This work was supported by the National Natural Science Foundation of China (No. 61702014) and Beijing Municipal Natural Science Foundation (No. 4192020).