Next Article in Journal
Navigation in Unknown Dynamic Environments Based on Deep Reinforcement Learning
Next Article in Special Issue
Advanced Estimation Techniques for Vehicle System Dynamic State: A Survey
Previous Article in Journal
Game Theoretic Solution for Power Management in IoT-Based Wireless Sensor Networks
Previous Article in Special Issue
A New Switched State Jump Observer for Traffic Density Estimation in Expressways Based on Hybrid-Dynamic-Traffic-Network-Model
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Traffic Speed Prediction: An Attention-Based Method

College of Computer Science and Technology, Zhejiang University of Technology, Hangzhou 310023, China
*
Author to whom correspondence should be addressed.
Sensors 2019, 19(18), 3836; https://doi.org/10.3390/s19183836
Submission received: 13 August 2019 / Revised: 31 August 2019 / Accepted: 2 September 2019 / Published: 5 September 2019
(This article belongs to the Special Issue Advance in Sensors and Sensing Systems for Driving and Transportation)

Abstract

:
Short-term traffic speed prediction has become one of the most important parts of intelligent transportation systems (ITSs). In recent years, deep learning methods have demonstrated their superiority both in accuracy and efficiency. However, most of them only consider the temporal information, overlooking the spatial or some environmental factors, especially the different correlations between the target road and the surrounding roads. This paper proposes a traffic speed prediction approach based on temporal clustering and hierarchical attention (TCHA) to address the above issues. We apply temporal clustering to the target road to distinguish the traffic environment. Traffic data in each cluster have a similar distribution, which can help improve the prediction accuracy. A hierarchical attention-based mechanism is then used to extract the features at each time step. The encoder measures the importance of spatial features, and the decoder measures the temporal ones. The proposed method is evaluated over the data of a certain area in Hangzhou, and experiments have shown that this method can outperform the state of the art for traffic speed prediction.

1. Introduction

Traffic speed prediction, especially short-term prediction (less than 20 min), has become increasingly important in intelligent transportation systems (ITSs) [1]. Many modern traffic facilities and applications rely heavily on the accuracy of prediction. For example, the navigation system can provide an optimal route for travelers based on real-time prediction, and can calculate the cost of travel time, which is helpful for making plans. The traffic speed can reflect the traffic state of the road network; based on the current value of traffic speed and its future short-term change trend, managers can partition the traffic network [2], optimize the signal timing, and guide the traffic traveling, so as to make full use of road resources and alleviate traffic congestion.
Because of the substantial amount of potential, traffic prediction has become a hot topic in the field of traffic over the past few decades. Considering that the current traffic states are relevant to the upstream and downstream roads, and are also similar to the same horizon of previous weekdays and weekends, various data-driven algorithms have been proposed to increase the prediction reliability and accuracy. In general, approaches can be categorized into three parts: parametric methods, non-parametric methods, and deep learning methods [3,4,5].
Parametric approaches rely on a fixed parameter set, assuming that the collected data satisfy a similar distribution. A most widely used approach is the auto-regressive integrated moving average model (ARIMA), which is a time-series prediction model and assumes that the data are stationary, that is to say, the mean value and variance remain unchanged. The ARIMA model was first used in traffic prediction in [6], and in the past few decades, a number of its extensions have been proposed [7,8]. Although such method is easy to implement, it can only be used in linear system. The traffic system is far more complex, if using such method, the prediction accuracy is not reliable enough.
Different from parametric methods, non-parametric methods are believed to more flexibly fit the nonlinear characteristics and are better able to process noisy data [9]. A Kalman filter is a main model to predict future states, which can be applied to any dynamic system whose state variables are uncertain. Kalman-filter-based approaches have been applied in traffic prediction in [10,11,12]. Other statistical techniques such as the hidden Markov model [13] and Bayesian interference [14] have also been under research in recent years. Recently, along with the arrival of big data, machine-learning-based methods have drawn academic attention. Davis and Nihan first applied the k-nearest-neighbors (k-NN) method to short-term traffic prediction, considering the stochastic traffic features. The results were comparable but were unable to reach the benchmarks [15]. One deficiency of k-NN is that the selection of k relies heavily on priori or experiential knowledge. Besides, as the historical data are growing every day, the search space becomes even more enormous, resulting in substantial costs when searching for an optimal solution. To resolve this problem, Simon et al. proposed an improved sequential search strategy with k-NN [16]. The support vector machine (SVM) and support vector regression (SVR) are considered as two other efficient algorithms for short-term traffic speed prediction. SVR maps multi-dimensional traffic data into a feature space and performs a linear regression within that space [17]. Several studies [18,19,20] have proved that SVR can outperform time-series methods. However, these studies with shallow architectures have been proved to have limitations in such a high-dimensional and complex traffic state [21].
With the enrichment of data and rapid development of data processing, neural network-based methods have become one of the most researched algorithms due to its capability of dealing with non-linear and multi-dimensional data [22,23,24,25]. Ma et al. utilized the long short-term memory (LSTM) structure to perform traffic speed prediction and obtained a higher accuracy compared to statistical or other classical methods [22]. Du et al. took multi-parameters as inputs, and presented a hybrid neural network that combined convolutional neural networks (CNNs) and LSTM to predict traffic [23]. However, the algorithms mentioned above do not consider spatial relations between roads or segments; that is to say, a certain road’s traffic speed is relevant to, or will be influenced by, its upstream and downstream roads’ speed. Zeng et al. incorporated the previous (temporal) inputs and exogenous (spatial) inputs to train a recurrent neural network (RNN) [26]. Li et al. used deep belief networks (DBNs) to predict short-term traffic flow using temporal-spatial traffic data, and a multi-objective particle swarm algorithm was used to optimize some of the parameters in certain networks [27]. Gu et al. captured the lane-level spatio-temporal characteristics traffic speed using the fusion deep learning (FDL) model [28]. Ma et al. converted the network traffic to images, and constructed a time–space matrix using time and space dimension data, which were collected from GPS devices, and a CNN-based network was finally introduced for prediction [22]. Yu et al. captured spatial-temporal features through graph convolution [29].
Furthermore, as traffic speed prediction can also be regarded as a sequence prediction task, research shows that the longer the length of sequences is, the lower the accuracy will be [30]. Consequently, an attention mechanism is processed to determine which part of the sequence is more important for improving prediction precision. As an attention mechanism has been demonstrated to have a better performance in many fields [31,32,33], a hybrid attention-based model with CNN to mine spatial features and a gated recurrent neural network (GRU) to mine temporal features was proposed [34]. GRU is a variant of RNN, which can model the long-term dependencies and vanishing error problem. The attention mechanism is aimed to measure the importance of the past inputs correlated to the future states. However, the space dimension still contains some temporal information, and the CNN model somewhat neglects the inner temporal relations. Liao et al. [35] applied an attention mechanism to predict traffic speed with map query data; however, it can only predict speeds around the busy roads, and was limited to the query data. Since there are various applications to queries, the integration may be a challenge.
To deal with the problems above, we introduce a novel traffic speed prediction approach based on temporal clustering and hierarchical attention (TCHA). Firstly, according to the time series information and the topological structure between the target road and the surrounding road, the historical data are divided into two parts: spatial data and temporal data. Secondly, to distinguish the traffic environment, temporal clustering analysis is applied to the target road [36], which separates the historical data into several clusters. Traffic data in each cluster have similar distribution, which can help improve the prediction accuracy. Thirdly, a hierarchical attention-based mechanism is used to measure the importance of each feature at each time step, the spatial attention in the encoder measures the importance of spatial features, and the temporal attention in the decoder measures the temporal ones. In each module, bi-directional LSTM (BiLSTM) is used to capture further nonlinear information.
The principal contributions of this paper are as follows:
  • A novel deep learning framework is proposed for short-term traffic speed prediction.
  • Temporal clustering is used to improve dataset partition for enhancing performance.
  • Two attention mechanisms are introduced to capture important spatio-temporal information.
  • The effectiveness of the proposed model is validated in two real-word traffic datasets.

