Traffic flow prediction method based on dynamic multi-graph convolutional network based on graph transformation
By introducing graph transformation and sparse matrix spatial attention mechanisms in traffic flow prediction, dynamic multi-map is generated, which solves the problem that existing methods cannot effectively capture the hidden spatiotemporal characteristics of traffic graphs, and achieves more accurate traffic flow prediction.
Patent Information
- Application Number
- CN202111343972.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-14
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-11-14
AI Technical Summary
The existing traffic flow prediction method based on graph convolution cannot effectively capture the hidden spatio-temporal characteristics in the traffic graph, resulting in insufficient prediction performance.
A dynamic multi-graph convolutional network traffic flow prediction method based on graph transformation is proposed. Through the combination of graph transformation and the sparse matrix spatial attention mechanism, dynamic multi-graphs are generated to better process complex traffic data.
This method can efficiently extract the inherent characteristics in traffic flow, capture hidden spatiotemporal characteristics, and significantly improve the performance of traffic flow prediction.
Smart Images

Figure CN113935548B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a dynamic multi-graph convolutional network traffic flow prediction method based on graph transformation, and belongs to the technical field of traffic flow prediction. Background Art
[0002] Traffic flow prediction plays a very important role in intelligent transportation systems. In previous studies, graph convolutional networks have been widely used in the field of traffic prediction. Since graph convolution can well represent the graph structure of the traffic network, the performance of traffic prediction is greatly improved, and dynamic graph convolution can capture the spatiotemporal characteristics of traffic flow at different times. Although good performance has been achieved in these studies, most of these traffic flow prediction methods based on graph convolution only use single graph convolution, or only use static graph convolutional networks, which cannot better capture the hidden spatiotemporal characteristics in traffic maps. Therefore, this application proposes a dynamic multi-graph convolutional network traffic flow prediction method based on graph transformation to capture hidden spatiotemporal characteristics, thereby better improving traffic flow prediction performance. Summary of the invention
[0003] The present invention combines graph transformation with a sparse matrix-based spatial attention mechanism to generate dynamic multi-graphs to better process complex traffic data; the proposed dynamic multi-graph convolutional model can efficiently extract the intrinsic characteristics of traffic flow.
[0004] The technical solution adopted by the present invention is a dynamic multi-graph convolutional network traffic flow prediction method based on graph transformation, which defines the traffic network as an undirected graph G = (V, E, A), where V∈R N represents the set of N nodes in the traffic road area, E represents the set of all edges, representing the connection between different nodes, A∈R N×N Represents the adjacency matrix of graph G. Each node of graph G has F features at the same sampling frequency.
[0005] use represents the cth eigenvalue of the ith road network node at time t, represents all the eigenvalues of the ith road network node at time t, so represents all eigenvalues of all network nodes at time t, and Represents all the eigenvalues of all the road network nodes at the past (1,2,…,τ) time. Definition is the predicted traffic flow value of the i-th road network node at time t.
[0006] Finally, the traffic prediction problem is defined mathematically as follows: Input the historical traffic data at time (1, 2, …, τ) To predict (τ+1,τ+2,…,τ+T p) time, where Represents the time from τ+1 to τ+T p The future traffic data of the i-th road network node.
[0007] The traffic prediction model based on this method mainly consists of four modules: spatial attention module based on graph transformation, dynamic multi-graph convolution module, temporal convolution module and output module.
[0008] The spatial attention module based on graph transformation consists of a spatial attention mechanism module with a sparse matrix and a graph transformation module. The spatial correlation of traffic network data is constructed through a sparse matrix containing a sparse matrix, and then different multi-graph adjacency matrices are constructed through the graph transformation module to capture the intrinsic characteristics of traffic flow.
[0009] The attention mechanism uses the Sparsemax activation function instead of the softmax function. The specific calculation formula of the spatial attention mechanism module based on the sparse matrix is as follows:
[0010]
[0011]
[0012] in, yes The linear transformation of is the input of traffic network data, conv(·) represents the two-dimensional convolution operator, and SparseMax(·) represents the SparseMax activation function.
[0013] A multi-graph prediction model is used to process complex graph structures, and the multi-graph is generated by generating multiple adjacency matrices by a graph transformation module.
[0014] According to the multiple adjacency matrices obtained above: the adjacency matrix extracted by the spatial attention module The output of the first layer graph transformation module A 1 , the output A of the second layer graph transformation module 2 , take these three adjacency matrices as the input of dynamic graph convolution, and select three features through graph convolution X 1 ,X 2 ,Connecting the feature outputs of the three graph convolutions, we can get the fusion of multiple features of traffic data. Graph convolution mainly processes the data in the frequency domain, through the adjacency matrix A 1 ,A 2 To calculate the Laplacian matrix.
[0015] In order to capture the temporal characteristics of traffic data flow, the temporal convolution module consists of two modules: temporal gated convolution and temporal attention mechanism.
[0016] The specific calculation formula of time gated convolution is as follows:
[0017]
[0018]
[0019]
[0020] Among them, Conv ts Indicates that the convolution kernel is t s The two-dimensional time convolution operator, split represents the equidistant separation operator, Tanh and sigmoid represent two activation functions respectively.
[0021] The temporal attention mechanism is used to explore the deeper temporal correlation of traffic data streams. The specific mathematical expression is as follows:
[0022]
[0023]
[0024]
[0025] in are all learnable parameters. The time correlation matrix E is determined by different inputs. i,j It represents the correlation strength between time i and time j, and finally E is normalized using the softmax function.
[0026] The output module consists of two ReLU modules and two linear modules, and the mean absolute error is used as the loss function.
[0027] Compared with the prior art, this application proposes a traffic flow prediction method based on a dynamic multi-graph convolutional network based on graph transformation, which processes complex traffic network data based on a dynamic multi-graph convolutional network based on graph transformation. It is proposed to capture the spatiotemporal characteristics of the traffic network through a spatiotemporal gated convolutional network; the spatial attention mechanism based on sparse matrices can effectively filter out interfering traffic network information; and multiple graphs are constructed through graph transformation to process traffic flow data affected by multiple factors (weather, season, traffic accidents, etc.), thereby capturing the intrinsic characteristics of traffic data and making traffic predictions more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A diagram of the spatial and temporal structure of the traffic network changing over time.
[0029] Figure 2 Figure 3. Dynamic multi-graph convolutional network traffic flow prediction model based on graph transformation.
[0030] Figure 3 Diagram of the sparse matrix-based spatial attention module.
[0031] Figure 4 Diagram of the graph transformation module.
[0032] Figure 5 Temporal gated convolution graph. DETAILED DESCRIPTION
[0033] The dynamic multi-graph convolutional network traffic flow prediction method based on graph transformation defines the traffic network as an undirected graph G = (V, E, A), such as Figure 1 As shown, where V∈R N represents the set of N nodes in the traffic road area, E represents the set of all edges, representing the connection between different nodes, A∈R N×N Represents the adjacency matrix of graph G. Each node of graph G has F features at the same sampling frequency, such as speed, flow, weather, season, traffic accidents, etc.
[0034] Traffic forecasting is to use past or current measured traffic data to predict future traffic flow or speed. Traffic forecasting can be defined as a function model that maps measured traffic network data to future traffic flow or speed. In this application, for ease of representation, we use represents the cth eigenvalue of the ith road network node at time t, represents all the eigenvalues of the ith road network node at time t, so represents all eigenvalues of all network nodes at time t, and represents all the eigenvalues of all the road network nodes at the past (1,2,…,τ) time. In addition, define is the predicted traffic flow value of the i-th road network node at time t.
[0035] Finally, the traffic prediction problem is defined mathematically as follows: Input the historical traffic data at time (1, 2, …, τ) To predict (τ+1,τ+2,…,τ+T p ) time, where Represents the time from τ+1 to τ+T p The future traffic data of the i-th road network node.
[0036] The traffic prediction model based on this method is mainly composed of four modules: spatial attention module based on graph transformation, dynamic multi-graph convolution module, temporal convolution module and output module. Figure 2 As shown:
[0037] 1. Spatial Attention Module Based on Graph Transformation
[0038] This module consists of a spatial attention mechanism module with a sparse matrix and a graph transformation module. First, the spatial correlation of traffic network data is constructed through a sparse matrix containing a sparse matrix. Then, different multi-graph adjacency matrices are constructed through the graph transformation module to capture the intrinsic characteristics of traffic flow.
[0039] (a) Spatial attention module
[0040] The spatial correlation of different road areas in the traffic network is obtained through the spatial attention mechanism. Due to the complexity of traffic data, traffic flow is usually affected by many factors, including weather, season, and traffic accidents. Therefore, the attention mechanism in this application uses the Sparsemax activation function instead of the softmax function, because the sparse matrix can effectively filter out interference information in the traffic data. And experiments have also proved that: as the traffic data becomes more complex, the use of the Sparsemax activation function will improve the performance of traffic prediction. The spatial attention mechanism module based on the sparse matrix proposed in this application is as follows Figure 3 As shown, the specific calculation formula is as follows:
[0041]
[0042]
[0043] in, yes The linear transformation of is the input of traffic network data, conv(·) represents the two-dimensional convolution operator, and SparseMax(·) represents the SparseMax activation function.
[0044] (b) Graph transformation module
[0045] Since traffic data is affected by many factors, such as weather, season, traffic accidents, etc., traffic data is much more complicated. In order to represent the complex characteristics of traffic flow in large-scale traffic systems, this application uses a multi-graph prediction model to process complex graph structures. And the multi-graph is generated by generating multiple adjacency matrices by the graph transformation module. The specific graph transformation module is as follows: Figure 4 As shown, the mathematical expression is as follows:
[0046]
[0047]
[0048] Among them, A 1 ∈R 1×N×N ,A 2 ∈R 1×N×N Multigraphs generated for graph transformations, are the trained parameters, and “×” represents matrix multiplication, that is, the sum is accumulated over the F dimension.
[0049] 2. Dynamic Multi-graph Convolution Module
[0050] According to the multiple adjacency matrices obtained above: the adjacency matrix extracted by the spatial attention module The output of the first layer graph transformation module A 1 , the output A of the second layer graph transformation module 2 , take these three adjacency matrices as the input of dynamic graph convolution, and select three features through graph convolution X 1 ,X 2 ,Then, we connect the feature outputs of the three graph convolutions to obtain the fusion of multiple features of traffic data.
[0051] Graph convolution mainly processes data in the frequency domain. We use the adjacency matrix A 1 ,A 2 To calculate the Laplacian matrix, take the adjacency matrix A 1 Take this as an example, the detailed calculation process is as follows: A 2 The calculation process is similar to A 1 Same:
[0052]
[0053] Among them I N is the identity matrix, D is the diagonal matrix of the vertices, we decompose L0, L0=UΛU T , where U is a matrix consisting of the eigenvectors of L0, Λ = diag(λ), λ is the eigenvector of the descent method of L0. The convolution operation is implemented in the spectral domain of the graph as follows:
[0054] g θ *X 1 =Ug θ (Λ)U T X 1
[0055] where θ=(θ1,θ2,…,θ N ) convolution parameters, g θ(Λ) = diah(θ)Λ is a multiplication operator calculated in the frequency domain. Multiplication in frequency is equivalent to convolution in the data domain. Therefore, g in Fourier space is θ (Λ) is the convolution operator. Finally, the frequency domain result is converted back to the data space domain through the inverse transform of U.
[0056] 3. Temporal Convolution Module
[0057] This module is mainly used to capture the temporal characteristics of traffic data flow. The temporal convolution module consists of two modules: temporal gated convolution and temporal attention mechanism. The following is a detailed introduction to these two parts:
[0058] (a). Temporal Gated Convolution
[0059] The gating mechanism is very important in recurrent neural networks and is very effective for long time series data. It can effectively control the flow of information through time convolution. The flowchart of time gated convolution is as follows: Figure 5 As shown, the specific calculation formula is as follows:
[0060]
[0061]
[0062]
[0063] Among them, Conv ts Indicates that the convolution kernel is t s The two-dimensional time convolution operator, split represents the equidistant separation operator, Tanh and sigmoid represent two activation functions respectively.
[0064] (b) Temporal Attention Mechanism
[0065] This module is used to explore the deeper temporal correlation of traffic data streams. The specific mathematical expression is as follows:
[0066]
[0067]
[0068]
[0069] in are all learnable parameters. The time correlation matrix E is determined by different inputs. i,j It represents the correlation strength between time i and time j, and finally E is normalized using the softmax function.
[0070] 4. Output module
[0071] The module consists of two Relu modules and two linear modules, such as Figure 1 As shown, we use the mean absolute error as the loss function, for example: the true value of the traffic flow is The predicted result of traffic flow is Y, then the loss function can be expressed as follows:
[0072]
[0073] The model has been greatly improved on the three databases of PeMS03, PeMS04 and PeMS08. Compared with the previous single-graph convolution model or static graph convolution model, the dynamic multi-graph convolution proposed in this application has achieved good performance. At the same time, relevant ablation experiments were also conducted. The final experiment proved that the method of dynamic multi-graph convolution network based on graph transformation proposed in this application can achieve the optimal value for traffic flow prediction.
Claims
1. A dynamic multi-graph convolutional network traffic flow prediction method based on graph transformation, characterized by: The traffic network is defined as an undirected graph G = (V, E, A), where V ∈ R N represents the set of N nodes in the traffic road area, E represents the set of all edges, representing the connection between different nodes, A∈R N×N Represents the adjacency matrix of graph G; each node of graph G has F features at the same sampling frequency; use represents the cth eigenvalue of the ith road network node at time t, represents all the eigenvalues of the ith road network node at time t, so represents all eigenvalues of all network nodes at time t, and Represents all eigenvalues of all network nodes at the past (1,2,…,τ) time; definition is the traffic forecast value of the ith road network node at time t; Finally, the traffic prediction problem is defined mathematically as follows: Input the historical traffic data at time (1, 2, …, τ) To predict (τ+1,τ+2,…,τ+T p ) time, where Y = Represents the time from τ+1 to τ+T p The future traffic data of the i-th road network node; The traffic prediction model consists of four modules: spatial attention module based on graph transformation, dynamic multi-graph convolution module, temporal convolution module and output module; The spatial attention module based on graph transformation is composed of a spatial attention mechanism module with a sparse matrix and a graph transformation module. The spatial correlation of traffic network data is constructed through a sparse matrix containing a sparse matrix. Then, different multi-graph adjacency matrices are constructed through the graph transformation module to capture the intrinsic characteristics of traffic flow. The attention mechanism uses the Sparsemax activation function instead of the softmax function. The specific calculation formula of the spatial attention mechanism module based on the sparse matrix is as follows: in, yes The linear transformation of is the input of traffic network data, conv(·) represents the two-dimensional convolution operator, and SparseMax(·) represents the SparseMax activation function; A multi-graph prediction model is used to process complex graph structures, and the multi-graph is generated by generating multiple adjacency matrices by the graph transformation module; According to the multiple adjacency matrices obtained above: the adjacency matrix extracted by the spatial attention module The output of the first layer graph transformation module A 1 , the output A of the second layer graph transformation module 2 , use these three adjacency matrices as the input of dynamic graph convolution, and select three features through graph convolution By connecting the feature outputs of the three graph convolutions, we can get the fusion of multiple features of traffic data; graph convolution processes the data in the frequency domain and uses the adjacency matrix To calculate the Laplacian matrix; In order to capture the temporal characteristics of traffic data flow, the temporal convolution module consists of two modules: temporal gated convolution and temporal attention mechanism; The specific calculation formula of time gated convolution is as follows: Among them, Conv ts Indicates that the convolution kernel is t s The two-dimensional time convolution operator, split represents the equidistant separation operator, Tanh and sigmoid represent two activation functions respectively; The temporal attention mechanism is used to explore the deeper temporal correlation of traffic data streams. The specific mathematical expression is as follows: in are all learnable parameters. The time correlation matrix E is determined by different inputs. i,j Indicates the strength of the correlation between time i and time j, and finally normalizes E using the softmax function; The output module consists of two ReLU modules and two linear modules, and the mean absolute error is used as the loss function.
Citation Information
Patent Citations
Traffic prediction method based on adaptive spatial self-attention map convolution
CN112801404A
Road condition assessment method of short-term traffic prediction map convolutional network
CN113313947A