Traffic flow prediction method based on multi-graph space-time convolution and dynamic measurement fusion

By introducing multi-graph spatiotemporal convolution and dynamic metric fusion technology into traffic flow prediction model, the spatiotemporal features in traffic networks are effectively extracted and integrated, and the problem of lack of adaptability and robustness in existing models when dealing with complex traffic networks is solved. , achieving more accurate and stable traffic flow forecasts.

CN119479291AInactive Publication Date: 2025-02-18NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411616164.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When existing traffic flow prediction models process complex traffic networks and timing data, it is difficult to effectively extract and integrate basic road features and potential spatiotemporal features, resulting in the lack of adaptability and robustness of the model in the face of new road conditions or emergencies. .

Method used

A multi-source basic information traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion is proposed. The spatial and temporal characteristics of multi-source basic information are processed and extracted respectively through the MGC module and the DMF module, and the spatial and temporal characteristics of multi-source basic information are fused through dynamic evaluation and fusion mechanism. Basic characteristics of the road and potential spatial and temporal characteristics.

Benefits of technology

This method can more effectively extract and integrate spatiotemporal features in the traffic network, improve the model's understanding of the nature of traffic flow and the accuracy and robustness of the prediction of traffic flow, and significantly improve the performance of traffic flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119479291A_ABST
    Figure CN119479291A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method based on multi-graph space-time convolution and dynamic measurement fusion, and the method comprises the following steps: collecting traffic road network information, and constructing a data set; constructing a traffic flow prediction network which comprises an MGC module and a DMF module; the MGC module comprises a distance feature spatial-temporal correlation feature module Dis, a kernel correlation module ICNC, a congestion correlation module TCC and a causal similarity module DG. Three new spatio-temporal correlation matrixes based on multi-source basic information are respectively provided in ICNC, TCC and DG modules. The DMF module comprises residual connection, a convolutional neural network, graph convolution and an attention mechanism, and is used for evaluating the importance of each node in different features, calculating an importance score, and carrying out weighted fusion on several spatio-temporal features. The MGC-DMF pays more attention to the diversity and authenticity of multiple images and the interpretability and balance of a fusion mode in design, so that the performance of a traffic flow prediction model is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent transportation and deep learning, and specifically is a multi-source basic information traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion. Background Art

[0002] Traffic flow prediction technology is a key technology to promote the development and management of urban traffic. Through the collection and in-depth analysis of historical traffic data, advanced prediction models can make accurate predictions of future traffic characteristics. These prediction results are applicable to different application scenarios, such as the rational allocation of police resources, road construction planning, and traffic flow control, thereby significantly improving the operational efficiency of transportation infrastructure. However, due to the complexity of the traffic network and the temporal nature of the data, coupled with the limitations of data acquisition hardware, how to effectively discover, extract and reasonably integrate explicit and potential spatiotemporal features has become the main challenge currently faced in the field of traffic flow prediction.

[0003] In the study of traffic flow prediction, the current trend is to enrich the types and depth of potential spatiotemporal correlations so that the model can better simulate the actual road conditions. However, the importance of basic road features is gradually ignored. This bias may cause the model to lose its understanding of the nature of traffic flow during the prediction process. Basic road features, such as road width, number of vehicles on the road, degree of congestion, etc., directly affect the vehicle's capacity and the distribution characteristics of traffic flow. In addition, over-reliance on potential spatiotemporal correlations and ignoring these basic features may cause the model to lack adaptability and robustness when facing new road conditions or emergencies. Appropriate use of basic features can alleviate this situation. Therefore, the primary goal of traffic flow prediction research at this stage is not only to explore the potential spatiotemporal correlation features in the traffic road network. At the same time, the basic road features need to be reasonably applied to the prediction process of the model. In addition, unlike traditional research that fuses graph convolutions through basic operations, it is necessary to propose a reasonable fusion mechanism to dynamically evaluate the weights of different spatiotemporal features during the training process, and then fuse and further extract them. Summary of the invention

