Next Article in Journal
Description of the Guelder Rose Fruit in Terms of Chemical Composition, Antioxidant Capacity and Phenolic Compounds
Previous Article in Journal
A New Foot Trajectory Planning Method for Legged Robots and Its Application in Hexapod Robots
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Spatial—Temporal Traffic Flow Data Restoration and Prediction Method Based on the Tensor Decomposition

School of Computer and Information Technology, Beijing Jiaotong University, Beijing 100044, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2021, 11(19), 9220; https://doi.org/10.3390/app11199220
Submission received: 10 August 2021 / Revised: 24 September 2021 / Accepted: 29 September 2021 / Published: 3 October 2021
(This article belongs to the Section Transportation and Future Mobility)

Abstract

:
As an important part of urban big data, traffic flow data play a critical role in traffic management and emergency response. Traffic flow data contain multi-mode characteristics, which need to be deeply mined. To make full use of multi-mode characteristics, we use a 3-order tensor to represent the traffic flow data, considering “temporal-spatial-periodic” characteristics. To recover the missing data of traffic flow, we propose the Missing Data Completion Algorithm Based on Residual Value Tensor Decomposition (MDCA-RVTD), which combines linear regression, univariate spline, and CP decomposition. Then, we predict the future traffic flow data by using the proposed Traffic Flow Prediction Algorithm Based on Data Completion Strategy (TFPA-DCS). The experimental results show that recovering the missing data is helpful in improving the prediction accuracy. Additionally, the prediction accuracy of the proposed Algorithm is better than gray model and traditional tensor CP decomposition method.

1. Introduction

Urban big data involves the daily life of citizens and the stable running of industries; it is characterized by large volume, complex sources, and heterogeneous structure [1]. How to make full use of urban big data to analyze city development issues and provide informational assistance for government departments has attracted great interest in recent years [2,3]. In challenges of city management, traffic problems such as increasingly traffic congestion, frequently traffic accidents, severely environmental pollution, should be of the upmost concern [4]. The traffic flow prediction is an important part of urban traffic management and emergency response [5]. In the background of controlling and preventing epidemic diseases, traffic flow prediction can obtain travel indicators, judge crowd-gathering areas, analyze cross-regional movements.
Traffic flow data are typical spatial-temporal data, which relate to various elements of the traffic network, including humans, vehicles, roads, and environmental information [6]. In the period of big data, city managers must dig deep into the potential value contained in traffic flow data. Traffic flow data contain multi-mode characteristics [7]. Most of the existing traffic flow prediction methods are based on three kinds of characteristics: temporal characteristics, spatial characteristics, and periodic characteristics [8,9].
In recent years, the common traffic flow prediction methods fall into two categories: the model-driven methods and the data-driven methods [10]. The model-driven methods, also known as parametric methods, including Autoregressive (AR), Historical Average (HA), Autoregressive Integrated Moving Average (ARIMA), Seasonal ARIMA (SARIMA) [11,12,13,14], etc. Generally, the model-driven methods only focus on temporal characteristics and need to satisfy predetermined theoretical assumptions, so the application of these methods is limited. The data-driven methods, also known as non-parametric methods, can be further divided into machine learning-based methods and deep learning-based methods [15,16,17,18]. For example, machine learning methods, such as Support Vector Regression (SVR) and K-Nearest Neighbor (KNN), were employed for traffic flow prediction [19,20]. Convolution Neural Networks (CNNs) are a classical type of deep learning method which can automatically capture spatial structural information and take spatial characteristics into account [21,22,23]. To settle spatial-temporal forecasting problems, some researchers proposed hybrid methods to improve the prediction accuracy, such as Convolutional LSTM Networks (ConvLSTMs) [24] and Spatio-Temporal Residual Network (ST-ResNet) [25]. However, hybrid methods increase the complexity of the prediction model. Moreover, all of the above methods cannot recover missing data. In the scenario of traffic flow prediction, missing data is inevitable due to equipment failure, bad weather and transmitting interference [26]. According to the report of the Texas Transportation Institute, the missing data of transportation system account for 16–93% in some states, with an average missing data rate of 67%. Therefore, how to recover the missing data is also an urgent problem in traffic flow prediction.
To take full advantage of multi-mode characteristics, and recover missing data as much as possible, some researchers have applied tensor decomposition to traffic flow prediction [27,28]. Using tensor to present traffic flow data can preserve the integrity of multi-mode characteristics. Tensor decomposition is an important part of multidimensional linear algebra theory, which can effectively mine potential characteristics contained in data. The common tensor decomposition methods include CP (CANDECOMP/PARAFAC) decomposition and Tucker decomposition.
In this paper, we use a high-dimensional tensor to represent the traffic flow data, considering “temporal-spatial-periodic” multi-mode characteristics. Firstly, we recover the missing data of the traffic flow data. Then, based on the completed data, the future traffic flow is predicted. The main contributions of this paper include the following.
(1)
Combined with linear regression, univariate spline and CP decomposition, we propose the Missing Data Completion Algorithm Based on Residual Value Tensor Decomposition (MDCA-RVTD). The linear regression and the univariate spline are used to obtain “day-hour trend” features and “hour-minute trend” features, respectively. Then, we get the residual value tensor by eliminating the “day-hour trend” features and the “hour-minute trend” features. We apply CP decomposition for the residual value tensor, and add “day-hour trend” features and the “hour-minute trend” features after reconstruction, which can recover missing data better;
(2)
We propose the Traffic Flow Prediction Algorithm Based on Data Completion Strategy (TFPA-DCS). The united tensor is composed by the historical data that recover the missing data and the prospective data that need to be predicted. The prospective data is regarded as missing data, which can be determined by using data completion strategy;
(3)
We verify the proposed Algorithms by experiments. The experimental results show that recovering the missing data is helpful in improving the prediction accuracy. And the prediction accuracy of the proposed Algorithm is better than gray model and traditional tensor CP decomposition method.
The rest of the paper is organized as follows: Section 2 introduces the related works. Section 3 introduces the theoretical background. Section 4 proposes the Missing Data Completion Algorithm Based on Residual Value Tensor Decomposition (MDCA-RVTD). Section 5 proposes a Traffic Flow Prediction Algorithm Based on Data Completion Strategy (TFPA-DCS). Section 6 explains the experiment’s results, and Section 7 provides a conclusion.

