A multi-information fusion spatiotemporal graph convolution traffic flow prediction method
By constructing a graph adjacency matrix that integrates distance factors and a time series of periodic factors, and designing a deep spatiotemporal graph convolutional gated neural network, the spatial correlation and temporal periodicity problems of traffic flow prediction in complex road networks are solved, thereby improving the prediction accuracy and efficiency.
Patent Information
- Application Number
- CN202310137926.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2043-02-20
AI Technical Summary
When dealing with complex road networks, existing traffic flow prediction models fail to effectively consider the spatial correlation differences and temporal periodicity of distances between road sections, resulting in insufficient prediction accuracy and increased time and space overhead for training independent components.
A graph adjacency matrix integrating distance factors and time series of periodic factors is constructed, and a deep spatiotemporal graph convolutional gated neural network is designed. The spatial features of the road network are extracted through the spatial graph convolution module and combined with the time series prediction module to perform multi-information fusion to realize traffic flow prediction.
The accuracy of traffic flow prediction is improved and the prediction error is reduced, especially in the short term, which significantly improves the prediction performance of the model.
Smart Images

Figure CN116258258B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of traffic flow prediction methods, and specifically relates to a multi-information fusion spatiotemporal graph convolution traffic flow prediction method. Background Art
[0002] Urban road networks are complex, and scientifically accurate traffic flow forecasting plays a vital role in areas such as road congestion assessment and route planning. Traffic flow exhibits strong cyclical characteristics and is closely tied to its state at the previous moment. Some researchers have focused on the logical relationships between sequences in the temporal dimension, using machine learning models such as historical mean methods, time series models, KNN algorithms, SVM algorithms, and RNN networks to predict traffic flow.
[0003] In reality, simply considering temporal relationships is quite limited. Accurate traffic flow prediction is difficult because the current state of one road section simultaneously affects the future states of neighboring sections. By incorporating spatial information and rationally analyzing the spatiotemporal characteristics of traffic flow, the model's prediction accuracy can be significantly improved. The concept of ConvLSTM has been proposed, replacing some Hadamard product operations in LSTM networks with convolution operations to exploit spatial information and reduce prediction errors. Another approach combines a CNN network, which extracts features in two-dimensional space, with an RNN network, which is designed for sequence prediction. The CNN exploits spatial feature information and combines it with the RNN network for prediction. Both methods operate on traditional two-dimensional spatiotemporal matrices and can only consider the impact of spatial relationships between upstream and downstream sections. They are not well-suited for complex road environments.
[0004] To represent the complex adjacency relationships between road segments, complex topological structures can be stored in the form of graphs. The emergence of graph convolutional neural networks (GCNs) has laid the foundation for deep learning models to mine the characteristic information of graph structures. Some have proposed graph convolutional recurrent networks (GCRNs), which combine graph convolutional networks with recurrent neural networks, providing a theoretical basis for mining spatiotemporal sequence features. Another proposed network, the Difusion Convolutional Recurrent Neural Network (DCRNN), models traffic flow trends as a diffusion process on a directed graph, capturing spatial features through the bidirectional random walks of the graph. Traffic flow exhibits strong cyclical patterns on daily and weekly cycles. Taking into account the cyclical nature of traffic flow, researchers have designed a multi-component spatiotemporal graph convolutional network. This network trains and predicts the hourly, daily, and weekly sub-components separately, and then performs a weighted combination of the prediction results from these three components to produce the final output.
[0005] Mining the spatiotemporal characteristics of traffic flow based on graph structures has become a research hotspot, but the current models built based on graph neural networks still have some problems:
[0006] 1) When storing the graph adjacency matrix, the traditional method only considers whether the road segments are adjacent to each other, ignoring the problem of different spatial correlations caused by the distance between nodes.
[0007] 2) In terms of network architecture, a spatial graph convolution module and a time series module are designed to extract the characteristics of traffic flow in the spatial and temporal dimensions, respectively. The spatial graph convolution module is used to extract the spatial feature information of traffic flow, and the time series prediction module is used to explore the temporal correlation of traffic flow.
[0008] 3) Considering the periodic factors, previous model designs trained and tested independent components on a daily, weekly basis, and finally outputted the weighted results of multiple sub-components, increasing the time and space costs.
[0009] Based on this, a multi-information fusion spatiotemporal graph convolution traffic flow prediction method is proposed. The network architecture is improved, and the feature information extracted by the spatial convolution module is correlated with the fused periodic time series. The final output can be obtained through a single-component prediction module. Summary of the Invention
[0010] The technical problem to be solved by the present invention is to provide a multi-information fusion spatiotemporal graph convolution traffic flow prediction method in response to the deficiencies of the above-mentioned prior art, so as to solve the problems raised in the above-mentioned background technology.
[0011] To solve the above technical problems, the present invention adopts a technical solution: a multi-information fusion spatiotemporal graph convolution traffic flow prediction method, comprising the following steps:
[0012] First, the graph adjacency matrix is constructed considering the distance factor, and then the fused time series is constructed considering the periodic factor. A deep spatiotemporal graph convolutional gated neural network model is designed. The input of the deep spatiotemporal graph convolutional gated neural network model includes historical traffic flow data and spatial road network adjacency relations. Through data processing, the fused time series and graph adjacency matrix are obtained, and then passed into the deep spatiotemporal graph convolutional gated neural network model for training and testing; finally, the trained model is used to predict the traffic flow and output the traffic flow.
[0013] Furthermore, considering the distance factor, a graph adjacency matrix is constructed to model traffic flow based on the graph structure, that is, to define a spatial road network G, which includes a point set and an edge set:
[0014] G=<V , E>(1)
[0015] Among them, V is a point set, and each road segment in the road network is regarded as a node;
[0016] E is an edge set, which represents the adjacency relationship between road segments. The data is stored in the form of an adjacency matrix. If two road segments are adjacent, the corresponding adjacency matrix value is set to 1, otherwise it is 0. If A and B are two adjacent road segments, the greater the distance between A and B, the smaller the degree of mutual influence. The graph adjacency matrix that integrates the distance factor is designed:
[0017]
[0018] Use α as the adjustment coefficient to define the weight ratio of the neighboring node relative to the self node, ranging from (0, 1);
[0019] Represents the maximum value of the reciprocal distance among all nodes connected to node i, through Divide it by α so that the maximum weight value of the adjacent node does not exceed α;
[0020] Set the main diagonal of the adjacency matrix to 1 to ensure that the self node has the largest weight value, and get the updated adjacency matrix And according to the number of adjacent nodes of each node, the updated adjacency matrix is obtained The degree matrix D of
[0021] By considering the distance between road sections and assigning different values to the adjacency matrix, the network model can learn weight parameters differently and finally construct the adjacency matrix by integrating the distance factor.
[0022] Furthermore, considering the periodic factors to construct the fusion time series is as follows: considering the daily and weekly periodicity of traffic flow, and combining the traffic flow in adjacent time periods, constructing the fusion time series, and constructing the fusion sequence information T history :
[0023]
[0024] T H represents the time series of adjacent periods,
[0025] h is the length of the sequence of adjacent time periods,
[0026] T D is a daily cycle sequence;
[0027] dn is the number of daily periodic sequences, indicating taking the daily periodic sequence of the previous dn;
[0028] pre is the length of the daily cycle sequence, which is consistent with the length of the time series to be predicted;
[0029] T Wis the weekly period sequence, wn is the number of weekly period sequences, which means taking the weekly period sequence of wn first, and replacing T H 、T D 、T W Fusion into historical time series T history .
[0030] Furthermore, the deep spatiotemporal graph convolutional gated neural network model is divided into two parts: a spatial graph convolution module and a time series prediction module. The spatial graph convolution module extracts the spatial features between road networks, and the extracted spatial feature information is combined with the time series related information and input into the time series prediction module for sequence prediction. The model first takes the traffic flow sequence X as the first layer input of the model, and adds the adjacency matrix A with the fusion distance factor to the GCN network for road network spatial feature extraction, and obtains the spatial feature vector G′ to analyze the spatial characteristics of traffic flow; the periodic time series T is added in the hierarchy: {x h ,x d ,x w}, and perform matrix operations with the output h of the previous hidden layer to obtain the input x of the time series prediction module t , input into the GRU network model for time series prediction, and finally obtain the final prediction output Y through the fully connected layer.
[0031] Furthermore, the spatial graph convolution module combines the adjacency matrix A with the deep neural network to analyze the spatiotemporal nature of traffic flow. For each hidden layer, combined with the adjacency matrix, there is a transfer function:
[0032] H (l+1) =f(H (l) ,A) (4)
[0033] Through the adjacency matrix A and H (l) Perform matrix multiplication and combine with the weight matrix W (l) Perform a progressive transformation on the weight multiplication line and make a nonlinear change through the activation function σ to obtain the input H of the next hidden layer (l+1) :
[0034] f(H (l) ,A)=σ(AH (l) W (l) ) (5)
[0035] The information aggregated in the node does not contain its own characteristics. Self-loops are added to the graph to consider the influence of the node itself. In the matrix transformation, matrix A is added to the identity matrix to obtain the updated adjacency matrix
[0036]
[0037] The graph convolution module obtains the features of adjacent nodes through continuous aggregation operations. When the number of adjacent nodes of a node is large, the value in the feature representation is large, which affects the convergence of the model. By adding the degree matrix D for symmetric normalization, the data explosion problem caused by the multiplication of parameters between multiple hidden layers is prevented.
[0038]
[0039] In the adjacency matrix representation, we have
[0040]
[0041] A ij is the matrix value of row i and column j, d i d j represents the degree of the matrix in row i and column j; then:
[0042]
[0043] A layer of graph convolution can obtain the spatial feature information of neighboring nodes in the graph. In order to expand the receptive field of the model, obtain the information of secondary neighboring nodes, and improve the spatial perception ability of the model, a double-layer graph convolution mechanism is adopted, namely
[0044]
[0045] Finally, let G' l+1 =f(H (l) ,A), passed into the time series prediction module.
[0046] Furthermore, the time series prediction module input includes the current input x t and the hidden state h passed down from the previous node t-1 , h t-1 Contains relevant information of the previous node, combined with x t and h t-1 , get the output y of the current hidden node t and the hidden state h passed to the next node t ; Through the last transmitted state h t-1 and the input x of the current node t To obtain the two gate states, as shown in the following equation; where r controls the reset gate and z controls the update gate.
[0047]
[0048] Through the spatial graph convolution module of the previous layer, the model can obtain the spatial feature information G in the road network, and combine the spatial feature information G with the output h of the previous hidden layer. t-1As the input of the time series prediction module, in order to make the model pay more attention to the periodic feature information, the time period series t is integrated at the same time, and multi-information fusion is used for feature extraction, which is finally input into the network unit;
[0049] Redefine the gated input in the module to achieve the purpose of multi-information fusion input, see Equations 13 and 14;
[0050] r t =σ(w gr *G t +w hr *h t-1 +w tr *t t +b r )(13)
[0051] z t =σ(w gz *G t +w hz *h t-1 +w tz *t t +b z )(14)
[0052] w is the weight parameter to be learned, b is the bias term;
[0053] The spatial feature information G t , the hidden layer information h t , periodic information t t Multiply them by the corresponding weight matrix w, add the bias term b, and perform nonlinear transformation through the activation function;
[0054] After obtaining the gate signal, the data after the gate reset must be scaled to the range of -1 to 1 through the tanh activation function, and the obtained
[0055]
[0056] Selectively memorize and forget the hidden state by updating the gating, (1-z t )*h t-1 Selective forgetting of hidden states, Selectively memorize the hidden state and finally get the unit output h t ;
[0057]
[0058] The constructed deep spatiotemporal graph convolutional recurrent neural network captures the complex spatial information in the urban road topology through the graph convolution module, combines it with the gated recurrent unit to obtain the temporal correlation of traffic flow, and finally obtains the final output sequence Y through the fully connected layer to complete the traffic flow prediction task.
[0059] Compared with the prior art, the present invention has the following advantages:
[0060] The proposed method first considers the distance between road segments and assigns different weights to the graph adjacency matrix. A spatial graph convolution module and a time series prediction module are designed during model construction. The spatial graph convolution module extracts spatial feature information and integrates it with periodic time series information before feeding it into the time series prediction module. The gating mechanism of the GRU unit is redesigned to allow for multi-feature input, ultimately yielding a predicted output. Experimental tests were conducted on a real highway traffic flow PEMS dataset. The results demonstrate that the proposed model achieves lower prediction error and superior performance than existing graph convolution-based prediction methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a traffic flow modeling diagram based on a graph structure in an embodiment of the present invention;
[0062] Figure 2 is a construction diagram of the adjacency matrix in an embodiment of the present invention;
[0063] Figure 3 is a time series diagram of a fusion cycle in an embodiment of the present invention;
[0064] Figure 4 Schematic diagram of the overall architecture of the model in the embodiment of the present invention;
[0065] Figure 5 This is a diagram of the network model architecture in an embodiment of the present invention;
[0066] Figure 6 It is a graph showing the results of different models at different time steps in the experimental example of the present invention;
[0067] Figure 7 This is an example diagram of predictions of the model on different data sets in the experimental example of the present invention. DETAILED DESCRIPTION
[0068] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0069] Examples, such as Figure 1-5 As shown, the present invention provides a technical solution: a multi-information fusion spatiotemporal graph convolution traffic flow prediction method, comprising the following steps:
[0070] First, the graph adjacency matrix is constructed considering the distance factor, and then the fused time series is constructed considering the periodic factor. A deep spatiotemporal graph convolutional gated neural network model is designed. The input of the deep spatiotemporal graph convolutional gated neural network model includes historical traffic flow data and spatial road network adjacency relations. Through data processing, the fused time series and graph adjacency matrix are obtained, and then passed into the deep spatiotemporal graph convolutional gated neural network model for training and testing; finally, the trained model is used to predict the traffic flow and output the traffic flow.
[0071] In the traditional two-dimensional space-time matrix of traffic flow, the horizontal and vertical dimensions represent a specific dimension of the time dimension and the space dimension respectively. Although the local spatial features of the data can be extracted through the convolution operation in the convolutional neural network, the convolutional neural network can only act on the standard Euclidean two-dimensional structure data. The storage method of the two-dimensional matrix determines that the adjacency relationship between road sections can only be a linear relationship, and at most can only record the positional relationship between two adjacent sections upstream and downstream of the road section. The road network structure is becoming increasingly complex. Due to the existence of road intersections and forks, there will be multiple adjacent sections to a certain section. The traditional two-dimensional matrix storage method cannot represent the complex topological relationship in the current road network. The form of the graph structure can most intuitively store the adjacency relationship between each section of the road network. Therefore, traffic flow modeling is performed based on the graph structure, such as Figure 1 As shown:
[0072] Considering the distance factor, the graph adjacency matrix is constructed to model traffic flow based on the graph structure, that is, to define the spatial road network G, which includes a point set and an edge set:
[0073] G=<V , E>(1)
[0074] Among them, V is a point set, and each road segment in the road network is regarded as a node;
[0075] E is an edge set, which represents the adjacency relationship between road segments. The data is stored in the form of an adjacency matrix. If two road segments are adjacent, the corresponding adjacency matrix value is set to 1, otherwise it is 0. If A and B are two adjacent road segments, the greater the distance between A and B, the smaller the degree of mutual influence. The graph adjacency matrix that integrates the distance factor is designed:
[0076]
[0077] Use α as the adjustment coefficient to define the weight ratio of the neighboring node relative to the self node, ranging from (0, 1);
[0078] Represents the maximum value of the reciprocal distance among all nodes connected to node i, through Divide it by α so that the maximum weight value of the adjacent node does not exceed α;
[0079] Set the main diagonal of the adjacency matrix to 1 to ensure that the self node has the largest weight value, and get the updated adjacency matrix And according to the number of adjacent nodes of each node, the updated adjacency matrix is obtained The degree matrix D of
[0080] By considering the distance between road sections and assigning different values to the adjacency matrix, the network model can differentiate the learning weight parameters. Finally, the adjacency matrix constructed by integrating the distance factor is as follows: Figure 2 As shown, α is set to 0.9 in the example.
[0081] Traffic flow has a strong periodicity, showing regular periodic changes in different time periods every day, and there are slight differences between weekdays and weekends. Considering the daily and weekly periodicity of traffic flow, and combining it with the traffic flow in adjacent time periods, a fused time series is constructed, such as Figure 3 As shown in the figure, considering the daily and weekly periodicity of traffic flow, and combining the traffic flow in adjacent time periods, a fusion time series is constructed to construct the fusion time series information T history :
[0082]
[0083] T H represents the time series of adjacent periods,
[0084] h is the length of the sequence of adjacent time periods,
[0085] T D is a daily cycle sequence;
[0086] dn is the number of daily periodic sequences, indicating taking the daily periodic sequence of the previous dn;
[0087] pre is the length of the daily cycle sequence, which is consistent with the length of the time series to be predicted;
[0088] T W is the weekly period sequence, wn is the number of weekly period sequences, which means taking the weekly period sequence of wn first, and replacing T H 、T D 、T W Fusion into historical time series T history .
[0089] The input of the designed deep spatiotemporal graph convolutional gated neural network model includes historical traffic flow data and spatial road network adjacency relations. The fused time series T is obtained by processing the relevant data.history And the graph adjacency matrix A. Then it is passed into the deep spatiotemporal graph convolutional gated neural network model for training and testing; finally, the trained model is used to predict the traffic flow, such as Figure 4 As shown in the figure, the deep spatiotemporal graph convolution gated neural network model is divided into two parts: the spatial graph convolution module and the time series prediction module. The spatial graph convolution module extracts the spatial features between the road networks, and the extracted spatial feature information is combined with the time series related information to be input into the time series prediction module for sequence prediction. The model first takes the traffic flow sequence X as the first layer input of the model, and adds the adjacency matrix A with the fusion distance factor to input it into the GCN network for road network spatial feature extraction, and obtains the spatial feature vector G′ to analyze the spatial characteristics of traffic flow; the periodic time series T is added in the hierarchy: {x h ,x d ,x w}, and perform matrix operations with the output h of the previous hidden layer to obtain the input x of the time series prediction module t , input into the GRU network model for time series prediction, and finally obtain the final prediction output Y through the fully connected layer. The network model architecture is shown in the figure below Figure 5 shown.
[0090] The complex logical relationships between road networks are preserved through irregular graph structures. The introduction of graph convolutional networks makes it possible to extract features from graph-structured data. In deep network models, the adjacency matrix A is combined with deep neural networks to analyze the spatiotemporal nature of traffic flow. For each hidden layer, combined with the adjacency matrix, the transfer function is:
[0091] H (l+1) =f(H (l) ,A)(4)
[0092] Through the adjacency matrix A and H (l) Perform matrix multiplication and combine with the weight matrix W (l) Perform a progressive transformation on the weight multiplication line and make a nonlinear change through the activation function σ to obtain the input H of the next hidden layer (l+1) :
[0093] f(H (l) ,A)=σ(AH (l) W (l) )(5)
[0094] The information aggregated in the node does not contain its own characteristics. Self-loops are added to the graph to consider the influence of the node itself. In the matrix transformation, matrix A is added to the identity matrix to obtain the updated adjacency matrix
[0095]
[0096] The graph convolution module obtains the features of adjacent nodes through continuous aggregation operations. When the number of adjacent nodes of a node is large, the value in the feature representation is large, which affects the convergence of the model. By adding the degree matrix D for symmetric normalization, the data explosion problem caused by the multiplication of parameters between multiple hidden layers is prevented.
[0097]
[0098] In the adjacency matrix representation, we have
[0099]
[0100] A ij is the matrix value of row i and column j, d i d j represents the degree of the matrix in row i and column j; then:
[0101]
[0102] A layer of graph convolution can obtain the spatial feature information of neighboring nodes in the graph. In order to expand the receptive field of the model, obtain the information of secondary neighboring nodes, and improve the spatial perception ability of the model, a double-layer graph convolution mechanism is adopted, namely
[0103]
[0104] Finally, let G' l+1 =f(H (l) ,A), passed into the time series prediction module.
[0105] The time series module is designed based on GRU, Gate Recurrent Unit, and GRU gated recurrent unit. The GRU input and output structure is similar to RNN. The input includes the current input x t and the hidden state h passed down from the previous node t-1 , h t-1 Contains information about the previous node. Combined with x t and h t-1 , GRU will get the output y of the current hidden node t and the hidden state h passed to the next node t .
[0106] GRU contains two important gating mechanisms: reset gate and update gate. t-1 and the input x of the current node t To obtain two gate states, as shown below.
[0107] Among them, r controls the reset gate and z controls the update gate.
[0108]
[0109] Through the spatial graph convolution module of the previous layer, the model can obtain the spatial feature information G in the road network. The spatial feature information G is combined with the output h of the previous hidden layer. t-1 As the input to the time series prediction module. To make the model focus more on periodic feature information, while integrating the time period sequence t, multi-information fusion is used for feature extraction, and finally input into the GRU network unit. Here, the gated input in the GRU module is redefined to achieve the purpose of multi-information fusion input, as shown in Equations 13 and 14.
[0110] r t =σ(w gr *G t +w hr *h t-1 +w tr *t t +b r ) (13)
[0111] z t =σ(w gz *G t +w hz *h t-1 +w tz *t t +b z ) (14)
[0112] w is the weight parameter to be learned, b is the bias term. t , the hidden layer information h t , periodic information t t Multiply them by the corresponding weight matrix w, add the bias term b, and perform nonlinear transformation through the activation function.
[0113] After obtaining the gate signal, the data after the gate reset must be scaled to the range of -1 to 1 through the tanh activation function, and the obtained
[0114]
[0115] Selectively remember and forget the hidden state by updating the gate. (1-z t )*h t-1 Selective forgetting of hidden states, Selectively memorize the hidden state and finally get the unit output h t .
[0116]
[0117] The constructed deep spatiotemporal graph convolutional recurrent neural network captures the complex spatial information in the urban road topology through the graph convolution module, combines it with the gated recurrent unit to obtain the temporal correlation of traffic flow, and finally obtains the final output sequence Y through the fully connected layer to complete the traffic flow prediction task.
[0118] Experimental example: The experimental environment is an Intel Core i7-9700*8 processor, 16G running memory, RTX2060 graphics card, CDUA 10.0 deep learning framework, Cudnn deep learning network acceleration library, the network is built based on the TensorFlow framework, and the programming environment is Python 3.5.
[0119] To verify the model's performance, we used a publicly available PEMS dataset from the California highway network. Each key-value pair in the dataset contains three attributes: {flow, occupy, speed}, representing traffic flow, lane occupancy, and vehicle speed, respectively. The sampling interval is 5 minutes. We captured the flow values and saved them as corresponding .csv files. To test the model's comprehensive performance on different datasets, we selected the PEMS03, PEMS04, and PEMS08 datasets for experiments. We also captured a dataset of 33 partial detectors from the PEMS03 dataset, named PEMS03-33, to verify the model's performance under small sample sizes. The training set and test set ratio for the experiment was 8:2. An overview of the dataset is shown in Table 1.
[0120] Table 1 Overview of experimental datasets
[0121]
[0122] For some missing data in the dataset, the default values are filled using the data of the adjacent sequence of default values and linear interpolation.
[0123]
[0124] Due to the large trend of traffic flow changes, the data input to the model is first z-score standardized to speed up the convergence efficiency of the model, and the final prediction results are denormalized to obtain the output.
[0125]
[0126] In the graph adjacency matrix construction, the corresponding adjacency matrix is constructed based on the detector adjacency position relationship table, as shown in Table 2. "from" and "to" record the detector numbers of the starting and ending points of a certain road segment, respectively, and "distance" represents the distance between road segments.
[0127] Table 2 Detector position adjacent position relationship table
[0128]
[0129]
[0130] Evaluation indicators and experimental parameter settings;
[0131] The evaluation indicators used are the mean absolute error (MAE) and root mean square error (RMSE), which are commonly used in regression problems. The calculation formula is shown in formula x.
[0132] The smaller the value, the smaller the error between the model prediction value and the actual value, and the higher the model prediction accuracy.
[0133]
[0134] Where n represents the length of the sequence to be predicted, represents the true value of traffic flow at time i, y i Represents the traffic flow prediction value of the model at time point i.
[0135] Hyperparameter settings. Model hyperparameters primarily include the number of GRU hidden units, the length of the input history, the number of daily and weekly sequences, the learning rate, and batchsize. Experiments investigated the impact of varying the number of GRU hidden units on model accuracy, ultimately selecting a value of 64, which achieved good performance. The effects of varying learning rates on model convergence speed and accuracy were also verified. Ultimately, a learning rate of α = 0.002 was selected, achieving rapid convergence while maintaining model accuracy. The experiments also examined the impact of the number of daily and weekly sequences, d, on model accuracy. The experiments set d and w to values within {1, 2, 3}, respectively, and ultimately found that the model error was minimized when d = 1 and w = 3. Regarding optimizer selection, the convergence curves of different optimizers, including RMSPropOptimizer, AdamOptimizer, and AdaGradOptimizer, were compared, and the AdamOptimizer, which combines RMSProp with gradient descent, was selected.
[0136] Experimental results and analysis:
[0137] Traffic flow multi-period prediction: In order to comprehensively evaluate the prediction accuracy of the model, different time steps are selected, with a 5-minute time interval, and the prediction time range is gradually increased from 5 minutes to 1 hour. The error performance of the model on the PEMS04 and PEMS08 datasets with the increase of prediction time is recorded, and the RMSE and MAE indicators are used for evaluation. The experimental results are shown in Table 3.
[0138] Table 3 Results of the model at different time steps on PEMS04 and PEMS08
[0139]
[0140]
[0141] Table 3 shows that as the prediction timeframe increases, the model's RMSE and MAE indicators gradually increase, and the model's predictive performance decreases. This is due to two reasons: first, in the temporal dimension, as the timeframe increases for the same road segment, the predicted data is less influenced by historical neighboring data, and the correlation decreases. Second, in the spatial dimension, as the timeframe increases, the data of neighboring nodes continuously changes, making spatial correlation more difficult to obtain. The combination of these two factors increases the difficulty of model training, making long-term traffic flow prediction more challenging.
[0142] Multi-model comparison experiment, the comparison experiment selected LSTM and GRU networks, which are representative of time series prediction, as benchmark models, and selected graph convolutional network models currently used in traffic flow prediction, including DCRNN, STGCN, MCSTGCN, STSGCN, and ASTGCN, to compare their prediction performance on the PEMS04 and PEMS08 datasets.
[0143] In order to comprehensively evaluate the prediction performance of the model, 12 sets of data within 5 minutes to 60 minutes were recorded for each model, with a time step of 5 minutes. The 12 sets of results were averaged to finally obtain the comprehensive prediction error result of the model.
[0144] LSTM: Long Short-Term Memory Network, proposed to solve the long-term dependency problem of RNN, introduces the concept of gate mechanism (input gate, output gate, forget gate)
[0145] GRU: Gated Recurrent Unit, an improvement on LSTM, combines the input gate and forget gate of LSTM into one update gate, which also achieves a gating mechanism. However, it has fewer parameters than LSTM and is easier to converge.
[0146] DCRNN: Diffused Convolutional Recurrent Neural Network, which establishes diffuse convolution to replace matrix multiplication in GRU network.
[0147] STGCN: Establishes a pure convolutional prediction model, designs spatial convolution layers and temporal convolution layers for feature extraction, and uses fewer parameters at a faster convergence speed than before.
[0148] MCSTGCN: Multi-component spatiotemporal graph convolutional network, which designs three independent convolutional modules for hour, day, and week to perform separate predictions. Finally, the prediction results of the three components are weighted to obtain the final output.
[0149] STSGCN: Constructs a local spatiotemporal graph, which consists of three adjacent time slices. Multiple STSGCN models are deployed in different time periods to address the heterogeneity of long-term spatiotemporal network data.
[0150] ASTGCN: Introduces the attention mechanism into the temporal convolution and spatial convolution modules, and finally obtains the final output through graph convolution operation.
[0151] Figure 6 The error curves of different models corresponding to the increase of time steps are plotted. From the figure, we can see that as the time step increases, the prediction error of the model gradually increases.
[0152] Table 4 records the comprehensive prediction performance of the eight models from 5 minutes to 60 minutes. The final error value of the model is obtained by summing up the errors of all time steps and taking the average.
[0153] Table 4 Errors of different models on PEMS04 and PEMS08 datasets
[0154]
[0155] Because they fail to consider spatial information, LSTM and GRU recurrent neural networks can only capture temporal correlations, resulting in higher errors than other graph convolutional models. The discrepancy becomes more pronounced as the prediction timeframe increases. The DCRNN and STGCN models, which simultaneously consider both spatial and temporal features, achieve significantly lower prediction errors than the LSTM and GRU models. MCSTGCN and ASTGCN, which consider periodicity, further reduce prediction errors in traffic flow forecasting by implementing independent prediction components for hourly, daily, and weekly predictions. STSGCN, through improved network architecture, proposes a spatiotemporal simultaneous modeling mechanism, demonstrating significant advantages. This model achieves optimal prediction performance by establishing separate spatial graph convolution modules and time series prediction modules, simultaneously considering distance to construct a novel adjacency matrix, and integrating periodic information sequences at the network level. The figure shows that this model has a significant advantage over short timeframes of 5 to 15 minutes, but the difference with other models decreases as the timeframe increases. Capturing spatiotemporal correlations in traffic flow over longer timeframes is more challenging, and this represents a direction for further research and improvement.
[0156] Experiment on the influence of distance factors. In order to test the influence of the improved adjacency matrix on the model accuracy, the error performance of the adjacency matrix constructed by integrating the distance factor and the traditional adjacency matrix constructed without considering the distance factor were compared on the four datasets of PEMS03, PEMS03-33, PEMS04, and PEMS08. The experimental results are shown in Table 5.
[0157] Table 5 The impact of constructing the adjacency matrix by integrating distance factors on the model prediction error
[0158]
[0159] The adjacency matrix constructed by integrating the distance factor takes into account the distance factor to construct a differentiated matrix. During model training, different weight parameters are learned to extract spatial feature information at a deeper level. As shown in Table 5, the model's prediction error is reduced on four different datasets compared to the adjacency matrix constructed without considering the distance factor. The RMSE indicator is reduced by 1.0%-2.0%, and the MAE indicator is reduced by 1.6%-3.3%.
[0160] Figure 7 Figure 2 shows the model's predictions for different datasets. The blue dashed line represents the actual traffic flow value, while the red solid line represents the model's predicted traffic flow value. It can be seen that the model's predicted traffic flow values closely match the actual values.
[0161] The prediction method of the multi-information fusion spatiotemporal graph convolution traffic flow prediction model in this application considers the distance factor of road section nodes in the construction of the graph adjacency matrix to improve the data definition format of the input model, so that the model can obtain the weight coefficients of adjacent nodes in a differentiated manner, which has a certain improvement in improving the prediction accuracy of the model. In the design of the model network architecture, a single-component network architecture model is designed, and an improved deep spatiotemporal graph convolution gated neural network model that integrates distance and periodic factors is proposed. In comparison with other graph convolution network models, the comprehensive prediction error is minimized, verifying the rationality of the network architecture of this model; it can further reduce the error of short-term traffic flow prediction within 15 minutes, making it convenient and practical.
[0162] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0163] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A multi-information fusion spatiotemporal graph convolution traffic flow prediction method, characterized by: The following steps are involved: First, the graph adjacency matrix is constructed by considering the distance factor, and then the fused time series is constructed by considering the periodic factor. The deep spatiotemporal graph convolutional gated neural network model is designed. The input of the deep spatiotemporal graph convolutional gated neural network model includes historical traffic flow data and spatial road network adjacency relationships. Through data processing, the fused time series and graph adjacency matrix are obtained, and then passed into the deep spatiotemporal graph convolutional gated neural network model for training and testing. Finally, the trained model is used to predict the traffic flow and output the traffic flow. Among them, the distance factor is considered to construct a graph adjacency matrix and traffic flow modeling is performed based on the graph structure, that is, the spatial road network G is defined, which includes a point set and an edge set: G=<V , E> (1) Among them, V is a point set, and each road segment in the road network is regarded as a node; E is an edge set, which represents the adjacency relationship between road segments. The data is stored in the form of an adjacency matrix. If two road segments are adjacent, the corresponding adjacency matrix value is set to 1, otherwise it is 0. If A and B are two adjacent road segments, the greater the distance between A and B, the smaller the degree of mutual influence. The graph adjacency matrix that integrates the distance factor is designed: Use α as the adjustment coefficient to define the weight ratio of the neighboring node relative to the self node, ranging from (0, 1); Represents the maximum value of the reciprocal distance among all nodes connected to node i, through Divide it by α so that the maximum weight value of the adjacent node does not exceed α; Set the main diagonal of the adjacency matrix to 1 to ensure that the self node has the largest weight value, and get the updated adjacency matrix And according to the number of adjacent nodes of each node, the updated adjacency matrix is obtained The degree matrix D of By considering the distance between road segments and assigning different values to the adjacency matrix, the network model can learn weight parameters differently. Finally, the adjacency matrix constructed by integrating the distance factor is constructed. Considering the periodic factors to construct the fusion time series is as follows: considering the daily and weekly periodicity of traffic flow, and combining the traffic flow in adjacent time periods, constructing the fusion time series, and constructing the fusion sequence information T history : T H represents the time series of adjacent periods, h is the length of the adjacent time period sequence, T D is a daily cycle sequence; dn is the number of daily periodic sequences, indicating taking the daily periodic sequence of the previous dn; pre is the length of the daily cycle sequence, which is consistent with the length of the time series to be predicted; T W is the weekly period sequence, wn is the number of weekly period sequences, which means taking the weekly period sequence of wn first, and replacing T H 、T D 、T W Fusion into historical time series T history ; The deep spatiotemporal graph convolution gated neural network model is divided into two parts: the spatial graph convolution module and the time series prediction module. The spatial graph convolution module extracts the spatial features between the road networks, and the extracted spatial feature information is combined with the time series related information to be input into the time series prediction module for sequence prediction. The model first takes the traffic flow sequence X as the first layer input of the model, and adds the adjacency matrix A with the fusion distance factor to the GCN network for road network spatial feature extraction, and obtains the spatial feature vector G′ to analyze the spatial characteristics of traffic flow; the periodic time series T is added in the hierarchy: {x h ,x d ,x w }, and perform matrix operations with the output h of the previous hidden layer to obtain the input x of the time series prediction module t , input into the GRU network model for time series prediction, and finally obtain the final prediction output Y through the fully connected layer.
2. The multi-information fusion spatiotemporal graph convolution traffic flow prediction method according to claim 1 is characterized in that: The spatial graph convolution module combines the adjacency matrix A with a deep neural network to analyze the spatiotemporal nature of traffic flow. For each hidden layer, combined with the adjacency matrix, there is a transfer function: H (l+1) =f(H (l) ,A) (4) Through the adjacency matrix A and H (l) Perform matrix multiplication and combine with the weight matrix W (l) Perform a progressive transformation on the weight multiplication line and make a nonlinear change through the activation function σ to obtain the input H of the next hidden layer (l+1) : f(H (l) ,A)=σ(AH (l) W (l) ) (5) The information aggregated in the node does not contain its own characteristics. Self-loops are added to the graph to consider the influence of the node itself. In the matrix transformation, matrix A is added to the identity matrix to obtain the updated adjacency matrix The graph convolution module obtains the features of adjacent nodes through continuous aggregation operations. When the number of adjacent nodes of a node is large, the value in the feature representation is large, which affects the convergence of the model. By adding the degree matrix D for symmetric normalization, the data explosion problem caused by the multiplication of parameters between multiple hidden layers is prevented. In the adjacency matrix representation, we have A ij is the matrix value of row i and column j, d i d j represents the degree of the matrix in row i and column j; then: A layer of graph convolution can obtain the spatial feature information of neighboring nodes in the graph. In order to expand the receptive field of the model, obtain the information of secondary neighboring nodes, and improve the spatial perception ability of the model, a double-layer graph convolution mechanism is adopted, namely Finally, let G′ l+1 =f(H (l) ,A), passed into the time series prediction module.
3. The multi-information fusion spatiotemporal graph convolution traffic flow prediction method according to claim 2 is characterized in that: The time series prediction module input includes the current input x t and the hidden state h passed down from the previous node t-1 , h t-1 Contains relevant information of the previous node, combined with x t and h t-1 , get the output y of the current hidden node t and the hidden state h passed to the next node t ; Through the last transmitted state h t-1 and the input x of the current node t To obtain two gate states, as shown below; where r controls the reset gate and z controls the update gate; Through the spatial graph convolution module of the previous layer, the model can obtain the spatial feature information G in the road network, and combine the spatial feature information G with the output h of the previous hidden layer. t-1 As the input of the time series prediction module, in order to make the model pay more attention to the periodic feature information, the time period series t is integrated at the same time, and multi-information fusion is used for feature extraction, which is finally input into the network unit; Redefine the gated input in the module to achieve the purpose of multi-information fusion input, see formula (13) and (14); r t =σ(w gr *G t +w hr *h t-1 +w tr *t t +b r ) (13) z t =σ(w gz *G t +w hz *h t-1 +w tz *t t +b z ) (14) w is the weight parameter to be learned, b is the bias term; The spatial feature information G t , the hidden layer information h t , periodic information t t Multiply them by the corresponding weight matrix w, add the bias term b, and perform nonlinear transformation through the activation function; After obtaining the gate signal, the data after the gate reset must be scaled to the range of -1 to 1 through the tanh activation function, and the obtained Selectively memorize and forget the hidden state by updating the gating, (1-z t )*h t-1 Selective forgetting of hidden states, Selectively memorize the hidden state and finally get the unit output h t ; The constructed deep spatiotemporal graph convolutional recurrent neural network captures the complex spatial information in the urban road topology through the graph convolution module, combines it with the gated recurrent unit to obtain the temporal correlation of traffic flow, and finally obtains the final output sequence Y through the fully connected layer to complete the traffic flow prediction task.
Citation Information
Patent Citations
Traffic prediction method of spatio-temporal diagram convolution model based on attribute enhancement
CN112216108A
Traffic prediction method based on multi-scale graph convolutional network model
CN113053115A