Traffic flow prediction method based on multi-scale joint spatiotemporal hypergraph neural network

Through the multi-scale combined spatiotemporal hypergraph neural network method, multi-scale spatiotemporal characteristics in traffic flow data are extracted and their higher-order dependencies are modeled, which solves the problem of difficulty in modeling multi-scale spatiotemporal dependencies in the existing technology, and achieves more efficient traffic flow prediction.

CN118966479BInactive Publication Date: 2025-03-25ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411448361.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2024-09-29
Filing Date
2024-10-17
Publication Date
2025-03-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods are difficult to effectively model multi-scale spatiotemporal dependence in traffic flow data, especially feature interactions across different spatial and temporal scales.

Method used

Using a method based on multi-scale combined space-time hypergraph neural network, multi-scale spatiotemporal features are extracted through the space-time pyramid modeling module, and high-order dependencies of multi-scale spatiotemporal features are modeled through three-stage hypergraph propagation in the adaptive hypergraph modeling module.

Benefits of technology

It significantly improves the accuracy of traffic flow prediction, can more effectively capture the high-order correlation between multi-scale spatio-temporal features, and is suitable for scenarios such as traffic resource scheduling, road network planning, and travel route recommendation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118966479B_ABST
    Figure CN118966479B_ABST
Patent Text Reader

Abstract

The present invention discloses a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network, comprising: constructing training samples according to traffic flow data, constructing a graph adjacency matrix for each spatial scale based on each batch of training samples; constructing a multi-scale joint spatiotemporal hypergraph neural network model, extracting multi-scale spatiotemporal features from the training samples based on the graph adjacency matrix and the constructed spatial pyramid graph in the spatiotemporal pyramid modeling module; learning the hypergraph structure and performing three-stage hypergraph propagation in the adaptive hypergraph modeling module to model the high-order dependencies between multi-scale spatiotemporal features; fusing the updated multi-scale spatiotemporal features in the fusion and output module and outputting the prediction results; and using the training samples for model training and then using them for traffic flow prediction. The present invention introduces a hypergraph neural network to explicitly model the interactions between multi-scale spatiotemporal features, that is, jointly modeling the multi-scale spatiotemporal dependencies, which can improve the prediction accuracy of traffic flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent traffic flow prediction, and specifically relates to a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network. Background Art

[0002] With the continuous development of urbanization and industrialization, the number of cars has continued to increase, and urban traffic congestion has become increasingly serious. This urban disease not only affects the daily travel experience of residents, but also brings huge challenges to urban road planning and traffic management. In this regard, it is particularly important to accurately predict the traffic flow of future traffic networks. Accurate traffic flow prediction not only helps traffic management departments to efficiently dispatch traffic resources and thus alleviate urban road congestion, but also guides citizens' travel route planning. Therefore, traffic flow prediction has become one of the most valuable research directions in intelligent transportation systems.

[0003] Accurately predicting traffic flow is very challenging because traffic flow data involves complex multi-scale spatiotemporal dependencies. For example, for multi-scale spatial dependencies, the traffic flow of a road is correlated with the traffic flow of its adjacent roads at the local scale; the traffic flow of urban areas with similar functions may also be correlated at the regional scale. For multi-scale temporal dependencies, traffic flow usually increases in the morning and decreases in the evening on a daily scale; and increases on weekdays and decreases on weekends on a weekly scale.

[0004] Existing traffic flow prediction methods can be divided into statistical methods and deep learning methods. Statistical methods, such as Vector Auto-Regressive Model (VAR), Vector Auto-Regressive Moving Average Model (VARMA) and Gaussian Process, cannot effectively model nonlinear dependencies between variables. Recently, deep learning-based methods have shown superiority in modeling nonlinear dependencies between variables. Recurrent Neural Network (RNN), Temporal Convolutional Network (TCN) and Self-Attention Network model temporal dependencies by capturing the relationship between features at different time steps. Graph Neural Network (GNN) treats variables as nodes and models spatial dependencies by propagating and updating node information. By combining graph neural networks with various networks that model temporal dependencies, Spatial-Temporal Graph Neural Network (STGNN) is able to extract rich information in both spatial and temporal dimensions.

[0005] Currently, some deep learning-based methods have shown great interest in modeling multi-scale spatiotemporal dependencies. Some methods only model multi-scale spatial dependencies or only model multi-scale temporal dependencies. Some recent methods model multi-scale spatial dependencies and multi-scale temporal dependencies through separate networks. However, these methods ignore the feature interactions across different spatial and temporal scales, that is, they cannot jointly model multi-scale spatiotemporal dependencies. Summary of the invention

[0006] In view of the above, the purpose of the present invention is to provide a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network, which can improve the prediction accuracy of traffic flow by extracting multi-scale spatiotemporal features from traffic flow data and introducing hypergraph modeling technology to jointly model the high-order dependencies between multi-scale spatiotemporal features in traffic flow data. In the context of smart cities, it has broad application value in scenarios such as traffic resource scheduling, road network planning, and travel route recommendation.

[0007] In order to achieve the above-mentioned invention object, the technical solution provided by the present invention is as follows:

[0008] The embodiment of the present invention provides a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network, comprising the following steps:

[0009] Preprocess the given traffic flow data and construct training samples, and build a graph adjacency matrix for each spatial scale based on each batch of training samples;