2. Related Works

Traffic flow prediction problems always attract great interest. Several studies have adopted model-driven methods and data-driven methods. Zambrano et al. discovered that only some street segments offered a good fit for quadratic regression, while a great number of street segments did not. They applied logistic regression to most of the street segments. Experimental results showed that they significantly improved the curve fitting results [29]. Zhang et al. proposed a method to predict freeway travel times using a linear model in which the coefficients varied as smooth functions of the departure time. They demonstrated the effectiveness of the proposed method by applying the method to two real-life loop detector data sets [30]. Wu et al. proposed a novel hybrid data-driven travel time prediction method. They explored a convolutional long short-term memory network with a self-attention mechanism that can accurately predict the running time of each segment of the trips and the waiting time at each station [31]. However, these methods can hardly take full advantage of potential multi-mode characteristics contained in traffic flow data effectively.
To make full use of multi-mode characteristics, some works apply tensor decomposition to traffic flow prediction. For example, Tan et al. presented a short-term traffic flow prediction approach based on Dynamic Tensor Completion (DTC), which was designed to use the multi-mode characteristics to forecast traffic flow with a low-rank constraint [32]. Duan et al. used a high-dimensional tensor to represent traffic flow data, considering “week-day-time” multi-mode. The Grey Model (GM (1, 1)) was used to week-mode prediction, the Scrolling Grey Model (SGM (1, 1)) was used to day-mode prediction, and the wavelet neural network was used to time-mode prediction. Then, the prediction results of the three different models were weighted by the grey correlation analysis method [33]. Tong et al. applied the tensor decomposition Algorithm to the Verhulst model and established the Verhulst model of the tensor decomposition Algorithm. Then, the new method was applied to short-term traffic flow prediction [34]. Yang et al. pointed out that the main challenge of traffic flow prediction was the data sparsity problem. To tackle this problem, they proposed the representation of the traffic flow using a tensor and utilized the gradient descent strategy to design a traffic flow prediction Algorithm [35].

3. Theoretical Background

3.1. Tensor Basics

Tensors, also referred to multi-dimensional arrays, are higher-order extension of vectors and matrices. For example, a vector can be regarded as a 1-order tensor, and a matrix can be regarded as a 2-order tensor. The N-order tensor is expressed as χ R I 1 × I 2 × × I N . Here are some related concepts [32,33,34].
Definition 1.
N-order tensor χ R I 1 × I 2 × × I N can be unfolded to a matrix, which is defined as unfolding matrix ( χ , n ) = X ( n ) . The tensor element ( i 1 , i 2 , , i n ) is mapped to the element ( i n , j ) in matrix X ( n ) , where j = 1 + k = 1 , k n N [ ( i k 1 ) m = 1 , m n k 1 I m ] .
Definition 2.
Set two N-order tensors as χ R I 1 × I 2 × × I N and y R I 1 × I 2 × × I N , then,
< χ , y > = i 1 = 1 I 1 i 2 = 1 I 2 i N = 1 I N x i 1 i 2 i N y i 1 i 2 i N
is the inner product of two N-order tensors.
Definition 3.
Set N-order tensor χ R I 1 × I 2 × × I N and define the Frobenius norm as follows:
χ = < χ , χ > = i 1 = 1 I 1 i 2 = 1 I 2 i N = 1 I N x i 1 i 2 i N 2 .
Definition 4.
The multiplication of a tensor χ R I 1 × I 2 × × I N and a matrix U R J × I n can be expressed as ( χ × n U ) R I 1 × × I n 1 × J × I n + 1 × × I N , then,
( χ × n U ) i 1 i n 1 j i n + 1 i N = i n = 1 I n x i 1 i 2 i N u j i n
Definition 5.
If N-order tensors χ R I 1 × I 2 × × I N can be expressed as a form of N vector exterior product χ = x 1 x 2 x N , x k R I k ( k = 1 , 2 , , N ) , then the tensor χ is a rank-1 tensor.