2. Methodology

With the overview of recent studies on short-term traffic speed prediction, a traffic speed prediction approach based on temporal clustering and hierarchical attention (TCHA) is proposed. Figure 1 shows the framework of this paper. We collected raw traffic speed data from cameras equipped on roads, capturing the passing vehicles and saving information into databases. Certain data cleaning methods were then employed to remove anomaly elements. The third step was to partition the pre-processed data into several clusters using a hierarchical temporal clustering algorithm. Traffic data in each cluster has a similar distribution, which can help improve the prediction accuracy. Following the above steps, two traffic speed vectors, which contain temporal speeds and spatial speeds respectively, were generated, and a hierarchical attention-based method was then applied to these two vectors to capture spatial and temporal features. In the encoder, spatial vectors were taken as inputs, and the relevance of each selected road was determined with the spatial attention. The hidden states computed from the encoder together with the temporal vectors were concatenated as inputs for the decoder. In the decoder, the importance of each time step was calculated with the temporal attention. Finally, a fully connected layer was used for prediction. Each part is detailed in the following subsections.

2.1. Data Partition

Traffic environments are changing every day, and some researchers [37] have proved that the traffic environment (or context) dimension is the most relevant to traffic prediction. The context includes the day of a week (weekday or weekend), emergency events (or how far it happens away from the target road), weather (rainy, sunny, etc.), and so on. Accuracy may be low if we take all of the pre-processed speed data as training or testing samples, this fact is quite evident, e.g., a model is highly likely to be unable to detect a dog if it is trained by thousands of cats and tens of dogs. However, traffic environments are complex. There is no clear boundary or auto-adjusted model to partition. In this paper, we apply an unsupervised method, temporal clustering (TC), to partition raw traffic data. Temporal clustering analysis uses hierarchical clustering to obtain several clusters, in which all of the traffic speed data have similar traffic variation patterns. Algorithm 1 illustrates the details of this part.
All of the historical traffic speed data are divided by days before clustering, as the input dataset sequence is D = ( d 1 , d 2 , …, d p ) with d i q , where q represents the number of data in one day, and p is the number of samples, i.e., the number of initial cluster. Threshold θ and sim_max is first initialized. sim_max is a constant that represents the maximum value of an integer. In each loop, the similarity within clusters is calculated, and two clusters whose similarity obtains the maximum are aggregated. The whole procedure will be stopped when there is only one cluster, or the maximum similarity is less than the threshold. In this paper, the Pearson correlation coefficient [38] is employed as a similarity function. The data of each cluster can be used to train a prediction model. Before the prediction, the similarity between the current day’s data and each cluster is calculated, the closest cluster and its model are selected to predict the short-term traffic speed.
Algorithm 1: Temporal clustering analysis.
Sensors 19 03836 i001