[0010] Construct a multi-scale joint spatiotemporal hypergraph neural network model including a spatiotemporal pyramid modeling module, an adaptive hypergraph modeling module, and a fusion and output module. In the spatiotemporal pyramid modeling module, multi-scale spatiotemporal features are extracted from training samples based on the graph adjacency matrix and the constructed spatial pyramid graph.

[0011] In the adaptive hypergraph modeling module, each feature of the multi-scale spatiotemporal features is used as a node in the hypergraph. The hypergraph structure is learned and three-stage hypergraph propagation including node to hyperedge, hyperedge to hyperedge and hyperedge to node is performed to model the high-order dependencies between the multi-scale spatiotemporal features.

[0012] In the fusion and output module, the multi-scale spatiotemporal features updated by the adaptive hypergraph modeling module are fused and the traffic flow prediction results are output;

[0013] The training samples are used to train the multi-scale joint spatiotemporal hypergraph neural network model, and the trained multi-scale joint spatiotemporal hypergraph neural network model is used to predict traffic flow.

[0014] Specifically, the preprocessing of given traffic flow data and constructing training samples includes:

[0015] The given traffic flow data is preprocessed including outlier and missing value elimination and standardization, and the time window size is set. Based on the time sequence, the preprocessed data is divided into training sets using a fixed-length sliding step, and the training sets are divided into batches according to the set batch size. Divide into batches, the total number of batches is , randomly select a batch of training samples from the training data set, where the data of each training sample contains variables Historical observations at time steps , a variable is a traffic flow monitoring sensor.

[0016] Specifically, constructing a graph adjacency matrix for each spatial scale based on each batch of training samples includes:

[0017] Spatial scale Unique graph adjacency matrix It is obtained through a graph learning method based on a memory network, and the formula is as follows:

[0018] ,

[0019] in, Represents the spatial scale with monitoring sensors as nodes Unique node embedding, Representing spatial scale The number of nodes, represents the spatial graph pooling ratio, represents the dimension of node embedding, Representing spatial scale A unique collection of memory items, represents the number of memory items, Representing spatial scale A unique projection matrix, represents the ReLU activation function, Represents the Softmax function, the superscript represents transpose, Representing spatial scale A unique graph adjacency matrix, for each batch of training samples, is finally constructed to obtain the corresponding graph adjacency matrix for each spatial scale.

[0020] Specifically, the multi-scale spatiotemporal features are extracted from the training samples based on the graph adjacency matrix and the constructed spatial pyramid graph in the spatiotemporal pyramid modeling module, including:

[0021] In the spatial pyramid graph learning submodule of the spatiotemporal pyramid modeling module, the graph allocation matrix is ​​initialized based on Construct a spatial pyramid diagram, where Represents the spatial scale with monitoring sensors as nodes From node to space scale The probability of assigning the node to the previous node, Indicates the number of spatial scales;

[0022] In the multi-scale spatiotemporal feature extraction submodule of the spatiotemporal pyramid modeling module, based on the historical observations and spatial pyramid diagrams in the input training samples, multi-scale spatiotemporal features that model temporal and spatial dependencies at multiple time scales and multiple spatial scales are extracted.

[0023] Specifically, based on the historical observations and the spatial pyramid diagram in the input training samples, multi-scale spatiotemporal features that model time and space dependencies at multiple time scales and multiple spatial scales are extracted, including:

[0024] Will Defined as spatial scale and time scale The historical observations Represented as spatial scale and time scale Features ,Will and the spatial pyramid map are input into the multi-scale spatiotemporal feature extraction submodule;

[0025] In the multi-scale spatiotemporal feature extraction submodule, the temporal convolutional network is first used to coarsen the information of the time dimension to extract multi-scale temporal features. The temporal convolutional network contains a kernel size of A one-dimensional convolutional layer and a The average pooling layer is used to process , the formula is as follows:

[0026] ,

[0027] in, Represented in spatial scale and time scale The above characteristics, Indicates time scale The number of temporal features, Indicates the time scale To time scale The temporal feature pooling ratio, represents the convolution operation, Represents the pooling operation, and in this way we get Characteristic sequence of time scales , Represents the total number of all monitoring sensor nodes;

[0028] Afterwards, the multi-scale spatiotemporal feature extraction submodule extracts multi-scale spatiotemporal features through the spatiotemporal encoder. The spatiotemporal encoder is based on graph convolutional cycle units GCRUs, and the formula is as follows:

[0029] ,

[0030] in, Represented in spatial scale and time scale The spatiotemporal characteristics of represents the feature dimension, Representing spatial scale The graph adjacency matrix of ;

[0031] According to the dependencies between nodes at different spatial scales represented by the spatial pyramid graph, the initial features are Input to GCRUs, the spatiotemporal characteristics of the current spatial scale Get the spatiotemporal characteristics of the next spatial scale , the formula is as follows:

[0032] ,

[0033] in, Represented in spatial scale and time scale The spatiotemporal characteristics of Represents transposition. Since GCRUs adopts a cyclic modeling approach, The last hidden state of It is used to remember historical information. By matching the features of the last hidden state of each time scale with the memory items of a specific spatial scale, the spatiotemporal features enhanced by the memory network are obtained. The formula is as follows:

[0034] ,