3.2. Tensor CP (CANDECOMP/PARAFAC) Decomposition

There are two central tensor decomposition methods: CP decomposition and Tucker decomposition. This paper adopts CP decomposition. Therefore, CP decomposition is introduced as following.
The CP decomposition is used to decompose the N-order tensor χ R I 1 × I 2 × × I N into the sum of several rank-1 tensors:
χ [ A ( 1 ) , A ( 2 ) , . . . . , A ( N ) ] = r = 1 R λ r a r ( 1 ) a r ( 2 ) a r ( N )
R is an integer. The factor matrix of tensor χ as follow: A ( 1 ) = ( a 1 ( 1 ) , a 2 ( 1 ) , , a R ( 1 ) ) , A ( 2 ) = ( a 1 ( 2 ) , a 2 ( 2 ) , , a R ( 2 ) ) , …, A ( N ) = ( a 1 ( N ) , a 2 ( N ) , , a R ( N ) ) .
For example, the CP decomposition of a 3-order tensor χ R I × J × K as Figure 1, it is as follow:
χ r = 1 R λ r a r b r c r
where a r R I , b r R J , c r R K , r = 1, 2, …, R, λ r is the coefficient. Set
χ ^ = r = 1 R λ r a r b r c r = λ ; A , B , C
where corresponding element of tensor is x ^ i j k = r = 1 R λ r a i r b j r c k r , i = 1 , 2 , , I ; i = 1 , 2 , , J ; i = 1 , 2 , , K ; The objective function of CP decomposition is as follow.
min χ χ ^
Firstly, we must determine the number of rank-1 tensors, which is expressed as R. However, it is an NP hard problem. In general, we traverse R starting at 1 until we find a suitable solution. When the number of rank-1 tensors is determined, CP decomposition can be performed by Alternating Least Square (ALS).

4. The Missing Data Completion Algorithm Based on Residual Value Tensor Decomposition

4.1. Tensor Model for Traffic Flow Data