2.2. The Attention Model

The attention model is aimed to determine how strong the target road’s speed is relative to several time steps and the surrounding roads. As we know, the historical traffic speed data at a closer time step and the surrounding road will have a greater impact on future speed data [39,40], but the influence factor may differ in different cases.
There are two attention mechanisms in the model, i.e., the spatial attention and the temporal attention (see Figure 2). The spatial attention is used in the encoder to capture the spatial features and determine the importance of each space point with a BiLSTM network, and the temporal attention is applied in the decoder to capture temporal relations and decide the importance of each time step with another BiLSTM network.

2.2.1. The Encoder Module

The encoder is essentially a BiLSTM network [41], aiming to determine the importance of each space point. Given the input spatial sequences at time step t, S = ( S t l + 1 , S t l + 2 , , S t ) T l × n , where n is the number of selected surrounding roads, and l is the time lags. The spatial matrix can also be written as S = ( S 1 , S 2 , , S n ) , where S i l represents the speed matrix of road i at all time steps.
The spatial attention mechanism can be constructed by a soft attention mechanism:
e t i = Z e T tanh ( W e [ h e , t 1 ; c t 1 ; S i ] + b e ) + b z e i ,
α t i = exp ( e t i ) i = 1 n exp ( e t i ) ,
where [ h e , t 1 ; c t 1 ; S i ] 2 m + l is a concatenation of the previous encoder hidden state, memory cell, and current spatial data, m is the encoder hidden size, Z e l and W e l × ( 2 m + l ) are the weights of linear functions, b e l and b z e n are the bias terms, which are all the parameters to learn, c t and h e , t m are memory cells and the linear transformation of hidden states in the encoder procedure, which are initialized as zero tensors and will be illustrated in detail, and tanh(·) is the hyperbolic tangent function. A SoftMax function is applied to compute the spatial attention weights α t n , which represent the scores of each selected road, with the higher score representing the stronger relation.
With the attention weights, the input spatial matrices can be transferred to
S ˜ t = ( α t 1 S t 1 , α t 2 S t 2 , , α t n S t n ) T ,
where S ˜ t contains spatial information.
To extract further features and learn parameters, an activation function should be applied. In this paper, we use BiLSTM, which is specialized for sequence learning. BiLSTM contains the forward LSTM (denoted as LSTM ), which processes spatial data from S ˜ t l + 1 to S ˜ t , and the backward LSTM (LSTM), which processes spatial data from S ˜ t to S ˜ t l + 1 .
The outputs of BiLSTM can be expressed as follows:
h t = LSTM ( w t 1 , h t 1 ) ,
h t = LSTM ( w t 2 , h t 1 ) ,
h t = [ h t ; h t ] ,
h e , t = W e , t h t + b e , t ,
where h t m represents the forward hidden state, and h t m represents the backward hidden state, both of which capture the deeper information of all inputs at time t. h t 2 m is the concatenation of h t and h t , which represents the encoder hidden state and will be decoded in temporal attention. h e , t m is the linear transformation of h t , which will be used for spatial attention calculation, W e , t m × 2 m and b e , t m are weight terms and bias terms.
With the proposed spatial attention, the encoder will focus more on several roads that obtain higher weights.

2.2.2. The Decoder Module

Another BiLSTM network is used in the decoder to determine how strong each time step will influence the predicted traffic speed.
With the computed hidden states ( h t l + 1 , h t l + 2 , , h t ) in the encoder layer, we calculate the temporal attention weights as follows:
d t i = Z d T tanh ( W d [ h d , t 1 ; c t 1 ; h i ] + b w d ) + b z d i ,
β t i = exp ( d t i ) i = 1 l exp ( d t i ) ,
where [ h d , t 1 ; c t 1 ; h i ] 2 m + 2 k is a concatenation of the previous decoder hidden state, memory cell, and encoder hidden state, k is the decoder hidden size, W d m × ( 2 m + 2 k ) , Z d m , b z d l , and b w d m are the weights and the bias terms in the decoder, which are all the parameters to learn. The temporal attention weights represent how much each encoder hidden state will influence the prediction results. Since each encoder hidden state has contained the spatial factors, a context vector that represents the sum of all encoder hidden states can be computed in the attention mechanism:
c t = i = 1 l β t i h t i + 1 .
Combined with context vectors, the input temporal sequence at time t ( y t l + 1 , y t l + 2 , , y t ) can be transferred to
y ˜ t = W c T [ c t y t ] + b c ,
where [ c t y t ] 2 m + 1 is the concatenation of the target road’s speed at time t and context vector; W c 2 m + 1 and b c are parameters to learn, which help map the concatenation to new inputs in the decoder. Similarly, we apply BiLSTM to extract further features in the time dimension. The outputs can be expressed as follows:
h t = LSTM ( w t 1 , h t 1 ) ,
h t = LSTM ( w t 2 , h t - 1 ) ,
h t = [ h t ; h t ] ,
h d , t = W d , t h t + b d , t ,
where h t k represents the forward hidden state, and h t k represents the backward hidden state, both of which capture the deeper information of entire inputs at time t. h t 2 k is the concatenation of h t and h t , h d , t k is the linear transformation of h t , which will be used for temporal attention calculation, W d , t k × 2 k and b e , t k are weight terms and bias terms.
Finally, the prediction result can be iteratively computed through the fully connected layer:
y p r e d t + 1 = W y T [ c t h t ] + b y ,
where [ c t h t ] 2 m + 2 k is the concatenation of the context vector and the decoder hidden state, W y 2 m + 2 k , b y are parameters to learn, and y p r e d t + 1 represents the predicted result at time step t + 1.