[0004] Purpose of the invention: In view of the above problems, the present invention proposes a traffic flow prediction method based on multi-source basic information based on multi-graph spatiotemporal convolution and dynamic metric fusion. The method consists of an MGC module (multi-graph convolution module) and a DMF module (dynamic metric module), which are used for processing and feature extraction of multi-source basic information and fusion of multi-source information respectively. In the multi-graph spatiotemporal convolution module MGC, based on multi-source basic information, the present invention proposes three new spatiotemporal correlation matrices, which are respectively a matrix that can reflect the internal correlation of traffic core node clusters (A ICNC A correlation matrix for measuring road travel comfort (A TCC A causal similarity matrix (ACS ) is used to mine similarity features that filter out accidental interference after causal testing. In addition, based on distance information, a distance weighted correlation adjacency matrix (A Dis ), used for multi-graph convolution, and used as residual connection in the fusion prediction module to promote feature flow. Compared with the traditional use of basic operations to fuse different features, a dynamic measurement fusion module DMF is proposed by the present invention to evaluate the importance of different spatiotemporal features before fusion. Residual links, convolutional neural networks (CNNs) and GCNs are further used to promote feature flow and feature extraction. The experimental results of MGC-DMF on three real-world datasets show that it exhibits good performance compared with advanced models, and the effectiveness of each component is verified through multi-graph ablation experiments and structural ablation experiments.

[0005] Technical solution: A multi-source basic information traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion, including the following steps:

[0006] Step 1: Collect information from the road network, transform it into a model that can identify data features, and divide it into training sets and test sets according to proportion;

[0007] Step 2: Construct a multi-source basic information traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion, the method includes MGC module and DMF module; the MGC module includes four submodules to model and output: road distance correlation feature X Dis , kernel correlation feature X ICNC , congestion correlation feature X TCC , and the causal similarity feature X CS . Restore the real spatiotemporal correlation characteristics and potential spatiotemporal correlation characteristics of the road network as much as possible to simulate the real situation of the road network;

[0008] Step 3: Use GCN, BiLSTM, and BiGRU network structures to model the spatiotemporal correlation of the above features;

[0009] Step 4: The DMF module further dynamically fuses several spatiotemporal features in the MGC module during the training process through the attention mechanism. Compared with the traditional fusion method, it is more interpretable. After fusion, the residual connection, CNN and GCN are used to further extract the features, and finally the prediction results are output;

[0010] Step 5: Based on the dataset used, the multi-source basic information traffic flow prediction network MGC-DMF with multi-graph spatiotemporal convolution and dynamic metric fusion is trained, and the MSE function is used as the loss function as a method to evaluate the error between the true value and the loss value in the prediction process, so as to dynamically adjust the weight of the traffic flow prediction expression; and the performance of the final generated test set prediction results is evaluated using two error indicators (RMSE, MAE);

[0011] Furthermore, in step 1, the original traffic flow data is preprocessed, the sensor information in the road network is converted into traffic features and adjacency matrix, and divided into training set and test set. The specific steps are as follows:

[0012] Step 1-1: The present invention uses G = (V, A, E) to construct a traffic spatiotemporal graph network, where V = {V1, V2, .., V N} represents the set of sensors in the road network, and N is the number of nodes. N×N represents the adjacency matrix, which is used to reflect the weights and spatial features between nodes, and E represents the set of edges. T}∈R T×N represents the temporal characteristics of the described traffic network, X i ∈R T×1 Represents the eigenvalues ​​of all nodes corresponding to the i-th time slice. X is defined as follows:

[0013]

[0014] where x i,j represents the traffic characteristic value of node j in the i-th time slice. Therefore, the expression of the traffic flow prediction problem studied in the present invention is defined as follows:

[0015] (X T+1 , X T+2 , ..., X T+H )=f(X T-h+1 , ..., X T-1 , X T )

[0016] Wherein h represents the number of historical time slices used for prediction, H represents the number of future time slices predicted, and f() represents the prediction expression of the prediction model proposed by the present invention;

[0017] Step 1-2: Determine the hyperparameter settings of the MGC-DMF model and correctly divide the dataset into training set and test set for model training and testing.

[0018] Furthermore, in step 2, a multi-graph convolution module MGC is constructed, and four sub-modules are constructed to model four spatiotemporal features respectively.

[0019] Step 2-1: Establish an ICNC module, which outputs the internal correlation adjacency matrix (core correlation matrix) representing some node groups with frequent internal traffic interactions in the transportation network. Cluster the historical features using the K-Means algorithm to determine the number of core groups, which are defined as follows:

[0020] K out :{{V1,C i}, {V2, C i}, ..., {V N , C i}}=K-Means(X 1 , X 2 , ..., X N )

[0021] Among them, {V j , C i} represents node j belongs to the i-th class. K represents the number of classes and is an adjustable hyperparameter. i ∈R T×N Represents all eigenvalues ​​of node i. K out Represents the clustering results.

[0022] Step 2-2: To make up for the global features that the K-Means algorithm fails to represent, the centrality algorithm is used to comprehensively measure the influence of each node in the entire road network. Their input is the road adjacency matrix. The output is the importance of each node in the road network and the core node group it belongs to.

[0023] Degree centrality refers to the node V i The ratio of the degree to the total number of points. i ) represents node V i degree, that is, the degree of node V i The number of connected edges. The calculation formula is as follows:

[0024]

[0025] Closeness centrality refers to the inverse of the average shortest path length between a node and other nodes. i , V j ) is the node V i , V j The minimum number of edges required can be reached between them. The calculation formula is as follows:

[0026]

[0027] Betweenness centrality refers to the frequency with which a node appears on the shortest path between all pairs of nodes. V i and V k The number of shortest paths between . is node v i and v k Through the node v j The calculation formula is as follows:

[0028]

[0029] The main idea of ​​eigenvector centrality is that the importance of a node depends on its degree of connection with other important nodes. If a node is already connected to many other nodes, and these nodes are also important nodes, then the importance of the node will increase accordingly. This is an iterative calculation process, and the eigenvector centrality of all nodes will be initialized at the beginning. ij Representative A Distance The distance between two nodes in EC. t (V i ) is the eigenvector centrality of node i at the tth iteration. λ is the adjacency matrix A Distance The maximum eigenvalue of . The calculation formula is as follows:

[0030]

[0031] The main idea of ​​PageRank centrality is that the more times a node is linked, the more important it is. d represents the damping factor (usually set to 0.85), which indicates the probability that the user will continue to browse the web page based on the current link. i ) represents the direction to node V i The node set, that is, V i Out(V j ) is the node V j The out-degree of PageRank is also an iterative calculation process. The calculation formula is as follows:

[0032]

[0033] The main idea of ​​Katz centrality is to consider not only the direct neighbors of a node, but also the influence of indirect neighbors. i ) represents the centrality of node i. α and β are parameters used to adjust the contribution of direct neighbors and indirect neighbors to the centrality of the node. Usually, λ max is the maximum eigenvalue of the adjacency matrix. The calculation formula is as follows:

[0034]

[0035] Next, for the several centralities RN×1 Perform the following splicing operations:

[0036] CentArrays({V i :{Cen1, Cen2,…,Cen6}})=[DC|CC|BC|EC|PR|Katz]∈R N×6

[0037] Where Ceni is the i-th centrality algorithm mentioned above, and '|' represents concatenation. Then take the average of CentArrays and use the K-Means classification result K out The sum is calculated to obtain the total importance of each node cluster. The overall importance is then mapped to each node of the corresponding class and normalized to obtain a node-category-importance comparison table VIC with classification identifiers. The process expression is as follows:

[0038] VIC: {{V1:[Imp, C i ]}, ..., {V N :[Imp,C i ]}}

[0039] =Normalize{MapToEachNode{SumBy(K out )[MeanByNode(CentArrays)]}}

[0040] Among them, {V j ,I,C i} represents the global importance I of node j and belongs to C i Node cluster. MeanByNode represents the average value of CentArrays, SumBy(K out ) represents the out Solve the importance of each node cluster. MapToEachNode means assigning the overall importance of each class to each node as the global importance. Normalize means the normalization operation.

[0041] Step 2-3: Calculate the Pearson correlation to supplement the global correlation feature. The calculation formula is as follows:

[0042]

[0043] Among them, Cov(X i , X j ) represents X i and X j The covariance of . and Represents X iand X j A[i, j] represents the standard deviation of V i and V j The size of the correlation.