Considering the multi-mode characteristics of traffic flow data, we model traffic flow data as a 3-order tensor χ t , d , n R T × D × N ( t = 1 , 2 , , T 1 , T , d = 1 , 2 , , D 1 , D , n = 1 , 2 , , N 1 , N ), where T is the total number of time slices, D is the total number of days, N is the total number of links. For example, if the sample data are collected in two minutes, 720 time slices can be collected in a day, so the value of T is 720. If the data are collected for 30 days, then the value of D is 30. If the road network has 132 links, then the value of N is 132. As shown in Figure 2, the potential data distribution contained in adjacent time slices can be obtained by the dimension of “time slices”. The fluctuation in the data on different days can be observed by the dimension of “days”, which also includes periodic variation, such as weeks and months. The correlation of data of adjacent links can be obtained by the dimension of “links”.
The advantages of tensor-based traffic flow data representation are as following.
(1)
When the tensor has structure of multi-dimension, it is intuitively easy to represent the multi-mode characteristics of traffic flow data;
(2)
The tensor can effectively preserve the structural features of the original traffic flow data;
(3)
The tensor can effectively solve the problems of dimension disasters and matrix singularity.
In the collection of traffic flow data, missing data is inevitable due to equipment failure, bad weather, and transmitting interference. There are missing data and non-missing data in the original traffic flow tensor. The missing data is denoted as χ ˜ t , d , n while the non-missing data is denoted as χ t , d , n . Therefore, χ t , d , n = χ ˜ t , d , n χ t , d , n , χ ˜ t , d , n χ t , d , n = . The problem of missing data restoration is how to recover the missing data by using the non-missing data.
Set the non-negative weight tensor ω has the same size with the original traffic flow tensor, that means ω R I 1 × I 2 × I 3 , I 1 = T , I 2 = D , I 3 = N . The corresponding element of tensor ω is as follows:
ω i 1 i 2 i 3 = { 0 i f χ i 1 i 2 i 3 i s m i s s i n g 1 i f χ i 1 i 2 i 3 i s n o n - m i s s i n g
where i 1 = 1 , 2 , , T 1 , T , i 2 = 1 , 2 , , D 1 , D , i 3 = 1 , 2 , , N 1 , N . Let χ t , d , n = χ t , d , n ω , then, the missing data is set to 0, and the non-missing data remains unchanged.

4.2. Features Extraction and Residual Value Tensor Construction

The traffic flow tensor can simultaneously represent spatial features and temporal features. The spatial features in traffic flow tensor are reflected by the data of adjacent links are also closely arranged in the dimension of “links”. The temporal feature is the most important feature of traffic flow data, which needs to be fully utilized. The temporal features have different granularity, such as “day-hour trend” features and “hour-minute trend” features.
The “day-hour trend” features refer to the similar data distribution at the same hour of the day. For example, on a link of road network, there is less traffic volume between 5:00 am and 5:59 am. Moreover, there is a higher volume of traffic between 8:00 am and 8:59 am. The “day-hour trend” features can be extracted for 24 h in a day, which can be calculated as follows:
x ¯ h d , n = i = h * ( 60 / τ ) + 1 ( h + 1 ) * ( 60 / τ ) x i d , n 60 / τ
where h = 0 , 1 , 2 , , 23 , and it represents 24 h in a day. d and n , respectively, represent number of days and number of links. τ is the size of the time slice, and 60 / τ is the total number of time slices in an hour, and i is sequence number of time slices. For example, if the sample data are collected in two minutes, there are 30 time slices in an hour. The corresponding sequence number of time slices for each hour is shown in Figure 3. x ¯ h d , n is the mean value of data of time slices within each hour in every day, where the data are grouped by link-ID before computing. The size of x ¯ h d , n is same as the original traffic flow tensor, and the data at the same hour in the same day are equal.
The “hour-minute trend” features refer to that the data of every time slice have similar distribution in different days. For example, on a link of road network, although the data of time slices at 5:00 am differ from that at 5:59 am, the data of time slices at 5:00 am are very similar each day. The “hour-minute trend” features are fine-granularity features, which can be calculated as follows:
x ¯ m d , n = j = 1 D x m j , n D
where m = 1 , 2 , , T 1 , T , and it represents sequence number of time slices. d and n , respectively, represent the number of days and the number of links. D is the total number of days. x ¯ m d , n is the mean value of data at same time slices within D days, where the data are grouped by link-ID before computing. The size of x ¯ m d , n is same as the original traffic flow tensor, and the data at the same time slice in the different day are equal.
Due to inevitably missing data, it is possible that a situation emerges where missing data appears continuously for several days. In this case, the “day-hour trend” features and the “hour-minute trend” features cannot be calculated. We can predict these features that cannot be calculated by means of regression or interpolation. According to the experimental data distribution, this paper adopts linear regression to predict the “day-hour trend” features that cannot be calculated, which is as following:
x ¯ h d , n = L i n e a r   R e g r e s s i o n ( x ¯ h d , n )
where x ¯ h d , n represents the “day-hour trend” features that cannot be calculated, while x ¯ h d , n represents the “day-hour trend” features that can be calculated by Equation (9). Set x ¯ h d , n = x ¯ h d , n x ¯ h d , n when we have predicted x ¯ h d , n .
According to the experimental data distribution, this paper adopts univariate spline to predict the “hour-minute trend” features that cannot be calculated, which is as following:
x ¯ m d , n = U n i v a r i a t e   S p l i n e ( x ¯ m d , n )
where x ¯ m d , n represents the “hour-minute trend” features that cannot be calculated, while x ¯ m d , n represents the “hour-minute trend” features that can be calculated by Equation (10). Set x ¯ m d , n = x ¯ m d , n x ¯ m d , n when we have predicted x ¯ m d , n .
In this paper, we extract the “day-hour trend” features x ¯ h d , n from the original traffic flow tensor χ t , d , n . And we get an intermediate tensor χ t , d , n by eliminating the “day-hour trend” features from the original traffic flow tensor. Then, we extract the “hour-minute trend” features x ¯ m d , n from intermediate tensor. Moreover, we obtain a residual value tensor E by eliminating the “hour-minute trend” features from intermediate tensor. The temporal characteristics have been approximately determined by “day-hour trend” and “hour-minute trend” features, while the remaining residual value means fluctuation caused by random factors. The residual value tensor is decomposed by CP-ALS, and the potential structure of the residual tensor is obtained. Since the two main features have been eliminated, the difference of the data elements of the residual value tensor is small. Therefore, the missing values could be recovered more accurately by CP decomposition. Then, we add “day-hour trend” features and the “hour-minute trend” features to the residual value tensor after reconstruction E ^ . We can get the completed traffic flow tensor as follows:
x t , d , n = x t , d , n ω + ( E ^ + x ¯ h d , n + x ¯ m d , n ) ( 1 ω )
which means the non-missing data remains unchanged, and the missing data is set to E ^ + x ¯ h d , n + x ¯ m d , n .

4.3. The Process of the Algorithm

The Missing Data Completion Algorithm Based on Residual Value Tensor Decomposition is shown as Algorithm 1.
Algorithm 1 The Missing Data Completion Algorithm Based on Residual Value Tensor Decomposition
Input: the original traffic flow tensor χ t , d , n
  • calculate the date-hour trend of χ t , d , n , get x ¯ h d , n
  • get the intermediate tensor χ t , d , n = χ t , d , n x ¯ h d , n
  • calculate the hour-minute trend of χ t , d , n , get x ¯ m d , n
  • get the residual tensor E = χ t , d , n x ¯ m d , n
  • E ^ = C P _ A L S ( E )
  • calculate E ^ + x ¯ h d , n + x ¯ m d , n
  • x t , d , n = x t , d , n ω + ( E ^ + x ¯ h d , n + x ¯ m d , n ) ( 1 ω )
Return x t , d , n
The input of the Algorithm 1 is original traffic flow tensor χ t , d , n , which has the missing data. Firstly, we extract the “day-hour trend” features x ¯ h d , n from the original traffic flow tensor χ t , d , n , when predict the “day-hour trend” features that cannot be calculated by linear regression. Secondly, we get an intermediate tensor χ t , d , n by eliminating the “day-hour trend” features from the original traffic flow tensor. Thirdly, we extract the “hour-minute trend” features x ¯ m d , n from intermediate tensor, when predict the “hour-minute trend” features that cannot be calculated by univariate spline. Fourthly, we get a residual value tensor E  by eliminating the “hour-minute trend” features from intermediate tensor. Fifthly, the residual value tensor is decomposed by CP-ALS. The CP-ALS Algorithm is shown as Algorithm 2. Sixthly, we add “day-hour trend” features and the “hour-minute trend” features to the residual value tensor after reconstruction ( E ^ ). Seventhly, the non-missing data remain unchanged, and the missing data are set to E ^ + x ¯ h d , n + x ¯ m d , n .
Algorithm 2 CP-ALS Algorithm
p r o c e d u r e C P A L S ( E , R )
   Initialize A , B , C
repeat
    A χ ( 1 ) ( C B ) ( C T C B T B )
    B χ ( 2 ) ( C A ) ( C T C A T A )
    C χ ( 3 ) ( B A ) ( B T B A T A )
  normalize columns
   until maximum iterations times or iterations convergence
   return λ , A , B , C

5. Traffic Flow Prediction Algorithm Based on Data Completion Strategy

The missing data of the original traffic flow tensor can be recovered by the Algorithm 1 proposed in the previous Section. To distinguish the original traffic flow tensor from the tensor after completion, we denote completed tensor as χ t d , n . We predict the future traffic flow based on the completed tensor. When we predict the future traffic flow, the data of time slices that close to the forecast point play a greater role, while the data of time slices that far away from the forecast point are less effective. Therefore, we introduce the tensor window W ( T , s ) = { χ T s + 1 d , n , , χ T d , n } , which localizes the tensor into smaller time slices sequence with size s at time T . As shown in Figure 4, the traffic flow prediction problem can be defined. Given the data in W { D 1 } ( T , s ) of previous D 1 days and the data in W D ( T 1 , s ) of the D day, we need to predict data at time T of the D day ( χ T D , n ), where n = 1 , 2 , , N 1 , N .
This problem can be solved by using data completion strategy, which means regarding data at forecast point as the missing data. As Algorithm 3 shows, we use data completion strategy to predict the future traffic flow. Firstly, we extract the data in W { D 1 } ( T , s ) and W D ( T 1 , s ) as historical data. Secondly, we recover the missing data of the historical data. Thirdly, the united tensor is composed by the historical data that recover the missing data and the prospective data that need to be predicted. Fourthly, the united tensor is processed by Algorithm 1.
Algorithm 3 Traffic Flow Prediction Algorithm Based on Data Completion Strategy
Input: the value of D and T of χ T D , n ,the size of tensor window s
  • get the historical data in W { D 1 } ( T , s ) and W D ( T 1 , s )
  • complete the missing values of the historical data
  • construct W { D + 1 } ( T , s ) , W D ( T 1 , s ) , χ T D , n to the united tensor
  • process the united tensor by Algorithm 1
Return χ T D , n

6. Instance Analysis and Experiment Results

We conduct an experiment to validate the effect of our approach. The experiment tool is MATLAB Tensor Toolbox, and we use Python for data processing and features extraction. The dataset provided by “Intelligent Traffic Prediction Competition” of Ali Tianchi is used. The dataset includes the road network information of 132 links, and average travel time of each links from 1 March to 31 May 2016, in which the sample data are collected every 2 min. For example, Table 1 shows the travel time of links. The other information, such as road network information, could be downloaded from Ali Tianchi official website. Since the dataset is real-data, there are a lot of missing data, some of statistical outliers, and out-of-order time slices. Therefore, it can be analyzed as an instance, and the effect of missing data completion and future data prediction can be verified.
The traffic flow prediction scenario predicts the travel time of each link during the first day of the May Day holiday by using the data in March and April 2016. To compare different time periods, according to the tensor window, we select the data of time slices between 6:00 am and 9:58 am for morning peak prediction, the data of time slices between 10:00 am and 13:58 pm for noon peak prediction, the data of time slices between 14:00 pm and 17:58 pm for evening peak prediction. The prediction results will be demonstrated below.
Our task is to validate the missing data restoration accuracy and future traffic flow prediction accuracy. Since we cannot obtain real value of the missing data, the restoration accuracy cannot be directly verified. Therefore, we compare the prediction accuracy of using the completed data and non-completed data to verify the restoration accuracy.
Figure 5 shows the data distribution, and there are some obvious outliers. Since the provided information cannot determine whether the outliers are actual fluctuations or incorrect records, we cannot simply delete the outliers. For the missing data, the dataset is not marked with the missing data. In other words, the time slices of missing data do not appear in the time slices sequence. Therefore, we need preprocess the dataset and mark the missing values. As shown in Figure 6, we take the data of time slices from 6:00 am to 9:58 am as an example to explain the missing data distribution. It can be seen that there are serious missing data. Moreover, most of data are missing in some links. Therefore, it is very necessary to recover the missing data.
The effect of missing data completion is shown in Figure 7. It can be seen that the Missing Data Completion Algorithm proposed in this paper has a high completion rate. Except for some links where almost all data are missing, other missing data have been completed. For the missing data of the links where almost all data are missing, the data of the upstream and downstream links can be used for approximate completion.
In this paper, the Root Mean Square Error (RMSE) is used to evaluate the prediction accuracy, and it is as follows [36]:
R M S E = i = 1 N ( t t p i t t r i ) 2 N
where t t p represents the predicted travel time of each link, t t r represents the actual travel time of each link, and N represents the total number of links, with the value of 132. The smaller RMSE means the better the prediction accuracy.
We predict the travel time of each link during the first day of the May Day holiday by using the data from March and April 2016. The data of time slices between 6:00 am ad 9:58 am are selected for morning peak prediction, and we suppose the morning peak appears at 10:00 am, because this day is a holiday. The data of time slices between 10:00 am and 13:58 pm are selected for noon peak prediction, and we suppose the noon peak appears at 14:00 pm. The data of time slices between 14:00 pm and 17:58 pm are selected for evening peak prediction and we suppose evening peak appears at 18:00 pm. Then, we compare the prediction value with real value. The results are shown in Figure 8. As shown in Figure 8, the predicted value is consistent with the actual value, but some points fluctuate. The reason is the influence of outliers, which will affect the “day-hour trend” features and the “hour-minute trend” features to affect the predicted value. In addition, the prediction value and real value at the morning peak is closer than that of the noon peak and the evening peak. Since it is the first day of the May Day holiday, people’s travel habits are different from the usual. As Table 2 shown, we compare the prediction Algorithm proposed in this paper with gray model, CP-WOPT, and uncompleted-missing-data-based prediction. The experimental results show that completing the missing data is helpful to improve the prediction accuracy. Moreover, the prediction accuracy of the proposed Algorithm is better than gray model and traditional CP-WOPT decomposition method. The reason is that the proposed Algorithm makes full use of “temporal-spatial-periodic” multi-mode characteristics based on the completed data, and the tensor window makes the data of time slices that close to the forecast point play a greater role.

7. Conclusions

Traffic flow data contain multi-mode characteristics and provide a foundation for researching intelligent transportation systems. In this paper, we use a 3-order tensor to represent the traffic flow data to make full use of “temporal-spatial-periodic” multi-mode characteristics. To deal with the inevitable missing data in transportation systems, we propose an Algorithm called the Missing Data Completion Algorithm Based on Residual Value Tensor Decomposition (MDCA-RVTD), which combines linear regression, univariate spline, and CP decomposition. This approach can extract critical different granularity features and preserve potential multi-mode characteristics. Experimental results show that recovering the missing data is helpful in improving the prediction accuracy. To predict the future traffic flow data, we propose an Algorithm called Traffic Flow Prediction Algorithm Based on Data Completion Strategy (TFPA-DCS), which performs CP decomposition on the united tensor. Experimental results show that the prediction accuracy of the proposed Algorithm is better than gray model and traditional tensor CP decomposition method.
The advantages of the method based on tensor decomposition include preserving correlation of the original data, representing the multi-mode characteristics, and solving the problems of dimension disasters. However, the proposed Algorithms also require improvement. For our future work, we plan to integrate multiple context factors, such as weather parameters and regions partition.

Author Contributions

Conceptualization, J.Y. and H.L.; methodology, J.Y. and H.L.; validation, J.Y., H.L. and Y.B.; formal analysis, Y.B.; investigation, Y.L.; resources, H.L.; data curation, Y.L.; writing—original draft preparation, J.Y.; writing—review and editing, J.Y.; supervision, H.L.; All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by the National key R&D Program of China under Grant 2019YFB2102500.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Acknowledgments

This work was supported by the National key R&D Program of China under Grant 2019YFB2102500.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Jiang, J.; Hong, N.; Zhang, G. A multi-source heterogeneous data fusion method and its application. Electron. Des. Eng. 2016, 24, 33–36. [Google Scholar]
  2. Ran, B.; Jin, P.J.; Boyce, D.; Qiu, T.Z.; Cheng, Y. Perspectives on future transportation research: Impact of intelligent transportation system technologies on next-generation transportation modeling. J. Intell. Transp. Syst. 2012, 16, 226–242. [Google Scholar] [CrossRef]
  3. Zhang, J.; Wang, F.Y.; Wang, K.; Lin, W.H.; Xu, X.; Chen, C. Data-driven intelligent transportation systems: A survey. IEEE Trans. Intell. Transp. Syst. 2011, 12, 1624–1639. [Google Scholar] [CrossRef]
  4. Jonathan, M.; John, F.R.; Rocco, Z. An Evaluation of HTM and LSTM for Short-Term Arterial Traffic Flow Prediction. IEEE Trans. Intell. Transp. Syst. 2018, 1, 1–11. [Google Scholar]
  5. Wang, F.Y. Parallel, Control and Management for Intelligent Transportation Systems: Concepts, Architectures, and Applications. IEEE Trans. Intell. Transp. Syst. 2010, 11, 630–638. [Google Scholar] [CrossRef]
  6. Chang, H.; Lee, Y.; Yoon, B.; Baek, S. Dynamic near-term traffic flow prediction: System oriented approach based on past experiences. IET Intell. Transp. Syst. 2012, 6, 292–305. [Google Scholar] [CrossRef]
  7. 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. 2015, 16, 865–873. [Google Scholar] [CrossRef]
  8. Leary, D.O. Artificial intelligence and big data. IEEE Intell. Syst 2013, 28, 96–99. [Google Scholar] [CrossRef]
  9. Shi, L.; Gangopadhyay, A.; Janeja, V.P. STenSr: Spatio-temporal tensor streams for anomaly detection and pattern discovery. Knowl. Inf. Syst 2014, 1–21. [Google Scholar] [CrossRef]
  10. Guo, S.N.; Lin, Y.F.; Li, S.J.; Chen, Z.M.; Wan, H.Y. Deep Spatial–Temporal 3D Convolutional Neural Networks for Traffic Data Forecasting. IEEE Trans. Intell. Transp. Syst. 2019, 20, 3913–3926. [Google Scholar] [CrossRef]
  11. Hamed, M.M.; Al-Masaeid, H.R.; Said, Z.M.B. Short-term prediction of traffic volume in urban arterials. J. Transp. Eng. 1995, 121, 249–254. [Google Scholar] [CrossRef]
  12. Van Der Voort, M.; Dougherty, M.; Watson, S. Combining Kohonen maps with ARIMA time series models to forecast traffic flow. Transp. Res. C Emerg. Technol. 1996, 4, 307–318. [Google Scholar] [CrossRef] [Green Version]
  13. Ding, A.; Zhao, X.; Jiao, L. Traffic flow time series prediction based on statistics learning theory. In Proceedings of the IEEE 5th International Conference on Intelligent Transportation Systems, Singapore, 6 September 2002; pp. 727–730. [Google Scholar]
  14. 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] [Green Version]
  15. LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef] [PubMed]
  16. Zheng, C.P.; Fan, X.L.; Wen, C.L.; Chen, L.B.; Wang, C.; Li, J. DeepSTD: Mining Spatio-Temporal Disturbances of Multiple Context Factors for Citywide Traffic Flow Prediction. IEEE Trans. Intell. Transp. Syst. 2020, 21, 3744–3755. [Google Scholar] [CrossRef]
  17. Davis, G.A.; Nihan, N.L. Nonparametric regression and short-term freeway traffic forecasting. J. Transp. Eng 1991, 117, 178–188. [Google Scholar] [CrossRef]
  18. Tan, M.C.; Wong, S.C.; Xu, J.M.; Guan, Z.R.; Zhang, P. An aggregation approach to short-term traffic flow prediction. IEEE Trans. Intell. Transp. Syst. 2009, 10, 60–69. [Google Scholar]
  19. Smola, A.J.; Schölkopf, B. A tutorial on support vector regression. Statist. Comput 2004, 14, 199–222. [Google Scholar] [CrossRef] [Green Version]
  20. Zheng, Y.S.; Li, Y.Q.; Sheng, G.J.; Lv, J. Research on Short-Term Traffic Flow Forecasting Based on KNN and Discrete Event Simulation. ADMA 2019, 11888, 853–862. [Google Scholar]
  21. Guo, S.N.; Lin, Y.F.; Feng, N.; Song, C.; Wan, H.Y. Attention Based Spatial-Temporal Graph Convolutional Networks for Traffic Flow Forecasting. In Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019. [Google Scholar]
  22. Tran, D.; Bourdev, L.; Fergus, R.; Torresani, L.; Paluri, M. Learning spatiotemporal features with 3D convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 7–13 December 2015; pp. 4489–4497. [Google Scholar]
  23. Ji, S.; Xu, W.; Yang, M.; Yu, K. 3D convolutional neural networks for human action recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 221–231. [Google Scholar] [CrossRef] [Green Version]
  24. Shi, X.J.; Chen, Z.R.; Wang, H.; Yeung, D.Y.; Wong, W.K.; Woo, W.C. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. In Proceedings of theAdvances in Neural Information Processing Systems, Montreal, QC, Canada, 7–12 December 2015; pp. 802–810. [Google Scholar]
  25. Zhang, J.; Zheng, Y.; Qi, D. Deep spatiotemporal residual networks for citywide crowd flows prediction. In Proceedings of the 31st AAAI Conference Artificial Intelligence, San Francisco, CA, USA, 4–9 February 2017; pp. 1655–1661. [Google Scholar]
  26. Li, Y.; Li, Z.; Li, L. Missing traffic data: Comparison of imputation methods. IET Intell. Transp. Syst. 2014, 8, 51–57. [Google Scholar] [CrossRef]
  27. Kolda, T.G.; Bader, B.W. Tensor decompositions and applications. SIAM Rev. 2009, 51, 455–500. [Google Scholar] [CrossRef]
  28. Tan, H.C.; Feng, G.D.; Feng, J.S.; Wang, W.H.; Zhang, Y.J.; Li, F. A tensor-based method for missing traffic data completion. Transp. Res. C Emerg. Technol. 2013, 28, 15–27. [Google Scholar] [CrossRef] [Green Version]
  29. Zambrano-Martinez, J.L.; Calafate, C.T.; Soler, D.; Cano, J.C.; Manzoni, P. Modeling and characterization of traffic flows in urban environments. Sensors 2018, 18, 2020. [Google Scholar] [CrossRef] [Green Version]
  30. Zhang, X.; Rice, J.A. Short-term travel time prediction. Transp. Res. C Emerg. Technol. 2003, 11, 187–210. [Google Scholar] [CrossRef]
  31. Wu, J.Q.; Wu, Q.; Shen, J.; Cai, C. Towards Attention-Based Convolutional Long Short-Term Memory for Travel Time Prediction of Bus Journeys. Sensors 2020, 12, 3354. [Google Scholar] [CrossRef] [PubMed]
  32. Tan, H.; Wu, Y.; Shen, B.; Jin, P.J.; Ran, B. Short-Term Traffic Prediction Based on Dynamic Tensor Completion. IEEE Trans. Intell. Transp. Syst. 2016, 17, 2123–2133. [Google Scholar] [CrossRef]
  33. Duan, H.M.; Liu, Y.Z.; Wang, D.; He, L.Y.; Xiao, X.P. Prediction of a multi-mode coupling model based on traffic flow tensor data. J. Intell. Fuzzy Syst. 2019, 36, 1691–1703. [Google Scholar] [CrossRef]
  34. Tong, M.Y.; Duan, H.M.; Luo, X.L. Research on short-term traffic flow prediction based on the tensor decomposition algorithm. J. Intell. Fuzzy Syst. 2021, 40, 5731–5741. [Google Scholar] [CrossRef]
  35. Yang, F.N.; Liu, G.L.; Huang, L.P.; Chin, C.S. Tensor Decomposition for Spatial-Temporal Traffic Flow Prediction with Sparse Data. Sensors 2020, 21, 6046. [Google Scholar] [CrossRef] [PubMed]
  36. Bao, L.C. Traffic Jam Prediction and Optimal Path Planning Based on Tensor Decomposition. Master’s Thesis, Yunnan University, Kunming, China, 2018. [Google Scholar]