[0035] in, Representing spatial scale and time scale The query matrix, Representing spatial scale The corresponding linear projection matrix is, Representing spatial scale The corresponding bias vector, Representing spatial scale A unique collection of memory items, represents the spatiotemporal features after being updated by the attention-based memory read operation, Represents the spatial scale with monitoring sensors as nodes The number of nodes, represents the spatial graph pooling ratio, represents the number of memory items, Indicates the dimension of node embedding, superscript represents transpose, Represents the Softmax function. After that, by concatenating and The feature dimension of the memory network is enhanced to obtain the spatiotemporal features , Represents a splicing operation;

[0036] Finally, the multi-scale spatiotemporal features output by the spatiotemporal pyramid modeling module are , is the number of time scales, is the number of spatial scales.

[0037] Specifically, in the adaptive hypergraph modeling module, each feature in the multi-scale spatiotemporal features is used as a node in the hypergraph, and the hypergraph structure is learned and three-stage hypergraph propagation including node to hyperedge, hyperedge to hyperedge and hyperedge to node is performed to model the high-order dependencies between the multi-scale spatiotemporal features, including:

[0038] Multi-scale spatiotemporal features Each feature in is regarded as a node in the hypergraph, and the number of nodes in the hypergraph is , Representing spatial scale The total number of nodes with monitoring sensors as nodes, Representing spatial scale The total number of nodes, represents the number of spatial scales, Indicates the number of time scales;

[0039] Through the hypergraph incidence matrix Reflects the learned hypergraph structure, is the number of hyperedges. First, by selecting the hypergraph incidence matrix The largest number of assignment probabilities in each row, the hypergraph association matrix After sparse processing, the hypergraph association matrix after sparse processing is expressed as ,Secondly, through the three-stage hypergraph propagation from node to hyperedge, hyperedge to hyperedge, and hyperedge to node, the multi-scale spatiotemporal features are jointly interacted , and obtain the updated multi-scale spatiotemporal features that model the high-order dependencies between multi-scale spatiotemporal features .

[0040] Specifically, the three-stage hypergraph propagation includes:

[0041] Node to hyperedge: This stage enables each hyperedge to collect the node information belonging to the hyperedge. Therefore, the hyperedge is regarded as a high-order representation that aggregates a set of multi-scale spatiotemporal features. The formula is as follows:

[0042] ,

[0043] in, represents the hyperedge obtained by converting the nodes of the hypergraph, represents the characteristic dimension of the hyperedge, the superscript represents transpose, represents the normalized weight of the hyperedge in the hypergraph, represents the activation function;

[0044] Hyperedge to hyperedge: This stage is used to model the high-order associations between hyperedges. First, a hyperedge graph is learned using a graph learning method based on a memory network. , Secondly, the graph attention network GAT is used to transmit hyperedge information. GAT uses the attention mechanism to dynamically weight neighbor nodes when aggregating the features of neighbor nodes. The formula is as follows:

[0045] ,

[0046] in, represents the hyperedge after being updated by the graph attention network, and then the hyperedge is enhanced by the attention-based memory read operation , the formula is as follows:

[0047] ,

[0048] in, represents the query matrix, Represents the query matrix The corresponding linear projection matrix is, Represents the query matrix The corresponding bias vector, superscript represents transpose, represents the hyperedge that has undergone the memory read operation, Represents a splicing operation, Represents the hyperedge enhanced by the memory network. Finally, the hyperedge is updated through the multi-layer perceptron Get the final hyperedge , the formula is as follows:

[0049] ,

[0050] in, represents a multi-layer perceptron, represents the linear projection matrix, represents the bias vector;

[0051] Hyperedge to node: This stage uses the hypergraph association matrix The super edge Reconvert to Node , that is, the multi-scale spatiotemporal features output by the adaptive hypergraph modeling module , the formula is as follows:

[0052] ,

[0053] in, Standardized operations at the presentation layer.

[0054] Specifically, the multi-scale spatiotemporal features updated by the adaptive hypergraph modeling module are integrated in the fusion and output module to output the prediction result of the traffic flow, including:

[0055] Based on the multi-scale spatiotemporal features updated by the adaptive hypergraph modeling module First, the fusion submodule in the fusion and output module fuses the features of all time scales for each node on each spatial scale, through the normalized parameters To determine the characteristics of each time scale for the fused features The contribution degree is as follows:

[0056] ,

[0057] in, Represents the spatial scale after being updated by the adaptive hypergraph modeling module and time scale The spatiotemporal characteristics of Representing spatial scale After fusion, represents the number of time scales, represents the feature dimension of the hyperedge in the hypergraph, represents the feature dimension, represents the dimension of node embedding with monitoring sensors as nodes;

[0058] Secondly, the fusion submodule fuses the features of all spatial scales by aggregating node features at other spatial scales into the spatial scale Node features on The formula is as follows:

[0059] ,

[0060] in, Represents the spatial scale The node features on the The probability of the node features on represents the graph allocation matrix, represents the total number of all monitoring sensor nodes, Representing spatial scale The number of nodes, represents the spatial graph pooling ratio, represents the number of spatial scales, Represents the final feature after all variables are integrated;

[0061] Finally, the output submodule in the fusion and output modules uses graph convolutional recurrent units (GCRUs) to exploit As the initial hidden state, it outputs the future cyclically The hidden state of time steps , and use linear transformation to Converted into output prediction value .

[0062] Specifically, the training of the multi-scale joint spatiotemporal hypergraph neural network model using training samples includes:

[0063] According to the true observation value of all samples in a batch and the model prediction value The error between them constructs the prediction loss , and construct the graph pooling loss for constrained spatial pyramid graph learning , and get the training loss The formula is as follows:

[0064] ,

[0065] in, Represents the set graph pooling loss The penalty coefficient of

[0066] According to the training loss , the network parameters in the multi-scale joint spatiotemporal hypergraph neural network model are adjusted until all batches of the training set participate in the model training.

[0067] Specifically, the prediction loss The calculation formula is as follows:

[0068] ,

[0069] in, represents the batch index of the training samples, Indicates the total number of batches;

[0070] Graph Pooling Loss The calculation formula is as follows:

[0071] ,

[0072] in, represents the Frobenius norm, express Chinese Communist Party The average entropy loss of the row, Representing spatial scale The graph adjacency matrix of , with superscript represents transpose, express The OK, represents the entropy function.

[0073] The present invention considers the complex spatiotemporal multi-scale dependencies in traffic flow data and jointly captures the high-order dependencies between multi-scale spatiotemporal features through a hypergraph neural network. Compared with the prior art, the present invention has at least the following beneficial effects:

[0074] (1) The method of the present invention introduces a spatiotemporal pyramid modeling module and learns a spatial pyramid diagram between variables. Each node in the spatial pyramid diagram is composed of multi-scale temporal features, so that multi-scale spatiotemporal features can be extracted from traffic flow data.

[0075] (2) The method of the present invention introduces an adaptive hypergraph modeling module, and uses hypergraph structure learning and three-stage hypergraph propagation to jointly interact multi-scale spatiotemporal features, thereby effectively capturing the high-order correlations between multi-scale spatiotemporal features, and ultimately improving the prediction accuracy of traffic flow. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0077] Figure 1 It is an overall flow chart of a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network provided by an embodiment of the present invention;

[0078] Figure 2 It is an overall framework diagram of the traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0079] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.

[0080] The inventive concept of the present invention is: in response to the problem of how to jointly model the multi-scale spatiotemporal dependencies in traffic flow data, an embodiment of the present invention provides a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network, by preprocessing the traffic flow data, and constructing a training set based on the time sequence sliding window partition; secondly, introducing a spatiotemporal pyramid modeling module to extract multi-scale spatiotemporal features from the traffic flow data; then introducing an adaptive hypergraph modeling module, which explicitly models the interaction between multi-scale spatiotemporal features by learning the hypergraph structure and performing three-stage hypergraph propagation on the hypergraph, and can capture the high-order correlation between multi-scale spatiotemporal features; finally, introducing a fusion and output module to fuse the multi-scale spatiotemporal features into the final feature representation of all variables and output the prediction results, which can effectively improve the prediction accuracy of traffic flow.

[0081] Figure 1 is an overall flow chart of a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network provided by an embodiment of the present invention, Figure 2 is a general framework diagram of a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network provided by an embodiment of the present invention. Figure 1 and Figure 2 As shown, the embodiment provides a traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network, comprising the following steps:

[0082] Step 1: Eliminate outliers and missing values ​​and perform standardization on the given traffic flow data, and divide the processed data into training sets using a sliding window based on the chronological order.

[0083] The outliers and missing values ​​in the given traffic flow data are eliminated, and then the traffic flow data is standardized. The formula is as follows:

[0084] ,

[0085] in, For the The original traffic flow of variables, one variable is a traffic flow monitoring sensor, For the The average value of the raw traffic flow of variables, For the The variance of the original traffic flow of the variables, For the Traffic flow data after standardization of variables.

[0086] Artificially set the time window size based on experience , based on the time sequence, the standardized data is divided into training sets using a fixed-length sliding step.

[0087] Step 2: The training set is divided into batches of the same size. Divide into batches, the total number of batches is .

[0088] The training set batch operation is based on the total number of training set samples and the batch size. The formula is as follows:

[0089] ,

[0090] in, is the total number of samples in the training set.

[0091] Step 3: Manually set the hyperparameters required by the model, including the spatial graph pooling ratio , the number of spatial scales , temporal pooling ratio , the number of time scales , the number of hyperedges .

[0092] Step 4: According to the set spatial scale quantity And spatial graph pooling ratio , randomly initialize the graph allocation matrix , a collection of memory items , the projection matrix and And the hypergraph incidence matrix .

[0093] Assign a matrix to a learnable graph, The elements in represent the spatial scale From node to space scale The probability of assigning nodes to Figure 2 In the figure, the nodes on the spatial scale 1 represent monitoring sensors, and the nodes on other spatial scales represent nodes aggregated from nodes on smaller spatial scales (nodes on the Figure 2 Medium express). Representing spatial scale A unique set of memory items, which consists of a set of parameter vectors. and Represents the projection matrix that projects the memory items to the node embeddings. Indicates the degree of association between a node and a hyperedge, which is defined as follows:

[0094] ,

[0095] in, The value range is , indicating the slave node To the super edge The probability of allocation.

[0096] Step 5: Randomly select a batch of training samples from the training set, where the data of each sample contains variables Historical observations at time steps .

[0097] Step 6: Based on spatial scale A collection of memory items and the projection matrix and , construct spatial scale Unique graph adjacency matrix .

[0098] Spatial scale Unique graph adjacency matrix It is obtained through a graph learning method based on a memory network, and the formula is as follows:

[0099] ,

[0100] in, Represents the spatial scale with monitoring sensors as nodes Unique node embedding, Representing spatial scale The number of nodes, represents the dimension of node embedding, Representing spatial scale A unique collection of memory items, represents the number of memory items, Representing spatial scale A unique projection matrix, represents the ReLU activation function, Represents the Softmax function, the superscript represents transpose, Representing spatial scale A unique graph adjacency matrix, for each batch of training samples, is finally constructed to obtain the corresponding graph adjacency matrix for each spatial scale.

[0101] Step 7: Defined as spatial scale and time scale Therefore, the historical observations Represented as spatial scale and time scale Features .Will Input into the multi-scale spatiotemporal pyramid modeling module to obtain multi-scale spatiotemporal features .

[0102] The spatiotemporal pyramid modeling module includes a spatial pyramid graph learning submodule and a multi-scale spatiotemporal feature extraction submodule. First, the graph allocation matrix It reflects the dependency between nodes at two adjacent spatial scales. Based on the graph allocation matrix , the spatial pyramid graph learning submodule constructs a spatial pyramid graph, i.e., a multi-scale spatial graph. and spatial pyramid graphs, the multi-scale spatio-temporal feature extraction submodule aims to extract features that model temporal and spatial dependencies at multiple temporal and spatial scales, namely, multi-scale spatio-temporal features.

[0103] The multi-scale spatiotemporal feature extraction submodule first uses the temporal convolutional network to coarsen the information of the time dimension, thereby extracting multi-scale temporal features. Specifically, the temporal convolutional network contains a kernel size of A one-dimensional convolutional layer and a The average pooling layer is used to process , the formula is as follows:

[0104] ,

[0105] in, Represented in spatial scale and time scale The above characteristics, Indicates time scale The number of temporal features, Indicates the time scale To time scale The temporal feature pooling ratio, represents the convolution operation, represents the pooling operation. In this way, we get Characteristic sequence of time scales .

[0106] Afterwards, the multi-scale spatiotemporal feature extraction submodule extracts multi-scale spatiotemporal features through the spatiotemporal encoder. The spatiotemporal encoder is mainly based on graph convolutional recurrent units (GCRUs), which can not only model spatial dependencies based on graph structures, but also model temporal dependencies in a cyclic manner. The formula is as follows:

[0107] ,

[0108] in, Represented in spatial scale and time scale The spatiotemporal characteristics of represents the feature dimension, Representing spatial scale The graph adjacency matrix of .

[0109] According to the dependencies between nodes at different spatial scales represented by the spatial pyramid graph, for larger spatial scales, the initial features of nodes at larger spatial scales can be obtained by grouping the spatiotemporal features of nodes at smaller spatial scales based on the graph allocation matrix (in Figure 2 After that, by inputting the initial features into GCRUs, the spatiotemporal features of a larger spatial scale can be obtained, as shown in the following formula:

[0110] ,

[0111] in, Represented in spatial scale and time scale Since GCRUs adopts a cyclic modeling approach, The last hidden state of can usually remember historical information, denoted as By matching the features of the last hidden state at each time scale with the memory item at a specific spatial scale, the spatiotemporal features enhanced by the memory network are obtained, as follows:

[0112] ,

[0113] in, Representing spatial scale and time scale The query matrix, Representing spatial scale The corresponding linear projection matrix is, Representing spatial scale The corresponding bias vector, Representing spatial scale A unique collection of memory items, represents the spatiotemporal features after the attention-based memory read operation. After that, by concatenating and The feature dimension of the memory network is enhanced to obtain the spatiotemporal features .

[0114] Finally, the multi-scale spatiotemporal features output by the spatiotemporal pyramid modeling module are , is the number of time scales, is the number of spatial scales.

[0115] Step 8: Multi-scale spatiotemporal features Input to the adaptive hypergraph modeling module. Hypergraph association matrix It can reflect the learned hypergraph structure. By performing three-stage hypergraph propagation on the hypergraph, the updated multi-scale spatiotemporal features are obtained. .

[0116] Multi-scale spatiotemporal features Each feature in is considered as a node in the hypergraph (in Figure 2 Medium ), the number of nodes in the hypergraph is . Hypergraph Incidence Matrix Can reflect the learned hypergraph structure, is the number of hyperedges. First, by selecting the hypergraph association matrix The largest number of assignment probabilities in each row, the hypergraph association matrix Perform sparse processing. The hypergraph association matrix after sparse processing is expressed as , The elements in the node To the super edge Secondly, the adaptive hypergraph modeling module jointly interacts multi-scale spatiotemporal features through a three-stage hypergraph propagation The three-stage hypergraph propagation includes three stages: 1) node to hyperedge, 2) hyperedge to hyperedge, and 3) hyperedge to node.

[0117] 1) Node to hyperedge: This stage enables each hyperedge to collect the node information belonging to the hyperedge. Therefore, the hyperedge is regarded as a high-order representation that aggregates a set of multi-scale spatiotemporal features (in Figure 2 Medium ), the formula is as follows:

[0118] ,

[0119] in, represents the hyperedge obtained by converting the nodes of the hypergraph, represents the characteristic dimension of the hyperedge, represents the normalized weight of the hyperedge in the hypergraph, Represents the activation function.

