A method for predicting urban traffic travel time based on multi-source heterogeneous data
By introducing a deep neural network model with multi-view convolution and attention mechanism in urban traffic travel time prediction, combined with urban road network and GPS trajectory information, the existing method solves the problem of information loss in urban road network information and long-term propagation. problem, achieving a more accurate and stable traffic journey time prediction effect.
Patent Information
- Application Number
- CN202111514594.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-13
AI Technical Summary
Existing urban traffic travel time prediction methods have shortcomings in considering urban road network information and information loss during long-term transmission. Especially when GPS track points are sparsely distributed or have large errors, the prediction accuracy decreases, and Insufficient integration of external information.
A deep neural network model based on multi-view convolution and attention mechanism is designed. Through the traffic information fusion component, multi-view convolution attention mechanism component and multi-task learning component, it combines urban road network information, GPS trajectory information and external Attribute information is used to build a traffic travel time prediction model that can capture spatiotemporal characteristics.
It achieves more accurate and stable traffic travel time prediction, can show higher accuracy and stability under different travel time and distance conditions, and provides better prediction results compared to existing methods.
Smart Images

Figure CN114202120B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation systems and multi-source information processing technology, and specifically to a method for predicting urban road travel time based on a deep neural network model with multi-view convolution and attention mechanism for multi-source heterogeneous data such as GPS trajectory data, urban road network data, and meteorological information. Background Art
[0002] With the rapid development of social economy, people's travel demand and the number of motor vehicles have shown a rapid growth trend, which has put forward an urgent need for the construction of a new urban intelligent transportation system (Intelligent Transportation System, ITS). Accurate and efficient urban traffic travel time prediction technology can effectively reflect real-time traffic conditions, alleviate or avoid traffic congestion, and support dynamic traffic management services. It is a key link in the intelligent transportation system and has great significance for traffic management and urban traffic intelligence. At the same time, with the popularization and application of various mobile devices and GPS sensors, massive traffic data (such as vehicle trajectory information, travel information, online ride-hailing data, etc.) are generated and collected. These massive data contain important information about urban travel, which makes it possible to build a better intelligent transportation system, alleviate traffic congestion, and improve people's daily commuting efficiency. Therefore, the research on an accurate and efficient urban road travel time prediction method that can target multi-source heterogeneous data is of great significance.
[0003] In recent years, the prediction methods for traffic travel time have also begun to shift from traditional statistical methods to machine learning. In particular, the field of deep learning has become a research hotspot in the current field of traffic travel time prediction due to its powerful learning ability for massive data. Existing traffic travel time prediction solutions can be roughly divided into two categories. The first category is path-based solutions, which use intuitive physical models to represent travel time: the total travel time for a given route is equal to the sum of the time to pass each road section and the time at each intersection. The second category is data-driven solutions, which use location-based data to build rich features and establish high-dimensional feature maps to predict travel time. The advantage of the first category of solutions is strong interpretability, but due to the accumulation of errors in multiple sections, as well as the influence of factors such as intersections and traffic lights, the prediction accuracy of this type of solution is not high. The second type of solution is the most accurate and popular solution at present, such as a series of traffic travel time prediction solutions such as the nearest neighbor-based method, ST-NN method, wide-deep learning model, Deep-TTE, etc. Some methods do not consider trajectory information, and some methods map trajectory points to areas without specifying any specific road sections, which results in errors in the precise statistics of traffic information. At the same time, previous methods mainly use LSTM-based methods in the time dimension, but LSTM-based methods have the problem of information loss during long-term transmission. A new method is also needed to deal with this problem.
[0004] Taking into account the recent superiority of the attention mechanism (Transformer) in feature association and temporal association analysis, as well as the superiority of convolutional neural networks in spatial feature extraction, combined with the data characteristics of multi-source heterogeneous traffic data, we designed a deep neural network model that uses the attention mechanism to capture the temporal association of traffic data before and after, and learns the changes in spatial characteristics of travel trajectories through convolutional networks; through the steps of dataset construction, model construction, model training, etc., we trained a city traffic travel time prediction model for multi-source heterogeneous data; through inference simulation on the verification dataset, we proved the efficiency and accuracy of the model in traffic travel time prediction.
[0005] At present, in the field of urban traffic travel time prediction based on deep learning, the DeepTTE method proposed by Zheng Yu of Microsoft Research Asia is generally considered to be an efficient and accurate authoritative baseline. The main function of the DeepTTE model is to predict vehicle commuting time by learning from historical vehicle trajectories, that is, given a path, predict the time required from the starting point to the end point.
[0006] The network structure of the DeepTTE model mainly consists of three parts: Spatio-Temporal Learning Component, Attribute Component and Multi-task Learning Component. Figure 1 shown.
[0007] The DeepTTE model is an end-to-end deep learning prediction method that learns temporal and spatial dependencies through GPS trajectory information to achieve traffic travel time prediction. Specifically, the model first uses an attribute component that integrates external factors, including weather conditions, path length, travel date, driving preferences, etc., to fuse the learned potential representation with the original GPS trajectory information to consider the comprehensive impact of external factors; then a geo-based convolutional layer is used to convert the GPS sequence into a series of feature maps; then a recurrent neural network (LSTMs) is used to capture the temporal correlation between a series of feature maps and external factors; finally, a multi-task component is proposed, which uses a multi-task loss function to simultaneously learn local and overall travel times, and through a multi-factor attention mechanism, the weights of different local paths are learned according to the implicit representation of individual paths and overall paths and external factors, so as to finally achieve the prediction of individual path travel time and overall path travel time.
[0008] Disadvantages of existing technologies: First, the DeepTTE model does not take into account urban road network information. When the GPS trajectory points are sparsely distributed or the error is large, the prediction accuracy of the model will drop significantly. Second, the DeepTTE model only uses simple encoding (embedding) and concatenation (concatenate) operations to fuse external information with GPS trajectory information, and lacks a deeper extraction of the change patterns between information. At the same time, the DeepTTE model mainly uses LSTM-based methods in the time dimension, but the LSTM-based method has the problem of information loss during long-term transmission, and it is difficult to capture long-series time characteristics. A new method is also needed to deal with this problem. Summary of the invention
[0009] To this end, the present invention first proposes a method for predicting urban traffic travel time for multi-source heterogeneous data, which is divided into three implementation steps:
[0010] Step 1: Collect traffic data and external attribute information, complete data preprocessing and annotation, and construct training sets, validation sets, and test sets suitable for deep learning tasks;
[0011] Step 2: Build a deep neural network model based on multi-view convolution and attention mechanism, and train it on the constructed dataset to obtain a deep neural network model;
[0012] Step 3: Input the travel trajectory to be predicted, use the trained deep neural network model for inference, and obtain the travel time prediction result.
[0013] The traffic travel data includes GPS track, travel time, travel date, specific driver vehicle number, route length, and actual travel time of the route.
[0014] The external attribute information includes urban road network structure and weather information.
[0015] The method for constructing the training set, the validation set and the test set is as follows: according to the common characteristics of the traffic travel trajectory, the screening conditions are set to eliminate the obvious abnormal trajectories; then, each point of the GPS trajectory is projected onto the corresponding road section through the Leuven.MapMatching map matching tool to obtain the road section trajectory sequence; then, the data is divided into a training data set, a validation data set and a test data set in a ratio of 2:1:1.
[0016] The screening conditions are: driving distance greater than 100 km or less than 0.5 km, average speed greater than 100 km / h or less than 5 km / h, driving time greater than 7200 seconds or less than 60 seconds.
[0017] The specific method for constructing the deep neural network model based on multi-view convolution and attention mechanism is: the model architecture is composed of three components: traffic information fusion component, multi-view convolution attention mechanism component and multi-task learning component.
[0018] The traffic information fusion component includes two modules: a road segment vector mapping module and a path encoding module. The road segment vector mapping module uses the skip-gram method to implement the mapping of the road segment vector. For a road segment sequence {r i}, i = 1...N, N is the number of road segments in the sequence, set a sliding window of length 3, and obtain for each road segment r in a road segment sequence i The central segment of each upstream and downstream segment point pair is denoted as r c , the upstream section is denoted as r u , the downstream section is denoted as r d , then the constructed upstream and downstream segment point pairs are (r c ,r u ) and (r c ,r d ),
[0019] Then, according to the probability P(r i ) Sampling constructs pseudo adjacent point pairs:
[0020]
[0021] Among them, freq(r i ) is the road section r i The frequency of occurrence in all road segment sequences,
[0022] Then, construct a vector mapping neural network from the road segment number to the road segment vector h = f (r) = σ (Wx + b), where b is the bias vector to be trained, W is the mapping matrix to be trained, and σ is the sigmoid activation function. c , upstream section u and downstream section r d The neural network parameters are W c ,b c , W u ,b u and W d ,b d , and the obtained road segment vectors are h c 、h u and h d , define the upstream relationship scoring function as The downstream relationship scoring function is The training goal of the vector mapping neural network is to make the inner product of the mapping vectors of the real upstream and downstream sections as close to 1 as possible, and the inner product of the mapping vectors of the pseudo upstream and downstream sections as close to 0 as possible, that is:
[0023]
[0024] Among them, up / down (r i ) represent the road section r i The real upstream and downstream segment points, Neg(r i ) represents the road segment r i The pseudo adjacent segment points of
[0025] Through training, the neural network parameters W for the central section, upstream section and downstream section are obtained respectively. c ,b c , W u ,b u and W d ,b d , thus obtaining the road segment vector mapping neural network f c 、f u and f d ;
[0026] The path encoding module is used for each GPS track point p on the track. i , through the road network map matching during preprocessing, the corresponding road section number p has been obtained i .r i , then the road segment vector corresponding to the GPS track point can be obtained through the road segment vector mapping module, that is:
[0027] p i .ev c =f c (p i .r i )
[0028] p i .ev u =f u (p i .r i )
[0029] p i .ev d =f d (p i .r i )
[0030] Then, the trajectory feature vector traj is calculated as follows i :
[0031]
[0032] Among them, p i represents the i-th trajectory point on the trajectory, p i .lon represents the longitude of the track point, p i .lat represents the latitude of the trajectory point, p i .ev c ,p i .ev u ,p i .ev d Represent the segment mapping vectors of the central segment, upstream segment, and downstream segment, respectively, p i .dis represents the length of the road section corresponding to the trajectory point, p i .spd represents the speed limit of the road section corresponding to the trajectory point, W loc represents the neural network parameter matrix to be trained, Represents a splicing operation,
[0033] Then, the external attribute feature vector attr is calculated as follows:
[0034]
[0035] Among them, Dis represents the total length of the track segment, WeekID em Represents the vector of the trajectory travel date after a simple embedding operation, timeID em Represents the vector of the trajectory travel time after a simple embedding operation, driverID em represents the vector of the taxi driver number after a simple embedding operation, Weather em Represents the vector after a simple embedding operation of weather information, W attr represents the neural network parameter matrix to be trained,
[0036] Then, a one-dimensional convolution kernel of size 3 is used to compare the trajectory feature vector traj of each trajectory point on the trajectory i Perform convolution operation on the vector concatenated with the external attribute feature vector attr to obtain the fused feature matrix As shown below:
[0037]
[0038] in, Represents the fusion feature matrix loc f The i-th row of Represents a one-dimensional convolution operation with an activation function of ELU and a kernel size of 3. The convolution kernel parameters are the parameters to be trained.
[0039] Finally, the traffic information fusion component is based on the input trajectory information {p i}, calculate the fusion feature matrix loc f as output.
[0040] The multi-view convolutional attention mechanism component consists of a series of multi-view convolutional attention modules. Each MCT module contains a spatial attention feature extraction model and a temporal attention feature extraction model, and finally outputs a multi-view spatiotemporal matrix as the input of the multi-task learning component.
[0041] Specifically, the input of the i-th MCT module is X i-1 , the output is X i , in particular, for the first MCT module, its input X 0 That is, the fusion feature matrix loc output by the traffic information fusion component f ; For the last MCT module, record it as the kth, output X k That is, the multi-view spatiotemporal matrix output by the multi-view convolutional attention mechanism component.
[0042] For any i-th MCT module, the calculation process is as follows: First, the input X of the module is converted into i-1 Encode to get location information As shown below:
[0043]
[0044] Among them, position(·) represents the general position encoding method in the multi-head attention mechanism. Then, three one-dimensional convolutional neural networks with different convolution kernel sizes are used to extract spatial features in different visual domains, and then mapped to the target domain in a nonlinear way to obtain the spatial feature matrix, as shown below:
[0045]
[0046] in, represents the parameter matrix corresponding to the j-th one-dimensional convolutional neural network in the i-th MCT module to be trained, b i,j represents the bias vector corresponding to the j-th one-dimensional convolutional neural network in the i-th MCT module to be trained, * represents the convolution operation, softmax(·) represents the normalized exponential function, represents the spatial feature matrix extracted by the j-th one-dimensional convolutional neural network of the i-th MCT module,
[0047] Then, the three spatial feature matrices are combined with the i-th MCT module Perform point multiplication, sum, and then use nonlinear mapping to obtain the multi-view spatial feature matrix of the i-th MCT module As shown below:
[0048]
[0049] Among them, W MVC represents the multi-view spatial mapping network matrix to be trained, elu(·) represents the ELU activation function, and then the output of the spatial attention feature extraction model of the i-th MCT module can be obtained for:
[0050]
[0051] Among them, TransformerEncoder(·) represents the encoder model (Encoder) in the general multi-head attention model (Multi-headattention),
[0052] Then, the output of the spatial attention feature extraction model is Input into the temporal attention feature extraction model, and also use the encoder model in the multi-head attention model to replace the LSTM method to extract temporal relationship features, and obtain the output of the temporal attention feature extraction model of the i-th MCT module as follows:
[0053]
[0054] Then, the output X of the i-th MCT module is calculated as follows i as follows:
[0055]
[0056] Let i traverse all MCT modules starting from the first MCT module, and its output X k This is the output multi-view spatiotemporal matrix of the multi-view convolutional attention mechanism component.
[0057] The multi-task learning component is based on the input multi-view spatiotemporal matrix X k , through a multi-factor attention mechanism for nonlinear mapping, the prediction result of the overall travel time is finally obtained. Specifically, x i , (i=1,…,N) are the multi-view spatiotemporal matrices X input to the multi-task learning component. k For any i-th row, N is X k The total number of rows, first calculate the multi-factor attention vector x attention as follows:
[0058]
[0059] Among them, α i is the multi-factor weight factor, which is calculated as follows:
[0060] z i = <attr,x i >
[0061]
[0062] Among them, <·> represents the vector inner product operation. Finally, the overall travel time t of the trajectory is calculated through a fully connected layer. entire The calculation is performed as follows:
[0063] t entire =W entire x attention +b entire
[0064] Among them, W entire represents the fully connected layer parameter matrix to be trained, b entireRepresents the bias vector of the fully connected layer to be trained.
[0065] The training method is: select the mean absolute error percentage as the model training error, as shown below:
[0066]
[0067] Among them, gap(p1,p N ) represents a trajectory in the database from the starting point p1 to the end point p N The time interval, that is, the overall travel time of the trajectory,
[0068] The Adam gradient optimization algorithm was used for model training. The initial learning rate was set to 1e-4, the batch size was set to 64, and the learning rate was reduced to 1 / 4 of the original after every 2 stages. A total of 100 stages were trained, and finally a deep neural network model for traffic travel time prediction based on multi-view convolution and attention mechanism was obtained.
[0069] The technical effects to be achieved by the present invention are:
[0070] The present invention provides a method for predicting travel time of traffic by comprehensively considering multi-source heterogeneous data such as urban road network information, GPS trajectory information, weather information, driver information, etc. Compared with the current existing methods, it can achieve more accurate and stable travel time prediction of traffic, thus providing support for the construction of intelligent transportation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 Existing technology method architecture;
[0072] Figure 2 Urban traffic travel time prediction method architecture for multi-source heterogeneous data;
[0073] Figure 3 Road segment vector mapping module structure;
[0074] Figure 4 Comparison of prediction accuracy methods under different travel times;
[0075] Figure 5 Model prediction accuracy at different travel distances DETAILED DESCRIPTION
[0076] The following is a preferred embodiment of the present invention and combined with the accompanying drawings to further describe the technical solution of the present invention, but the present invention is not limited to this embodiment.
[0077] The present invention proposes a method for predicting urban traffic travel time for multi-source heterogeneous data. The specific implementation steps are as follows: (1) Collect massive traffic travel data and external attribute information, complete data preprocessing and annotation, and construct training sets, validation sets, and test sets suitable for deep learning tasks; (2) Design and construct a deep neural network model based on multi-view convolution and attention mechanism, and train it on the constructed data set to obtain a deep neural network model; (3) Input the travel trajectory to be predicted, use the trained deep neural network model for inference, and obtain the travel time prediction result.
[0078] Specifically, step (1) is as follows:
[0079] We first collected the following traffic data: Chengdu taxi trajectory data in August 2014, including about 15,000 taxi drivers and a total of 9.73 million GPS trajectories. In addition to GPS trajectories, the data also includes attribute information such as travel time, travel date, taxi driver number, route length, and actual travel time. In addition, we also collected the following external attribute information: Chengdu's urban road network structure in 2014, Chengdu's weather information in August 2014, etc.
[0080] Then, based on the common characteristics of traffic travel trajectories, we set the following screening conditions to eliminate obvious abnormal trajectories: driving distance greater than 100km or less than 0.5km, average speed greater than 100km / h or less than 5km / h, driving time greater than 7200 seconds or less than 60 seconds.
[0081] Then, we project each point of the GPS trajectory onto the corresponding road segment through the Leuven.MapMatching map matching tool to obtain the road segment trajectory sequence.
[0082] Then, we divide the data into training dataset, validation dataset and test dataset in a ratio of 2:1:1. The training dataset is used for model training, the validation dataset is used for parameter calibration, and the test dataset is used for performance verification.
[0083] Specifically, step (2) is as follows:
[0084] The deep neural network model based on multi-view convolution and attention mechanism designed by the present invention consists of three components: traffic information fusion component, multi-view convolution attention mechanism component (multiview CNN Transformer) and multi-task learning component (multi-task learning). Figure 2 as shown.
[0085] The specific details of each component of the model are as follows:
[0086] (A) Traffic Information Fusion Component
[0087] The traffic information fusion component consists of two modules: the RSV Embedding Model and the Path Encoder. The RSV Embedding Model is used to map the segment number into a segment number vector, thereby compressing the feature space while retaining the upstream and downstream information of the segment. The Path Encoder captures the spatial structural features of the trajectory and processes other external factors (such as taxi driver number, weather information, etc.) and basic information of a given path (such as start time, total distance, etc.) to generate a fused feature matrix as the output of the traffic information fusion component and the input of the multi-view convolutional attention mechanism component.
[0088] (a) Road segment vector mapping module (RSV Embedding Model)
[0089] The road segment vector mapping module proposed in the present invention uses the skip-gram method to implement the mapping of road segment vectors. i}, i = 1...N (N is the number of road segments in the sequence), set a sliding window of length 3, and obtain the value of r for each road segment in a road segment sequence. i The upstream and downstream segment points of Figure 3 as shown.
[0090] The center segment of each upstream and downstream segment point pair is denoted as r c , the upstream section is denoted as r u , the downstream section is denoted as r d , then the constructed upstream and downstream segment point pairs are (r c ,r u ) and (r c ,r d ).
[0091] Then, according to the probability P(r i ) Sampling constructs pseudo adjacent point pairs:
[0092]
[0093] Among them, freq(r i ) is the road section r i The frequency of occurrence in all road segment sequences.
[0094] Then, construct a vector mapping neural network from the road segment number to the road segment vector h = f (r) = σ (Wx + b), where b is the bias vector to be trained, W is the mapping matrix to be trained, and σ is the sigmoid activation function. c , upstream section u and downstream section r d The neural network parameters are W c ,b c , W u ,b u and W d ,b d , and the obtained road segment vectors are h c 、h u and h d , define the upstream relationship scoring function as The downstream relationship scoring function is The training goal of the vector mapping neural network is to make the inner product of the mapping vectors of the real upstream and downstream sections as large as possible (close to 1), and the inner product of the mapping vectors of the pseudo upstream and downstream sections as small as possible (close to 0), that is:
[0095]
[0096] Among them, up / down (r i ) represent the road section r i The real upstream and downstream segment points, Neg(r i ) represents the road segment r i Pseudo adjacent segment points.
[0097] Through training, the neural network parameters W for the central section, upstream section and downstream section can be obtained respectively. c ,b c , W u ,b u and W d ,b d , thus obtaining the road segment vector mapping neural network f c 、f u and f d .
[0098] (b) Path Encoder
[0099] For each GPS track point p on the track i , through the road network map matching during preprocessing, the corresponding road section number p has been obtained i .r i , then the road segment vector corresponding to the GPS track point can be obtained through the road segment vector mapping module, that is:
[0100] p i .ev c =f c (p i .r i )
[0101] p i .ev u =f u (p i .r i )
[0102] p i .ev d =f d (p i .r i )
[0103] Then, the trajectory feature vector traj is calculated as follows i :
[0104]
[0105] Among them, p i represents the i-th trajectory point on the trajectory, p i .lon represents the longitude of the track point, p i .lat represents the latitude of the trajectory point, p i .ev c ,p i .ev u ,p i .ev d Represent the segment mapping vectors of the central segment, upstream segment, and downstream segment, respectively, p i .dis represents the length of the road section corresponding to the trajectory point, p i .spd represents the speed limit of the road section corresponding to the trajectory point, W loc represents the neural network parameter matrix to be trained, Represents a splicing operation.
[0106] Then, the external attribute feature vector attr is calculated as follows:
[0107]
[0108] Among them, Dis represents the total length of the track segment, WeekID em Represents the vector of the trajectory travel date after a simple embedding operation, timeID em Represents the vector of the trajectory travel time after a simple embedding operation, driverID emrepresents the vector of the taxi driver number after a simple embedding operation, Weather em Represents the vector after a simple embedding operation of weather information, W attr Represents the neural network parameter matrix to be trained.
[0109] Then, a one-dimensional convolution kernel of size 3 is used to compare the trajectory feature vector traj of each trajectory point on the trajectory i Perform convolution operation on the vector concatenated with the external attribute feature vector attr to obtain the fused feature matrix As shown below:
[0110]
[0111] in, Represents the fusion feature matrix loc f The i-th row of Represents a one-dimensional convolution operation with an activation function of ELU and a kernel size of 3. The convolution kernel parameters are the parameters to be trained.
[0112] In summary, through the traffic information fusion component, according to the input trajectory information {p i}, calculate the fusion feature matrix loc f as output.
[0113] (B) Multi-view convolutional attention mechanism components
[0114] The multi-view convolutional attention mechanism component consists of a series of multi-view convolutional attention modules (multiview CNNTransformer block, MCT for short). Each MCT module contains a spatial attention feature extraction model (spatial transformer) and a temporal attention feature extraction model (temporal transformer) for jointly learning spatiotemporal features in the context of dynamically changing dependencies.
[0115] The multi-view convolutional attention mechanism component improves the network structure of the spatial attention feature extraction model and uses a multi-view convolutional layer to extract multi-level spatial related information, making it more suitable for the prediction of traffic travel time. The multi-view convolutional attention mechanism component will eventually output a multi-view spatiotemporal matrix as the input of the multi-task learning component. Specifically, the input of the i-th MCT module is X i-1 , the output is X i In particular, for the first MCT module, its input X 0 That is, the fusion feature matrix loc output by the traffic information fusion component f; For the last MCT module (set as the kth), its output X k This is the multi-view spatiotemporal matrix output by the multi-view convolutional attention mechanism component.
[0116] The following takes the i-th MCT module as an example to illustrate the specific calculation steps of the MCT module. First, the position encoding method in the multi-head attention mechanism is used to convert the input X i-1 Encode to get location information As shown below:
[0117]
[0118] Among them, position(·) represents the general position encoding (position embedding) method in the multi-head attention mechanism. Then, three one-dimensional convolutional neural networks with different convolution kernel sizes are used to extract spatial features in different visual domains, and then mapped to the target domain in a nonlinear way to obtain the spatial feature matrix, as shown below:
[0119]
[0120] in, represents the parameter matrix corresponding to the j-th one-dimensional convolutional neural network in the i-th MCT module to be trained, b i,j represents the bias vector corresponding to the j-th one-dimensional convolutional neural network in the i-th MCT module to be trained, * represents the convolution operation, softmax(·) represents the normalized exponential function, Represents the spatial feature matrix extracted by the j-th one-dimensional convolutional neural network of the i-th MCT module.
[0121] Then, the three spatial feature matrices are combined with the i-th MCT module Perform point multiplication, sum, and then use nonlinear mapping to obtain the multi-view spatial feature matrix of the i-th MCT module As shown below:
[0122]
[0123] Among them, W MVC represents the multi-view spatial mapping network matrix to be trained, and elu(·) represents the ELU activation function. Then, the output of the spatial attention feature extraction model of the i-th MCT module can be obtained for:
[0124]
[0125] Among them, TransformerEncoder(·) represents the encoder model (Encoder) in the general multi-head attention model (Multi-headattention).
[0126] Then, the output of the spatial attention feature extraction model is Input into the temporal attention feature extraction model, and also use the encoder model in the multi-head attention model to replace the LSTM method to extract temporal relationship features, and obtain the output of the temporal attention feature extraction model of the i-th MCT module as follows:
[0127]
[0128] Then, the output X of the i-th MCT module is calculated as follows i as follows:
[0129]
[0130] According to the above principle, starting from the first MCT module, the calculation is performed sequentially until the last MCT module (set as the kth), and its output X k This is the output multi-view spatiotemporal matrix of the multi-view convolutional attention mechanism component.
[0131] (C) Multi-task learning component
[0132] The multi-task learning component is based on the input multi-view spatiotemporal matrix X k , a multi-factor attention mechanism is used to perform nonlinear mapping, and finally the prediction result of the overall travel time is obtained. Specifically, let x i , (i=1,...,N) are the multi-view spatiotemporal matrices X input to the multi-task learning component. k The i-th row of k The total number of rows, first calculate the multi-factor attention vector x attention as follows:
[0133]
[0134] Among them, α i is the multi-factor weight factor, which is calculated as follows:
[0135] z i = <attr,x i >
[0136]
[0137] Among them, <·> represents the vector inner product operation. Finally, a fully connected layer is used to calculate the overall travel time t of the trajectory. entireThe calculation is performed as follows:
[0138] t entire =W entire x attention +b entire
[0139] Among them, W entire represents the fully connected layer parameter matrix to be trained, b entire Represents the bias vector of the fully connected layer to be trained. So far, the structure of the deep neural network model for traffic travel time prediction based on multi-view convolution and attention mechanism has been explained.
[0140] We choose the mean absolute percentage error (MAPE) as the model training error, as follows:
[0141]
[0142] Among them, gap(p1,p N ) represents a trajectory in the database from the starting point p1 to the end point p N The time interval is the overall travel time of the trajectory.
[0143] We use the Adam gradient optimization algorithm for model training. The initial learning rate is set to 1e-4, the batch size is set to 64, and the learning rate is reduced to 1 / 4 of the original after every 2 stages. A total of 100 stages are trained, and finally a deep neural network model for traffic travel time prediction based on multi-view convolution and attention mechanism is obtained.
[0144] After completing the training of the above-mentioned deep neural network model for predicting travel time, you only need to input the GPS trajectory information to be predicted, and the model can output the predicted travel time value of the entire trajectory.
[0145] The present invention can achieve higher accuracy and better stability in predicting urban traffic travel time.
[0146] Specifically, through simulation verification on a test data set, the mean absolute percentage error (MAPE) of the travel time prediction results of the urban traffic travel time prediction method for multi-source heterogeneous data proposed in the present invention is 11.25%, and the mean absolute error (MAE) is 154.8s. Compared with DeepTTE, the baseline method in the field of urban traffic travel time prediction, although the training time of the urban traffic travel time prediction method for multi-source heterogeneous data proposed in the present invention is relatively long, after the model training is completed, the model reasoning speed is comparable, the memory occupancy is comparable, and the prediction accuracy is about 1.1% higher than DeepTTE. Compared with DeepGTT, another recently proposed traffic travel time prediction method (this method combines statistical learning and deep learning, and uses three hierarchical probability models to predict travel time distribution and reconstruct travel routes), the method proposed in the present invention can also achieve a MAPE accuracy of 1% while maintaining comparable model reasoning speed and memory occupancy. Comparison of prediction accuracy methods under different travel times. Figure 4 as shown.
[0147] It can be seen that in trajectories with different travel time lengths, the performance of the present invention is better than that of the DeepTTE and DeepGTT models, which shows that the present invention has better performance under different travel time lengths; and as the travel time increases, the prediction accuracy of the three models decreases. However, compared with DeepTTE and DeepGTT, the accuracy of the model proposed by the present invention decreases less and performs more stably when the travel time increases.
[0148] The model prediction accuracy under different travel distances is as follows Figure 5 As shown. It can be seen that the MAE and MAPE of the model proposed in the present invention are smaller than those of the DeepTTE and DeepGTT models under the trajectories of different travel distances, indicating that the model proposed in the present invention has better performance under different travel distances. As the travel distance increases, the MAE of the three models gradually increases, and the MAPE shows a downward trend. This shows that as the distance increases, the absolute error of the prediction gradually increases, while the relative error gradually decreases, but the accuracy of the model proposed in the present invention changes less relatively and has better stability.
Claims
1. A method for predicting urban traffic travel time based on multi-source heterogeneous data. Features: There are three implementation steps: Step 1: Collect traffic data and external attribute information, complete data preprocessing and annotation, and construct training sets, validation sets, and test sets suitable for deep learning tasks; Step 2: Build a deep neural network model based on multi-view convolution and attention mechanism, and train it on the constructed dataset to obtain a deep neural network model; Step 3: Input the travel trajectory to be predicted, use the trained deep neural network model for inference, and obtain the travel time prediction result; The transportation travel data includes GPS track, travel time, travel date, specific driver vehicle number, route length, and actual travel time of the route; The external attribute information includes urban road network structure and weather information; The method for constructing the training set, the validation set and the test set is as follows: according to the common characteristics of the traffic travel trajectory, the screening conditions are set to eliminate the obvious abnormal trajectories; then, each point of the GPS trajectory is projected onto the corresponding road section through the Leuven.MapMatching map matching tool to obtain the road section trajectory sequence; then, the data is divided into a training data set, a validation data set and a test data set according to a ratio of 2:1:1; The screening conditions are: driving distance greater than 100km or less than 0.5km, average speed greater than 100km / h or less than 5km / h, driving time greater than 7200 seconds or less than 60 seconds; The specific method of constructing the deep neural network model based on multi-view convolution and attention mechanism is as follows: the model architecture is composed of three components: a traffic information fusion component, a multi-view convolution attention mechanism component, and a multi-task learning component; The traffic information fusion component includes two modules: a road segment vector mapping module and a path encoding module. The road segment vector mapping module uses the skip-gram method to implement the mapping of the road segment vector. , N is the number of road sections in the sequence, set the sliding window length to 3, and obtain the The upstream and downstream segment point pairs are recorded as , the upstream section is recorded as , the downstream section is recorded as , then the constructed upstream and downstream segment point pairs are and , Then, according to the probability Sampling to construct pseudo adjacent point pairs: in, For road section The frequency of occurrence in all road segment sequences, Then, a neural network is constructed to map the vector from the road segment number to the road segment vector. ,in, is the bias vector to be trained, is the mapping matrix to be trained, is the sigmoid activation function; for each central section , upstream section and downstream sections The neural network parameters are , and , and the obtained road segment vectors are , and , define the upstream relationship scoring function as , the downstream relationship scoring function is , the training goal of the vector mapping neural network is to make the inner product of the mapping vectors of the real upstream and downstream sections as close to 1 as possible, and the inner product of the mapping vectors of the pseudo upstream and downstream sections as close to 0 as possible, that is: in, Representing road sections The real upstream and downstream segment points, Representative road section The pseudo adjacent segment points of Through training, the neural network parameters for the central section, upstream section and downstream section are obtained respectively. , and , thus obtaining the road segment vector mapping neural network , and ; The path encoding module is for each GPS track point on the track , through the road network map matching during preprocessing, the corresponding road section number has been obtained , then the road segment vector corresponding to the GPS track point can be obtained through the road segment vector mapping module, that is: Then, the trajectory feature vector is calculated as follows : in, represents the i-th trajectory point on the trajectory, represents the longitude of the trajectory point, represents the latitude of the trajectory point, The segment mapping vectors representing the central segment, upstream segment, and downstream segment respectively, Represents the length of the road section corresponding to the trajectory point, Represents the speed limit of the road section corresponding to the trajectory point, represents the neural network parameter matrix to be trained, Represents a splicing operation, Then, calculate the external attribute feature vector as follows: in, Represents the total length of the track segment. Represents the vector of the trajectory travel date after a simple embedding operation. Represents the vector of the trajectory travel time after a simple embedding operation. Represents the vector of the taxi driver number after a simple embedding operation. Represents the vector after a simple embedding operation of weather information. represents the neural network parameter matrix to be trained, Then, a one-dimensional convolution kernel of size 3 is used to compare the trajectory feature vector of each trajectory point on the trajectory. and the external attribute feature vector The concatenated vectors are convolved to obtain a fused feature matrix As shown below: in, Represents the fusion feature matrix The i-th row of Represents a one-dimensional convolution operation with an activation function of ELU and a kernel size of 3. The convolution kernel parameters are the parameters to be trained. Finally, the traffic information fusion component is based on the input trajectory information , calculate the fusion feature matrix As output; The multi-view convolutional attention mechanism component consists of a series of multi-view convolutional attention modules. Each MCT module contains a spatial attention feature extraction model and a temporal attention feature extraction model, and finally outputs a multi-view spatiotemporal matrix as the input of the multi-task learning component. Specifically, the input of the i-th MCT module is , the output is , in particular, for the first MCT module, its input That is the fusion feature matrix output by the traffic information fusion component ; For the last MCT module, recorded as the kth, the output That is, the multi-view spatiotemporal matrix output by the multi-view convolutional attention mechanism component. For any i-th MCT module, the calculation process is as follows: First, the input of the module is encoded by the position encoding method in the multi-head attention mechanism. Encode to get location information , as shown below: in, Represents the general position encoding method in the multi-head attention mechanism. Then, three one-dimensional convolutional neural networks with different convolution kernel sizes are used to extract spatial features in different visual domains, and then mapped to the target domain in a nonlinear manner to obtain the spatial feature matrix, as shown below: in, represents the parameter matrix corresponding to the j-th one-dimensional convolutional neural network in the i-th MCT module to be trained, represents the bias vector corresponding to the j-th one-dimensional convolutional neural network in the i-th MCT module to be trained, represents the convolution operation, It stands for normalized exponential function. represents the spatial feature matrix extracted by the j-th one-dimensional convolutional neural network of the i-th MCT module, Then, the three spatial feature matrices are combined with the i-th MCT module Perform point multiplication, sum, and then use nonlinear mapping to obtain the multi-view spatial feature matrix of the i-th MCT module , as shown below: in, Represents the multi-view spatial mapping network matrix to be trained, represents the ELU activation function, then the output of the spatial attention feature extraction model of the i-th MCT module can be obtained for: in, Represents the encoder model in the general multi-head attention model. Then, the output of the spatial attention feature extraction model is Input into the temporal attention feature extraction model, and also use the encoder model in the multi-head attention model to replace the LSTM method to extract temporal relationship features, and obtain the output of the temporal attention feature extraction model of the i-th MCT module as follows: Then, the output of the i-th MCT module is calculated as follows as follows: Let i traverse all MCT modules starting from the first MCT module, and its output That is, the output multi-view spatiotemporal matrix of the multi-view convolutional attention mechanism component; The multi-task learning component is based on the input multi-view spatiotemporal matrix , a multi-factor attention mechanism is used to perform nonlinear mapping, and finally the prediction result of the overall travel time is obtained. Specifically, The multi-view spatiotemporal matrix of the input of the multi-task learning component For any i-th row of The total number of rows, then first calculate the multi-factor attention vector as follows: in, is the multi-factor weight factor, which is calculated as follows: in, represents the vector inner product operation. Finally, a fully connected layer is used to calculate the overall travel time of the trajectory. The calculation is performed as follows: in, represents the fully connected layer parameter matrix to be trained, Represents the bias vector of the fully connected layer to be trained.
2. A method for predicting urban traffic travel time for multi-source heterogeneous data as claimed in claim 1, Features: The training method is: select the mean absolute error percentage as the model training error, as shown below: in, Represents a trajectory in the database from the starting point To the end The time interval, that is, the overall travel time of the trajectory, The Adam gradient optimization algorithm was used for model training. The initial learning rate was set to 1e-4, the batch size was set to 64, and the learning rate was reduced to 1 / 4 of the original after every 2 stages. A total of 100 stages were trained, and finally a deep neural network model for traffic travel time prediction based on multi-view convolution and attention mechanism was obtained.
Citation Information
Patent Citations
Traffic road condition prediction method and device, equipment and storage medium
CN112669594A
Traffic flow prediction method for training convolutional neural network by using dynamic space-time diagram
CN112669606A