Figure 1. CP decomposition of a 3-order tensor.
Figure 1. CP decomposition of a 3-order tensor.
Applsci 11 09220 g001
Figure 2. Traffic flow data tensor.
Figure 2. Traffic flow data tensor.
Applsci 11 09220 g002
Figure 3. Sequence number of time slices.
Figure 3. Sequence number of time slices.
Applsci 11 09220 g003
Figure 4. Traffic flow prediction.
Figure 4. Traffic flow prediction.
Applsci 11 09220 g004
Figure 5. Data distribution.
Figure 5. Data distribution.
Applsci 11 09220 g005
Figure 6. Missing data of each link.
Figure 6. Missing data of each link.
Applsci 11 09220 g006
Figure 7. Missing data completion rate.
Figure 7. Missing data completion rate.
Applsci 11 09220 g007
Figure 8. Prediction results. (a) Morning peak prediction; (b) Noon peak prediction; (c) Evening peak prediction.
Figure 8. Prediction results. (a) Morning peak prediction; (b) Noon peak prediction; (c) Evening peak prediction.
Applsci 11 09220 g008
Table 1. Example for travel time of links.
Table 1. Example for travel time of links.
Link_IDTime_Interval_BeginDateTravel_Time
43779062898695005142016-03-01 06:18:002016-03-01Nan
43779062898695005142016-03-01 06:20:002016-03-014.8
43779062898695005142016-03-01 06:22:002016-03-016.3
43779062898695005142016-03-01 06:24:002016-03-016.6
43779062898695005142016-03-01 06:26:002016-03-016.6
43779062898695005142016-03-01 06:28:002016-03-01Nan
Table 2. Comparison of prediction accuracy.
Table 2. Comparison of prediction accuracy.
IndicatorRMSE
Model
Gray Model12.01486
Traditional CP-WOPT11.63461
Uncompleted-Missing-Data-Based13.055
Proposed Algorithm3.6672
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Yan, J.; Li, H.; Bai, Y.; Lin, Y. Spatial—Temporal Traffic Flow Data Restoration and Prediction Method Based on the Tensor Decomposition. Appl. Sci. 2021, 11, 9220. https://doi.org/10.3390/app11199220

AMA Style

Yan J, Li H, Bai Y, Lin Y. Spatial—Temporal Traffic Flow Data Restoration and Prediction Method Based on the Tensor Decomposition. Applied Sciences. 2021; 11(19):9220. https://doi.org/10.3390/app11199220

Chicago/Turabian Style

Yan, Jiahe, Honghui Li, Yanhui Bai, and Yingli Lin. 2021. "Spatial—Temporal Traffic Flow Data Restoration and Prediction Method Based on the Tensor Decomposition" Applied Sciences 11, no. 19: 9220. https://doi.org/10.3390/app11199220

APA Style

Yan, J., Li, H., Bai, Y., & Lin, Y. (2021). Spatial—Temporal Traffic Flow Data Restoration and Prediction Method Based on the Tensor Decomposition. Applied Sciences, 11(19), 9220. https://doi.org/10.3390/app11199220

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