[0120] 2) Hyperedge to hyperedge: This stage is used to model the high-order associations between hyperedges. First, the hyperedge graph formula is learned using a graph learning method based on a memory network as follows:

[0121] ,

[0122] in, represents the node embedding unique to the hyperedge graph, represents the number of hyperedges, represents the dimension of node embedding, represents the set of memory items unique to the hyperedge graph, represents the number of memory items, represents the projection matrix unique to the hyperedge graph, represents the ReLU activation function, Represents the Softmax function, the superscript represents transpose, is the hyperedge graph adjacency matrix.

[0123] Secondly, the graph attention network (GAT) is used to transmit hyperedge information. GAT uses the attention mechanism to dynamically weight neighbor nodes when aggregating the features of neighbor nodes. The formula is as follows:

[0124] ,

[0125] in, represents the hyperedge after being updated by the graph attention network. Then, similar to formula (8), the hyperedge is enhanced by the attention-based memory read operation , the formula is as follows:

[0126] ,

[0127] in, represents the query matrix, Represents the query matrix The corresponding linear projection matrix is, Represents the query matrix The corresponding bias vector, represents the set of memory items unique to the hyperedge graph, represents the hyperedge that has undergone the memory read operation, Represents the hyperedge enhanced by the memory network, through the concatenation and Finally, a multi-layer perceptron is used to update the hyperedge Get the final hyperedge , the formula is as follows:

[0128] ,

[0129] in, represents a multi-layer perceptron, represents the linear projection matrix, Represents the bias vector.

[0130] 3) Hyperedge to node, this stage uses the hypergraph association matrix The super edge Reconvert to Node , that is, the multi-scale spatiotemporal features output by the adaptive hypergraph modeling module , the formula is as follows:

[0131] ,

[0132] in, Standardized operations at the presentation layer.

[0133] Step 9: Update the multi-scale spatiotemporal features of the adaptive hypergraph modeling module Input to the fusion and output module. First, the fusion submodule converts the multi-scale spatiotemporal features Fusion obtains the final features of all variables , then the feature Pass the output submodule to get the prediction result .

[0134] Based on multi-scale spatiotemporal features ,First, the fusion submodule fuses the features of all time scales for each node at each spatial scale.,Through the normalized parameters To determine the characteristics of each time scale for the fused features The contribution degree is as follows:

[0135] ,

[0136] in, Represents the spatial scale after being updated by the adaptive hypergraph modeling module and time scale The spatiotemporal characteristics of Represents the features after spatial scale fusion.

[0137] Secondly, the fusion submodule fuses the features of all spatial scales by aggregating the node features at a larger spatial scale into the spatial scale Node features on The formula is as follows:

[0138] ,

[0139] in, Represents the spatial scale The node features on the The probability of the node features on represents the graph allocation matrix, Represents the final feature after all variables are fused.

[0140] Finally, the output submodule uses GCRUs to exploit As the initial hidden state, it outputs the future cyclically The hidden state of time steps , and use linear transformation to Converted into output prediction value .

[0141] Step 10: Calculate the prediction loss of all samples in a batch , that is, the true observed value of all samples in a batch and the model prediction value Calculate the graph pooling loss , which is the regular term constraining multi-scale spatial graph learning. Based on the prediction loss and graph pooling loss , and get the training loss .

[0142] Using mean absolute error as prediction loss , that is, the true observed value of all samples in a batch and the model prediction value The error between them is as follows:

[0143] ,

[0144] In addition, using the graph pooling loss As a regular term for constrained spatial pyramid graph learning (i.e., multi-scale spatial graph learning), the formula is as follows:

[0145] ,