[0044] If two nodes belong to the same class, A Cor The corresponding elements in are classified and multiplied with the VIC comparison table to obtain the ICNC matrix. The calculation formula is as follows:

[0045]

[0046] Where VIC[V k ].Imp represents node V k The global importance of A ICNC [i, j] represents V i and V j The global core relevance of .

[0047] Step 2-4: Establish the TCC module, calculate the travel comfort vector TCV, and calculate the congestion correlation adjacency matrix TCC based on TCV. The data used comprehensively considers the flow X Flow ∈R T×N , speed X Speed ∈R T×N , road occupancy rate X Occupation ∈R T×N First, we need to calculate each node V i Corresponding to the peak carrying capacity of the three characteristics, the road peak flow carrying capacity RDFCC∈R 1×N , road peak speed carrying capacity RDSCC∈R 1×N , road peak occupancy carrying capacity RDOCC∈R 1 ×N The calculation method is as follows:

[0048]

[0049] in, Represents each node The set of maximum values ​​over all time slices. represents the eigenvalue of a node in all time slices. Next, for each node V i The TVC formula is established to measure the travel comfort level of a node. The calculation formula is as follows:

[0050]

[0051] Among them, Occ jrepresents the characteristic value corresponding to the current node at the jth time slice. This is done to use the maximum value of the characteristic as the benchmark, and then calculate the ratio of the characteristic value to the maximum benchmark at each moment as the driving pressure of the current road. Then, the speed ratio and flow ratio are averaged and summed to obtain the comprehensive road driving pressure. Then, Multiply (representing the remaining utilization rate of the road at the current moment) as a balancing factor to alleviate the driving pressure of the comprehensive road, and get the node V i Travel comfort vector TCV i ∈R 1×N , represents the travel comfort of each node.

[0052] Step 2-5: Construct the TCC congestion correlation matrix, the TCV obtained in step 3-4 i To a certain extent, it can reflect the congestion of a road. When the travel comfort is high, the current road congestion is light. When the travel comfort is low, the current road congestion is serious. In order to explore the impact of the current road traffic congestion on other roads, the ratio of the travel comfort of each node to the travel comfort of other nodes can be used to measure the congestion correlation. The calculation formula is as follows:

[0053]

[0054] Among them, TCV i Representative node V i Travel comfort, TCV j Representative node V j The travel comfort of the node V is represented by the ratio TCC[i,j] of the two. i and V j The congestion correlation is used to measure the influence of the congestion status of the current node on other nodes.

[0055] Step 2-6: Establish a DG module to explore the similarity between two road nodes from the perspective of causal relationship and similarity relationship, and verify through the algorithm whether a node can be used as a predictor variable for another node. The calculation formula is as follows:

[0056] S[i, j] = DTW(X i , X j )

[0057] G[i, j] = Granger(X i , X j )