2.3. Model Optimization

As mentioned above, there are parameters to learn with training samples. The Adam [42] optimizer is used to train the model, and the mean square error in Equation (17) is employed as a loss function to measure the difference between the ground truth values and the predicted results:
l o s s = 1 N i = 1 N ( y p r e d i y t r u e i ) 2 ,
where y p r e d i is the predicted result, y t r u e i is the ground truth value, and N denotes the number of training samples.

3. Results

In this section, the traffic speed data collected from Xiaoshan District, Hangzhou, China, are used to demonstrate the effectiveness of the proposed TCHA method, through comparing to several state-of-the-art prediction approaches with deep architectures.

3.1. Experimental Setup

As is shown in Figure 3, to evaluate the performance of the proposed TCHA method, part of the Xiaoshan District was chosen to performance experiments (in black), Shixin Road (in red) and Tonghui Road (in green) were selected as target roads, and the remaining segments were used to determine the spatial features. There were 38 detectors along the whole roads, and the traffic speed data were collected and calculated every 5 min. Consequently, one detector preserved 288 data per day. As mentioned before, we partitioned the raw traffic speed data into two vectors; however, due to the malfunction of detectors and the failure of data transmission, there were some incorrect data, which includes the following:
  • Missing data. There are some zero elements in the raw data, which are marked as missing data.
  • Outliers. Considering that the speed limits in Hangzhou are usually lower than 80 km/h, we set the maximum traffic speed as 100 km/h, which means that, if a certain record of speed is higher than the threshold, it is marked as an outlier.
  • Noisy data. Since it is a real-world traffic speed dataset, dramatic changes should be avoided. Consequently, traffic speeds differing more than 20 km/h between two adjacent time points are considered as noisy data.
The traffic speed data marked as any type of anomaly data are replaced by the average speed of the previous 10 min. In general, the proportion of anomaly records is less than 10%.
Figure 4 is a plot of several typical traffic speeds over time, which demonstrates obvious period patterns. Different distributions of traffic speed data in different clusters after employing TC can be seen in Figure 5. It is clear that the traffic speed data in the same cluster have similar distributions, while the distribution may differ more when the data come from two clusters.
The TCHA method is evaluated on different prediction horizons, and the time lag l is set as 12. Prediction horizons are set up to 5, which means that 60 min of historical traffic speed data are used to predict speed of the following 25 min. For example, suppose the current time is 7:00 a.m.: The proposed method will predict the speed of 7:05 a.m., 7:10 a.m., 7:15 a.m., 7:20 a.m., and 7:25 a.m.
The proposed TCHA method is compared to several state-of-the-art prediction approaches, which includes the following:
  • support vector regression (SVR) [43], which uses linear support vector machine for regression tasks, especially time-series prediction;
  • stacked autoencoder (SAE) [21], which encodes the inputs into dense or sparse representations by using multi-layer autoencoders;
  • long short-term memory (LSTM) [44], which is an extension of recurrent neural networks (RNNs) and has an input gate, a forget gate, and an output gate so as to deal with the long-term dependency and gradient vanishing/explosion problems;
  • the gated recurrent unit (GRU) [44], which has an architecture similar to LSTM but only has two gates, a reset gate, and an update gate, which makes GRU have fewer tensor operations than LSTM;
  • the hierarchical attention model (HA), which uses spatial and temporal attention mechanisms to capture spatial and temporal features respectively, but TC is not employed to the input data, and it is different from the proposed TCHA.
To guarantee the fairness of experiments, all of the approaches are trained by the Adam optimizer, which updates the parameters with a gradient descent algorithm, and the batch size is set as 128. The threshold θ of TC is another hyper-parameter, which is set as 0.6 [36]. All of the neural networks are built in the pyTorch framework. For support vector regression, radial basis function (RBF) is applied as a kernel function for its better performance in a non-linear situation.

3.2. Evaluation Criteria