[0146] in, represents the Frobenius norm, It can make nodes with strong correlation (i.e. Nodes with larger weights in the cluster are clustered together as much as possible. express All rows in The average entropy loss of rows, Enable Each row of is close to a one-hot vector, making the membership of each group node as clear as possible. express The OK, Represents the entropy function. Based on the obtained prediction loss and graph pooling loss , and get the training loss , the formula is as follows:

[0147] ,

[0148] in, Artificially set graph pooling loss The penalty coefficient, The value range is .

[0149] Step 11, based on the training loss , adjust the network parameters in the entire model.

[0150] Based on the training loss obtained in step 10 , the network parameters in the entire multi-scale joint spatiotemporal hypergraph neural network model To update, the formula is as follows:

[0151] ,

[0152] in, A manually set learning rate.

[0153] Step 12: Repeat steps 5-11 until all batches of the training set participate in model training.

[0154] Step 13, repeat steps 5-12 until the specified number of iterations is reached.

[0155] Step 14: input the traffic flow data to be predicted into the trained multi-scale joint spatiotemporal hypergraph neural network model to obtain the prediction result.

[0156] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network, characterized in that: The following steps are involved: (1) Preprocess the given traffic flow data and construct training samples. Based on each batch of training samples, a graph adjacency matrix is ​​constructed for each spatial scale. (2) Construct a multi-scale joint spatiotemporal hypergraph neural network model including a spatiotemporal pyramid modeling module, an adaptive hypergraph modeling module, and a fusion and output module. In the spatiotemporal pyramid modeling module, multi-scale spatiotemporal features are extracted from training samples based on the graph adjacency matrix and the constructed spatial pyramid graph. Among them, in the spatial pyramid graph learning submodule of the spatiotemporal pyramid modeling module, based on the initialized graph allocation matrix Construct a spatial pyramid diagram, where Represents the spatial scale with monitoring sensors as nodes From node to space scale The probability of assigning the node to the previous node, Indicates the number of spatial scales; Among them, in the multi-scale spatiotemporal feature extraction submodule of the spatiotemporal pyramid modeling module, given the historical observations and spatial pyramid maps in the input training samples, multi-scale spatiotemporal features that model time and space dependencies at multiple time scales and multiple spatial scales are extracted, including: Will Defined as spatial scale and time scale The historical observations Represented as spatial scale and time scale Features ,Will and the spatial pyramid map are input into the multi-scale spatiotemporal feature extraction submodule; In the multi-scale spatiotemporal feature extraction submodule, the temporal convolutional network is first used to coarsen the information of the time dimension to extract multi-scale temporal features. The temporal convolutional network contains a kernel size of A one-dimensional convolutional layer and a The average pooling layer is used to process , the formula is as follows: , in, Represented in spatial scale and time scale The above characteristics, Indicates time scale The number of temporal features, Indicates the time scale To time scale The temporal feature pooling ratio, represents the convolution operation, Represents the pooling operation, and in this way we get Characteristic sequence of time scales , Represents the total number of all monitoring sensor nodes; Afterwards, the multi-scale spatiotemporal feature extraction submodule extracts multi-scale spatiotemporal features through the spatiotemporal encoder. The spatiotemporal encoder is based on graph convolutional cycle units GCRUs, and the formula is as follows: , in, Represented in spatial scale and time scale The spatiotemporal characteristics of represents the feature dimension, Representing spatial scale The graph adjacency matrix of ; According to the dependencies between nodes at different spatial scales represented by the spatial pyramid graph, the initial features are Input to GCRUs, the spatiotemporal characteristics of the current spatial scale Get the spatiotemporal characteristics of the next spatial scale , the formula is as follows: , in, Represented in spatial scale and time scale The spatiotemporal characteristics of Represents transposition. Since GCRUs adopts a cyclic modeling approach, The last hidden state of It is used to remember historical information. By matching the features of the last hidden state of each time scale with the memory items of a specific spatial scale, the spatiotemporal features enhanced by the memory network are obtained. The formula is as follows: , in, Representing spatial scale and time scale The query matrix, Representing spatial scale The corresponding linear projection matrix is, Representing spatial scale The corresponding bias vector, Representing spatial scale A unique collection of memory items, represents the spatiotemporal features after being updated by the attention-based memory read operation, Represents the spatial scale with monitoring sensors as nodes The number of nodes, represents the spatial graph pooling ratio, represents the number of memory items, Indicates the dimension of node embedding, superscript represents transpose, Represents the Softmax function. After that, by concatenating and The feature dimension of the memory network is enhanced to obtain the spatiotemporal features , Represents a splicing operation; Finally, the multi-scale spatiotemporal features output by the spatiotemporal pyramid modeling module are , is the number of time scales, is the number of spatial scales; (3) In the adaptive hypergraph modeling module, each feature in the multi-scale spatiotemporal features is used as a node in the hypergraph. By learning the hypergraph structure and performing three-stage hypergraph propagation from node to hyperedge, hyperedge to hyperedge, and hyperedge to node, the high-order dependencies between the multi-scale spatiotemporal features are modeled, including: Multi-scale spatiotemporal features Each feature in is regarded as a node in the hypergraph, and the number of nodes in the hypergraph is , Representing spatial scale The total number of nodes with monitoring sensors as nodes, Representing spatial scale The total number of nodes, represents the number of spatial scales, Indicates the number of time scales; Hypergraph Incidence Matrix Reflects the learned hypergraph structure, is the number of hyperedges, defined as follows: , in, The value range is , indicating the slave node To the super edge The probability of allocation; First, by selecting the hypergraph association matrix The largest number of assignment probabilities in each row, the hypergraph association matrix After sparse processing, the hypergraph association matrix after sparse processing is expressed as ,Secondly, through the three-stage hypergraph propagation from node to hyperedge, hyperedge to hyperedge, and hyperedge to node, the multi-scale spatiotemporal features are jointly interacted , and obtain the updated multi-scale spatiotemporal features that model the high-order dependencies between multi-scale spatiotemporal features ; (4) In the fusion and output module, the multi-scale spatiotemporal features updated by the adaptive hypergraph modeling module are fused and the traffic flow prediction results are output; (5) Use the training samples to train the multi-scale joint spatiotemporal hypergraph neural network model, and use the trained multi-scale joint spatiotemporal hypergraph neural network model to predict traffic flow.

2. The traffic flow prediction method based on multi-scale joint spatiotemporal hypergraph neural network according to claim 1 is characterized in that: The preprocessing of given traffic flow data and construction of training samples include: The given traffic flow data is preprocessed including outlier and missing value elimination and standardization, and the time window size is set. Based on the time sequence, the preprocessed data is divided into training sets using a fixed-length sliding step, and the training sets are divided into batches according to the set batch size. Divide into batches, the total number of batches is , randomly select a batch of training samples from the training data set, where the data of each training sample contains variables Historical observations at time steps , a variable is a traffic flow monitoring sensor.

3. The traffic flow prediction method based on multi-scale joint spatiotemporal hypergraph neural network according to claim 1 or 2 is characterized in that: The step of constructing a graph adjacency matrix for each spatial scale based on each batch of training samples includes: Spatial scale Unique graph adjacency matrix It is obtained through a graph learning method based on a memory network, and the formula is as follows: , in, Represents the spatial scale with monitoring sensors as nodes Unique node embedding, Representing spatial scale The number of nodes, represents the spatial graph pooling ratio, represents the dimension of node embedding, Representing spatial scale A unique collection of memory items, represents the number of memory items, Representing spatial scale A unique projection matrix, represents the ReLU activation function, Represents the Softmax function, the superscript represents transpose, Representing spatial scale A unique graph adjacency matrix, for each batch of training samples, is finally constructed to obtain the corresponding graph adjacency matrix for each spatial scale.

4. The traffic flow prediction method based on a multi-scale joint spatiotemporal hypergraph neural network according to claim 1 or 2 is characterized in that: The three-stage hypergraph propagation specifically includes: Node to hyperedge: This stage enables each hyperedge to collect the node information belonging to the hyperedge. Therefore, the hyperedge is regarded as a high-order representation that aggregates a set of multi-scale spatiotemporal features. The formula is as follows: , in, represents the hyperedge obtained by converting the nodes of the hypergraph, represents the characteristic dimension of the hyperedge, the superscript represents transpose, represents the normalized weight of the hyperedge in the hypergraph, represents the activation function; Hyperedge to hyperedge: This stage is used to model the high-order associations between hyperedges. First, the hyperedge graph is learned using a graph learning method based on a memory network. , Secondly, the graph attention network GAT is used to transmit hyperedge information. GAT uses the attention mechanism to dynamically weight neighbor nodes when aggregating the features of neighbor nodes. The formula is as follows: , in, represents the hyperedge after being updated by the graph attention network, and then the hyperedge is enhanced by the attention-based memory read operation , the formula is as follows: , in, represents the query matrix, Represents the query matrix The corresponding linear projection matrix is, Represents the query matrix The corresponding bias vector, superscript represents transpose, represents the hyperedge that has undergone the memory read operation, Represents a splicing operation, Represents the hyperedge enhanced by the memory network. Finally, the hyperedge is updated through the multi-layer perceptron Get the final hyperedge , the formula is as follows: , in, represents a multi-layer perceptron, represents the linear projection matrix, represents the bias vector; Hyperedge to node: This stage uses the hypergraph association matrix The super edge Reconvert to Node , that is, the multi-scale spatiotemporal features output by the adaptive hypergraph modeling module , the formula is as follows: , in, Standardized operations at the presentation layer.

5. The traffic flow prediction method based on multi-scale joint spatiotemporal hypergraph neural network according to claim 1 or 2 is characterized in that: The multi-scale spatiotemporal features updated by the adaptive hypergraph modeling module are integrated in the fusion and output module to output the prediction result of the traffic flow, including: Based on the multi-scale spatiotemporal features updated by the adaptive hypergraph modeling module First, the fusion submodule in the fusion and output module fuses the features of all time scales for each node on each spatial scale, through the normalized parameters To determine the characteristics of each time scale for the fused features The contribution degree is as follows: , in, Represents the spatial scale after being updated by the adaptive hypergraph modeling module and time scale The spatiotemporal characteristics of Representing spatial scale After fusion, represents the number of time scales, represents the feature dimension of the hyperedge in the hypergraph, represents the feature dimension, represents the dimension of node embedding with monitoring sensors as nodes; Secondly, the fusion submodule fuses the features of all spatial scales by aggregating node features at other spatial scales into the spatial scale Node features on The formula is as follows: , in, Represents the spatial scale The node features on the The probability of the node features on represents the graph allocation matrix, represents the total number of all monitoring sensor nodes, Representing spatial scale The number of nodes, represents the spatial graph pooling ratio, represents the number of spatial scales, Represents the final feature after all variables are integrated; Finally, the output submodule in the fusion and output modules uses graph convolutional recurrent units (GCRUs) to exploit As the initial hidden state, it outputs the future cyclically The hidden state of time steps , and use linear transformation to Converted into output prediction value .

6. The traffic flow prediction method based on multi-scale joint spatiotemporal hypergraph neural network according to claim 1 or 2 is characterized in that: The method of training the multi-scale joint spatiotemporal hypergraph neural network model using training samples includes: According to the true observation value of all samples in a batch and the model prediction value The error between them constructs the prediction loss , and construct the graph pooling loss for constrained spatial pyramid graph learning , and get the training loss The formula is as follows: , in, Represents the set graph pooling loss The penalty coefficient of According to the training loss , the network parameters in the multi-scale joint spatiotemporal hypergraph neural network model are adjusted until all batches of the training set participate in the model training.

7. The traffic flow prediction method based on multi-scale joint spatiotemporal hypergraph neural network according to claim 6 is characterized in that: Predicting Losses The calculation formula is as follows: , in, represents the batch index of the training samples, Indicates the total number of batches; Graph Pooling Loss The calculation formula is as follows: , in, represents the Frobenius norm, express Chinese Communist Party The average entropy loss of the row, Representing spatial scale The graph adjacency matrix of , superscript represents transpose, express The OK, represents the entropy function.

Citation Information

Patent Citations

  • Traffic flow prediction model construction method and prediction method based on adaptive dynamic graph

    CN116187555A

  • Multi-information fusion space-time diagram convolution traffic flow prediction method

    CN116258258A