A traffic network data prediction method based on graph spatiotemporal autoencoder network
Through the graph spatio-temporal autoencoding network, combined with the bidirectional diffusion convolution layer and the graph attention gate recurrent unit, the problem of local and global feature imbalance in road network traffic flow prediction is solved, and more accurate and stable traffic flow prediction is achieved.
Patent Information
- Application Number
- CN202210339542.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-04-01
AI Technical Summary
It is difficult for existing technologies to take into account both local and global spatio-temporal characteristics in road network traffic flow prediction, resulting in insufficient stability and accuracy of prediction results and the inability to effectively capture the complex spatio-temporal correlation of the traffic network.
Using a method based on graph spatio-temporal autoencoding network, the traffic network data is abstracted into a weighted directed graph structure. Traffic data is extracted and predicted through graph encoder, graph decoder and predictor, and bidirectional diffusion convolution layer and graph attention gate are used. The recurrent unit captures the spatial and temporal correlation of traffic flow, enabling end-to-end spatiotemporal feature extraction and prediction.
It improves the accuracy and stability of road network traffic flow prediction, can effectively capture the spatiotemporal correlation of the traffic network, improves the overall prediction accuracy, and avoids repeated calculations and waste of computing power in single-node prediction models.
Smart Images

Figure CN114565187B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a traffic network data prediction method based on a graph spatiotemporal autoencoding network, and belongs to the technical field of intelligent transportation. Background Art
[0002] The task of road network traffic flow prediction has always been an important part of the intelligent transportation system, and has a significant impact on residents' travel planning and urban traffic management. Different from the traditional single-point traffic flow prediction task, road network traffic flow prediction is to learn the spatial and spatial laws of the traffic flow operation of the entire road network, which can more accurately infer the future changes in road network traffic. However, this requires the prediction model to not only discover the potential spatial dependence of road network traffic flow, but also to have the ability to obtain and utilize the time-varying characteristics of traffic flow. In addition, the traffic flow operation in different areas of the road network is often heterogeneous, manifested as different traffic modes, which makes the road network traffic prediction task challenging.
[0003] There are many traffic prediction methods in the prior art, which are mainly divided into model-driven methods and data-driven methods based on the calculation principle. Model-driven methods such as linear regression, time series method, autoregressive integrated moving average model (ARIMA), etc., realize the inference and prediction of traffic parameters by pre-assuming the trend and statistical distribution of traffic parameters. However, these assumptions are difficult to meet in actual traffic flow, which limits the prediction effect of this type of method. Data-driven methods use various machine learning models to model the complex nonlinear changes in traffic data, and have better prediction performance; its representative methods include artificial neural networks (ANN), radial basis functions (RBF), support vector machines (SVM), etc., as well as various deep learning models such as convolutional neural networks (CNN) and recurrent neural networks (RNN) and their various combination variants. Graph Neural Network (GNN) can abstract the traffic network into a graph structure, which is more consistent with the correlation structure of actual road network traffic than conventional grid data and can better reflect the correlation between traffic flow nodes. It is currently the mainstream research method for road network traffic flow prediction tasks.
[0004] Most existing graph neural network prediction models calculate spatial correlation through pre-set edge weights, that is, they assume that there is a fixed spatial dependency between roads, and do not fully consider the temporal variation characteristics of traffic flow and its spatial correlation in the actual traffic network environment. Secondly, for large-scale heterogeneous traffic networks, it is difficult to ensure the effectiveness of the spatiotemporal correlation features of each road node in the layer-by-layer feature extraction process of the neural network. The network structure of the existing technology is difficult to take into account the local and global spatiotemporal characteristics of the road network, and it is difficult to ensure the stability and reliability of the prediction results of each node in the road network, which reduces the accuracy of road network traffic prediction. Summary of the invention
[0005] The purpose of the present invention is to solve the problem of imbalance between local and global features in the process of road network traffic spatiotemporal feature extraction and data prediction in the prior art, which makes it difficult to ensure the stability and reliability of the prediction results of each node in the road network, and reduces the accuracy of road network traffic prediction, and proposes a traffic road network data prediction method based on a graph spatiotemporal autoencoder network.
[0006] A traffic network data prediction method based on graph spatiotemporal autoencoder network. The specific process is as follows:
[0007] Step 1: Abstract the actual traffic network data into a weighted directed graph structure, represent the detector positions as nodes of the graph, and represent the connection relationship between the detector positions as edges of the graph, so as to obtain the graph structure traffic data;
[0008] Step 2: Construct a graph spatiotemporal autoencoder network;
[0009] The graph spatiotemporal autoencoder network includes: graph encoder, graph decoder, and predictor;
[0010] The graph structure traffic data is input into the graph encoder in the graph spatiotemporal autoencoder network, and the graph encoder extracts the features of the graph structure traffic data in spatial and temporal dimensions by fusion;
[0011] The graph decoder takes the features extracted by the graph encoder as input and reconstructs the graph structure traffic data;
[0012] The predictor uses the features extracted by the graph encoder as input to predict future road network traffic data;
[0013] Step 3: Organize the historical traffic data according to the graph structure of step 1, and train the graph spatiotemporal autoencoder network constructed in step 2 to obtain a trained graph spatiotemporal autoencoder network;
[0014] Step 4: Process the real-time traffic data according to step 1 to obtain graph-structured traffic data, input the graph-structured traffic data into the graph spatiotemporal autoencoder network trained in step 3, and obtain the prediction results of each node in the road network.
[0015] The beneficial effects of the present invention are:
[0016] The purpose of the present invention is to provide a method for predicting traffic network data based on a graph spatiotemporal autoencoder network. Through an end-to-end encoder-decoder-predictor composite autoencoder network structure and a three-stage network learning strategy, local and global features between nodes in the traffic network are extracted, and the potential shared features of the network are adjusted to update the overall model parameters in a direction that is more conducive to prediction. At the same time, in order to utilize the dynamic spatiotemporal relationship of traffic flow operation, a bidirectional diffusion convolutional layer is used to capture traffic spatial correlation, and a graph attention gate recurrent unit (GAT-GRU) is proposed to capture traffic time correlation, thereby achieving overall accurate prediction of traffic network data.
[0017] Aiming at the actual application needs of road network traffic prediction, the present invention designs a graph spatiotemporal autoencoder network to capture the complex spatiotemporal correlations between traffic network nodes and realize accurate prediction of traffic flow data within the road network. First, the road network traffic flow prediction problem is expressed as a spatiotemporal prediction problem on a graph, and an end-to-end network structure of graph encoder-graph decoder-predictor fusion is designed, and a corresponding three-stage network training and learning strategy is proposed to ensure the effective extraction of local and global features at each network node, thereby structurally overcoming the problem that existing traffic flow prediction technology cannot guarantee the validity of features. In terms of network layer structure design, a bidirectional diffusion convolutional layer DCL is used to model the spatial correlation of traffic flow road networks, and a graph attention gate recurrent unit GAT-GRU is designed to model the temporal correlation of traffic flows. Good prediction performance was achieved on real data sets, proving that the graph spatiotemporal autoencoder network has good ability to capture the spatiotemporal correlation of traffic networks and predict parameters. The present invention can effectively improve the overall prediction accuracy of the traffic network while taking into account the prediction effect of each node in the network, avoiding the repeated operation and waste of computing power of multiple calculations of each node by a single-node prediction model, and overcoming the problem that the existing traffic network prediction model cannot take into account the prediction accuracy of each node; it can further improve the application effect and practical value in actual applications in the field of intelligent transportation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flow chart of an embodiment of a method for predicting traffic network data according to the present invention;
[0019] Figure 2 The schematic diagram of the spatiotemporal autoencoding network structure in the middle figure of the traffic network data prediction method embodiment of the present invention;
[0020] Figure 3 The diagram of the structure of the attention gate recurrence unit in the embodiment of the traffic network data prediction method of the present invention;
[0021] Figure 4 A schematic diagram of a regional road network in an embodiment of the present invention;
[0022] Figure 5 It is a box plot of prediction errors of different comparison methods in the embodiment of the present invention;
[0023] Figure 6 A schematic diagram of visual analysis of node prediction results and real traffic data in an embodiment of the present invention;
[0024] Figure 7 Schematic diagram of the effect of the figure attention mechanism in an embodiment of the present invention;
[0025] Figure 8a This is a schematic diagram of the allocation result of the attention coefficient of the N5 observation node at 07:00 in an embodiment of the present invention;
[0026] Figure 8b This is a schematic diagram of the allocation result of the attention coefficient of the N5 observation node at 09:00 in an embodiment of the present invention;
[0027] Figure 8c This is a schematic diagram of the spatial visualization allocation result of the attention coefficient of the N5 observation node at 07:00 in an embodiment of the present invention;
[0028] Figure 8d This is a schematic diagram of the spatial visualization allocation result of the attention coefficient of the N5 observation node at 09:00 in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] Specific implementation method 1: This implementation method is a traffic network data prediction method based on a graph spatiotemporal autoencoder network. The specific process is as follows:
[0030] Step 1: Abstract the actual traffic network data into a weighted directed graph structure, represent the detector positions as nodes of the graph, and represent the connection relationship between the detector positions as edges of the graph, so as to obtain the graph structure traffic data;
[0031] Step 2: Construct a graph spatiotemporal autoencoder network; the specific process is as follows:
[0032] The graph spatiotemporal autoencoder network includes: a graph encoder, a graph decoder, and a prediction network combination framework of a predictor. Through the combination of various modules, the spatiotemporal feature extraction of traffic flow and the road network prediction function are realized. In order to ensure the learning and processing ability of the autoencoder network for the spatiotemporal laws of traffic flow;
[0033] The graph structure traffic data is input into the graph encoder in the graph spatiotemporal autoencoder network, and the graph encoder extracts the features of the graph structure traffic data in spatial and temporal dimensions by fusion;
[0034] The graph decoder takes the features extracted by the graph encoder as input and reconstructs the graph structure traffic data;
[0035] The predictor uses the features extracted by the graph encoder as input to predict future road network traffic data;
[0036] Step 3: Organize the historical traffic data according to the graph structure of step 1, and train the graph spatiotemporal autoencoder network constructed in step 2 to obtain a trained graph spatiotemporal autoencoder network;
[0037] Step 4: Process the real-time traffic data according to step 1 to obtain graph-structured traffic data, input the graph-structured traffic data into the graph spatiotemporal autoencoder network trained in step 3, and obtain the prediction results of each node in the road network.
[0038] Specific implementation method 2: This implementation method is different from specific implementation method 1 in that in step 1, the actual traffic network data is abstracted into a weighted directed graph structure, the detector positions are represented as nodes of the graph, and the connection relationship between the detector positions is represented as the edge of the graph, so as to obtain the graph structure traffic data;
[0039] The traffic operation data provided by the road network detector is stored and calculated in the form of a graph structure, providing basic data input for model prediction;
[0040] The specific process is:
[0041] Abstract the actual traffic network data into a weighted directed graph structure according to its detection location Obtaining graph-structured traffic data Graph-structured traffic data is used as the input data of the graph spatiotemporal autoencoder network; Store in the form of
[0042] in is a node set, representing the location of the road network detector, and the number is N, that is, ε is the edge set, i.e., the physical connection edge between nodes; A represents the weighted adjacency matrix, which represents the proximity relationship of nodes; P represents the dimension of traffic flow data obtained by each node (such as flow, speed, occupancy);
[0043] When node v i With v j The spatial distance is greater than the threshold Then A ij =0; when node v i With v j The spatial distance is less than or equal to the threshold but A ij ∈A;
[0044] where dist(v i ,v j ) is the node v i With node v j, σ represents the standard deviation of node distance.
[0045] Threshold The role is to control the scope of influence determined by the network size;
[0046] Let X (t) represents the road network observation data at time t, then the purpose of road network traffic flow prediction is to learn the historical data within the time range of T' through network model training. Data for the future T time range [X (t+1) ,…,X (t+T) ]’s complex mapping relationship.
[0047] The other steps and parameters are the same as those in the first embodiment.
[0048] Specific implementation method three: This implementation method is different from specific implementation methods one or two in that a graph spatiotemporal autoencoder network is constructed in step two; the specific process is as follows:
[0049] The graph spatiotemporal autoencoder network includes a graph encoder, a graph decoder, and a predictor;
[0050] The prediction network combination framework of graph encoder, graph decoder and predictor realizes the functions of traffic flow spatiotemporal feature extraction and road network prediction through the combination of various modules. In order to ensure the learning and processing ability of the autoencoder network for the spatiotemporal laws of traffic flow;
[0051] The graph structure traffic data is input into the graph encoder in the graph spatiotemporal autoencoder network. The graph encoder encodes the graph structure traffic data. Perform feature fusion extraction in spatial and temporal dimensions;
[0052] The graph decoder takes the features extracted by the graph encoder as input and reconstructs the graph structure traffic data;
[0053] The predictor uses the features extracted by the graph encoder as input to predict future road network traffic data;
[0054] The structure of the graph encoder-graph decoder is to ensure the effectiveness of local and global spatiotemporal features in the feature extraction process, and the structure of the predictor is to improve the overall prediction performance of road network traffic data.
[0055] The specific process is:
[0056] The graph encoder includes a bidirectional diffusion convolutional layer and a graph attention gate recurrent unit;
[0057] The graph decoder includes a graph attention gate recurrent unit and a bidirectional diffusion convolutional layer;
[0058] The bidirectional diffusion convolutional layer and the graph attention gate recurrent unit in the graph encoder and the graph decoder are symmetrical;
[0059] The predictor includes a graph attention mechanism (GAT);
[0060] The bidirectional diffusion convolution layer (DCL) is introduced to model the spatial diffusion process of traffic flow and capture the spatial correlation between nodes in the network. Combining the advantages of the weight self-adjustment of the graph attention mechanism (GAT) and the temporal order learning of the gated recurrent unit (GRU), the graph attention gated recurrent unit (GAT-GRU) is designed to model the dynamic temporal changes of network node dependencies.
[0061] The graph spatiotemporal autoencoder network uses bidirectional diffusion convolutional layers to capture traffic spatial correlation;
[0062] The design graph attention gate recurrent unit captures the traffic time correlation;
[0063] The diffuse convolutional layer and the graph attention gate recurrent unit are used as the basic network layers to form a graph spatiotemporal autoencoder network for traffic network prediction.
[0064] The bidirectional diffusion convolution layer associates the traffic flow in the road network through the diffusion convolution process and establishes a spatial dependency model of the traffic flow. The traffic flow diffusion process in the road network is abstracted as a graph. The random walk process with a certain restart probability α∈[0,1], and the state transfer matrix Here D O =diag(A) represents the out-degree diagonal matrix of the weighted adjacency matrix A. After repeated random walk steps, the diffusion process converges to a stable distribution in Representation Node The diffusion likelihood probability.
[0065] Therefore, the stable distribution of the diffusion process in the graph structure can be expressed as a weighted combination of infinite random walks, and the calculation form is expressed as:
[0066] in, is the state transfer matrix, k represents the number of random walks, D O =diag(A) represents the out-degree diagonal matrix of the weighted adjacency matrix A, α is the restart probability, α∈[0,1]; Stabilize the distribution for diffusion processes in graph structures;
[0067] Where k represents the number of random walks. However, in order to facilitate practical application calculations, a finite number of K times is selected for truncation calculation and approximation.
[0068] Step 21: Input the graph structure traffic data obtained in step 1 into the bidirectional diffusion convolution layer in the graph encoder, the bidirectional diffusion convolution layer outputs H, and the bidirectional diffusion convolution layer in the graph encoder completes the convolution mapping from P-dimensional input to Q-dimensional output;
[0069] Step 2: The output H of the bidirectional diffusion convolutional layer is used as the input of the GAT-GRU layer, which outputs a new set of node features. M is the output feature dimension of the graph attention gate recurrent unit;
[0070] Step 23: Define H′ obtained in step 22 as is the graph attention gate recurrent unit function, W is a trainable matrix, is the hidden state of the gated recurrent unit, a is the attention kernel of the graph attention gated recurrent unit, and A is the weighted adjacency matrix;
[0071] Introduce the Gated Recurrent Unit (GRU) to dynamically extract the time sequence rules of traffic flow;
[0072] Step 24:
[0073] In order to realize the learning and training of network parameters and ensure the effectiveness of spatiotemporal features in the autoencoder extraction process and the predictive ability of the extracted features in the network prediction process, the network loss function contains two parts: minimum reconstruction loss and minimum prediction loss, which guide network training at different network training stages.
[0074] The graph spatiotemporal autoencoder network extracts The traffic input tensor on The decoder is used to reconstruct the original input.
[0075] The graph decoder takes the features extracted by the graph encoder as input and processes the graph structure traffic data obtained in step 1. Refactoring
[0076] The reconstruction loss of the graph decoder is defined as
[0077] in and X represent the reconstructed value of graph structure traffic data and the graph structure traffic data obtained in step 1, respectively. represents the reconstructed value, X n,p Represents the graph structure traffic data obtained in step 1 That is, the true value; N and P represent the number of nodes and features in X respectively;
[0078] The smaller the reconstruction loss, the more effective feature information is obtained in the encoding and decoding feature extraction.
[0079] Step 25: The predictor uses the features extracted by the graph encoder as input and performs an analysis on the graph structure traffic data obtained in step 1. Make predictions;
[0080] The core purpose of the spatiotemporal autoencoder network is to predict the next traffic state by extracting spatiotemporal features. The predictor predicts the loss by using the network prediction result Y and the traffic detection data X for the next period. t+1 The cross entropy is defined as
[0081] Where N and P represent the number of nodes and features in X respectively. represents the graph structure traffic data for the next period, Y n,p Represents the predicted value.
[0082] The other steps and parameters are the same as those in the first or second embodiment.
[0083] Specific implementation method 4: This implementation method is different from any one of specific implementation methods 1 to 3 in that in step 21, the graph structure traffic data obtained in step 1 is input into the bidirectional diffusion convolution layer in the graph encoder, and the bidirectional diffusion convolution layer outputs H. The bidirectional diffusion convolution layer in the graph encoder completes the convolution mapping from P-dimensional input to Q-dimensional output; the specific process is:
[0084] Step 2: In order to more flexibly capture the influence relationship between upstream and downstream traffic in the road network, the graph structure traffic data obtained in step 1 is And the convolution kernel f of the bidirectional diffusion convolution layer θ Perform a bidirectional diffuse convolution operation:
[0085] in Represents the convolution kernel parameters; represents the transfer matrix of the forward diffusion process; represents the transfer matrix of the reverse diffusion process; k represents the kth random walk of the diffusion process in the graph structure, K represents the number of random walks of the diffusion process in the graph structure, and D O represents the out-degree diagonal matrix of the weighted adjacency matrix A; D I represents the in-degree diagonal matrix of the weighted adjacency matrix A; X :,p represents the p-th column vector in all N dimensions, θ k′,1 represents the convolution kernel parameters of the forward diffusion convolution process, θ k′,2represents the convolution kernel parameter of the back-diffusion convolution process, and P represents the dimension of traffic flow data obtained by each node (such as flow, speed, and occupancy);
[0086] Step 2: Define parameter tensor
[0087] in Represents the convolution kernel parameter tensor from the p′th dimension input to the q′th dimension output, [θ] q′,p′ Represents the convolution kernel parameter tensor from the p′th dimension input to the q′th dimension output, Q′ represents the convolution kernel output dimension, P′ represents the convolution kernel input dimension; K′ represents the size of the convolution kernel;
[0088] The convolution layer calculation process is:
[0089]
[0090] in is the input of the bidirectional diffusion convolution layer, is the output of the bidirectional diffusion convolutional layer, is the convolution kernel; σ is the ReLU activation function; H:, q is the output of the q-dimensional bidirectional diffusion convolution layer;
[0091] The diffusion convolutional layer learning can represent the spatial representation of graph structured data and extract the spatial correlation between traffic nodes in the road network.
[0092] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.
[0093] Specific implementation method 5: This implementation method is different from any one of the specific implementation methods 1 to 4 in that the output H of the bidirectional diffusion convolution layer in step 22 is used as the input of the graph attention gate recurrent unit (GAT-GRU) layer, and the graph attention gate recurrent unit (GAT-GRU) layer outputs a set of new node features M is the output feature dimension of the graph attention gate recurrent unit; the specific process is:
[0094] In real traffic networks, the future state of road nodes has a strong temporal correlation with the historical state; at the same time, the spatial correlation between road nodes will change dynamically over time. In view of the temporal characteristics of these two types of traffic flows, a graph attention gate recurrent unit (GAT-GRU) is designed to model the dynamic temporal changes of network node dependencies. The feature conversion between the input and output of the graph attention gate recurrent unit uses a node-shared trainable matrix conduct;
[0095] Step 221: Define the attention kernel of the graph attention gate recurrent unit as Then the graph attention calculation process of the graph attention gate recurrent unit is:
[0096]
[0097] where α m,q is the importance of the feature of the q-th dimension node to the feature of the m-th dimension node, is the normalized attention weight, q = 1, 2, ..., Q, m = 1, 2, ..., M; T represents matrix transposition, || represents concatenation operation, Representation diagram Middle node v m Less than threshold The set of spatial neighborhood points of , W is the trainable matrix, F is the size of the attention kernel (forward and reverse added together), is the feature of the m-th dimension node, is the feature of the q-th dimension node, For the The characteristics of the dimension node, For the dimension,
[0098] When node v m and The spatial distance is greater than the threshold but When node v m and The spatial distance is less than or equal to the threshold but
[0099] in For node v m and The spatial distance of , σ represents the standard deviation of node distance;
[0100] Step 222: Bidirectional diffusion convolution layer output node features Input the graph attention gate recurrent unit, and the node features output by the graph attention gate recurrent unit are:
[0101]
[0102] The graph attention mechanism is a dynamic adjustment of the spatial relationship of network nodes.
[0103] Step 223: In order to ensure the stability of the feature attention mechanism calculation, K″ independent attention cores are selected to perform the graph attention calculation process of step 221; the average value of the node features output by the K″ graph attention gate recurrent units As the output of the Graph Attention Gate Recurrent Unit (GAT-GRU) layer;
[0104] Where W k″ is a trainable matrix; is the k″th graph attention.
[0105] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.
[0106] Specific implementation method 6: This implementation method is different from the specific implementation methods 1 to 5 in that in step 23, H′ obtained in step 22 is defined as is the graph attention gate recurrent unit function, W is the trainable matrix, H is the output node feature of the bidirectional diffusion convolution layer, a is the attention kernel of the graph attention gate recurrent unit, and A is the weighted adjacency matrix;
[0107] The gated recurrent unit (GRU) is introduced to dynamically extract the time sequence rules of traffic flow. The calculation process is as follows:
[0108]
[0109]
[0110]
[0111]
[0112] Where: H' t is the node feature output by the GAT-GRU layer at time t, and Represent the implicit states of the gated recurrent unit at time t and t-1, respectively, r t represents the reset gate, z t represents the update gate, B r , B z and B h They represent the reset gate, update gate, and implicit state corresponding bias respectively, and all parameters have the same graph structure; tanh represents the activation function, ⊙ represents the bitwise multiplication of the graph tensor; W xr represents the trainable matrix input to the reset gate, W xz represents the trainable matrix input to the update gate, W xh Represents the trainable matrix of input to hidden state, W hr Represents the trainable matrix from hidden state to reset gate, W hz Represents the trainable matrix from hidden state to update gate, W hh represents a trainable matrix from hidden state to hidden state, Represents an intermediate variable.
[0113] In the state transfer process of GAT-GRU, the time-varying characteristics of each node on the graph and the dynamic time changes of the relevant weights between each node and its adjacent nodes are taken into account, so that the traffic timing rules of the road network can be learned.
[0114] Through the multi-layer combination of bidirectional diffusion convolutional layers DCL and graph attention gate recurrent units GAT-GRU, three network components: graph encoder, graph decoder, and predictor are constructed. The specific form is set according to the prediction effect in actual applications.
[0115] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.
[0116] Specific implementation method 7: This implementation method is different from any one of specific implementation methods 1 to 6 in that in step 3, the historical traffic data is organized according to the graph structure of step 1, and the graph spatiotemporal autoencoder network constructed in step 2 is trained to obtain a trained graph spatiotemporal autoencoder network; the specific process is:
[0117] Different from the traditional overall network training method, the graph spatiotemporal autoencoder network model adopts a three-stage combined training form, designing different task objectives in each training stage to guide the update of network parameters.
[0118] First, the graph encoder-graph decoder parameters are trained to effectively capture the global and local spatiotemporal characteristics of traffic implicit in the input graph structure data;
[0119] Then, the graph encoder-predictor is jointly trained to preliminarily guide the predictor parameters and realize the mapping and calculation from traffic characteristics to prediction results;
[0120] Finally, the overall network including the graph encoder-graph decoder-predictor is fine-tuned to adjust the network's potential shared features so that the overall network parameters can be updated in a direction that is helpful for prediction. This further improves the network's prediction capabilities while ensuring the effectiveness of traffic spatiotemporal features.
[0121] Step 31: In order to make the graph spatiotemporal autoencoder network converge simultaneously in two tasks (feature extraction and prediction), a new three-stage network learning strategy is proposed. According to the priority and importance of the task, the network training strategy is divided into: (0, n / 2) (greater than 0 and less than n / 2), [n / 2, 3n / 4) (greater than or equal to n / 2, less than 3n / 4) and [3n / 4, n] (greater than or equal to 3n / 4, less than or equal to n), where n represents the total number of overall network training times, and its setting should be large enough to ensure that the network parameters converge at each stage;
[0122] Step 32: Given a graph spatiotemporal autoencoder network with fixed parameters, including the number of input graph nodes n input , the number of network layers n layer , the number of hidden layer nodes n node ;
[0123] Given historical data As network training data, M′ is the number of training sets, is the first data in the training set (graph structure traffic data), is the M′th data in the training set (graph structure traffic data); is the input of the graph spatiotemporal autoencoder network, Output of the graph spatiotemporal autoencoder network;
[0124] Step 33: Randomly initialize the parameters of the graph encoder, graph decoder, and predictor in the graph spatiotemporal autoencoder network;
[0125] Step 3 and 4: When the number of training times is in the range of (0, n / 2), train the graph encoder-graph decoder; the specific process is as follows:
[0126] When the number of training times is in the range of (0, n / 2), The input graph spatiotemporal autoencoder network is used to obtain the reconstructed input Calculate the reconstruction loss L construct , and use Adam optimizer to optimize the graph encoder and graph decoder parameters; i = 1, 2, ..., M′;
[0127] Step 35: When the number of training times is in the range of [n / 2,3n / 4), train the predictor; the specific process is:
[0128] When the number of training times is in the range of [n / 2,3n / 4), Input the graph spatiotemporal autoencoder network (the graph encoder and decoder network parameters are fixed) to obtain the predicted value Calculate the prediction loss L forecast , and use the Adam optimizer to optimize the predictor parameters;
[0129] Step 36: When the number of training times is in the range of [3n / 4,n], train the graph spatiotemporal autoencoder network; the specific process is:
[0130] When the number of training times is in the range of [3n / 4,n], the entire network is weight-shared, and the reconstruction loss and prediction loss are used to adjust the potential shared features to update the parameters in a way that is beneficial to the prediction task;
[0131] When the number of training times is in the range of [3n / 4,n], The input graph spatiotemporal autoencoder network is used to obtain the reconstructed input With the predicted value Calculate the mixed loss function L = βL construct +(1-β)L forecast , and use the Adam optimizer to optimize the overall parameters of the graph spatiotemporal autoencoder network to obtain the trained graph spatiotemporal autoencoder network;
[0132] Among them, β is the coefficient.
[0133] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.
[0134] The following examples are used to verify the beneficial effects of the present invention:
[0135] Embodiment 1:
[0136] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0137] In one embodiment of the present invention, the traffic flow operation data collected by 63 traffic sensors in the Changchun urban expressway system are used for testing. Figure 4 The data range is from December 5, 2017 to March 30, 2018, and the traffic data is processed into 5-minute time windows, of which 70% of the data set is used for training, 20% for testing, and 10% for validation.
[0138] The embodiment uses mean absolute error (MAE), mean absolute percentage error (MAPE) and root mean square error (RMSE) as model evaluation indicators, respectively, and sets x = x1, ... x n represents the observed value, represents the model prediction value, then
[0139] Mean absolute error
[0140] Mean absolute percentage error
[0141] Root mean square error
[0142] Where: Ω is the number of samples.
[0143] In order to control the influence range of network nodes, the spatial threshold In the example, it is set to 5 km.
[0144] In order to achieve the best effect of road network traffic parameters, the random walk times of the bidirectional diffusion convolution layer are set to 4, and the convolution kernel f θ The number is set to 60. The encoder structure is set to 1 layer of DCL + 6 layers of GAT-GRU, the decoder structure is set to 6 layers of GAT-GRU + 1 layer of DCL, and the predictor structure is set to 6 layers of graph attention layer. The network learning rate is set to 0.0001, the maximum number of iterations is set to 40000, and the balance coefficient β in the hybrid loss function L(θ) is set to 0.5.
[0145] Organize the data in the form of graph structure according to step one, build the network according to step two, train the network parameters according to step three, and finally input the test set data into the trained graph spatiotemporal autoencoder network to obtain the final prediction result.
[0146] Figure 5 Some prediction results of node N5 are given. The prediction results of the present invention are close to the actual observed values, which verifies the effectiveness of the graph spatiotemporal autoencoder network.
[0147] In order to prove the advancedness of the algorithm, the prediction algorithm of this patent is compared with common traffic prediction methods including: autoregressive integrated moving average (ARIMA), radial basis function (RBF), support vector machine (SVM), stacked autoencoder (SAE), long short-term memory network (LSTM), convolutional neural network combined with long short-term memory network (CNN+LSTM), spatiotemporal graph convolutional network (GSTCN), graph convolutional GRU network (GCGRU), diffusion convolutional recurrent neural network (DCRNN), and graph attention LSTM (GAT-LSTM). The comparison results are shown in Table 1.
[0148] Table 1 Comparison of prediction results of different algorithms for Changchun dataset
[0149]
[0150] Figure 6 The relative error box plots of each prediction algorithm within a 5-minute prediction range are given. Comprehensive analysis shows that the method of the present invention has the smallest prediction error within the prediction ranges of 5 minutes, 10 minutes, and 15 minutes, which indicates that the graph spatiotemporal autoencoder network has better ability to extract spatiotemporal correlation of traffic and has better overall prediction performance for road sensor networks.
[0151] In order to further verify the effect of the patented method on temporal dependency modeling, the method of the present invention is compared with a graph spatiotemporal autoencoder network that does not include a graph attention mechanism GAT and a graph attention gate recurrent unit (GAT-GRU), and the experimental results are shown in Table 2. The comparison proves that the prediction error of the method of the present invention is the smallest, and also proves that the graph attention gate recurrent unit (GAT-GRU) proposed in the present invention can dynamically adjust the feature weights and improve the network's temporal dependency modeling capability.
[0152] Figure 2 Analysis of performance verification results of Graph Attention Gate Recurrent Unit (GAT-GRU)
[0153]
[0154] To visualize the dynamic weight adjustment of GAT-GRU under different traffic patterns, Figure 7The prediction results of the patent model under normal and accident conditions are given. Due to a serious accident at the N5 observation point around 07:30, the traffic volume dropped sharply; in the event of an accident,
[0155] Traffic conditions. Figure 7 In the study, the traffic volume dropped sharply during 07:30-13:00, which was caused by a serious accident near the Changchun N5 observation point. In this abnormal traffic situation, the patented method can predict abnormal changes in traffic flow more accurately than without using the graph attention mechanism GAT, which proves that the GAT attention mechanism plays a decisive role in the model.
[0156] Figure 8a , 8b Figures 8c and 8d show the distribution and spatial visualization results of the attention coefficient of the N5 observation point at 07:00 and 09:00. At 07:00, the attention coefficient of the N5 observation point is relatively scattered, indicating that the observation point is associated with most of its adjacent nodes. However, after the accident occurred at 09:00, the attention coefficient of the N5 observation point was concentrated and was almost only related to itself. This shows that the sudden change in traffic status caused by the accident is relatively isolated in a short period of time and has no global correlation, which is consistent with the actual situation. This confirms that the method of the present invention has a strong ability to model the time-dependent traffic network flow.
[0157] The present invention may also have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.
Claims
1. A traffic network data prediction method based on a graph spatiotemporal autoencoder network, characterized by: The specific process of the method is: Step 1: Abstract the actual traffic network data into a weighted directed graph structure, represent the detector positions as nodes of the graph, and represent the connection relationship between the detector positions as edges of the graph, so as to obtain the graph structure traffic data; Step 2: Construct a graph spatiotemporal autoencoder network; The graph spatiotemporal autoencoder network includes: graph encoder, graph decoder, and predictor; The graph structure traffic data is input into the graph encoder in the graph spatiotemporal autoencoder network, and the graph encoder extracts the features of the graph structure traffic data in spatial and temporal dimensions by fusion; The graph decoder takes the features extracted by the graph encoder as input and reconstructs the graph structure traffic data; The predictor uses the features extracted by the graph encoder as input to predict future road network traffic data; The specific process is: The graph encoder includes a bidirectional diffusion convolutional layer and a graph attention gate recurrent unit; The graph decoder includes a graph attention gate recurrent unit and a bidirectional diffusion convolutional layer; The bidirectional diffusion convolutional layer and the graph attention gate recurrent unit in the graph encoder and the graph decoder are symmetrical; The predictor comprises a graph attention layer; Step 21: Input the graph structure traffic data obtained in step 1 into the bidirectional diffusion convolution layer in the graph encoder, the bidirectional diffusion convolution layer outputs H, and the bidirectional diffusion convolution layer in the graph encoder completes the convolution mapping from P-dimensional input to Q-dimensional output; Step 2: The output H of the bidirectional diffusion convolutional layer is used as the input of the graph attention gate recurrent unit layer, and the graph attention gate recurrent unit layer outputs a set of new node features M is the output feature dimension of the graph attention gate recurrent unit; Step 23: Define H′ obtained in step 22 as is the graph attention gate recurrent unit function, W is a trainable matrix, is the hidden state of the gated recurrent unit, a is the attention kernel of the graph attention gated recurrent unit, and A is the weighted adjacency matrix; The gated recurrent unit is introduced to dynamically extract the time sequence rules of traffic flow; Step 24: The graph decoder uses the features extracted by the graph encoder as input and decodes the graph structure traffic data obtained in step 1. Refactoring The reconstruction loss of the graph decoder is defined as in and X represent the reconstructed value of graph structure traffic data and the graph structure traffic data obtained in step 1, respectively. represents the reconstructed value, X n,p Represents the graph structure traffic data obtained in step 1 That is, the true value; N and P represent the number of nodes and features in X respectively; Step 25: The predictor uses the features extracted by the graph encoder as input and performs an analysis on the graph structure traffic data obtained in step 1. Make predictions; The predictor predicts the loss using the network prediction result Y and the traffic detection data X for the next period t+1 The cross entropy is defined as Where N and P represent the number of nodes and features in X respectively. represents the graph structure traffic data for the next period, Y n,p represents the predicted value; Step 3: Organize the historical traffic data according to the graph structure of step 1, and train the graph spatiotemporal autoencoder network constructed in step 2 to obtain a trained graph spatiotemporal autoencoder network; Step 4: Process the real-time traffic data according to step 1 to obtain graph-structured traffic data, input the graph-structured traffic data into the graph spatiotemporal autoencoder network trained in step 3, and obtain the prediction results of each node in the road network.
2. According to claim 1, a method for predicting traffic network data based on a graph spatiotemporal autoencoder network is characterized by: In the step 1, the actual traffic network data is abstracted into a weighted directed graph structure, the detector positions are represented as nodes of the graph, and the connection relationship between the detector positions is represented as edges of the graph, so as to obtain the graph structure traffic data; The specific process is: Abstract the actual traffic network data into a weighted directed graph structure Obtaining graph-structured traffic data The graph-structured traffic data is used as the input data of the graph spatiotemporal autoencoder network; in is a node set, representing the location of the road network detector, and the number is N, that is, E is the edge set, i.e., the physical connection edges between nodes; A represents the weighted adjacency matrix, which represents the proximity relationship of nodes; P represents the dimension of traffic flow data obtained by each node; When node v i With v j The spatial distance is greater than the threshold Then A ij =0; when node v i With v j The spatial distance is less than or equal to the threshold but A ij ∈A;v i , where dist(v i ,v j ) is the node v i With node v j , σ represents the standard deviation of node distance.
3. According to claim 2, a method for predicting traffic network data based on a graph spatiotemporal autoencoder network is characterized by: In the step 21, the graph structure traffic data obtained in step 1 is input into the bidirectional diffusion convolution layer in the graph encoder, and the bidirectional diffusion convolution layer outputs H. The bidirectional diffusion convolution layer in the graph encoder completes the convolution mapping from P-dimensional input to Q-dimensional output. The specific process is: Step 2: Graph structure traffic data obtained in step 1 And the convolution kernel f of the bidirectional diffusion convolution layer θ Perform a bidirectional diffuse convolution operation: in Represents the convolution kernel parameters; represents the transfer matrix of the forward diffusion process; represents the transfer matrix of the reverse diffusion process; k represents the kth random walk of the diffusion process in the graph structure, K represents the number of random walks of the diffusion process in the graph structure, and D O represents the out-degree diagonal matrix of the weighted adjacency matrix A; D I represents the in-degree diagonal matrix of the weighted adjacency matrix A; X :,p represents the p-th column vector in all N dimensions, θ k′,1 represents the convolution kernel parameters of the forward diffusion convolution process, θ k′,2 represents the convolution kernel parameter of the reverse diffusion convolution process, and P represents the dimension of the traffic flow data obtained by each node; Step 2: Define parameter tensor in Represents the convolution kernel parameter tensor from the p′th dimension input to the q′th dimension output, [θ] q′,p′ Represents the convolution kernel parameter tensor from the p′th dimension input to the q′th dimension output, Q′ represents the convolution kernel output dimension, P′ represents the convolution kernel input dimension; K′ represents the size of the convolution kernel; The convolution layer calculation process is: in is the input of the bidirectional diffusion convolution layer, is the output of the bidirectional diffusion convolutional layer, is the convolution kernel; σ is the ReLU activation function; H :,q It is the output of the q-dimensional bidirectional diffusion convolution layer.
4. The method for predicting traffic network data based on a graph spatiotemporal autoencoder network according to claim 3, characterized in that: The output H of the bidirectional diffusion convolutional layer in step 22 is used as the input of the graph attention gate recurrent unit layer, and the graph attention gate recurrent unit layer outputs a set of new node features M is the output feature dimension of the graph attention gate recurrent unit; The specific process is: Step 221: Define the attention kernel of the graph attention gate recurrent unit as Then the graph attention calculation process of the graph attention gate recurrent unit is: where α m,q is the importance of the feature of the q-th dimension node to the feature of the m-th dimension node, q = 1, 2, ..., Q, m = 1, 2, ..., M; T represents matrix transpose, || represents concatenation operation, Representation diagram The node vm is less than the threshold The set of spatial neighborhood points, W is the trainable matrix, F is the size of the attention kernel, is the feature of the m-th dimension node, is the feature of the q-th dimension node, For the The characteristics of the dimension node, For the dimension, When the node vm and The spatial distance is greater than the threshold but When node v m and The spatial distance is less than or equal to the threshold but in For node vm and The spatial distance of , σ represents the standard deviation of node distance; Step 222: Bidirectional diffusion convolution layer output node features Input the graph attention gate recurrent unit, and the node features output by the graph attention gate recurrent unit are: Step 223: Select K″ independent attention cores to perform the graph attention calculation process of step 221; the average value of the node features output by the K″ graph attention gate recurrent units As the output of the graph attention gate recurrent unit layer; Where W k″ is a trainable matrix; is the k″th graph attention.
5. The method for predicting traffic network data based on a graph spatiotemporal autoencoder network according to claim 4, characterized in that: In step 23, H′ obtained in step 22 is defined as is the graph attention gate recurrent unit function, W is the trainable matrix, H is the output node feature of the bidirectional diffusion convolution layer, a is the attention kernel of the graph attention gate recurrent unit, and A is the weighted adjacency matrix; The gated recurrent unit is introduced to dynamically extract the traffic flow timing law. The calculation process is as follows: Where: H' t is the node feature output by the graph attention gate recurrent unit layer at time t, and Represent the implicit states of the gated recurrent unit at time t and t-1, respectively, r t represents the reset gate, z t represents the update gate, B r , B z and B h Respectively represent the reset gate, update gate, and implicit state corresponding bias; tanh represents the activation function, ⊙ represents the bitwise multiplication of the graph tensor; W xr represents the trainable matrix input to the reset gate, W xz represents the trainable matrix input to the update gate, W xh Represents the trainable matrix of input to hidden state, W hr Represents the trainable matrix from hidden state to reset gate, W hz Represents the trainable matrix from hidden state to update gate, W hh represents a trainable matrix from hidden state to hidden state, Represents an intermediate variable.
6. The method for predicting traffic network data based on a graph spatiotemporal autoencoder network according to claim 5, characterized in that: In the step 3, the historical traffic data is organized according to the graph structure of the step 1, and the graph spatiotemporal autoencoder network constructed in the step 2 is trained to obtain a trained graph spatiotemporal autoencoder network; The specific process is: Step 31: Divide the network training strategies into: (0,n / 2), [n / 2,3n / 4) and [3n / 4,n]; Where n represents the total number of overall network training; Step 32: Given a graph spatiotemporal autoencoder network with fixed parameters, including the number of input graph nodes n input , the number of network layers n layer , the number of hidden layer nodes n node ; Given historical data As network training data, M′ is the number of training sets, is the first data in the training set. is the M′th data in the training set; Step 33: Randomly initialize the parameters of the graph encoder, graph decoder, and predictor in the graph spatiotemporal autoencoder network; Step 34: When the number of training times is in the range of (0, n / 2), train the graph encoder-graph decoder; The specific process is: When the number of training times is in the range of (0, n / 2), The input graph spatiotemporal autoencoder network is used to obtain the reconstructed input Calculate the reconstruction loss L construct , and use Adam optimizer to optimize the graph encoder and graph decoder parameters; i = 1, 2, ..., M′; Step 35: When the number of training times is in the range of [n / 2,3n / 4), train the predictor; the specific process is: When the number of training times is in the range of [n / 2,3n / 4), Input graph spatiotemporal autoencoder network to obtain prediction value Calculate the prediction loss L forecast , and use the Adam optimizer to optimize the predictor parameters; Step 36: When the number of training times is in the range of [3n / 4,n], train the graph spatiotemporal autoencoder network; the specific process is: When the number of training times is in the range of [3n / 4,n], The input graph spatiotemporal autoencoder network is used to obtain the reconstructed input With the predicted value Calculate the mixed loss function L = βL construct +(1-β)L forecast , and use the Adam optimizer to optimize the overall parameters of the graph spatiotemporal autoencoder network to obtain the trained graph spatiotemporal autoencoder network; Among them, β is the coefficient.
