Traffic flow prediction method and system for dynamic association information fusion space-time network
By combining the temporal attention mechanism with the spatiotemporal dynamic module, and utilizing gated attention units and spectral domain graph convolution technology, the problem of insufficient spatiotemporal feature mining in traffic flow prediction is solved, achieving higher prediction accuracy and adaptability.
Patent Information
- Application Number
- CN202511055218.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-10-10
AI Technical Summary
Existing traffic flow prediction methods have shortcomings in long-term data mining, dynamic spatial structure capture, and road network feature information fusion, resulting in poor prediction adaptability and low accuracy.
The temporal attention mechanism is used to adjust the correlation strength of time points. The spatiotemporal dynamic module, gated attention unit and spectral domain graph convolution technology are combined to construct a dynamic feature matrix to capture the spatiotemporal characteristics and node characteristics of the transportation network.
It improves the accuracy and robustness of traffic flow prediction, can better capture long-term dependencies and dynamic spatial structures, and enhances the ability to extract spatiotemporal features of traffic networks.
Smart Images

Figure CN120766546A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent transportation, and in particular to a traffic flow prediction method and system for a dynamic correlation information fusion space-time network. BACKGROUND
[0002] Intelligent transportation system (ITS) is a complex and highly dependent on space-time characteristics of the dynamic system associated. As an important method to understand the city road traffic situation, traffic prediction mainly relies on the data collected by sensors deployed in different geographical space points in the real traffic road, including traffic flow, occupancy and speed based on nodes, etc. Similar to many complex systems, in the actual traffic network, there is a strong correlation between each traffic node, forming a complex traffic topology network.
[0003] Traditional traffic flow prediction methods, such as HA (Historical Average) and ARIMA (Autoregressive Integrated Moving Average), can capture the linkage relationship between nodes in the road network flow, but the massive parameter requirements and computational pressure lead to a significant decrease in prediction efficiency. Machine learning-based traffic flow prediction methods, such as KNN (K-nearest Neighbor) and VAR (Vector Autoregressive), cannot sufficiently capture real-time changes in traffic flow due to reliance on oversimplified assumptions. To address the above problems, researchers gradually adopted deep learning, such as RNN (Recurrent Neural Network), GRU (Gated Recurrent Unit), and LSTM (Long Short Term Memory Network). Although these methods have improved prediction performance, they still cannot fully utilize the complete information of historical data, thereby limiting the ability to capture long-term dependencies. To more accurately reveal the complex spatio-temporal relationships in the traffic network, existing work has conducted in-depth research on the network structure of GNN in traffic flow prediction, including T-GCN (Temporal Graph Convolutional Network), DCRNN (Diffusion Convolutional Recurrent Neural Network), AGCRN (Adaptive Graph Convolutional Recurrent Network), and STFGNN (Spatial-Temporal Fusion Graph Neural Networks). These methods utilize the inherent graph structure of the traffic network, capture the spatial relationship between nodes through graph convolution operations, and combine with time series analysis techniques to comprehensively model spatio-temporal features, not only improving the generalization ability and accuracy of traffic flow prediction, but also providing a new perspective for solving traffic flow prediction problems in complex traffic networks.
[0004] Despite the progress made in the above work, existing traffic flow prediction methods still face three challenges: 1) Defects in mining long time series data: Traditional RNN models are unable to effectively mine the trend characteristics of long-term time series due to memory decay problems when faced with the travel regularity and the continuous impact of characteristic events mapped by traffic data. 2) Limitations in capturing dynamic spatial structures: Complex urban road networks are dynamically constructed based on complex road sections such as intersections and overpasses, in which spatiotemporal correlations have real-time evolution characteristics. Most existing methods only analyze the static topological spatial relationships of the road network, and do not fully consider the dynamic nature of the road network, resulting in the inability to effectively capture dynamic structural information. 3) Insufficient fusion of road network feature information: Most existing methods only consider the analysis and mining of a single feature of the traffic road network, and fail to fully utilize and integrate other important features and parameters in the traffic road network.
[0005] It can be seen that the existing methods are insufficient in extracting and utilizing the spatiotemporal information of road networks and in mining the potential patterns in traffic data, resulting in poor adaptability in mining complex traffic information and low prediction accuracy. Summary of the Invention
[0006] In response to the problems existing in the existing technology, the present invention provides a traffic flow prediction method and system for dynamic correlation information fusion spatiotemporal network to solve the technical problems that the existing technology is insufficient in extracting and utilizing the spatiotemporal information of the road network, insufficient in mining the potential patterns in the traffic data, resulting in poor adaptability to mining complex traffic information and low prediction accuracy.
[0007] The present invention provides a traffic flow prediction method for a dynamic correlation information fusion spatiotemporal network, comprising:
[0008] S1. Obtain traffic input data, use the temporal attention mechanism to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data;
[0009] S2. Inputting the spatiotemporal feature data into a spatiotemporal dynamic module and utilizing a spatiotemporal feature enhancement mechanism to obtain corresponding enhanced features;
[0010] S3, constructing a gated attention unit in the spatiotemporal dynamic module to capture long-term trend temporal dependencies;
[0011] S4. Constructing a dynamic feature matrix in the spatiotemporal dynamic module, integrating it into the spatial graph convolution, and using spectral domain graph convolution technology in the spatial graph convolution to capture node features;
[0012] S5. Construct an output layer to receive the output features of the spatiotemporal dynamic module and output the prediction results.
[0013] Optionally, the traffic input data is obtained, and a temporal attention mechanism is used to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data, including:
[0014] M=U·δ((X T W1)W2(XW3) T ),
[0015]
[0016] Where X∈R C×T×N Input data for traffic, X T ∈R C×T×N , W1∈R N , W2∈R C×N W2∈R C×N , W3∈R C , U and b∈R T×T For learning parameters, M represents the time attention matrix, T represents the time step, N represents the number of nodes, C represents the number of feature channels, and M′ i,j It represents the correlation strength between time point i and time point j, and uses the SoftMax function to apply the time attention matrix to the traffic input data to obtain the spatiotemporal feature data.
[0017] Optionally, the spatiotemporal feature data is input into a spatiotemporal dynamic module, and a spatiotemporal feature enhancement mechanism is used to obtain corresponding enhanced features, including:
[0018] S201. Input the spatiotemporal feature data into the spatiotemporal dynamic module, and use global pooling to aggregate weighted feature information along the time dimension (S, i) and the spatial dimension (j, T). The output space and time of the global pooling channel are expressed as:
[0019]
[0020] At the same time, the spatial weighted feature maps are output respectively and time-weighted feature maps
[0021] S202, and sending the spatial weighted feature map and the temporal weighted feature map to a shared 1×1 convolution transformation function f1, expressed as:
[0022] F=δ(f1([E T ,E S ])),
[0023] Among them, [E T ,E S ] represents a serial operation, F∈R C / r×1×(N+T)represents the spatiotemporal feature information encoded in the intermediate feature map, and r represents the reduction ratio of the control block size in the spatiotemporal feature enhancement mechanism;
[0024] S203, decompose the spatiotemporal feature information encoded in the intermediate feature map into two independent tensors F S ∈R C / r×1×N and F T ∈R C / r×T×1 , and use two 1×1 convolution operations f S and f T , and map them to the tensor space with the same dimension as the input spatiotemporal feature data, expressed as:
[0025] X S =δ(f S (F S )),
[0026] X T =δ(f T (F T )),
[0027] Among them, X T ∈R C×T×1 and X S ∈R C×1×N Represent the weights of key features in time and space dimensions respectively, and transform the output Y∈R C×T×N Expressed as:
[0028]
[0029] Optionally, the spatiotemporal dynamics module constructs a gated attention unit to capture long-term trend temporal dependencies, including:
[0030] Calculate the attention weight matrix M according to the spatiotemporal feature enhancement mechanism a , expressed as:
[0031] R=Φ r (XW r ),
[0032] M a =ReLU 2 (Q(R)K(R) T +b),
[0033] Among them, R is the shared embedding vector, Q and K represent simple affine transformations, b represents the relative position deviation, Φ r is the element-level activation function, and the attention weight matrix M a Integrate with the input of the gated linear unit and express the gated attention unit as:
[0034] Γ*γX=P⊙σ(VM a ),
[0035] The output data is ⊙ represents the Hadamard product operation, and the input of the gated attention unit is X∈R C×T×N , It is the core of the dilated convolution, where 1 represents the traffic flow feature and 2C1 represents the information channel.
[0036] Optionally, constructing a dynamic feature matrix in the spatiotemporal dynamic module includes:
[0037] S401, construct a velocity feature matrix and use normalized embedding Gaussian function, expressed as:
[0038]
[0039] Among them, the embedded function Using a convolution kernel with a 1×1 convolution layer, the tensor is reorganized after embedding as and Among them, C1 represents the number of channels and and Perform a matrix multiplication operation to generate the second tensor, which is represented as:
[0040]
[0041] Among them, L v ∈R B×N×N The values are normalized to the range of 0 to 1. For embedded functions parameter set;
[0042] S402. Construct a node feature matrix, expressed as:
[0043]
[0044] Where E1∈R N×m is the source node, E2∈R N×m is the target node;
[0045] S403: Construct a dynamic feature matrix based on the speed feature matrix and the node feature matrix, expressed as:
[0046]
[0047] At the same time, the dynamic feature matrix is integrated into the spatial graph convolution.
[0048] Optionally, the spatial graph convolution uses spectral domain graph convolution technology to capture node features, including:
[0049] Using Chebyshev polynomial approximation, the convolution kernel g in the spatial graph convolution is Θ Expressed as:
[0050]
[0051] Among them, K s is the kernel size, Θ is the polynomial coefficient, and the traffic flow graph at time t is regarded as the network signal representation of the traffic input data, which is defined as:
[0052]
[0053] Optionally, constructing an output layer to receive the output features of the spatiotemporal dynamic module and output the predicted traffic flow includes:
[0054] Through two spatiotemporal dynamic modules connected in series, the characteristic output of the spatiotemporal dynamic module is obtained Input it to the output layer and output the traffic flow sequence Wherein, p is the output time step, and the output layer consists of two gated linear units, a LayerNorm layer and an FC layer.
[0055] The present invention further provides a traffic flow prediction system for a dynamic correlation information fusion spatiotemporal network, comprising:
[0056] The data processing module is used to obtain traffic input data, and uses the temporal attention mechanism to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data;
[0057] A feature enhancement module, configured to input the spatiotemporal feature data into a spatiotemporal dynamic module and obtain corresponding enhanced features using a spatiotemporal feature enhancement mechanism;
[0058] a gated attention construction module, configured to construct a gated attention unit and a dynamic feature matrix in the spatiotemporal dynamic module;
[0059] A dynamic feature construction module, configured to construct a dynamic feature matrix in the spatiotemporal dynamic module, integrate it into the spatial graph convolution, and employ spectral domain graph convolution technology in the spatial graph convolution to capture node features;
[0060] The output layer construction module is used to construct the output layer, receive the output of the spatiotemporal dynamic module, and output the prediction result.
[0061] Compared with the prior art, the present invention:
[0062] The time attention mechanism is adopted to adaptively adjust the correlation strength between different time points and assign corresponding weights to each time point to accurately model the timing dependence relationship. The spatio-temporal dynamic module captures the directionality information and location perception features of the traffic flow by introducing a spatio-temporal feature enhancement mechanism, thereby improving the expression ability of the traffic flow data and the extraction effect of the spatio-temporal features. Then, a gated attention unit is proposed to effectively mine the deep dynamic trends in the traffic sequence data and capture potential timing change patterns. By constructing a dynamic feature matrix, the spatial correlation and node features are fused in real time to provide more accurate spatial context information. Secondly, the correlation information extracted by the dynamic feature matrix is introduced into the spatial graph convolution network, so as to deeply learn the spatial structure and dynamic features in the traffic network and further improve the understanding and prediction ability of the spatio-temporal dynamic characteristics of the road network. Finally, the output layer receives the spatio-temporal feature information extracted by the spatio-temporal dynamic module and generates accurate traffic flow prediction results. BRIEF DESCRIPTION OF DRAWINGS
[0063] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without creative labor.
[0065] Figure 1 The method flowchart of the present application;
[0066] Figure 2 The traffic flow prediction framework of the dynamic correlation information fusion spatio-temporal network (DCIF) in the present application;
[0067] Figure 3 The working flowchart of the spatio-temporal dynamic module in the present application;
[0068] Figure 4 The principle diagram of the gated attention unit in the present application. DETAILED DESCRIPTION
[0069] 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.
[0070] In order to better understand the present invention, some technical terms in the present invention are explained below:
[0071] TAtt: Temporal attention, temporal attention.
[0072] STFE: Spatiotemporal feature enhancement mechanism, spatiotemporal feature enhancement mechanism.
[0073] STD: Spatiotemporal dynamic module, spatiotemporal dynamic module.
[0074] GAU: Gated attention unit, gated attention unit.
[0075] DFM: Dynamic feature matrix, dynamic feature matrix.
[0076] GAP: Global average pooling, global average pooling.
[0077] GLU: Gated linear unit, gated linear unit.
[0078] GCN: Graph convolutional network.
[0079] See also Figure 1 The present invention provides a traffic flow prediction method for a dynamic correlation information fusion spatiotemporal network, comprising:
[0080] S1. Obtain traffic input data, use the temporal attention mechanism to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data;
[0081] S2. Inputting the spatiotemporal feature data into a spatiotemporal dynamic module and utilizing a spatiotemporal feature enhancement mechanism to obtain corresponding enhanced features;
[0082] S3. Constructing a gated attention unit in the spatiotemporal dynamic module;
[0083] S4. Constructing a dynamic feature matrix in the spatiotemporal dynamic module, integrating it into the spatial graph convolution, and using spectral domain graph convolution technology in the spatial graph convolution to capture node features;
[0084] S5. Construct an output layer to receive the output of the spatiotemporal dynamic module and output the prediction result.
[0085] See also Figure 1 and Figure 2 ,In this embodiment, S1, obtains traffic input data, and adopts the ,temporal attention mechanism to adaptively adjust the correlation strength between ,each time point and assign different weights to obtain the ,spatiotemporal feature data.
[0086] The collected traffic data is obtained as input data, and the temporal attention mechanism TAtt is used to dynamically adjust the correlation strength between different time points. TAtt adaptively adjusts the relative importance of each data in the time series and assigns different weights accordingly in real time.
[0087] Traffic input data is obtained and the temporal attention mechanism is used to dynamically adjust the correlation strength between different time points. The temporal attention mechanism adaptively adjusts the relative importance of each data point in the time series and assigns different weights accordingly in real time.
[0088] The specific formula is as follows
[0089] M=U·δ((X T W1)W2(XW3) T ), (1)
[0090]
[0091] Where X∈R C×T×N Input data for traffic, X T ∈R C×T×N , W1∈R N 、W2∈ C×N W2∈R C×N , W3∈R C , U and b∈R T×T For learning parameters, M represents the time attention matrix, T represents the time step, N represents the number of nodes, C represents the number of feature channels, and M′ i,j It represents the correlation strength between time point i and time point j, and uses the SoftMax function to apply the time attention matrix to the traffic input data to obtain the spatiotemporal feature data.
[0092] The dimension of the temporal attention matrix M is determined by the temporal characteristics of the input data X, where the element Mij Represents the strength of the correlation between time point i and time point j. Then, using the SoftMax function, the TAtt matrix is directly applied to the input data X to aggregate the relevant time information to achieve dynamic adaptation and adjustment of the input data.
[0093] S2. Input the spatiotemporal feature data into the spatiotemporal dynamic module, and use the spatiotemporal feature enhancement mechanism to obtain corresponding enhanced features.
[0094] See also Figure 3 Traffic data is fed into the spatiotemporal dynamics module (STD), which is used to deeply explore and jointly model the spatiotemporal interaction characteristics of spatial network nodes and traffic data. Specifically, the spatiotemporal feature enhancement mechanism is used to capture directional information and traffic location perception features, and to enhance the representation of traffic flow information and the spatiotemporal feature extraction capabilities.
[0095] Global pooling provides efficient global encoding by compressing spatial information into multiple channels. In traffic flow prediction, accurately utilizing location information is key to capturing the spatiotemporal correlation of traffic roads. The spatiotemporal feature data is input into the spatiotemporal dynamics module, and global pooling is used to aggregate weighted feature information along the temporal dimension (S, i) and spatial dimension (j, T). The output space and time of the global pooling channel are expressed as:
[0096]
[0097] The above convolution transformation aggregates weighted feature information along the time and space dimensions, and outputs spatial weighted feature maps respectively. and time-weighted feature maps
[0098] At the same time, the spatial weighted feature map and the temporal weighted feature map are sent to a shared 1×1 convolution transformation function f1 to accurately mine the feature area of interest, which is expressed as:
[0099] F=δ(f1([E T ,E S ])), (5)
[0100] Among them, [E T ,E S ] represents a serial operation, F∈R C / r×1×(N+T) represents the spatiotemporal feature information encoded in the intermediate feature map, and r represents the reduction ratio of the control block size in the spatiotemporal feature enhancement mechanism;
[0101] Decompose the spatiotemporal feature information F encoded in the intermediate feature map into two independent tensors F S ∈R C / r×1×N and F T ∈R C / r×T×1, and use two 1×1 convolution operations f S and f T , F S and F T They are mapped to the tensor space with the same dimension as the input spatiotemporal feature data, respectively, and are expressed as:
[0102] X S =δ(f S (F S )), (6)
[0103] X T =δ(f T (F T )), (7)
[0104] Among them, X T ∈R C×T×1 and X S ∈R C×1×N Represent the weights of key features in time and space dimensions respectively, enhance the representation of key features through STFE mechanism, suppress irrelevant information, and transform the output Y∈ C×T×N Expressed as:
[0105]
[0106] S3. Construct a gated attention unit in the spatiotemporal dynamic module.
[0107] See also Figure 4 , a gated attention unit is proposed to effectively mine the deep dynamic trends of traffic sequence data, and the attention mechanism and gated linear unit (GLU) are merged in the same layer to share as many computing resources as possible to improve computing efficiency.
[0108] Calculate the attention weight matrix M according to the spatiotemporal feature enhancement mechanism a , to reveal the correlation strength of traffic flow between different road nodes, expressed as:
[0109] R=Φ r (XW r ), (9)
[0110] M a =ReLU 2 (Q(R)K(R) T +b), (10)
[0111] Among them, R is the shared embedding vector, Q and K represent simple affine transformations, b represents the relative position deviation, Φ r is the element-level activation function, and the attention weight matrix M aThe gated attention unit is expressed as:
[0112] Γ*γX=P⊙σ(VM a ), (11)
[0113] where the output data is ⊙ represents Hadamard product operation, and the input of the gated attention unit is X∈R C×T×N , is the core of extended convolution, where 1 represents traffic flow features, and 2C1 represents information channels.
[0114] S4, constructing a dynamic feature matrix in the spatio-temporal dynamic module, integrating it into the spatial graph convolution, and using spectral domain graph convolution technology in the spatial graph convolution to capture node features.
[0115] Referring to Figure 4 , the dynamic feature matrix is constructed to fuse spatial related information and node features in real time to provide richer and more accurate spatial context information; the related information extracted by the dynamic feature matrix is included in the spatial graph convolution to learn the traffic network information more deeply and effectively mine the dynamic spatial features in the road network.
[0116] where the speed feature matrix has the ability to dynamically adapt to road flow trends, improving the prediction ability of the model. A normalized embedded Gaussian function is used to effectively measure the similarity of traffic patterns between different road segments. As the similarity increases, the function value rises, thereby improving the accuracy of the traffic pattern similarity and enhancing the ability to reflect and predict the dynamic changes of the road network.
[0117]
[0118] where the embedding function uses a convolution kernel with a 1x1 convolution layer, and the tensor is reorganized as and where C1 represents the number of channels. Then, matrix multiplication is performed on the two tensors to generate the tensor L v . The elements L v in L v(i,j) reflect the degree of similarity between nodes v i and v j .
[0119] The value of L v ∈R B×N×N is normalized to the range of 0 to 1 to quantify the strength of the correlation between the two road segments, as follows:
[0120]
[0121] in, For embedded functions The parameter set is dynamically parameterized and updated based on the results of traffic flow prediction through the back propagation algorithm.
[0122] Next, we use the node feature matrix to dynamically adjust the connectivity between nodes based on real-time traffic data to reflect the dynamic changes of nodes in the road network. Randomly initialize two learnable node embeddings: the source node E1∈R N×m and target node E2∈R N×m Therefore, the learnable node feature matrix is expressed as follows:
[0123]
[0124] Among them, the node feature matrix L between the source node and the target node d ∈R B×N×N Obtained by multiplying E1 and E2.
[0125]
[0126] Finally, we transform the dynamic feature matrix L d ∈R B×N×N Integrating it into spatial graph convolution effectively overcomes the limitations of traditional predefined graph structures to accurately capture the dynamic characteristics of traffic networks.
[0127] We further employ spectral domain graph convolution technology to treat traffic flow as a signal graph, effectively capturing node features. We construct a Laplacian matrix to describe the structural properties of the graph, and perform convolution operations based on it. This includes:
[0128] Using Chebyshev polynomial approximation, kernel g Θ Expressed as The polynomial form of K s is the size of the kernel, Θ is the polynomial coefficient. The convolution kernel extracts the s -1 order nodes and their neighbor information. Therefore, the traffic flow at time t is regarded as graph X t The representation of the network signal and define the operation as:
[0129]
[0130] Since a fixed Laplacian matrix is difficult to fully characterize the dynamic associations between nodes, a dynamic feature matrix is introduced into the spatial graph convolution to dynamically mine the spatial relationships in the road network.
[0131] S5. Construct an output layer to receive the output of the spatiotemporal dynamic module and output the prediction result.
[0132] Through two spatiotemporal dynamic modules connected in series, the characteristic output of the spatiotemporal dynamic module is obtained And input it to the output layer to output the traffic flow sequence Wherein, p is the output time step, and the output layer consists of two gated linear units (GLU), a LayerNorm layer and an FC layer.
[0133] The present invention adopts the temporal attention mechanism to adaptively adjust the correlation strength between different time points and assign different relative weights. In the spatiotemporal dynamic module, the spatiotemporal feature enhancement mechanism is used to capture directional information and traffic location perception features, and enhance the representation of traffic flow information and the spatiotemporal feature extraction capabilities. A gated attention unit is proposed to effectively mine the deep dynamic trends of traffic sequence data. A dynamic feature matrix is constructed to fuse spatially related information and node features in real time, providing richer and more accurate spatial context information. The correlation information extracted by the dynamic feature matrix is incorporated into the spatial graph convolution, which can learn traffic network information more deeply and effectively mine the dynamic spatial features in the road network. The output layer receives the spatiotemporal feature information extracted by the spatiotemporal dynamic module and outputs the final prediction result. It effectively improves the accuracy and robustness of traffic flow prediction and solves the complex and difficult problem of spatiotemporal correlation modeling in traffic flow prediction.
[0134] The present invention also provides a traffic flow prediction system for a dynamic correlation information fusion spatiotemporal network, comprising:
[0135] The data processing module is used to obtain traffic input data, and uses the temporal attention mechanism to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data;
[0136] A feature enhancement module, configured to input the spatiotemporal feature data into a spatiotemporal dynamic module and obtain corresponding enhanced features using a spatiotemporal feature enhancement mechanism;
[0137] a gated attention construction module, configured to construct a gated attention unit and a dynamic feature matrix in the spatiotemporal dynamic module;
[0138] A dynamic feature construction module, configured to construct a dynamic feature matrix in the spatiotemporal dynamic module, integrate it into the spatial graph convolution, and employ spectral domain graph convolution technology in the spatial graph convolution to capture node features;
[0139] The output layer construction module is used to construct the output layer, receive the output features of the spatiotemporal dynamic module, and output the prediction results.
[0140] 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 "comprises", "includes" or any other variations 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 "comprises a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.
[0141] 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 to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A traffic flow prediction method based on dynamic correlation information fusion spatiotemporal network, characterized by: include: S1. Obtain traffic input data, use the temporal attention mechanism to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data; S2. Inputting the spatiotemporal feature data into a spatiotemporal dynamic module and utilizing a spatiotemporal feature enhancement mechanism to obtain corresponding enhanced features; S3, constructing a gated attention unit in the spatiotemporal dynamic module to capture long-term trend temporal dependencies; S4. Constructing a dynamic feature matrix in the spatiotemporal dynamic module, integrating it into the spatial graph convolution, and using spectral domain graph convolution technology in the spatial graph convolution to capture node features; S5. Construct an output layer to receive the output features of the spatiotemporal dynamic module and output the predicted traffic flow.
2. The traffic flow prediction method for dynamic correlation information fusion spatiotemporal network according to claim 1 is characterized in that: The traffic input data is obtained, and the temporal attention mechanism is used to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data, including: M=U·δ((X T W1)W2(XW3) T ), Where X∈R C×T×N Input data for traffic, X T ∈R C×T×N , W1∈R N W2∈R C×N W2∈R C×N , W3∈R C , U and b∈R T×T For learning parameters, M represents the time attention matrix, T represents the time step, N represents the number of nodes, C represents the number of feature channels, and M′ i,j It represents the correlation strength between time point i and time point j, and uses the SoftMax function to apply the time attention matrix to the traffic input data to obtain the spatiotemporal feature data.
3. The traffic flow prediction method for dynamic correlation information fusion spatiotemporal network according to claim 2, characterized in that: The spatiotemporal feature data is input into the spatiotemporal dynamic module, and the spatiotemporal feature enhancement mechanism is used to obtain corresponding enhanced features, including: S201. Input the spatiotemporal feature data into the spatiotemporal dynamic module, and use global pooling to aggregate weighted feature information along the time dimension (S, i) and the spatial dimension (j, T). The output space and time of the global pooling channel are expressed as: Output spatial weighted feature maps separately and time-weighted feature maps S202, and sending the spatial weighted feature map and the temporal weighted feature map to a shared 1×1 convolution transformation function f1, expressed as: F=δ(f1([E T ,AND S ])), Among them, [E T ,E S ] represents a serial operation, F∈R C / r×1×(N+T) represents the spatiotemporal feature information encoded in the intermediate feature map, and r represents the reduction ratio of the control block size in the spatiotemporal feature enhancement mechanism; S203, decompose the spatiotemporal feature information encoded in the intermediate feature map into two independent tensors F S ∈R C / r×1×N and F T ∈R C / r×T×1 , and use two 1×1 convolution operations f S and f T , and map them to the tensor space with the same dimension as the input spatiotemporal feature data, expressed as: X S =δ(f S (F S )), X T =δ(f T (F T )), Among them, X T ∈R C×T×1 and X S ∈R C×1×N Represent the weights of key features in time and space dimensions respectively, and transform the output Y∈R C×T×N Expressed as:
4. The traffic flow prediction method for dynamic correlation information fusion spatiotemporal network according to claim 3 is characterized in that: The spatiotemporal dynamics module constructs a gated attention unit to capture long-term trend temporal dependencies, including: Calculate the attention weight matrix M according to the spatiotemporal feature enhancement mechanism a , expressed as: R=Φ r (XW r ), M a =ReLU 2 (Q(R)K(R) T +b), Among them, R is the shared embedding vector, Q and K represent simple affine transformations, b represents the relative position deviation, Φ r is the element-level activation function, and the attention weight matrix M a Integrating with the input of the gated linear unit, the gated attention unit is expressed as: Γ*γX=P⊙σ(VM a ), The output data is ⊙ represents the Hadamard product operation, and the input of the gated attention unit is X∈R C×T×N , It is the core of the dilated convolution, where 1 represents the traffic flow feature and 2C1 represents the information channel.
5. The traffic flow prediction method for dynamic correlation information fusion spatiotemporal network according to claim 4 is characterized in that: The dynamic feature matrix is constructed in the spatiotemporal dynamic module, including: S401, construct a velocity feature matrix and use normalized embedding Gaussian function, expressed as: Among them, the embedded function Using a convolution kernel with a 1×1 convolution layer, the tensor is reorganized after embedding as and Among them, C1 represents the number of channels and and Perform a matrix multiplication operation to generate the second tensor, which is represented as: Among them, L v ∈R B×N×N The values are normalized to the range of 0 to 1. For embedded functions parameter set; S402. Construct a node feature matrix, expressed as: Where E1∈R N×m is the source node, E2∈R N×m is the target node; S403: Construct a dynamic feature matrix based on the speed feature matrix and the node feature matrix, expressed as: At the same time, the dynamic feature matrix is integrated into the spatial graph convolution.
6. The traffic flow prediction method for dynamic correlation information fusion spatiotemporal network according to claim 5, characterized in that: The spatial graph convolution uses spectral domain graph convolution technology to capture node features, including: Using Chebyshev polynomial approximation, the convolution kernel g in the spatial graph convolution is Θ Expressed as: Among them, K s is the kernel size, Θ is the polynomial coefficient, and the traffic flow graph at time t is regarded as the network signal representation of the traffic input data, which is defined as:
7. The traffic flow prediction method for dynamic correlation information fusion spatiotemporal network according to claim 6 is characterized in that: The output layer is constructed to receive the output features of the spatiotemporal dynamic module and output the predicted traffic flow, including: Through two spatiotemporal dynamic modules connected in series, the characteristic output of the spatiotemporal dynamic module is obtained Input it to the output layer and output the traffic flow sequence Wherein, p is the output time step, and the output layer consists of two gated linear units, a LayerNorm layer and an FC layer.
8. A traffic flow prediction system for dynamic correlation information fusion spatiotemporal network, characterized by: include: The data processing module is used to obtain traffic input data, and uses the temporal attention mechanism to adaptively adjust the correlation strength between each time point and assign different weights to obtain spatiotemporal feature data; A feature enhancement module, configured to input the spatiotemporal feature data into a spatiotemporal dynamic module and obtain corresponding enhanced features using a spatiotemporal feature enhancement mechanism; a gated attention construction module, configured to construct a gated attention unit and a dynamic feature matrix in the spatiotemporal dynamic module; A dynamic feature construction module, configured to construct a dynamic feature matrix in the spatiotemporal dynamic module, integrate it into the spatial graph convolution, and employ spectral domain graph convolution technology in the spatial graph convolution to capture node features; The output layer construction module is used to construct the output layer, receive the output features of the spatiotemporal dynamic module, and output the prediction results.
Citation Information
Cited By
Traffic flow prediction method and system based on space-time progressive fusion
CN121640720A
Traffic flow prediction method and system based on spatiotemporal progressive fusion
CN121640720B