The mean absolute error (MAE), mean relative error (MRE), and the root-mean-squared error (MRSE) are employed as the evaluation criteria to evaluate the prediction accuracy, which are defined as follows:
MAE = 1 n i = 1 n | y p r e d i y t r u e i | ,
RMSE = 1 n i = 1 n ( | y p r e d i y t r u e i | ) 2 ,
MRE = 1 n i = 1 n | y p r e d i y t r u e i y t r u e i | ,
where n denotes the number of prediction samples, y p r e d i is the prediction value, and y t r u e i is the true value. MSE and MAE can measure the absolute differences between the predicted and true values, and MRE can measure the relative ones.

3.3. Experiments Result and Analysis

Table 1 and Table 2 show the errors of different prediction horizons using different methods for both target roads. The outperformance of the proposed TCHA method can be seen at all time points.
On Shixin Road, compared to the hierarchical attention model without TC, the TCHA has average improvements of 0.1029, 0.2369, and 0.0063 on MAE, RMSE, and MRE, and outperforms the relative accurate method. The GRU showed improvements of 0.5360, 0.496 and 0.0919 on MAE, RMSE, and MRE. On Tonghui Road, the proposed TCHA model outperforms the HA with improvements of 0.2353, 0.2370, and 0.0082 on MAE, RMSE and MRE.
With the increase in prediction horizons, the errors become larger, whereas the TCHA still reaches the best performance, which implies that long-term prediction is more difficult and challenging, and confirms that extracting temporal and spatial features in encoder and decoder mechanisms is reasonable.
Figure 6 shows the curves of the predicted results corresponding to the ground truth on both roads. Different colors represent different algorithms, during the entire day. The proposed TCHA algorithm fits the true speed data whether it is peak hour or not. In Figure 6b, the difference between the ground truth and the results of the proposed method is relatively large around 15 h, which may be due to the large variation when traffic speed meets peak hour. Peak hour and emergencies are challenges when making short-term predictions. The large influence can be seen more clearly when using GRU to make prediction. GRU also fits the general trend of traffic speed in one day, but when traffic speed meets large variation, the prediction performance gets lower, which further emphasizes the importance of spatial and temporal mechanisms, and demonstrates that our proposed model is good approximate to the ground truth.
Figure 7 shows the attention scores learned by the hierarchical attention mechanism described in Section 2.2. The darker color indicates a higher importance when making predictions, while the lighter part indicates a lower importance. Rows represent the parts of all the prediction points, and the columns in the two subfigures represent the time lag and space point importance, respectively. In the temporal dimension, closer time lags contribute more to prediction, which matches our intuition that average traffic speed is always continuous and will not have dramatic changes compared to the speed at adjacent times. When time lag is 1, the temporal score is always highest, which may reach 0.87 in some cases. Generally, traffic speed at the farthest time lag (more than 50 min) has little or almost no contribution to future prediction. While in the spatial dimension, it is harder to find the obvious and significant regularity, the difference between the largest attention score and the lowest score is only 0.17. However, the proposed TCHA model still achieves higher weights with respect to the upstream and downstream roads than with respect to the indirect surrounding roads.

4. Conclusions

In this paper, we propose a traffic speed prediction approach based on temporal clustering and hierarchical attention (TCHA) for traffic speed prediction. We first divided the historical traffic speed data into several clusters based on the similarity function of the Pearson correlation coefficient. A spatial attention mechanism was then designed in the encoder, which can adaptively select the relatively important segments for prediction, and a temporal attention mechanism was used in the decoder to determine the importance of each time step. The BiLSTM network was used in both mechanisms, for its better ability to capture further features in sequence learning. To validate the effectiveness of the proposed model, five approaches (i.e., SVR, SAE, LSTM, GRU, and the original hierarchical attention model) are compared to the TCHA based on the same dataset. The experiment results confirm that our proposed method can learn more temporal and spatial information to increase prediction accuracy. Several findings can be summarized:
  • With the increasement of prediction horizons, the prediction errors become larger.
  • Making traffic speed prediction during peak hour is challenging.
  • Although GRU can be regarded as a simplification of LSTM, it can reach a higher accuracy in most cases.
In the future, the model can be improved by considering some environmental factors, social events, and especially traffic signal control data. Due to the faults of devices and transmission, missing data and anomaly data will decrease the accuracy of the trained model and predicted results. It is necessary to generate data from various sources, i.e., camera detectors, GPSs, taxies, etc., and to apply data fusion methods to improve the confidence of the raw traffic speed data.

Author Contributions

Conceptualization: D.L., L.T., and G.S.; methodology: L.T.; validation: L.T. and X.H.; formal analysis: L.T.; investigation: L.T.; writing—original draft preparation: L.T.; writing—review and editing: D.L., G.S., and X.H.; project administration: D.L. and G.S.; funding acquisition: D.L. and G.S.

Funding