[0058] A CS [i, j] = S [i, j] ⊙ G [i, j

[0059] Among them, S[i, j] represents the node V i and node V j The feature similarity of G[i, j] represents the node V i Can it be used as a node V j A prediction node. CS [i, j] is the causal similarity matrix, which is used to mine similar latent features filtered by causal relationships.

[0060] Step 2-7: Establish the Dis module, encode the basic road structure (distance, connectivity adjacency matrix) and historical features using GCN, and obtain the basic distance correlation matrix A Dis and distance space-time feature X Dis The calculation formula is as follows:

[0061]

[0062] Where distance(V i , V j ) is the node V i and V j The transportation distance, A Dis [i, j] is the node V i and V j Distance correlation. The longer the distance between two nodes, the smaller the weight; the shorter the distance, the larger the weight.

[0063] Furthermore, in step 3, the four spatiotemporal features obtained in step 2 are dynamically evaluated and integrated during the training process.

[0064] Step 3-1: First, A ICNC , A TCC , A CS The three features are fused and the calculation formula is as follows:

[0065] X ICNC =BiGRU(GCN(A ICNC , X Flow ))

[0066] X TCC =BiGRU(GCN(A TCC ,X Flow ))

[0067] X CS =BiGRU(GCN(A CS , X Flow ))

[0068] After the spatiotemporal convolution, the spatiotemporal features of the output of three modules are obtained: X ICNC , X TCC , XCS .

[0069] Step 3-2: In order to better integrate these three features, three additional trainable parameters are set to optimize this process. The calculation formula is as follows:

[0070] STF=(k1*X ICNC +k2*X TCC +k3*X CS ) / 3

[0071] Among them, k1, k2, and k3 are trainable parameters, and STF is the fused spatiotemporal feature. STF is one of the outputs of the multi-graph convolution module MGC.

[0072] Step 3-3: Distance correlation matrix A Dis The temporal and spatial correlation feature modeling is performed separately with the historical traffic characteristics for subsequent residual linking and dynamic evaluation fusion, which is also the second output of the MGC module, denoted as ASTF. The calculation formula is as follows:

[0073] ASTF = BiLSTM(IEGCN(DisW,X Flow ))

[0074] Furthermore, in step 4, different features usually have different information values. The DMF module can be integrated according to the scoring weight to avoid the loss and mixing of features caused by the fusion of simple basic operations, reduce the impact of redundant information, increase the model's attention to key information, and improve the robustness of the model. The attention mechanism algorithm can automatically learn and focus on important information. The two spatiotemporal features ASTF and STF obtained in step 3 are dynamically evaluated and integrated during the training process to obtain the final spatiotemporal feature output FSTF (Final STF). Then the residual network is used to promote the further flow of features and make up for the lost features. Finally, prediction is performed.

[0075] Step 4-1: Input the two spatiotemporal features into the attention mechanism respectively, learn the key information in the features, and obtain the weight scores corresponding to each node in different features through the Tanh activation function. The scoring process of this network module is as follows:

[0076]

[0077] S = Mean (S1, S2)

[0078] Among them, Linear() represents the linear layer. is a trainable weight matrix. A , k A , v A It is the key value of the feature ASTF. B , kB , v B is the key value of the feature STF. The Softmax() layer is used to calculate the attention weights and normalize them to probability distribution to ensure that the sum of the outputs of all categories is 1. Tanh() is the activation function. v1 and v2 represent trainable weight parameters. Then, the weights S1 and S2 of the two features obtained above are averaged and the final spatiotemporal features are obtained. S1 and S2 are the score weights of the features STF and ASTF, respectively. Mean(S1, S2) represents the mean of S1 and S2.

[0079] Step 4-2: Based on the idea of ​​the gating mechanism, the two features of STF and ASTF are integrated. The calculation formula is as follows:

[0080] FSTF=(1-S)⊙STF+S⊙ASTF

[0081] Among them, FSTF is the eigenvalue of the fusion of STF and ASTF. ⊙ represents the Hadamard product.

[0082] Step 4-3: In order to prevent the problems of feature loss, gradient vanishing and gradient explosion, residual links are introduced to extract features from a richer perspective with the convolutional neural network. The residual information mainly comes from the spatiotemporal feature output of the basic information and the graph convolution output. The network structure is defined as follows:

[0083] ResCNN=CNN(FSTF+STF)

[0084] IEGCN=LeakyReLU(Linear(IEGCN(DisW,X Flow )))

[0085] ResFSTF=Linear(LeakyReLU(Linear(ResCNN+IEEGCN)))

[0086] PreResult=GCN(DisW,ResFSTF)

[0087] Among them, CNN() represents the convolutional neural network layer, LeakyReLU is the activation function, and PreResult is the prediction result.

[0088] Furthermore, in step 5, the training process uses the MSE loss function to measure the difference between the true value and the error value, thereby optimizing the trainable weight matrix. The prediction results of the test set are evaluated using the RMSE and MAE performance evaluation indicators to evaluate the performance of the proposed model.

[0089] Step 5-1: During the training process, after determining the training set, test set, and hyperparameter settings, the MSE function is used as the loss function. The MSE formula is as follows:

[0090]

[0091] in, Represents node V i The predicted value, y i Represents node V i The smaller the MSE, the smaller the gap between the predicted value and the true value of the model.

[0092] Step 5-2: The present invention uses root mean square error (RMSE) and mean absolute error (MAE) as evaluation indicators. The calculation formula is as follows:

[0093]

[0094] in, Represents node V i The predicted value, y i Represents node V i is the true value of , and N is the number of nodes.

[0095] Beneficial effects: In the MGC module, the present invention analyzes and mines three potential spatiotemporal features. The kernel correlation feature is used to reflect some frequently interacting node groups in the road network, and their internal correlation features are mined for weight correction in the model prediction process, giving more attention to these key nodes. The congestion correlation feature is used to reflect the congestion correlation of all nodes in the road network, because when congestion occurs between two adjacent or correlated nodes, the traffic flow change of the other node will be affected. The causal correlation feature reflects the similarity of nodes and causal relationships in the road network. In real life, the prediction results may be inaccurate or missing due to hardware problems or data containing noise. The historical traffic characteristics between two nodes with high similarity can achieve the effect of mutual reference of information when using GCN for information aggregation. Based on this, due to the interference of some other noises, some abnormal similarities may be caused, and this influence is filtered out through causal tests. In the DMF module, the present invention fuses the basic road distance correlation features and the three proposed new spatiotemporal features. Compared with the traditional methods of directly using the Hadamard product or directly adding them, which may cause more feature loss or anomalies, the DMF module uses the attention mechanism to dynamically evaluate the importance of each node in different features during the training process, and fuses the above features through the gating mechanism. Then, the distance correlation feature is added to the prediction process through the residual connection method to promote feature circulation and reduce feature loss. Finally, the features are further extracted through CNN and GCN and the prediction results are output. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] Figure 1 : MGC-DMF model framework diagram;

[0097] Figure 2 : ICNC matrix construction process;

[0098] Figure 3 : TCC matrix construction process;

[0099] Figure 4 : Loss function convergence process;

[0100] Figure 5 : Visualization of MGC-DMF performance indicators. DETAILED DESCRIPTION

[0101] The present invention is further described below in conjunction with the accompanying drawings.

[0102] The whole process diagram is as follows Figure 1 As shown, a multi-source basic information traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion.

[0103] Step 1: Preprocess the original traffic flow data, convert the sensor information in the road network into traffic features and adjacency matrix, and divide them into training set and test set. The specific steps are as follows:

[0104] Step 1-1: The present invention uses G = (V, A, E) to construct a traffic spatiotemporal graph network, where V = {V1, V2, .., V N} represents the set of sensors in the road network, and N is the number of nodes. N×N represents the adjacency matrix, which is used to reflect the weights and spatial features between nodes, and E represents the set of edges. T}∈R T×N represents the temporal characteristics of the described traffic network, X i ∈R T×1 Represents the eigenvalues ​​of all nodes corresponding to the i-th time slice. X is defined as follows:

[0105]

[0106] where x i,j represents the traffic characteristic value of node j in the i-th time slice. Therefore, the expression of the traffic flow prediction problem studied in the present invention is defined as follows:

[0107] (X T+1 , X T+2 , ..., X T+H )=f(X T-h+1 , ..., X T-1 , X T )

[0108] Wherein h represents the number of historical time slices used for prediction, H represents the number of future time slices predicted, and f() represents the prediction expression of the prediction model proposed by the present invention;

[0109] Step 1-2: Determine the hyperparameter settings of the MGC-DMF model and correctly divide the dataset into training set and test set for model training and testing.

[0110] Step 2: Construct a multi-graph convolution module MGC and construct four sub-modules to model four types of spatiotemporal features respectively.

[0111] Step 2-1: Create ICNC module, as shown in the attached Figure 2 As shown in Figure 1, the module outputs the internal correlation adjacency matrix (core correlation matrix) representing some node groups with frequent internal traffic interactions in the traffic network. The historical features are clustered using the K-Means algorithm to determine the number of core groups, which are defined as follows:

[0112] K out:{{V1,C i}, {V2, C i}, …, {V N , C i}}=K-Means(X 1 , X 2 , …, X N )

[0113] Among them, {V j , C i} represents node j belongs to the i-th class. K represents the number of classes and is an adjustable hyperparameter. i ∈R T×N Represents all eigenvalues ​​of node i. K out Represents the clustering results.

