Traffic flow prediction method of space-time attention adaptive graph diffusion convolutional network
By combining the adaptive graph structure and the diffusion convolutional network with spatiotemporal attention, the problem of difficulty in capturing long-term dependencies in existing methods is solved, and traffic flow prediction with high accuracy and strong robustness is achieved.
Patent Information
- Application Number
- CN202511052920.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-09-26
AI Technical Summary
Existing traffic flow prediction methods have difficulty in effectively capturing long-term dependencies, their training speed is limited by internal loop operations, they suffer from time-consuming iterative propagation, weak generalization capabilities, and gradient explosion/vanishing, resulting in insufficient accuracy and robustness in traffic flow prediction.
The spatiotemporal attention adaptive graph diffusion convolutional network is adopted. By combining the adaptive graph structure module and the adaptive graph diffusion convolutional network with a bidirectional gated recurrent unit, the spatiotemporal correlation of spatiotemporal feature traffic data is mined and a time process embedding module is constructed to improve prediction accuracy and robustness.
It improves the accuracy and robustness of traffic flow prediction, effectively solves the complexity of traffic flow spatiotemporal correlation modeling, and enhances the generalization ability and training speed of the model.
Smart Images

Figure CN120708407A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent transportation, and in particular to a traffic flow prediction method based on a spatiotemporal attention adaptive graph diffusion convolutional network. Background Art
[0002] Traffic flow forecasting is an important component of building an intelligent transportation system. It aims to estimate the traffic flow on roads, highways, urban streets, and even public transportation facilities within a certain period of time in the future by analyzing historical traffic data, real-time road conditions, and potential influencing factors. The technical background stems from the accelerated urbanization process and the increasing demand for transportation. Traditional traffic management methods can no longer meet the needs of efficient, safe, and green modern transportation. In practical applications, traffic flow forecasting is of great significance for alleviating urban traffic congestion, optimizing traffic resource allocation, and improving the public travel experience. It can provide decision-making support for traffic management departments (such as dynamically adjusting signal control strategies and formulating traffic diversion plans). With the rapid development of technologies such as big data, artificial intelligence, the Internet of Things, 5G communications, and cloud computing, traffic flow forecasting technology is moving towards higher accuracy, faster response, and wider coverage, laying a solid foundation for building an intelligent transportation system and promoting the sustainable development of smart cities.
[0003] In recent years, traffic flow prediction based on deep learning and machine learning has made significant progress. In deep learning, recurrent neural networks (RNNs) and their variants, such as long short-term memory (LSTM) and gated recurrent units (GRU), have been widely used in traffic flow prediction due to their powerful ability to process time series data. By introducing a gating mechanism, they address the shortcomings of traditional RNNs in long-term dependencies and can more accurately capture the temporal characteristics of traffic flow. Convolutional neural networks (CNNs) have also been widely applied to traffic flow prediction, extracting spatial features from traffic data and combining multi-feature fusion techniques to achieve accurate predictions. In recent years, the Transformer architecture, with its advantages in capturing long-range spatiotemporal correlations through its self-attention mechanism, has become a research hotspot in traffic flow prediction. In machine learning, support vector machines (SVMs) have been applied to traffic flow prediction due to their powerful nonlinear modeling capabilities. They accurately classify and predict traffic flow data by finding the optimal separating hyperplane in high-dimensional space. Furthermore, random forests, as an ensemble learning method, construct multiple decision trees and combine their results to improve prediction stability and accuracy. In addition, algorithms such as decision trees also play an important role in traffic flow prediction, building tree structures to classify and predict traffic flow data. GMAN (AGraph Multi-Attention Network for Traffic Prediction) uses a decoder-encoder architecture to construct multiple spatiotemporal modules. ASTGCN (Attention Based Spatial-Temporal Graph Convolutional Networks) employs a novel attention mechanism to capture temporal dependencies and dynamic graph convolution to capture spatial heterogeneity. Because the spatial structure of road networks is dynamic rather than static, most predefined graph structures fail to fully capture spatial relationships. STFGNN (Spatial-Temporal Fusion Graph Neural Networks) uses a dynamic time warp (DTW) algorithm to capture the underlying correlations between nodes, fuses multiple different spatiotemporal graphs, and jointly learns hidden spatiotemporal dependencies with a temporal convolutional module. However, existing methods still struggle to effectively capture complex spatiotemporal correlations. Although existing methods based on spatiotemporal graph neural networks have been widely used in traffic flow prediction, they still have limitations.
[0004] In traffic flow prediction, most of the existing methods mentioned above model spatial correlation in a static manner, which limits the ability to learn dynamic spatiotemporal patterns in cities. At the same time, the spatial correlation between spatial locations in spatiotemporal data changes over time, but static models cannot effectively capture this dynamic nature. Many existing methods focus mainly on short-range spatial information and have difficulty capturing long-range spatial correlation. However, in actual traffic systems, two locations that are far apart may exhibit similar spatiotemporal patterns due to functional division, which means that long-range spatial dependencies are equally important. In most RNN-based traffic flow prediction methods, the limited receptive field of the convolution kernel makes it difficult to capture long-term dependencies, and the training speed is limited by the internal loop operations. Therefore, when capturing random sequences, there may be problems such as time-consuming iterative propagation, weak generalization ability, and gradient explosion / vanishing.
[0005] In summary, existing methods still have problems such as difficulty in capturing long-term dependencies, training speed being limited by internal loop operations, and time-consuming iterative propagation, weak generalization ability, and gradient explosion / vanishing when capturing random sequences. Summary of the Invention
[0006] In response to the problems existing in the prior art, the present invention provides a traffic flow prediction method based on a spatiotemporal attention adaptive graph diffusion convolutional network, which solves the technical problems in the prior art, such as the difficulty in capturing long-term dependencies, the limitation of training speed by internal loop operations, the time-consuming iterative propagation when capturing random sequences, weak generalization ability, and gradient explosion / vanishing, so as to develop a traffic flow prediction method with high accuracy and strong robustness.
[0007] The present invention provides a traffic flow prediction method based on a spatiotemporal attention adaptive graph diffusion convolutional network, comprising:
[0008] S1. Obtaining traffic input data, interpolating the traffic input data using linear interpolation, normalizing the traffic input data, and dividing the traffic input data using periodic segmentation to obtain spatiotemporal characteristic traffic data;
[0009] S2. Processing the spatiotemporal characteristic traffic data using a spatiotemporal attention mechanism, constructing an adaptive graph structure module, an adaptive graph diffusion convolutional network, and a bidirectional gated recurrent unit, respectively, and combining the adaptive graph structure module with the adaptive graph diffusion convolutional network to mine the spatiotemporal correlation of the spatiotemporal characteristic traffic data;
[0010] S3. Construct a time process embedding module, combine the time process embedding module with a bidirectional gated recurrent unit and an adaptive graph diffusion convolutional network, and output a prediction result.
[0011] Optionally, the interpolating the traffic input data using linear interpolation and then normalizing the traffic input data includes:
[0012] y′=y-mean(y),
[0013]
[0014] Among them, (x0, y0) and (x1, y1) are two known points, x is the point to be interpolated, and y is the interpolation result.
[0015] Optionally, the spatiotemporal attention mechanism is used to process the spatiotemporal characteristic traffic data, and an adaptive graph structure module, an adaptive graph diffusion convolutional network, and a bidirectional gated recurrent unit are respectively constructed, and the adaptive graph structure module is combined with the adaptive graph diffusion convolutional network to mine the spatiotemporal correlation in the spatiotemporal characteristic traffic data, including:
[0016] S201: Input the spatiotemporal feature traffic flow data into a spatiotemporal extraction module, and use a spatiotemporal attention mechanism to obtain corresponding dimensional features;
[0017] S202, constructing an adaptive graph structure module and defining an adaptive adjacency matrix;
[0018] S203, using the spatiotemporal extraction module to extract dynamic topological structure features of the adaptive graph structure module, and combining the spatial attention mechanism to adaptively learn the importance weight of prediction time under different input conditions;
[0019] S204: Construct a bidirectional gated recurrent unit to perceive the temporal correlation of the input data.
[0020] Optionally, the spatiotemporal feature traffic flow data is input into a spatiotemporal extraction module, and a spatiotemporal attention mechanism is used to obtain corresponding dimensional features, including:
[0021] The spatiotemporal attention mechanism takes the input vector Linear projection into subspace: query vector Key-value vector Value vector in and It is a learning parameter. The attention weight is calculated by the query vector and the key-value vector, and then applied to the value vector to obtain the output vector. Its calculation formula is:
[0022]
[0023] Among them, M is the number of heads in the multi-head self-attention mechanism.
[0024] The multi-head self-attention mechanism is used to calculate the attention of each node i. The calculation formula of the attention mechanism is expressed as:
[0025] S att =U s ·σ((X (l-1) ) T P1)P2(P3X (l-1) ) T +b s ),
[0026] Among them, S att represents the attention score matrix, U s ,b s ∈R N×N 、 and is a dynamic learning parameter, σ represents the activation function, F l-1 It represents the number of attributes of the output data of the l-1 layer, and the coefficient matrix S i,j The element S in att is the influence degree of node i and node j in the road network, and the standardized weight coefficient formula is:
[0027]
[0028] Among them, S′ i,j Represents the influence weight of node i on target node j in the road network.
[0029] Optionally, the step of constructing an adaptive graph structure module and defining an adaptive adjacency matrix includes:
[0030] The adaptive adjacency matrix is expressed as:
[0031]
[0032] Among them, E1 represents the starting node embedding, E2 represents the connection embedding, and E3 represents the target node embedding.
[0033] Optionally, the utilizing of the spatiotemporal extraction module to extract dynamic topological structure features of the adaptive graph structure module and combining the spatial attention mechanism to adaptively learn the importance weights of prediction time under different input conditions includes:
[0034] The adaptive graph diffusion convolutional network is defined as:
[0035]
[0036] in, Represents the adaptive adjacency matrix, X∈R N×D, D is the number of input features of the adaptive graph diffusion convolutional network, Z∈R N×M , M is the number of output features of the adaptive graph diffusion convolutional network, W∈R D×M A learning parameter matrix representing the adaptive graph diffusion convolutional network;
[0037] Determine whether the adaptive adjacency matrix is an undirected graph. If so, P = A / rowsum(A). Otherwise, it is a directed graph. Further determine whether it is forward diffusion. If so, the diffusion transfer matrix is P. f =A / rowsum(A), otherwise the backward diffusion transfer matrix is P b =A T / rowsum(A T ), and further define the adaptive graph diffusion convolutional network as:
[0038]
[0039] At the same time, combined with the road network graph structure in the adaptive graph structure module, the adaptive graph diffusion convolution network is defined again as:
[0040]
[0041] The spatiotemporal extraction module is used to extract the dynamic topological structure features of the adaptive graph structure module, and the spatial attention mechanism is combined to adaptively learn the importance weight of predicting time under different input conditions, including:
[0042] The attention coefficient matrix in the spatiotemporal extraction module is expressed as:
[0043] T att =U t ·σ((X (l-1) ) T V1)V2(V3X (l-1) ) T +b t .
[0044] Optionally, constructing a bidirectional gated recurrent unit to sense the temporal correlation of input data includes:
[0045] Z t =σ(W z ·[h t-1 ,x t ]),
[0046] r t =σ(W r ·[h t-1 ,x t ]),
[0047]
[0048] Among them, Z t represents the update gate, r t Represents the reset gate, is the state of the memory gate neuron, h t is the state of the neuron at time step t, and They represent the forward and backward states of the neuron at the current time step t, respectively, and H t is the state of the hidden layer at time step t.
[0049] Optionally, constructing a time process embedding module, combining the time process embedding module with the bidirectional gated recurrent unit and the adaptive graph diffusion convolutional network, and outputting a prediction result, includes:
[0050] The specific model of the time process embedding module combined with the bidirectional gated recurrent unit and the adaptive graph diffusion convolutional network is expressed as:
[0051]
[0052] Among them, ψ represents the Bi-GRU operation, φ is the learning parameter of the time process convolution kernel, * represents the standard convolution operation, and f represents the diffusion convolution aggregation.
[0053] Compared with the prior art, the present invention:
[0054] A spatiotemporal attention mechanism was constructed to adaptively calculate the influence weight coefficient of each road node on the current node, an adaptive diffuse convolutional network was used to aggregate complex spatial relationships, and the Bi-GRU algorithm was integrated to weightedly fuse the weights of the recent, daily, and weekly periods, thereby improving the accuracy and robustness of traffic flow prediction and effectively solving the complex and difficult technical problems of modeling the spatiotemporal correlation of traffic flow. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0057] Figure 1 Schematic diagram of the process of the present invention;
[0058] Figure 2A traffic flow prediction framework for an attention-based spatiotemporal adaptive graph diffusion convolutional network in one embodiment of the present invention;
[0059] Figure 3 A schematic diagram of data feature processing and division in one embodiment of the present invention;
[0060] Figure 4 Schematic diagram of the principle of a multi-head self-attention mechanism in one embodiment of the present invention;
[0061] Figure 5 Schematic diagram of the principle of a bidirectional gated recurrent unit in one embodiment of the present invention;
[0062] Figure 6 The figure is a schematic diagram of the principle of the adaptive graph construction module in one embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in this application, all other implementation cases obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. The functional units with the same labels in the examples of the present invention have the same or similar structures and functions.
[0064] See also Figure 1 The present invention provides a traffic flow prediction method based on a spatiotemporal attention adaptive graph diffusion convolutional network, comprising:
[0065] S1. Obtaining traffic input data, interpolating the traffic input data using linear interpolation, normalizing the traffic input data, and dividing the traffic input data using periodic segmentation to obtain spatiotemporal characteristic traffic data;
[0066] S2. Processing the spatiotemporal characteristic traffic data using a spatiotemporal attention mechanism, constructing an adaptive graph structure module and an adaptive graph diffusion convolutional network, respectively, and combining the adaptive graph structure module with the adaptive graph diffusion convolutional network to mine the spatiotemporal correlation in the spatiotemporal characteristic traffic data;
[0067] S3. Construct a bidirectional gated recurrent unit and a time process embedding module, combine the time process embedding module with the bidirectional gated recurrent unit and the adaptive graph diffusion convolutional network, and output the prediction result.
[0068] See also Figure 1 and Figure 3In this embodiment, S1, traffic input data is obtained, the traffic input data is interpolated by linear interpolation, the traffic input data is normalized, and the traffic input data is divided by periodic segmentation to obtain spatiotemporal characteristic traffic data.
[0069] The method of interpolating the traffic input data using linear interpolation and then normalizing the traffic input data includes:
[0070] y′=y-mean(y),
[0071]
[0072] Where (x0, y0) and (x1, y1) are two known points, x is the point to be interpolated, and y is the interpolation result.
[0073] The traffic input data is divided into periodic segments to obtain spatiotemporal characteristic traffic data, specifically:
[0074] (1) Recent cycle correlation
[0075] The recent cycle correlation describes the impact of the trend of the previous time step on the changes in traffic data in the current time period.
[0076]
[0077] Among them, T h =K h *T p is the time range of the most recent period component, indicating the forecast target T p K is the time step past the current time step h Historical traffic flow data for a time window.
[0078] (2) Daily cycle correlation
[0079]
[0080] Daily correlation indicates that the forecast depends on traffic data from the previous day at the same time. For example, traffic volume peaks during the morning rush hour and drops to its lowest point during the evening trough. Daily correlation refers to the similarity between traffic patterns in the forecast and historical data at the same time.
[0081] Among them, T d =K d *T p The data range of the daily cycle data segment represents the K in the same period as the prediction window d days of historical traffic data.
[0082] (3) Weekly correlation
[0083] Weekly correlation means that the data in the forecast period has similar periodic characteristics to the data in the time window of the previous few weeks.
[0084] Generally speaking, data for the same period over consecutive weeks show repeating patterns.
[0085]
[0086] Among them, T w =K w *T p It is the time range of weekly periodic data segmentation, indicating K in the same period as the forecast window w Weekly historical traffic flow data.
[0087] S2. Use the spatiotemporal attention mechanism to process the spatiotemporal characteristic traffic data, construct an adaptive graph structure module and an adaptive graph diffusion convolutional network respectively, and combine the adaptive graph structure module with the adaptive graph diffusion convolutional network to mine the spatiotemporal correlation in the spatiotemporal characteristic traffic data.
[0088] S201: Input the spatiotemporal feature traffic flow data into a spatiotemporal extraction module, and use a spatiotemporal attention mechanism to obtain corresponding dimensional features;
[0089] See also Figure 4 The spatiotemporal attention mechanism adopts a multi-head attention mechanism to input vector Linear projection into subspace: query vector Key-value vector Value vector in and It is a learning parameter. The attention weight is calculated by the query vector and the key-value vector, and then applied to the value vector to obtain the output vector. Its calculation formula is:
[0090]
[0091] Among them, M is the number of heads in the multi-head self-attention mechanism.
[0092] Traditional convolution relies solely on conventional convolution kernels to extract graph structural features, making it challenging to detect spatial dependencies across time. Furthermore, it fails to capture the changing nature of the impact of spatial structure on traffic flow. Therefore, an attention mechanism is employed to describe the dynamic nature of spatial dependencies between adjacent nodes. Furthermore, an attention coefficient matrix is used to weight the influence of each node, enabling the network to identify the most influential spatial features and fully utilize hidden spatial features. In this case study, we improved the form of the attention mechanism.
[0093] Calculate the attention output of each node i, expressed as:
[0094] S att =U s ·σ((X (l-1) ) T P1)P2(P3X (l-1) ) T +b s ),
[0095] Among them, S att represents the attention score matrix, U s ,b s ∈R N×N 、 and is a dynamic learning parameter, σ represents the activation function, F l-1 It represents the number of attributes in the output data of the l-1 layer, and the coefficient matrix S i,j The element S in att is the influence degree of node i and node j in the road network, and the standardized weight coefficient formula is:
[0096]
[0097] Among them, S′ i,j Represents the influence weight of node i on target node j in the road network.
[0098] The calculated attention coefficient matrix is normalized using the softmax function to output the weighted attention coefficient. Before being fed into the graph diffusion convolutional network layer, the spatiotemporal attention coefficient matrix is integrated with the original traffic flow sequence to effectively update the correlation between nodes in different spatiotemporal features.
[0099] S202, constructing an adaptive graph structure module and defining an adaptive adjacency matrix;
[0100] Constructing an adaptive graph structure module. This adaptive graph modeling method does not require prior knowledge, but dynamically describes the implicit spatial relationships in the data through gradient descent. This matrix construction is derived from matrix decomposition and can learn the spatial similarity of each node through gradient descent. Therefore, the model can adaptively discover hidden spatial dependencies. By initializing the three node embeddings of the learnable parameters, namely E1∈R N×C ,E2∈R C×C ,E3∈R N×C , to achieve the modeling of spatial correlation of transportation network.
[0101] See also Figure 6The method of using adaptive graph modeling to model the dynamic characteristics of the interaction between regions, thereby obtaining a dynamic adjacency matrix, includes: using adaptive graph modeling to characterize the dynamic topological structure of the road network, and the adaptive graph modeling uses iteratively generated data and historical information to obtain a dynamic adjacency matrix, the formula is:
[0102]
[0103] Among them, E1 represents the starting node embedding, E2 represents the connection embedding, and E3 represents the target node embedding.
[0104] By multiplying E1, E2, and E3, we obtain the spatial feature correlation between the starting and target nodes. During training, we use a function to remove weakly influential connection values. The resulting matrix is normalized using a function. Therefore, the processed adaptive learning matrix can be viewed as the adjacency matrix of the implicit aggregation process.
[0105] S203, using the spatiotemporal extraction module to extract dynamic topological structure features of the adaptive graph structure module, and adaptively learning the importance weight of prediction time under different input conditions in combination with the spatial attention mechanism;
[0106] See also Figure 2 , using DCN to perform graph convolution aggregation operations, extract the spatial correlation of the road network graph, and input the graph structure into DCN for aggregation. The generated graph uses diffuse graph convolution to simulate spatial features. The input of the diffuse graph convolution operation is: F l-1 is the feature number of the node. Considering the spatial structure information of the node, diffusion graph convolution is the basic operation of aggregating node information.
[0107] From a spatial perspective, node information is smoothed by aggregating and extracting node neighborhood information. Represents the adjacency matrix obtained by the adaptive graph structure module. X∈R N×D , D is the number of input features, Z∈R N×M , M is the number of output features. W∈R D×M Represents the learning parameter matrix of the network. The formula form is generalized using the diffusion convolution layer, and the formula expression of the diffusion convolution layer is defined as:
[0108]
[0109] Among them, P k represents the power of the transfer matrix, and k is the hyperparameter of the map diffusion convolution order.
[0110] When the traffic network (the traffic network refers to the road network graph inherent in the spatiotemporal traffic data) is modeled as an undirected graph, P = A / rowsum(A). When the traffic network is modeled as a directed graph, the process has two diffusion modes, namely forward diffusion and backward diffusion, where the forward diffusion transfer matrix is P f =A / rowsum(A), the backward diffusion transfer matrix is P b =A T / rowsum(A T ). For the forward and backward transfer matrices, the diffusion graph convolution layer is defined as:
[0111]
[0112] Combined with the road network graph structure in the adaptive graph structure module, the following graph diffusion convolution expression is defined. The dynamic dependency relationship of nodes is represented by the self-learning graph modeling module, and the diffusion convolution is used to further aggregate the spatial dependency relationship of the road network structure.
[0113]
[0114] It should be noted that the diffusion graph convolution network is a method based on extracting spatial correlation, and then the obtained node feature matrix is fed back to the diffusion convolution module for updating. Therefore, the diffusion graph convolution process is used to aggregate node feature information from different neighborhood orders.
[0115] Specifically, the dynamic topological relationships within the traffic flow network structure are characterized using an adaptive graph structure module. This module uses iteratively generated data to generate a dynamic adjacency matrix. At each time step, the generated dynamic graph is combined with a graph diffusion convolutional network to learn the spatial characteristics of the network structure. Node embeddings with randomly initialized trainable parameters are used, and the dynamic correlation between each pair of nodes is captured through self-multiplication. This generates a dynamic adjacency matrix to represent the correlation between network nodes.
[0116] S204: Construct a bidirectional gated recurrent unit to perceive the temporal correlation of the input data.
[0117] See also Figure 5 , constructing a bidirectional gated recurrent unit process convolutional network. Taking into account the learning of traffic flow temporal characteristics, a bidirectional long short-term memory unit is also used to model long-term temporal relationships in the data. The Bi-GRU's inherent gating mechanism and memory capacity can fully extract effective features in the time dimension to improve traffic flow prediction accuracy. By combining two independent GRU networks, one for forward processing of sequence data and the other for reverse processing of sequence data, the Bi-GRU can simultaneously capture both forward and backward information in the sequence. Therefore, it effectively improves traffic flow prediction performance.
[0118] Z t =σ(W z ·[h t-1 ,x t ]),
[0119] r t =σ(W r ·[h t-1 ,x t ]),
[0120]
[0121] Among them, Z t represents the update gate, r t Represents the reset gate, is the state of the memory gate neuron, h t is the state of the neuron at time step t, and They represent the forward and backward states of the neuron at the current time step t, respectively, and H t is the state of the hidden layer at time step t.
[0122] In order to explore the potential temporal correlation, a bidirectional gated recurrent unit process convolutional network is constructed, which can perceive the forward and backward temporal correlation of the input data, enabling the model to capture dynamic temporal correlation more accurately.
[0123] S3. Construct a time process embedding module, combine the time process embedding module with the bidirectional gated recurrent unit and the adaptive graph diffusion convolutional network, and output a prediction result.
[0124] The constructed time-location awareness module incorporates time-location information into the spatiotemporal relationship and adaptively learns the hidden features of a single node, thereby effectively understanding the spatiotemporal variation characteristics and obtaining the corresponding time-location embedding. At the same time, the time-location embedding is integrated with the mapping function to obtain traffic flow prediction results with high prediction accuracy. Spatial features affect traffic prediction and usually have complex temporal pattern similarities. By utilizing the diffusion graph convolution operation to capture the neighborhood spatial attributes of multi-order road network nodes, and based on Bi-GRU and convolution operations to mine the correlation in the time dimension. The specific model is described as follows:
[0125]
[0126] Among them, ψ represents the Bi-GRU operation, φ is the learning parameter of the time process convolution kernel, * represents the standard convolution operation, and f represents the diffusion convolution aggregation.
[0127] At the same time, we analyze traffic sequences with three periodic segments: near-periodicity, daily periodicity, and weekly periodicity. By combining the three different periodic attributes, the model can adaptively assign weights to the three periodic segments to improve prediction accuracy. The specific formula is as follows:
[0128]
[0129] Among them, W h 、W d and W w It is a dynamic learning parameter that characterizes the influence of the three period segments on the prediction node.
[0130] It should be noted that, in this document, relational terms such as "first" and "second" 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. At the same time, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.
[0131] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A traffic flow prediction method based on spatiotemporal attention adaptive graph diffusion convolutional network, characterized by: include: S1. Obtaining traffic input data, interpolating the traffic input data using linear interpolation, normalizing the traffic input data, and dividing the traffic input data using periodic segmentation to obtain spatiotemporal characteristic traffic data; S2. Processing the spatiotemporal characteristic traffic data using a spatiotemporal attention mechanism, and constructing an adaptive graph structure module, an adaptive graph diffusion convolutional network, and a bidirectional gated recurrent unit, respectively. The adaptive graph structure module and the adaptive graph diffusion convolutional network are combined to mine the spatiotemporal correlation in the spatiotemporal characteristic traffic data; S3. Construct a time process embedding module, combine the time process embedding module with the bidirectional gated recurrent unit and the adaptive graph diffusion convolutional network, and output a prediction result.
2. The traffic flow prediction method using spatiotemporal attention adaptive graph diffusion convolutional network according to claim 1 is characterized in that: The interpolating the traffic input data using linear interpolation and then normalizing the traffic input data includes: y′=y-mean(y), Among them, (x0, y0) and (x1, y1) are two known points, x is the point to be interpolated, and y is the interpolation result.
3. The traffic flow prediction method using spatiotemporal attention adaptive graph diffusion convolutional network according to claim 2 is characterized in that: The spatiotemporal attention mechanism is used to process the spatiotemporal characteristic traffic data, and an adaptive graph structure module, an adaptive graph diffusion convolutional network, and a bidirectional gated recurrent unit are respectively constructed. The adaptive graph structure module and the adaptive graph diffusion convolutional network are combined to mine the spatiotemporal correlation in the spatiotemporal characteristic traffic data, including: S201: Input the spatiotemporal feature traffic flow data into a spatiotemporal extraction module, and use a spatiotemporal attention mechanism to obtain corresponding dimensional features; S202, constructing an adaptive graph structure module and defining an adaptive adjacency matrix; S203, using the spatiotemporal extraction module to extract dynamic topological structure features of the adaptive graph structure module, and combining the spatial attention mechanism to adaptively learn the importance weight of prediction time under different input conditions; S204: Construct a bidirectional gated recurrent unit to perceive the temporal correlation of the input data.
4. The traffic flow prediction method using a spatiotemporal attention adaptive graph diffusion convolutional network as claimed in claim 3 is characterized in that: The spatiotemporal feature traffic flow data is input into the spatiotemporal extraction module, and the spatiotemporal attention mechanism is used to obtain the corresponding dimensional features, including: The spatiotemporal attention mechanism takes the input vector Linear projection into subspace: query vector Key-value vector Value vector in and It is a learning parameter. The attention weight is calculated by the query vector and the key-value vector, and then applied to the value vector to obtain the output vector. Its calculation formula is: Where M is the number of heads in the multi-head self-attention mechanism; The multi-head self-attention mechanism is used to calculate the attention of each node i. The calculation formula of the attention mechanism is expressed as: S att =U s ·σ((X (l-1) ) T P1)P2(P3X (l-1) ) T +b s ), Among them, S att represents the attention score matrix, U s ,b s ∈R N×N 、 and is a dynamic learning parameter, σ represents the activation function, F l-1 It represents the number of features of the output data of the l-1 layer, and the coefficient matrix S i,j The element S in att is the influence degree of node i and node j in the road network, and the standardized weight coefficient formula is: Among them, S′ i,j Represents the influence weight of node i on target node j in the road network.
5. The traffic flow prediction method using spatiotemporal attention adaptive graph diffusion convolutional network according to claim 4 is characterized in that: The construction of the adaptive graph structure module and the definition of the adaptive adjacency matrix include: The adaptive adjacency matrix is expressed as: Among them, E1 represents the starting node embedding, E2 represents the connection embedding, and E3 represents the target node embedding.
6. The traffic flow prediction method using spatiotemporal attention adaptive graph diffusion convolutional network according to claim 5 is characterized in that: The method utilizes the spatiotemporal extraction module to extract the dynamic topological structure features of the adaptive graph structure module, and combines the spatial attention mechanism to adaptively learn the importance weight of predicting time under different input conditions, including: The adaptive graph diffusion convolutional network is defined as: in, Represents the adaptive adjacency matrix, X∈R N×D , D is the number of input features of the adaptive graph diffusion convolutional network, Z∈R N×M , M is the number of output features of the adaptive graph diffusion convolutional network, W∈R D×M A learning parameter matrix representing the adaptive graph diffusion convolutional network; Determine whether the adaptive adjacency matrix is an undirected graph. If so, P = A / rowsum(A). Otherwise, it is a directed graph. Further determine whether it is forward diffusion. If so, the diffusion transfer matrix is P. f =A / rowsum(A), otherwise the backward diffusion transfer matrix is P b =A T / rowsum(A T ), and further define the adaptive graph diffusion convolutional network as: At the same time, combined with the road network graph structure in the adaptive graph structure module, the adaptive graph diffusion convolution network is defined again as:
7. The traffic flow prediction method using a spatiotemporal attention adaptive graph diffusion convolutional network as claimed in claim 6 is characterized in that: The bidirectional gated recurrent unit is constructed to perceive the temporal correlation of input data, including: Z t =σ(W z ·[h t-1 ,x t ]), r t =σ(W r ·[h t-1 ,x t ]), Among them, Z t represents the update gate, r t Represents the reset gate, is the state of the memory gate neuron, h t is the state of the neuron at time step t, and They represent the forward and backward states of the neuron at the current time step t, respectively, and H t is the state of the hidden layer at time step t.
8. The traffic flow prediction method using spatiotemporal attention adaptive graph diffusion convolutional network according to claim 7 is characterized in that: The constructing of the time process embedding module, combining the time process embedding module with the bidirectional gated recurrent unit and the adaptive graph diffusion convolutional network, and outputting the prediction result includes: The specific model of the time process embedding module combined with the bidirectional gated recurrent unit and the adaptive graph diffusion convolutional network is expressed as: Among them, ψ represents the Bi-GRU operation, φ is the learning parameter of the time process convolution kernel, * represents the standard convolution operation, and f represents the diffusion convolution aggregation.
Citation Information
Cited By
Traffic flow prediction method based on hierarchical space-time correlation
CN121838470A
Traffic flow prediction method based on dynamic random self-attention network
CN122201005A