This work was supported by the Zhejiang Public Welfare Technology Research Program under Grant LGG19F030012, the Scientific Research Project of Education Department of Zhejiang under Grant No. Y201840830, the National Natural Science Foundation of China under Grant No. 61603339, and in part by the Zhejiang Xinmiao Talents Program under Grand No. 2019R403073.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Vlahogianni, E.I.; Karlaftis, M.G.; Golias, J.C. Short-term traffic forecasting: Where we are and where we’re going. Transp. Res. Part C Emerg. Technol. 2014, 43, 3–19. [Google Scholar] [CrossRef]
  2. Liu, D.; Wang, M.; Shen, G. A New Combinatorial Characteristic Parameter for Clustering-Based Traffic Network Partitioning. IEEE Access 2019, 7, 40175–40182. [Google Scholar] [CrossRef]
  3. Chrobok, R. Theory and Application of Advanced Traffic Forecast Methods; University of Duisburg Physics: Duisburg, Germany, 2005. [Google Scholar]
  4. Fei, X.; Lu, C.C.; Liu, K. A bayesian dynamic linear model approach for real-time short-term freeway travel time prediction. Transp. Res. Part C Emerg. Technol. 2011, 19, 1306–1318. [Google Scholar] [CrossRef]
  5. Oh, S.; Byon, Y.J.; Jang, K.; Yeo, H. Short-term travel-time prediction on highway: A review on model-based approach. KSCE J. Civ. Eng. 2018, 22, 298–310. [Google Scholar] [CrossRef]
  6. Williams, B.M.; Hoel, L.A. Modeling and Forecasting Vehicular Traffic Flow as a Seasonal ARIMA Process: Theoretical Basis and Empirical Results. J. Transp. Eng. 2003, 129, 664–672. [Google Scholar] [CrossRef]
  7. Tran, Q.T.; Ma, Z.; Li, H.; Hao, L.; Trinh, Q.K. A Multiplicative Seasonal ARIMA/GARCH Model in EVN Traffic Prediction. Int. J. Commun. Netw. Syst. Sci. 2015, 8, 43–49. [Google Scholar] [CrossRef] [Green Version]
  8. Chandra, S.R.; Al-Deek, H. Predictions of freeway traffic speeds and volumes using vector autoregressive models. J. Intell. Transp. Syst. 2009, 13, 53–72. [Google Scholar] [CrossRef]
  9. Karlaftis, M.G.; Vlahogianni, E.I. Statistical methods versus neural networks in transportation research: Differences, similarities and some insights. Transp. Res. Part C Emerg. Technol. 2011, 19, 387–399. [Google Scholar] [CrossRef]
  10. Chen, H.; Rakha, H.A.; Sadek, S. Real-time freeway traffic state prediction: A particle filter approach. In Proceedings of the 14th International IEEE Conference on Intelligent Transportation Systems (ITSC), Washington, DC, USA, 5–7 October 2011; pp. 626–631. [Google Scholar]
  11. Nair, A.S.; Liu, J.-C.; Rilett, L.; Gupta, S. Non-linear analysis of traffic flow. In Proceedings of the IEEE Intelligent Transportation Systems, Oakland, CA, USA, 25–29 August 2001; Volume 68, pp. 681–685. [Google Scholar]
  12. Van Hinsbergen, C.P.I.J.; Schreiter, T.; Zuurbier, F.S.; Van Lint, J.W.C.; Van Zuylen, H.J. Localized extended kalman filter for scalable real-time traffic state estimation. IEEE Trans. Intell. Transp. Syst. 2012, 13, 385–394. [Google Scholar] [CrossRef]
  13. Qi, Y.; Ishak, S. A Hidden Markov Model for short term prediction of traffic conditions on freeways. Transp. Res. Part C Emerg. Technol. 2014, 43, 95–111. [Google Scholar] [CrossRef]
  14. Wang, J.; Deng, W.; Guo, Y. New Bayesian combination method for short-term traffic flow forecasting. Transp. Res. Part C Emerg. Technol. 2014, 43, 79–94. [Google Scholar] [CrossRef]
  15. Davis, B.G.A.; Nihan, N.L. Nonparametric regression and short-term freeway traffic forecasting. J. Transp. Eng. 1991, 117, 178–188. [Google Scholar] [CrossRef]
  16. Oh, S.; Byon, Y.J.; Yeo, H. Improvement of Search Strategy with K-Nearest Neighbors Approach for Traffic State Prediction. IEEE Trans. Intell. Transp. Syst. 2016, 17, 1146–1156. [Google Scholar] [CrossRef]
  17. Smola, A.J.; Olkopf, B.S.C.H. A tutorial on support vector regression. Stat. Comput 2004, 14, 199–222. [Google Scholar] [CrossRef] [Green Version]
  18. Zhang, Y.; Liu, Y. Traffic forecasting using least squares support vector machines. Transportmetrica 2009, 5, 193–213. [Google Scholar] [CrossRef]
  19. Asif, M.T.; Dauwels, J.; Goh, C.Y.; Oran, A.; Fathi, E.; Xu, M.; Dhanya, M.M.; Mitrovic, N.; Jaillet, P. Spatiotemporal patterns in large-scale traffic speed prediction. IEEE Trans. Intell. Transp. Syst. 2014, 15, 794–804. [Google Scholar] [CrossRef]
  20. Luo, X.; Li, D.; Zhang, S. Traffic Flow Prediction during the Holidays Based on DFT and SVR. J. Sens. 2019, 2019, 1–10. [Google Scholar] [CrossRef] [Green Version]
  21. Lv, Y.; Duan, Y.; Kang, W.; Li, Z.; Wang, F.Y. Traffic Flow Prediction With Big Data: A Deep Learning Approach. IEEE Trans. Intell. Transp. Syst. 2014, 16, 865–873. [Google Scholar] [CrossRef]
  22. Ma, X.; Tao, Z.; Wang, Y.; Yu, H.; Wang, Y. Long short-term memory neural network for traffic speed prediction using remote microwave sensor data. Transp. Res. Part C Emerg. Technol. 2015, 54, 187–197. [Google Scholar] [CrossRef]
  23. Du, S.; Li, T.; Gong, X.; Yu, Z.; Horng, S.-J. A Hybrid Method for Traffic Flow Forecasting Using Multimodal Deep Learning. arXiv 2018, arXiv:1803.02099. [Google Scholar]
  24. Zhang, S.; Yao, Y.; Hu, J.; Zhao, Y.; Li, S.; Hu, J. Deep autoencoder neural networks for short-term traffic congestion prediction of transportation networks. Sensors 2019, 19, 2229. [Google Scholar] [CrossRef]
  25. Ran, X.; Shan, Z.; Fang, Y.; Lin, C. A Convolution Component-Based Method with Attention Mechanism for Travel-Time Prediction. Sensors (Basel) 2019, 19, 2063. [Google Scholar] [CrossRef]
  26. Zeng, X.; Zhang, Y. Development of recurrent neural network considering temporal-spatial input dynamics for freeway travel time modeling. Comput. Civ. Infrastruct. Eng. 2013, 28, 359–371. [Google Scholar] [CrossRef]
  27. Li, L.; Qin, L.; Qu, X.; Zhang, J.; Wang, Y.; Ran, B. Knowledge-Based Systems Day-ahead traffic flow forecasting based on a deep belief network optimized by the multi-objective particle swarm algorithm. Knowl.-Based Syst. 2019, 172, 1–14. [Google Scholar] [CrossRef]
  28. Gu, Y.; Lu, W.; Qin, L.; Li, M.; Shao, Z. Short-term prediction of lane-level traffic speeds: A fusion deep learning model. Transp. Res. Part C 2019, 106, 1–16. [Google Scholar] [CrossRef]
  29. Yu, H.; Wu, Z.; Wang, S.; Wang, Y.; Ma, X. Spatiotemporal recurrent convolutional networks for traffic prediction in transportation networks. Sensors (Switzerland) 2017, 17, 1501. [Google Scholar] [CrossRef]
  30. Bhaduri, S. Learning phrase representations using RNN encoder-decoder for statistical machine translation. J. Clin. Microbiol. 1990, 28, 828–829. [Google Scholar]
  31. Zanella, S.; Neviani, A.; Zanoni, E.; Miliozzi, P.; Charbon, E.; Guardiani, C.; Carloni, L.; Sangiovanni-Vincentelli, A. Recurrent models of visual attention. In Proceedings of the Neural Information Processing Systems 2014, Montreal, QC, Canada, 8–13 December 2014. [Google Scholar]
  32. Luong, M.-T.; Pham, H.; Manning, C.D. Effective Approaches to Attention-based Neural Machine Translation. arXiv 2015, arXiv:1508.04025. [Google Scholar] [Green Version]
  33. Qin, Y.; Song, D.; Cheng, H.; Cheng, W.; Jiang, G.; Cottrell, G.W. A dual-stage attention-based recurrent neural network for time series prediction. arXiv 2017, arXiv:1704.02971. [Google Scholar]
  34. Wu, Y.; Tan, H.; Qin, L.; Ran, B.; Jiang, Z. A hybrid deep learning based traffic flow prediction method and its understanding. Transp. Res. Part C Emerg. Technol. 2018, 90, 166–180. [Google Scholar] [CrossRef]
  35. Liao, B.; Tang, S.; Yang, S.; Zhu, W.; Wu, F. Multi-Modal Sequence to Sequence Learning with Content Attention for Hotspot Traffic Speed Prediction; Springer International Publishing: Berlin, Germany, 2012; Volume 7674, ISBN 978-3-642-34777-1. [Google Scholar]
  36. Shen, G.; Chen, C.; Pan, Q.; Shen, S.; Liu, Z. Research on Traffic Speed Prediction by Temporal Clustering Analysis and Convolutional Neural Network with Deformable Kernels. IEEE Access 2018, 6, 51756–51765. [Google Scholar] [CrossRef]
  37. Xu, J.; Deng, D.; Demiryurek, U.; Shahabi, C.; Van Der Schaar, M. Mining the Situation: Spatiotemporal Traffic. J. Sel. Top. Signal Process. 2015, 9, 702–715. [Google Scholar] [CrossRef]
  38. Lin, L.I. A Concordance Correlation Coefficient to Evaluate Reproducibility. Biomatrics 1989, 45, 255–268. [Google Scholar] [CrossRef]
  39. Min, W.; Wynter, L. Real-time road traffic prediction with spatio-temporal correlations. Transp. Res. Part C Emerg. Technol. 2011, 19, 606–616. [Google Scholar] [CrossRef]
  40. Habtemichael, F.G.; Cetin, M. Short-term traffic flow rate forecasting based on identifying similar traffic patterns. Transp. Res. Part C Emerg. Technol. 2016, 66, 61–78. [Google Scholar] [CrossRef]
  41. Schuster, M.; Paliwal, K.K. Bidirectional Recurrent Neural Networks. IEEE Trans. Signal Process. 1997, 45, 6757. [Google Scholar] [CrossRef]
  42. Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar]
  43. Wang, J.; Shi, Q. Short-term traffic speed forecasting hybrid model based on Chaos-Wavelet Analysis-Support Vector Machine theory. Transp. Res. Part C Emerg. Technol. 2013, 27, 219–232. [Google Scholar] [CrossRef]
  44. Fu, R.; Zhang, Z.; Li, L. Using LSTM and GRU neural network methods for traffic flow prediction. In Proceedings of the 31st Youth Academic Annual Conference of Chinese Association of Automation (YAC), Wuhan, China, 11–13 November 2016; pp. 324–328. [Google Scholar]