[0114] Step 2-2: To make up for the global features that the K-Means algorithm fails to represent, the centrality algorithm is used to comprehensively measure the influence of each node in the entire road network. Their input is the road adjacency matrix. The output is the importance of each node in the road network and the core node group it belongs to.

[0115] Degree centrality refers to the node V i The ratio of the degree to the total number of points. i ) represents node V i degree, that is, the degree of node V i The number of connected edges. The calculation formula is as follows:

[0116]

[0117] Closeness centrality refers to the inverse of the average shortest path length between a node and other nodes. i , V j ) is the node V i , V j The minimum number of edges required can be reached between them. The calculation formula is as follows:

[0118]

[0119] Betweenness centrality refers to the frequency with which a node appears on the shortest path between all pairs of nodes. V i and V k The number of shortest paths between . is node v i and v k Through the node v j The calculation formula is as follows:

[0120]

[0121] The main idea of ​​eigenvector centrality is that the importance of a node depends on its degree of connection with other important nodes. If a node is already connected to many other nodes, and these nodes are also important nodes, then the importance of the node will increase accordingly. This is an iterative calculation process, and the eigenvector centrality of all nodes will be initialized at the beginning. ij Representative A Distance The distance between two nodes in EC. t (V i ) is the eigenvector centrality of node i at the tth iteration. λ is the adjacency matrix A Distance The maximum eigenvalue of . The calculation formula is as follows:

[0122]

[0123] The main idea of ​​PageRank centrality is that the more times a node is linked, the more important it is. d represents the damping factor (usually set to 0.85), which indicates the probability that the user will continue to browse the web page based on the current link. i ) represents the direction to node V i The node set, that is, V i Out(V j ) is the node V j The out-degree of PageRank is also an iterative calculation process. The calculation formula is as follows:

[0124]

[0125] The main idea of ​​Katz centrality is to consider not only the direct neighbors of a node, but also the influence of indirect neighbors. i ) represents the centrality of node i. α and β are parameters used to adjust the contribution of direct neighbors and indirect neighbors to the centrality of the node. Usually, λ max is the maximum eigenvalue of the adjacency matrix. The calculation formula is as follows:

[0126]

[0127] Next, for the several centralities R N×1 Perform the following splicing operations:

[0128] CentArrays({V i :{Cen1, Cen2,...,Cen6}})=[DC|CC|BC|EC|PR|Katz]∈R N×6

[0129] Where Ceni is the i-th centrality algorithm mentioned above, and '|' represents concatenation. Then take the average of CentArrays and use the K-Means classification result K out The sum is calculated to obtain the total importance of each node cluster. The overall importance is then mapped to each node of the corresponding class and normalized to obtain a node-category-importance comparison table VIC with classification identifiers. The process expression is as follows:

[0130] VIC: {{V1:[Imp, C i ]}, ..., {V N :[Imp,C i ]}}

[0131] =Normalize{MapToEachNode{SumBy(K out )[MeanByNode(CentArrays)]}}

[0132] Among them, {V j ,I,C i} represents the global importance I of node j and belongs to C i Node cluster. MeanByNode represents the average value of CentArrays, SumBy(K out ) represents the out Solve the importance of each node cluster. MapToEachNode means assigning the overall importance of each class to each node as the global importance. Normalize means the normalization operation.

[0133] Step 2-3: Calculate the Pearson correlation to supplement the global correlation feature. The calculation formula is as follows:

[0134]

[0135] Among them, Cov(X i , X j ) represents X i and X j The covariance of . and Represents X i and X j A[i, j] represents the standard deviation of V i and V j The size of the correlation.

[0136] If two nodes belong to the same class, A CorThe corresponding elements in are classified and multiplied with the VIC comparison table to obtain the ICNC matrix. The calculation formula is as follows:

[0137]

[0138] Where VIC[V k ].Imp represents node V k The global importance of A ICNC [i, j] represents V i and V j The global core relevance of .

[0139] Step 2-4: Create a TCC module, as shown in the attached Figure 3 As shown in Figure 1, the travel comfort vector TCV is calculated, and the congestion correlation adjacency matrix TCC is calculated based on TCV. The data used comprehensively considers the flow X Flow ∈R T×N , speed X Speed ∈R T×N , road occupancy rate X Occupation ∈R T×N First, we need to calculate each node V i Corresponding to the peak carrying capacity of the three characteristics, the road peak flow carrying capacity RDFCC∈R 1×N , road peak speed carrying capacity RDSCC∈R 1×N , road peak occupancy carrying capacity RDOCC∈R 1×N The calculation method is as follows:

[0140]

[0141] in, Represents each node The set of maximum values ​​over all time slices. represents the eigenvalue of a node in all time slices. Next, for each node V i The TVC formula is established to measure the travel comfort level of a node. The calculation formula is as follows:

[0142]

[0143] Among them, Occ j represents the characteristic value corresponding to the current node at the jth time slice. This is done to use the maximum value of the characteristic as the benchmark, and then calculate the ratio of the characteristic value to the maximum benchmark at each moment as the driving pressure of the current road. Then, the speed ratio and flow ratio are averaged and summed to obtain the comprehensive road driving pressure. Then, Multiply (representing the remaining utilization rate of the road at the current moment) as a balancing factor to alleviate the driving pressure of the comprehensive road, and get the node V i Travel comfort vector TCV i ∈R 1×N , represents the travel comfort of each node.

[0144] Step 2-5: Construct the TCC congestion correlation matrix, the TCV obtained in step 2-4 i To a certain extent, it can reflect the congestion of a road. When the travel comfort is high, the current road congestion is light. When the travel comfort is low, the current road congestion is serious. In order to explore the impact of the current road traffic congestion on other roads, the ratio of the travel comfort of each node to the travel comfort of other nodes can be used to measure the congestion correlation. The calculation formula is as follows:

[0145]

[0146] Among them, TCV i Representative node V i Travel comfort, TCV j Representative node V j The travel comfort of the node V is represented by the ratio TCC[i,j] of the two. i and V j The congestion correlation is used to measure the influence of the congestion status of the current node on other nodes.

[0147] Step 2-6: Establish a DG module to explore the similarity between two road nodes from the perspective of causal relationship and similarity relationship, and verify through the algorithm whether a node can be used as a predictor variable for another node. The calculation formula is as follows:

[0148] S[i, j] = DTW(X i , X j )

[0149] G[i, j] = Granger(X i , X j )

[0150] A CS [i, j] = S [i, j] ⊙ G [i, j

[0151] Among them, S[i, j] represents the node V i and node V j The feature similarity of G[i, j] represents the node V i Can it be used as a node V j A prediction node. CS[i, j] is the causal similarity matrix, which is used to mine similar latent features filtered by causal relationships.

[0152] Step 2-7: Establish the Dis module, encode the basic road structure (distance, connectivity adjacency matrix) and historical features using GCN, and obtain the basic distance correlation matrix A Dis and distance space-time feature X Dis The calculation formula is as follows:

[0153]

[0154] Where distance(V i , V j ) is the node V i and V j The transportation distance, A Dis [i, j] is the node V i and V j Distance correlation. The longer the distance between two nodes, the smaller the weight; the shorter the distance, the larger the weight.

[0155] Step 3: Dynamically evaluate and integrate the four spatiotemporal features obtained in step 2 during the training process.

[0156] Step 3-1: First, A ICNC , A TCC , A CS The three features are fused and the calculation formula is as follows:

[0157] X ICNC =BiGRU(GCN(A ICNC , X Flow ))

[0158] X TCC =BiGRU(GCN(A TCC ,X Flow ))

[0159] X CS =BiGRU(GCN(A CS , X Flow ))

[0160] After the spatiotemporal convolution, the spatiotemporal features of the output of three modules are obtained: X ICNC , X TCC , X CS .

[0161] Step 3-2: In order to better integrate these three features, three additional trainable parameters are set to optimize this process. The calculation formula is as follows:

[0162] STF=(k1*XICNC +k2*X TCC +k3*X CS ) / 3

[0163] Among them, k1, k2, and k3 are trainable parameters, and STF is the fused spatiotemporal feature. STF is one of the outputs of the multi-graph convolution module MGC.

[0164] Step 3-3: Distance correlation matrix A Dis The temporal and spatial correlation feature modeling is performed separately with the historical traffic characteristics for subsequent residual linking and dynamic evaluation fusion, which is also the second output of the MGC module, denoted as ASTF. The calculation formula is as follows:

[0165] ASTF = BiLSTM(IEGCN(DisW,X Flow ))

[0166] Furthermore, in step 4, different features usually have different information values. The DMF module can be integrated according to the scoring weight to avoid the loss and mixing of features caused by the fusion of simple basic operations, reduce the impact of redundant information, increase the model's attention to key information, and improve the robustness of the model. The attention mechanism algorithm can automatically learn and focus on important information. The two spatiotemporal features ASTF and STF obtained in step 3 are dynamically evaluated and integrated during the training process to obtain the final spatiotemporal feature output FSTF (Final STF). Then the residual network is used to promote the further flow of features and make up for the lost features. Finally, prediction is performed.

[0167] Step 4-1: Input the two spatiotemporal features into the attention mechanism respectively, learn the key information in the features, and obtain the weight scores corresponding to each node in different features through the Tanh activation function. The scoring process of this network module is as follows:

[0168]

[0169] S = Mean (S1, S2)

[0170] Among them, Linear() represents the linear layer. is a trainable weight matrix. A , k A , v A It is the key value of the feature ASTF. B , k B , v Bis the key value of the feature STF. The Soffmax() layer is used to calculate the attention weights, normalize them to probability distribution, and ensure that the sum of the outputs of all categories is 1. Tanh() is the activation function. v1 and v2 represent trainable weight parameters. Then, the weights S1 and S2 of the two features obtained above are averaged and the final spatiotemporal features are obtained. S1 and S2 are the scoring weights of the features STF and ASTF, respectively. Mean(S1, S2) represents the mean of S1 and S2.

[0171] Step 4-2: Based on the idea of ​​the gating mechanism, the two features of STF and ASTF are integrated. The calculation formula is as follows:

[0172] FSTF=(1-S)⊙STF+S⊙ASTF

[0173] Among them, FSTF is the eigenvalue of the fusion of STF and ASTF. ⊙ represents the Hadamard product.

[0174] Step 4-3: In order to prevent the problems of feature loss, gradient vanishing and gradient explosion, residual links are introduced to extract features from a richer perspective with the convolutional neural network. The residual information mainly comes from the spatiotemporal feature output of the basic information and the graph convolution output. The network structure is defined as follows:

[0175] ResCNN=CNN(FSTF+STF)

[0176] IEGCN=LeakyReLU(Linear(IEGCN(DisW,X Flow )))

[0177] ResFSTF=Linear(LeakyReLU(Linear(ResCNN+IEEGCN)))

[0178] PreResult=GCN(DisW,ResFSTF)

[0179] Among them, CNN() represents the convolutional neural network layer, LeakyReLU is the activation function, and PreResult is the prediction result.

[0180] Step 5: The training process uses the MSE loss function to measure the difference between the true value and the error value, thereby optimizing the trainable weight matrix. The RMSE and MAE performance evaluation indicators are used to evaluate the performance of the proposed model for the prediction results of the test set. Figure 4 As shown in the figure, the Loss convergence process is visualized. Figure 5 As shown, the present invention visualizes the prediction performance indicator results.

[0181] Step 5-1: During the training process, after determining the training set, test set, and hyperparameter settings, the MSE function is used as the loss function. The MSE formula is as follows:

[0182]

[0183] in, Represents node V i The predicted value, y i Represents node V i The smaller the MSE, the smaller the gap between the predicted value and the true value of the model.

[0184] Step 5-2: The present invention uses root mean square error (RMSE) and mean absolute error (MAE) as evaluation indicators. The calculation formula is as follows:

[0185]

[0186] in, Represents node V i The predicted value, y i Represents node V i is the true value of , and N is the number of nodes.

[0187] The above description is only a preferred implementation of the present invention under the PEMSD8 data set. The protection scope of the present invention is not limited to the above implementation. Any equivalent modifications and other modifications made by ordinary technicians in this field based on the contents disclosed by the present invention should be included in the protection scope recorded in the claims.

Claims

1. A traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion, characterized in that: The following steps are involved: Step 1: Collect information from the road network, convert it into data features that can be recognized by the model, and build a data set based on the data features; Step 2: Construct a multi-source basic information traffic flow prediction network based on multi-graph spatiotemporal convolution and dynamic metric fusion, the network includes an MGC module and a DMF module; the MGC module is used to restore the real spatiotemporal correlation characteristics and potential spatiotemporal correlation characteristics of the road network and simulate the real situation of the road network. It contains four submodules to model and output four spatiotemporal characteristics: road distance correlation feature X Dis , kernel correlation feature X ICNC , congestion correlation feature X TCC , and the causal similarity feature X CS ; Step 3: Use GCN, BiLSTM, and BiGRU network structures to model the spatiotemporal correlation of the four spatiotemporal features; Step 4: The DMF module further dynamically fuses the four spatiotemporal features in the MGC module through the attention mechanism during the training process. After fusion, the features are further extracted through residual connection, CNN and GCN, and finally the prediction results are output; Step 5: Based on the data set, a traffic flow prediction network based on multi-graph spatiotemporal convolution and dynamic metric fusion is trained, and the MSE function is used as the loss function as a method to evaluate the error between the true value and the loss value in the prediction process, so as to dynamically adjust the weight of the traffic flow prediction expression; and the performance of the final generated test set prediction results is evaluated using two error indicators.

2. The traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion according to claim 1 is characterized by: In step 1, the original traffic flow data is preprocessed, the sensor information in the road network is converted into traffic features and adjacency matrix, and divided into training set and test set. The specific steps are as follows: Use G = (V, A, E) to construct the traffic spatiotemporal graph network, where V = {V1, V2, .., V N } represents the set of sensors in the road network, N is the number of nodes, A∈R N×N represents the adjacency matrix, which is used to reflect the weights and spatial features between nodes. E represents the set of edges. X = {X1, X2, …, X T }∈R T×N represents the temporal characteristics of the described traffic network, X i ∈R T×1 Represents the eigenvalues ​​of all nodes corresponding to the i-th time slice. X is defined as follows: where x i,j represents the traffic characteristic value of node j in the i-th time slice; the traffic flow prediction problem expression is defined as follows: (X T+1 ,X T+2 ,…,X T+H )=f(X T-h+1 ,…,X T-1 ,X T ) Wherein h represents the number of historical time slices used for prediction, H represents the number of future time slices predicted, and f() represents the prediction expression of the prediction model proposed by the present invention.

3. The traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion according to claim 2 is characterized by: In step 2, the steps of constructing the MGC module include: Step 2-1: Establish an ICNC module, which outputs the internal correlation adjacency matrix representing some node groups with frequent internal traffic interactions in the transportation network; cluster the historical features through the K-Means algorithm to determine the number of core groups, which are defined as follows: K out :{{V1,C i },{V2,C i },…,{V N ,C i }}=K-Means(X 1 ,X 2 ,…,X N ) Among them, {V j ,C i } represents node j belongs to the i-th class, K represents the number of classes and is an adjustable hyperparameter, X i ∈R T×N represents all eigenvalues ​​of node i, K out represents the clustering results; Step 2-2: Use the centrality algorithm to comprehensively measure the influence of each node in the entire road network. The input of the node is the road adjacency matrix, and the output is the importance of each node in the road network and the core node group it belongs to. The specific steps include: Degree centrality DC(V i ), the calculation formula is as follows: Among them, deg(V i ) represents node V i degree, that is, the degree of node V i The number of connected edges; Definition of closeness centrality CC(V i ), the calculation formula is as follows: Among them, the shortest path d(V i ,V j ) is the node V i ,V j The minimum number of edges required to reach between them; Define the betweenness centrality BC(V i ), the calculation formula is as follows: in, V i and V k The number of shortest paths between is node v i and v k Through the node v j The number of shortest paths; Define the eigenvector centrality EC of node i at the tth iteration t (V i ), the calculation formula is as follows: Among them, a ij Representative A Distance The distance between two nodes in EC t (V i ) is the eigenvector centrality of node i at the tth iteration, λ is the adjacency matrix A Distance The maximum eigenvalue of Define PageRank centrality PT(V i ), the calculation formula is as follows: Where d represents the damping factor, which indicates the probability that the user continues to browse the web page according to the current link; Out(V j ) is the node V j The out-degree of Define the Katz centrality of node i as Katz(V i ), the calculation formula is as follows: Among them, α and β are parameters used to adjust the contribution of direct neighbors and indirect neighbors to the node centrality. λ max is the largest eigenvalue of the adjacency matrix; For several obtained centrality R N×1 Perform the following splicing operations: CentArrays({V i :{Cen1,Cen2,…,Cen6}})=[DC|CC|BC|EC|PR|Katz]∈R N×6 Where Ceni is the i-th centrality algorithm mentioned above, and '|' represents concatenation; then the CentArrays are averaged and the K-Means classification result K is used. out The sum is calculated to obtain the total importance of each node cluster. The overall importance is then mapped to each node of the corresponding class and normalized to obtain a node-category-importance comparison table VIC with classification identifiers. The expression is as follows: VIC:{{V1:[Imp,C i ]},…,{V N :[Imp,C i ]}} =Normalize{MapToEachNode{SumBy(K out )[MeanByNode(CentArrays)]}} Among them, {V j ,I,C i } represents the global importance I of node j and belongs to C i Node cluster; MeanByNode represents the average value of CentArrays, SumBy(K out ) represents the out Solve the importance of each node cluster. MapToEachNode means assigning the overall importance of each class to each node as the global importance. Normalize means the normalization operation. Step 2-3: Calculate the Pearson correlation to supplement the global correlation feature. The calculation formula is as follows: Among them, Cov(X i ,X j ) represents X i and X j The covariance of and Represents X i and X j The standard deviation of V i and V j The size of the correlation; If two nodes belong to the same class, A Cor The corresponding elements in are classified and multiplied with the VIC comparison table to obtain the ICNC matrix. The calculation formula is as follows: Where VIC[V k ].Imp represents node V k The global importance of A ICNC [i,j] represents V i and V j The global core relevance of Step 2-4: Establish the TCC module, calculate the travel comfort vector TCV, and calculate the congestion correlation adjacency matrix TCC based on TCV; the data used comprehensively considers the flow X Flow ∈R T×N , speed X Speed ∈R T×N , road occupancy rate X Occupation ∈R T ×N ; The specific steps include: First, calculate each node V i Corresponding to the peak carrying capacity of the three characteristics: road peak flow carrying capacity RDFCC∈R 1×N , road peak speed carrying capacity RDSCC∈R 1×N , road peak occupancy carrying capacity RDOCC∈R 1×N , the calculation method is as follows: in, Represents each node The set of maximum values ​​over all time slices; represents the eigenvalue of a node in all time slices; then, for each node V i The TVC formula is established to measure the travel comfort level of a node. The calculation formula is as follows: Among them, Occ j Represents the characteristic value corresponding to the current node at the jth time slice. Taking the maximum value of the characteristic as the benchmark, the ratio of the characteristic value to the maximum benchmark at each moment is calculated as the driving pressure of the current road. Then, the speed ratio and the flow ratio are averaged and summed to obtain the comprehensive road driving pressure. Then, Multiply them together and use them as a balancing factor to relieve the driving pressure of the comprehensive road, and get the node V i Travel comfort vector TCV i ∈R 1×N , represents the travel comfort of each node; Step 2-5: Construct the TCC congestion correlation matrix. The calculation formula is as follows: Among them, TCV i Representative node V i Travel comfort, TCV j Representative node V j The travel comfort of the node V is represented by the ratio TCC[i,j] of the two. i and V j The congestion correlation is used to measure the influence of the congestion status of the current node on other nodes; Step 2-6: Establish the DG module. The calculation formula is as follows: S[i,j]=DTW(X i ,X j ) G[i,j]=Granger(X i ,X j ) A CS [i,j]=S[i,j]⊙G[i,j] Among them, S[i,j] represents the node V i and node V j The feature similarity of G[i,j] represents the node V i Can it be used as a node V j The prediction node A CS [i,j] is the causal similarity matrix, which is used to mine similar latent features filtered by causal relationships; Step 2-7: Establish the Dis module, encode the basic road structure and historical features using GCN, and obtain the basic distance correlation matrix A Dis and distance space-time feature X Dis , the calculation formula is as follows: Where distance(V i ,V j ) is the node V i and V j The transportation distance, A Dis [i,j] is the node V i and V j Distance correlation.

4. The traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion according to claim 3 is characterized by: The step 3 is to dynamically evaluate and integrate the four spatiotemporal features during the training process, and the specific steps include: Step 3-1: First, A ICNC ,A TCC ,A CS The three features are fused and the calculation formula is as follows: X ICNC =BiGRU(GCN(A ICNC ,X Flow )) X TCC =BiGRU(GCN(A TCC ,X Flow )) X CS =BiGRU(GCN(A CS ,X Flow )) After the spatiotemporal convolution, the spatiotemporal features of the output of three modules are obtained: X ICNC , X TCC , X CS ; Step 3-2: Set three trainable parameters to optimize the fusion process. The calculation formula is as follows: STF=(k1*X ICNC +k2*X TCC +k3*X CS ) / 3 Among them, k1, k2, and k3 are trainable parameters, STF is the fused spatiotemporal feature, and STF is one of the outputs of the multi-graph convolution module MGC; Step 3-3: Distance correlation matrix A Dis The spatiotemporal correlation feature modeling is performed separately with the historical traffic characteristics for subsequent residual linking and dynamic evaluation fusion. It is also the second output of the MGC module, denoted as ASTF, and the calculation formula is as follows: ASTF=BiLSTM(IEGCN(DisW,X Flow ))。 5. The traffic flow prediction method based on multi-graph spatiotemporal convolution kernel dynamic metric fusion according to claim 4 is characterized by: The step 4 specifically includes: Step 4-1: Input the two spatiotemporal features ASTF and STF into the attention mechanism respectively, learn the key information in the features, and obtain the weight scores corresponding to each node in different features through the Tanh activation function. The scoring process is as follows: S=Mean(S1,S2) Among them, Linear() represents the linear layer; is the trainable weight matrix; q A ,k A ,v A is the key value of the feature ASTF; q B ,k B ,v B is the key value of the feature STF; the Softmax() layer is used to calculate the attention weights, normalize them to probability distribution, and ensure that the sum of the outputs of all categories is 1; Tanh() is the activation function; v1 and v2 represent trainable weight parameters; then the weights S1 and S2 of the two features obtained above are averaged and the final spatiotemporal features are obtained; S1 and S2 are the scoring weights of the features STF and ASTF respectively; Mean(S1,S2) represents the mean of S1 and S2; Step 4-2: Based on the idea of ​​the gating mechanism, the two features of STF and ASTF are integrated. The calculation formula is as follows: FSTF=(1-S)⊙STF+S⊙SATF Among them, FSTF is the eigenvalue of the fusion of STF and ASTF, ⊙ represents the Hadamard product; Step 4-3: Introduce residual links and use convolutional neural networks to extract features from a richer perspective; the residual information comes from the spatiotemporal feature output of the basic information and the graph convolution output; the residual network structure is defined as follows: ResCNN=CNN(FSTF+STF) IEGCN=LeakyReLU(Linear(IEGCN(DisW,X Flow ))) ResFSTF=Linear(LeakyReLU(Linear(ResCNN+IEEGCN))) PreResult=GCN(DisW,ResFSTF) Among them, CNN() represents the convolutional neural network layer, LeakyReLU is the activation function, and PreResult is the prediction result.

6. The traffic flow prediction method based on multi-graph spatiotemporal convolution and dynamic metric fusion according to claim 5 is characterized by: The step 5 specifically includes: Step 5-1: During the training process, after determining the training set, test set, and hyperparameter settings, the MSE function is used as the loss function. The MSE formula is as follows: in, Represents node V i The predicted value, y i Represents node V i The true value of, N is the number of nodes, the smaller the MSE, the smaller the gap between the predicted value of the representative model and the true value; Step 5-2: Use root mean square error RMSE and mean absolute error MAE as evaluation indicators. The calculation formula is as follows: in, Represents node V i The predicted value, y i Represents node V i is the true value of , and N is the number of nodes.