Figure 1. Framework of the proposed method.
Figure 1. Framework of the proposed method.
Sensors 19 03836 g001
Figure 2. Graphic illustration of temporal clustering and hierarchical attention (TCHA).
Figure 2. Graphic illustration of temporal clustering and hierarchical attention (TCHA).
Sensors 19 03836 g002
Figure 3. Traffic speed locations.
Figure 3. Traffic speed locations.
Sensors 19 03836 g003
Figure 4. Traffic speed patterns.
Figure 4. Traffic speed patterns.
Sensors 19 03836 g004
Figure 5. Distribution of traffic speed data in different clusters.
Figure 5. Distribution of traffic speed data in different clusters.
Sensors 19 03836 g005
Figure 6. Traffic speed prediction performance. (a) Shixin Road and (b) Tonghui Road.
Figure 6. Traffic speed prediction performance. (a) Shixin Road and (b) Tonghui Road.
Sensors 19 03836 g006
Figure 7. Attention visualization of average score on different prediction points at (a) different time lags and (b) different space points.
Figure 7. Attention visualization of average score on different prediction points at (a) different time lags and (b) different space points.
Sensors 19 03836 g007
Table 1. Performance of difference prediction horizons (Shixin Road).
Table 1. Performance of difference prediction horizons (Shixin Road).
AlgorithmError IndexHorizon 1Horizon 2Horizon 3Horizon 4Horizon 5
SVRMAE3.14103.28293.42123.57463.7013
RMSE4.44254.55384.65584.78104.8937
MRE0.16700.17500.18300.19250.2004
SAEMAE2.24772.88313.02393.15503.2762
RMSE3.02733.67423.86464.02224.1691
MRE0.12260.16270.16950.17610.1823
LSTMMAE2.45012.72802.89573.05123.1998
RMSE3.29713.56133.77493.96424.1405
MRE0.12830.14640.15530.16350.1715
GRUMAE2.18592.57382.74582.90193.0501
RMSE2.98503.43933.65183.83584.0064
MRE0.11660.13780.14640.15440.1621
HAMAE1.62592.08412.34892.52232.7112
RMSE2.37563.00043.29933.54203.7166
MRE0.07680.10290.11630.12590.1374
TCHAMAE1.50512.00172.16892.38922.7127
RMSE2.30402.82173.13513.42943.7481
MRE0.06810.09840.10630.11820.1366
Table 2. Performance of difference prediction horizons (Tonghui Road).
Table 2. Performance of difference prediction horizons (Tonghui Road).
AlgorithmError IndexHorizon 1Horizon 2Horizon 3Horizon 4Horizon 5
SVRMAE4.94555.03615.15115.21865.2512
RMSE6.41936.47266.56926.62836.6590
MRE0.14960.15250.15580.15770.1586
SAEMAE3.59003.68903.80204.74044.9129
RMSE4.26954.42564.59116.01306.2097
MRE0.11630.11910.12230.14280.1482
LSTMMAE3.10103.24023.67493.75644.0615
RMSE4.08614.25744.64044.74575.0561
MRE0.09350.09770.11430.11670.1280
GRUMAE2.80532.96353.29873.56283.6247
RMSE3.80974.01044.21094.49124.6136
MRE0.08260.08720.10220.11120.1221
HAMAE1.88422.70232.95823.17973.3378
RMSE2.56053.62643.93194.16144.3393
MRE0.05540.08060.08870.09600.1012
TCHAMAE1.76862.41122.71112.91153.0833
RMSE2.42713.30313.67413.92534.1050
MRE0.05180.07060.08020.08650.0916

Share and Cite

MDPI and ACS Style

Liu, D.; Tang, L.; Shen, G.; Han, X. Traffic Speed Prediction: An Attention-Based Method. Sensors 2019, 19, 3836. https://doi.org/10.3390/s19183836

AMA Style

Liu D, Tang L, Shen G, Han X. Traffic Speed Prediction: An Attention-Based Method. Sensors. 2019; 19(18):3836. https://doi.org/10.3390/s19183836

Chicago/Turabian Style

Liu, Duanyang, Longfeng Tang, Guojiang Shen, and Xiao Han. 2019. "Traffic Speed Prediction: An Attention-Based Method" Sensors 19, no. 18: 3836. https://doi.org/10.3390/s19183836

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop