Traffic flow prediction method based on dual hypergraph neural network

By constructing traffic flow diagrams and dual hypergraphs, using the traffic flow prediction method of the spatiotemporal dual hypergraph convolutional layer, the problem of ignoring the dynamic impact of road network topology in the existing methods is solved, and a higher precision traffic flow prediction is achieved.

CN119670004APending Publication Date: 2025-03-21HENAN UNIVERSITY

Patent Information

Application Number
CN202411727316.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing traffic flow prediction methods ignore the dynamic impact of potential factors on the road network topology, resulting in low prediction accuracy.

Method used

A traffic flow prediction method based on dual hypergraph neural network is proposed. By constructing traffic flow diagrams and dual hypergraphs, the traffic flow prediction model is constructed using the spatiotemporal dual hypergraph convolutional layer to capture the dynamic changes and spatial and temporal correlation of road network topology structure.

Benefits of technology

It improves the accuracy of traffic flow prediction, and can more accurately capture the dynamic changes and spatial and temporal correlation of road network topology, thereby improving the performance of traffic prediction models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670004A_ABST
    Figure CN119670004A_ABST
Patent Text Reader

Abstract

The invention provides a traffic flow prediction method based on a dual hypergraph neural network. The method comprises the following steps: preprocessing traffic data collected by a sensor in a traffic road network in a certain time period; forming a data set by the preprocessed traffic data, and dividing the data set into a training set, a test set and a verification set; respectively constructing a traffic flow graph and a dual hypergraph according to the topological graph of the traffic network; constructing a traffic flow prediction model based on the space-time dual hypergraph convolution layer, wherein the traffic flow prediction model comprises an input layer, the space-time dual hypergraph convolution layer and an output layer which are connected in sequence; inputting the preprocessed traffic data in the training set into a traffic flow prediction model for training; testing the trained traffic flow prediction model by using the preprocessed traffic data in the test set to obtain a final traffic flow prediction model; and inputting the traffic data preprocessed in the verification set into the final traffic flow prediction model to obtain the predicted traffic flow. According to the method, multi-source data are fused and external knowledge is utilized, so that the spatial-temporal correlation in the data can be better understood and utilized, and the accuracy of a traffic prediction model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic prediction, and in particular to a traffic flow prediction method. Background Art

[0002] With the rapid development of the national economy and the gradual acceleration of urbanization, many traffic problems have arisen one after another. There are many reasons for the emergence of these problems, such as the continuous and significant growth in demand for transportation systems, the singleness of traffic management subjects, the imbalance between traffic supply and demand, imperfect transportation infrastructure, and insufficient public participation. With the co-development of urbanization and motorization, alleviating traffic congestion has become a top priority in the traffic management of various cities. Road traffic forecasting for this problem has important theoretical value and practical significance for urban traffic control systems and traffic management systems. In addition, accurate traffic forecasting can strengthen the relationship between vehicles, roads, management departments and travelers, thereby improving transportation efficiency.

[0003] With the rapid development of intelligent transportation systems, advanced data communication technology, information technology and control technology have been applied to ground traffic management systems, expanding the scope of traffic management systems and improving real-time, accuracy and efficiency. It enables people to analyze and study the large amount of data generated to improve urban traffic conditions. At present, vehicle-mounted GPS, road sensors and intelligent traffic cameras are becoming increasingly popular on urban roads. These intelligent devices can collect data and provide assistance to traffic management systems.

[0004] In the face of the increasing informatization of urban traffic and the requirements of the times for intelligent development, it is crucial to fully understand urban traffic and regard it as the premise and core key to solving problems. Accurate traffic prediction is an important aspect of intelligent transportation systems. However, existing methods usually rely on static graphs to learn the correlation between different sensors in space, ignoring the dynamic impact of potential factors on the topological structure of the road network.

[0005] The invention patent with application number 202210096933.X discloses a traffic prediction method based on dual dynamic spatiotemporal graph convolution, which is used to solve the problem of low prediction accuracy caused by lack of edge modeling and dynamic modeling in the current traffic prediction method based on graph network. First, the historical traffic data is input and sent to the input layer for processing, and then the output of the input layer is sent to the dynamic spatiotemporal layer. The spatiotemporal correlation features are extracted through multiple stacked dual dynamic spatiotemporal blocks in the dynamic spatiotemporal layer, and then these features are input to the output layer. The final output is the final prediction result. Among them, the most core and key dual dynamic spatiotemporal blocks include dynamic graph convolution modules, dynamic hypergraph convolution modules, and dynamic interaction modules between the two. The above invention can well mine the complex spatiotemporal correlations in traffic data, thereby revealing the potential spatiotemporal correlations of dynamic traffic systems, and then more accurately predicting urban traffic data. However, the dual dynamic spatiotemporal blocks in the above patent are complex in design. Although this design can improve the accuracy of prediction, it may also significantly increase the computational overhead of the model and require high hardware resources. Summary of the invention

[0006] In view of the technical problem that the existing traffic flow prediction methods ignore the dynamic impact of potential factors on the road network topology structure, the present invention proposes a traffic flow prediction method based on a dual hypergraph neural network to improve the prediction accuracy. The method is suitable for traffic flow prediction tasks in the field of urban transportation, so as to reasonably dispatch urban traffic resources and improve urban traffic efficiency.

[0007] In order to achieve the above object, the technical solution of the present invention is implemented as follows: a traffic flow prediction method based on a dual hypergraph neural network, the steps of which are as follows:

[0008] S1: pre-processing the traffic data collected by sensors in the traffic network within a certain period of time;

[0009] S2: The preprocessed traffic data is organized into a dataset and divided into a training set, a test set, and a validation set;

[0010] S3: Construct the traffic flow graph and dual hypergraph respectively according to the topological graph of the traffic network;

[0011] S4: Construct a traffic flow prediction model based on the spatiotemporal dual hypergraph convolutional layer. The traffic flow prediction model includes an input layer, a spatiotemporal dual hypergraph convolutional layer, and an output layer connected in sequence.

[0012] S5: input the traffic data preprocessed in the training set into the traffic flow prediction model for training; use the traffic data preprocessed in the test set to test the trained traffic flow prediction model to obtain the final traffic flow prediction model; use the traffic data preprocessed in the validation set to input the final traffic flow prediction model to obtain the predicted traffic flow.

[0013] Preferably, the implementation method of the preprocessing is: screening and removing abnormal values ​​in the collected traffic data by a threshold method to obtain time series data; using an average interpolation method to supplement the missing values ​​and the traffic data removed due to data anomalies;

[0014] Assign a unique number to each sensor node to ensure that each sensor node has a unique identifier;

[0015] According to the location information of sensor nodes, the distance between adjacent sensor nodes is calculated;

[0016] The training set, test set, and validation set are divided in a ratio of 7:2:1.

[0017] Preferably, the traffic flow graph is G=(V, E, A), where V represents a set of sensor nodes in the road network, E refers to the edges connecting the sensors, and A represents the adjacency matrix of the road network;

[0018] The dual hypergraph G d =(V d ,E d ,A d ), where V d represents the set of super nodes, E d refers to the set of hyperedges, A d Represents the adjacency matrix of the dual hypergraph;

[0019] The traffic network is divided into different areas according to geographical location, and the sensor nodes in adjacent or similar areas are aggregated into supernodes, or supernodes are aggregated through traffic data or feature similarity; supernodes represent the aggregation of sensor nodes in space or traffic patterns, and each supernode contains one or more sensor nodes; if the sensor nodes contained in two supernodes are close in physical space or the traffic characteristics of the two supernodes have a strong correlation, a hyperedge is established between the two supernodes; a hyperedge is a high-order connection relationship between multiple sensor nodes.

[0020] Preferably, the adjacency matrix includes an initialization adjacency matrix, a similarity adjacency matrix and an adaptive adjacency matrix. The initialization adjacency matrix is ​​generated based on the geographical location or topological structure between the sensor nodes to represent the fixed spatial relationship of the sensor nodes; the similarity adjacency matrix is ​​generated based on the traffic mode or flow data similarity of the nodes to reflect the similarity relationship between the nodes; the adaptive adjacency matrix is ​​an adjacency matrix dynamically adjusted through model learning, and the relationship weights between the nodes are updated in real time as the data input changes;

[0021] The element values ​​in the initial adjacency matrix are Euclidean distance information calculated from the node location information; the Wasserstein distance is used to measure the initial similarity relationship between nodes in the similarity adjacency matrix; the low-dimensional feature vector obtained by decomposition based on the vector decomposition principle is used to calculate the similarity between nodes, construct an adaptive adjacency matrix between the initial nodes, and train the subsequent model in a data-driven manner.

[0022] Preferably, the input layer transforms the preprocessed traffic data into a high-dimensional space using the linear transformation of the linear layer to obtain a high-dimensional feature representation; the number of the space-time dual hypergraph convolutional layers is set to three, the three space-time dual hypergraph convolutional layers are connected in parallel, the high-dimensional feature representation obtained by the input layer is respectively input into the three space-time dual hypergraph convolutional layers, the three space-time dual hypergraph convolutional layers generate a variety of feature representations and then input into the output layer, the output layer obtains the output result through continuous linear transformation of the multiple feature representations; the output layer includes two ReLU activation layers and a linear layer connected in sequence, the two linear layers perform feature adjustment through learnable weights, and the linear layer between the two ReLU activation layers enables the model to perform more accurate feature selection between different feature channels.

[0023] Preferably, the spatiotemporal dual hypergraph convolution layer includes a temporal convolution module, a spatiotemporal hypergraph convolution module and a multi-head attention module connected in sequence, the spatiotemporal hypergraph convolution module includes a graph convolution module, a hypergraph convolution module and a convolution interaction module, and a dual transformation module is provided on the convolution interaction module; the results output by the graph convolution module, the hypergraph convolution module and the convolution interaction module are transmitted to the multi-head attention module, the multi-head attention module includes a spatial attention mechanism and a temporal attention mechanism, the results obtained by the spatial attention mechanism and the temporal attention mechanism are concatenated and linearly transformed through a linear layer, and the feature representation obtained by adding the result of the linear transformation to the high-dimensional feature representation output by the input layer using a residual learning mechanism is used as the output of the spatiotemporal dual hypergraph convolution layer.

[0024] Preferably, the implementation method of the graph convolution module is: in the graph convolution operation, the forward and backward adjacency matrices are considered respectively, and the dependency relationship and propagation process between nodes are fully captured by weighted summation of the forward adjacency matrix and the backward adjacency matrix of each step, so as to obtain the feature representation as follows: Where X represents the intermediate feature representation output by the temporal convolution module, S represents the total number of diffusion steps, represents the nth-order forward adjacency matrix, which is used to capture the information of nodes propagated forward in the network; represents the nth-order backward adjacency matrix, which is used to capture the backward dependency relationship of nodes; W s,f is the weight of the forward adjacency matrix, which is used to weight the influence of forward neighbors during feature propagation; W s,bis the weight of the backward adjacency matrix, which is used to weight the influence of backward neighbors during feature propagation;

[0025] The convolution interaction module is based on the convolution interaction of the graph convolutional network, and uses the adjacency matrix and feature matrix to perform multi-layer feature fusion. The output is expressed as: Among them, GCN d (X) represents the output of the graph convolution operation, represents the n-th order adaptive adjacency matrix, Both represent learnable weight matrices, K represents the total number of multi-order graph convolution operations, and d represents the depth of graph convolution.

[0026] Preferably, the hypergraph convolution operation of the hypergraph convolution module is: in, Represents the hypergraph convolution operation; represents the hypergraph feature at the dth layer; Θ k is a learnable parameter matrix; E represents the dimension of the output feature matrix; Represents the learnable weight matrices used for different layers of the hypergraph structure.

[0027] Preferably, the temporal convolution module includes two parallel dilated convolution branches, each dilated convolution branch is set with a different dilated rate, and the output features of the two dilated convolution branches are respectively:

[0028]

[0029] in, and denote the one-dimensional convolution operations with dilation rates d1 and d2 respectively, X high Represents the high-dimensional feature representation obtained by the input layer; and Represent the output features of the two dilated convolution branches respectively;

[0030] Interactively fuse the output features of two parallel dilated convolution branches:

[0031]

[0032] Among them, X out represents the intermediate feature representation after fusion, tanh is the activation function, and σ represents the output feature The transformation function to be performed;

[0033] The weight matrix The implementation method is Among them, D node represents the degree matrix of the supernode in the dual hypergraph, D edgerepresents the degree matrix of the hyperedge in the dual hypergraph, H represents the traffic flow graph G and the dual hypergraph G d The structural correlation matrix, W adp is the adaptive weight matrix,

[0034] The structural association matrix H is: Among them, [H] ij is the element in the i-th row and j-th column of the structural association matrix H, v i represents the i-th node in the traffic flow graph G; e j Denote the dual hypergraph G d The jth hyperedge in; the adaptive weight matrix is: Parameter matrix L adp Each element L adp,i Corresponding to the adaptive connection strength of the i-th node in the traffic flow graph G;

[0035] The adaptive adjacency matrix A adp =SoftMax(ReLU((emb2) T emb1)) is obtained by matrix multiplication of two learnable parameter vectors, where SoftMax function is a normalization function, ReLU is an activation function, emb2 and emb1 are two learnable embedding vectors, and T represents transpose;

[0036] The multi-head attention module concatenates the output results obtained by the graph convolution module, the convolution interaction module and the hypergraph convolution module, passes through a linear layer and then passes through two activation functions to obtain the input features of the spatial attention mechanism and the temporal attention mechanism respectively. The implementation method is:

[0037]

[0038] X temp =Liner(X temp )

[0039] X T =tanh(SA(X temp ))

[0040] X S =σ(SA(X temp ))

[0041] Among them, X temp is a temporary feature representation, Liner is the linear transformation function of the linear layer, X T and X S are the input features of the spatial attention mechanism and the temporal attention mechanism respectively; SA() is the dependency calculation function;

[0042] The spatial attention mechanism and the temporal attention mechanism calculate the query matrix, key matrix and value matrix according to the input features respectively, apply the self-attention operation in the time and space dimensions, use the query matrix, key matrix and value matrix to calculate the dependency between time and space, and connect the multi-head attention dependency to obtain the output of the spatial attention mechanism and the temporal attention mechanism;

[0043] During the training phase, the loss function is: Among them, Y, Represent the true value and predicted value respectively; represents the predicted value, Y T represents the true value of traffic, λ is the regularization hyperparameter, L reg represents the L2 regularization term that reduces the risk of overfitting and improves generalization ability.

[0044] Preferably, the dual transformation module includes a dual transformation from a traffic flow graph to a dual hypergraph and a dual transformation from a dual hypergraph to a traffic flow graph;

[0045] The dual transformation from the traffic flow graph to the dual hypergraph is implemented as follows:

[0046] The dual transformation module is part of the convolution interaction module, which introduces an information exchange mechanism between different graph convolution modules. The convolution interaction module relies on the dual transformation module to realize the interaction between different convolution layers. Through the dual transformation, feature information can be shared or converted between multiple structures, thereby obtaining richer spatial features in spatial convolution. The supernode features of the dual hypergraph correspond to the edge features of the traffic flow graph. The features obtained after a convolution of the traffic flow graph are input into the dual hypergraph. The dual hypergraph is defined by the edge and node features of the traffic flow graph as:

[0047]

[0048] in, Denote the dual hypergraph G d Input features of super nodes; H src and H dst Represent the feature matrices of the source node and the target node respectively. W1 and W2 are the learned weight matrices used to adjust the influence of the source node and the target node. X high Represents the high-dimensional feature representation obtained by the input layer; Represents the distance feature matrix between node pairs;

[0049] The dual transformation from the dual hypergraph to the traffic flow graph is implemented by restoring the features of the dual hypergraph to the traffic flow graph and mapping the features of the supernodes of the dual hypergraph back to the features of the nodes of the traffic flow graph: Where H is the structural correlation matrix, The feature representation of the dual hypergraph is the supernode feature matrix in the dual hypergraph, W3 is a learnable weight matrix, is the parameter matrix required to restore the transformation.

[0050] Compared with the prior art, the present invention has the following beneficial effects: First, a data-driven strategy based on a dynamic spatiotemporal perception graph is proposed to replace the predefined static graph commonly used in traditional graph convolutional networks. Considering that historical data carries intrinsic dynamic information about the spatial structure of the road network, this strategy can collect edge attributes (geographic proximity) and node attributes (spatial heterogeneity) between nodes, and capture the dynamic changes in the topological structure of the road network; secondly, the duality principle is introduced to construct a dual hypergraph of the traffic graph. The nodes of the dual hypergraph are actually the edges of the original traffic flow graph, which captures the correlation between the edges of the traffic graph. In the iterative process of dynamic graph convolution, the dependency between dynamic edge attributes and static node attributes is captured on the basis of merging spatial relationships. Finally, an improved multi-head attention mechanism is designed to represent the dynamic spatial correlation between nodes. Experiments were conducted on two actual traffic prediction tasks, and the experimental results show that the prediction effect of the present invention is better than other methods. Therefore, the present invention designs a short-term traffic flow prediction method based on multi-graph convolution and attention mechanism, which integrates multi-source data and utilizes external knowledge, can better understand and utilize the spatiotemporal correlation in the data, thereby improving the accuracy of the traffic prediction model and promoting the comprehensive cognition and understanding of urban traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] 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 paying creative work.

[0052] Figure 1 It is the overall data processing flow chart of the present invention.

[0053] Figure 2 This is an illustration of a use case of the present invention, wherein (a) is the topological structure of a real road network, (b) is the initial topological structure, and (c) is a schematic diagram of the dual hypergraph. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] like Figure 1 As shown, a traffic flow prediction method based on a dual hypergraph neural network includes the following steps:

[0056] S1: Preprocess the traffic data collected by sensors in the traffic network within a certain period of time.

[0057] The traffic data was preprocessed using the average interpolation method. First, the traffic data was collected and recorded by sensors in the traffic network at intervals of 5 minutes. Then, the outliers were screened and removed by the threshold method to obtain time series data. This method can fill in the data gaps and improve data integrity. At the same time, it can also eliminate the interference of outliers and improve the prediction accuracy. Finally, the missing values ​​and the traffic data that were removed due to data anomalies were supplemented by the average interpolation method. In order to facilitate subsequent processing and analysis, a unique number was assigned to each sensor node to ensure that each sensor node has a unique identifier. The assignment of a unique number enables each sensor node to have a unique identifier, which is convenient for data management and rapid query. In large-scale traffic networks, the data of a specific sensor node can be easily located, which helps to store and access data more efficiently. In addition, based on the location information of the sensor nodes, the distance between adjacent sensor nodes is also calculated. The distance information can help define the spatial correlation between sensor nodes. The closer the distance between adjacent nodes, the more relevant their traffic conditions are. This spatial correlation can be used as the weight information of the adjacency matrix to help the model more accurately model the spatial characteristics in the traffic network.

[0058] S2: The preprocessed data is organized into a data set and divided into a training set and a test set, which are used to train the model and test the trained model respectively.

[0059] The data set is divided into three parts in a ratio of 7:2:1. The functions of the three parts are as follows: the training set is used for model training, the test set is used for parameter experiments to analyze the impact of parameters on the model and perform fine-tuning, and the validation set is used for prediction tasks and model evaluation.

[0060] S3: Construct the graph and dual graph and the corresponding adjacency matrix based on the topological graph of the traffic network.

[0061] After obtaining the vector representation of the road network nodes using a data-driven node similarity algorithm, a topological graph of the traffic road network is constructed. The road network can be defined as a graph G = (V, E, A), where V represents the set of sensor nodes in the road network, E refers to the edges between sensors, and represents the dependency relationship between sensor nodes; A represents the adjacency matrix of the road network; the adjacency matrix A refers to three parts: one is the initialization adjacency matrix, which is usually generated based on the geographical location or topological structure between sensor nodes. It is the basic structure for constructing a road network graph and is used to represent the fixed spatial relationship of sensor nodes (such as directly adjacent road sections); the second is the similarity adjacency matrix, which is generated based on the similarity of the node's traffic mode or flow data and is used to reflect the similarity relationship between nodes. Even if they are not physically adjacent, nodes with similar flow or flow patterns can be connected; the third is the adaptive adjacency matrix, which is dynamically adjusted through model learning and can update the relationship weights between nodes in real time as the data input changes.

[0062] Construction of adjacency matrix: adjacency matrix The element value A(i,j) represents the initialized adjacency matrix of the Euclidean distance information calculated from the location information of the node, which is a method commonly used in traditional traffic flow prediction methods. Based on the previous traditional methods, the present invention introduces two methods, similar adjacency matrix and adaptive adjacency matrix, to jointly obtain the spatiotemporal information of the road network, where N is the number of roads. The initial similarity relationship between nodes is measured by the Wasserstein distance to obtain the initial similarity adjacency matrix. The model can capture the changes in traffic distribution of different nodes over time, provide more flexible spatiotemporal characteristics for dynamic traffic flow prediction, and help the prediction model better adapt to the changes in traffic flow over time. Based on the principle of vector decomposition, the low-dimensional feature vector obtained by decomposition is used to calculate the similarity between nodes, thereby constructing an adaptive adjacency matrix between the initial nodes, and training subsequent models in a data-driven manner.

[0063] Based on the duality principle and the knowledge of hypergraph convolution, the traffic network can be defined as the dual graph G d =(V d ,E d ,A d ), where V d represents the set of super nodes in the road network dual graph, E d The set of hyperedges in the dual graph of the road network, A dRepresents the adjacency matrix of the dual graph of the road network. For supernodes, the traffic network can be divided into different areas according to geographical location, and sensor nodes in adjacent or similar areas can be aggregated into supernodes. If the clustering effect based on geographical location is not good, supernodes can be aggregated by traffic data or feature similarity. For example, nodes with similar traffic patterns can be clustered into a supernode through a clustering algorithm (such as K-Means or a similarity metric based on Wasserstein distance). If the sensor nodes contained in two supernodes are close in physical space, a hyperedge can be established between them. If the traffic characteristics of two supernodes have a strong correlation (such as similar fluctuation trends and synchronized traffic peak hours), a hyperedge can be established between them, indicating that there is a cross-regional traffic flow dependency between the two. Sensor nodes are the basic components of supernodes, and supernodes represent the aggregation of sensor nodes in space or traffic patterns. Each supernode contains one or more sensor nodes, so supernodes express the group characteristics between sensor nodes. Sensor edges are direct spatial connections between nodes in the original graph, while hyperedges are high-order connection relationships between multiple sensor nodes. Hyperedges express the complex dependencies between multiple sensor nodes or regions in the dual graph and are the abstraction and synthesis of the original edges.

[0064] Define the road network status at time T: The short-term traffic flow prediction process can be regarded as the road network state based on the previous T time By predicting the function f, the road network status at the future time T′ is calculated: That is, the problem can be expressed as: f(X (t-*T+1):t ,G,G d )=X (t+1):(t+T′) Among them, X (t-T+1):t represents the input state sequence from time t-T+1 to time t, that is, the road network state data of the past T time periods. d , it means that it contains the original graph G and the dual graph G d Historical status information in X (t+1):(t+T′) It represents the predicted state sequence from time t+1 to time t+T, that is, the road network state at the next T′ time points.

[0065] S4: Construct a traffic flow prediction model based on the spatiotemporal dual hypergraph convolutional layer: Use the linear transformation in the input layer to transform the preprocessed traffic data into a high-dimensional space to improve the network's expressive power.

[0066] The linear transformation operation process can be expressed as: high =Liner(X), where X represents the input traffic data, high It represents the high-dimensional feature representation after linear transformation, and Liner(·) represents the operation function of linear transformation.

[0067] S5: Design of the spatiotemporal dual hypergraph convolution layer: including the temporal convolution module, the spatiotemporal hypergraph convolution module, the multi-head attention module and the dual interaction module.

[0068] In the hypergraph convolution part, adaptive adjacency matrix information is introduced to enhance the acquisition of dynamic topological information of the road network. At the same time, in the process of alternating optimization of hypergraph convolution and graph convolution, the transfer matrix is ​​used to add adjustment operations to the feature dimension to adapt to the dimensional requirements of the next convolution, so that the alternating optimization process can proceed smoothly.

[0069] S5.1: Temporal convolution module Based on one-dimensional temporal convolution, dilated convolution is introduced to improve the efficiency of temporal feature extraction. The convolution operation can be expressed as: out =Conv(X high ), where X high represents high-dimensional feature representation, which is a high-dimensional representation of preprocessed traffic data in time and space, and contains richer feature information; Conv(·) represents a one-dimensional convolution operation in the time dimension, which is used to extract dependency information in the time dimension. In order to capture the features in the time dimension in a more refined manner, two parallel dilated convolution branches can be added on the basis of the time convolution module, and each branch is set with a different dilation rate. This design can expand the receptive field and capture short-term and long-term time dependency features, which can be expressed as follows:

[0070]

[0071] in, and denote the one-dimensional convolution operation with dilation rates d1 and d2 respectively; X high Represents high-dimensional feature representation; and They represent the output features of the two dilated convolution branches, respectively, and extract time-dependent features of different scales. After the two parallel dilated convolution branches extract the time features respectively, they perform interactive fusion on the features. The formula is as follows:

[0072]

[0073] Among them, X out Represents the intermediate feature representation after fusion, and outputs the feature and Through the fusion operation, it is integrated into a new time feature representation; tanh is an activation function, which is a nonlinear function that can output the feature X out Perform nonlinear transformation to adjust the importance of features. σ represents the output feature The transformation function performed can be a simple linear transformation, a learnable parameterized function, or other feature conversion method for output features. Specific processing is performed to enhance the interaction effect. For the convenience of expression, the following fused intermediate feature representation X out They are all represented by X.

[0074] S5.2: The spatiotemporal hypergraph convolution module includes two operations: one is the graph convolution operation based on the diffusion model, and the other is the hypergraph convolution operation based on the duality principle. Figure 1 The input of the spatiotemporal hypergraph convolution module is the output of the temporal convolution module.

[0075] S5.2.1: The graph convolution operation in the present invention is:

[0076]

[0077] Where X is the intermediate feature representation after fusion in step S5.1. d (X) represents the output of the graph convolution operation, reflecting the integration of multi-order spatial dependency features. and This formula is able to capture node relationships of different directions and adaptabilities; represents the nth-order forward adjacency matrix, which is used to capture the information of nodes propagating forward in the network and simulate the diffusion of traffic flow from the current node to the forward node; represents the nth-order backward adjacency matrix, which is used to capture the backward dependency of nodes and simulate the backward propagation of traffic information from the current node; represents the nth-order adaptive adjacency matrix, which is an adjacency matrix obtained through data-driven learning and can dynamically adjust the connection strength between nodes to adapt to the changes in the temporal and spatial dependencies in traffic data; Both represent learnable weight matrices, which are used to linearly transform node features and adapt to the feature update requirements brought by different adjacency matrices; K represents the total number of multi-order graph convolution operations, representing the number of adjacency matrices of different orders (for example, first order, second order, etc.) considered; in the graph convolution operation, d represents the depth of the graph convolution.

[0078] The first part represents the forward convolution part in the directed graph convolution. The second part represents the reverse convolution part, is an adaptive adjacency matrix obtained by matrix multiplication of two learnable parameter vectors. The specific improvement process of the graph convolution of the present invention is as follows:

[0079] S5.2.1.1: Ordinary graph convolution in graph convolutional neural network GCN: GCN(X) = AXW, A is the adjacency matrix, and W is the learnable parameter matrix.

[0080] S5.1.1.2: Inspired by the previous step, the diffusion process of graph signals is represented as a finite S-step transfer matrix. The diffusion process of graph signals simulates the propagation of signals in the graph structure and reflects the mutual influence between nodes through edge connections. By exponentially operating the adjacency matrix A n , which can represent the state of the signal on the graph after propagation. The convolution is expressed as follows: Where S represents the total number of diffusion steps, W s Represents a learnable weight matrix, which is used to linearly transform node features to adapt to the feature update requirements brought by different adjacency matrices.

[0081] S5.1.1.3: Inspired by the previous step, the convolution is extended to the directed graph scenario. In a directed graph, the relationship between nodes is directional, so the forward and backward adjacency matrices need to be considered separately in the graph convolution operation. By taking the weighted sum of the forward and backward adjacency matrices of each step, the dependency and propagation process between nodes can be captured more comprehensively, which can be expressed as: in, represents the nth-order forward adjacency matrix, which is used to capture the information of nodes propagating forward in the network and simulate the diffusion of traffic flow from the current node to the forward node; represents the nth-order backward adjacency matrix, which is used to capture the backward dependency of nodes and simulate the backward propagation of traffic information from the current node; W s,f is the weight of the forward adjacency matrix, which is used to weight the influence of forward neighbors during feature propagation; W s,b are the weights of the backward adjacency matrix, which are used to weight the influence of backward neighbors when propagating features.

[0082] S5.1.1.4: Based on the convolution interaction of the graph convolutional network, the adjacency matrix and feature matrix are used to perform multi-layer feature fusion, so as to more effectively capture the relationship and characteristics between nodes in the traffic network. This structure can improve the expression ability of the model and enhance the processing ability of complex graph data, which can be expressed as: Among them, the adaptive adjacency matrix A adp =SoftMax(ReLU((emb2) T emb1)) is obtained by matrix multiplication of two learnable parameter vectors, where Can be regarded as A adpDifferent versions of , to meet the needs of different levels. Among them, the SoftMax function is a normalization function, usually used to convert a set of real values ​​into a probability distribution; ReLU is a commonly used activation function, which is defined as ReLU(x) = max(0,x); emb2 and emb1 are two learnable embedding vectors, usually used to represent the characteristics or states of nodes in the graph, and their specific acquisition methods are obtained through the embedding layer or through back propagation learning during model training; it should be noted that T here represents transpose.

[0083] S5.2.2: The hypergraph convolution operation in the present invention is: in, Represents the hypergraph convolution operation, which combines the adjacency relationship of the hypergraph to extract and fuse the high-order spatial features of super nodes; The input feature matrix used in the hypergraph convolution operation also represents the hypergraph features at the dth layer. k is a learnable parameter matrix for high-dimensional features Perform linear transformation and feature mapping; E represents the dimension of the output feature matrix, that is, the number of hypergraph convolution output features; It is a learnable weight matrix used in the hypergraph convolution layer for different layers of the hypergraph structure, which is responsible for adjusting the weights of features in different order diffusions and helping to capture the multi-order spatial dependency information of the hypergraph. These weights are specifically adapted to the complex relationships in the hypergraph and improve the integration effect of supernode features. The implementation method is In the weight matrix In the process of realizing node represents the degree matrix of the supernode in the dual graph, D edge represents the degree matrix of the hyperedge in the dual graph, H represents the original graph G and the dual graph G d The structural correlation matrix between them can be expressed as follows: Among them, [H] ij is the element in the i-th row and j-th column of the structural association matrix H, v i represents the i-th node in the original graph G; e j Denote the dual graph G d The jth hyperedge in . The adaptive weight matrix is: Parameter matrix L adp Each element L adp,i Corresponding to the adaptive connection strength or importance of the i-th node in the graph G, the adaptive weight matrix W adp The parameter matrix L adp The diagonalized parameter matrix.

[0084] S5.3: Multi-head attention module: In order to model the long-distance dependency between sequence data, a multi-head attention mechanism is introduced into the model. The multi-head attention module can enable the entire model to better understand the contextual information of the input data, thereby improving the generalization and representation capabilities. The results obtained in steps S5.1.1.3, 5.1.1.4, and 5.2.2 are concatenated, passed through a linear layer, and then passed through two activation functions respectively to obtain the input of the multi-head attention:

[0085]

[0086] X temp =Liner(X temp )

[0087] X T =tanh(SA(X temp ))

[0088] X S =σ(SA(X temp ))

[0089] Specifically, for node i, the attention mechanism is performed in the time and space dimensions respectively. First, the query, key and value matrix is ​​obtained: Q1 = X T W Q1 ,K1=X T W K1 ,V1=X T W V1 and Q2 = X S W Q2 ,K2=x S W K2 ,V2=X S W V2 . Among them, the weight matrix is a learnable parameter, X T and X S Represent the input of the attention mechanism in time and space dimensions respectively. Then, the self-attention operation is applied in time and space dimensions, and the dependencies between all time and space of node i are obtained: and Among them, softmax means row-wise softmax normalization. Next, in order to include multiple aspects that we want to focus on, the dependency relationship SA(X T ) is further expanded to multi-head self-attention, and the spatial dimension is the same as shown below:

[0090] MSA(X T )=concat(SSA(X T )1,…,SSA(X T )h )W O

[0091] Among them, h is the number of heads of the attention mechanism used, MSA(X T ) represents the input X T The result of multi-head self-attention processing. Specifically, multi-head self-attention will input X T Divide into multiple subspaces, each subspace performs independent self-attention calculation, and then concatenate these attention results; W O This is a learnable linear transformation matrix that further transforms the concatenated multi-head attention output to the required output dimension. Linear transformation matrix W O By default, the model is automatically generated. When the outputs of two temporal attentions are concatenated together, information from different time scales or different focus points can be integrated together to form a richer feature representation. This multi-perspective information fusion can improve the learning ability of the model and enable it to better understand complex time series data.

[0092] The third linear layer handles the concatenated temporal attention and spatial attention. Using the residual learning mechanism to add the results of the third linear layer to the results of the input layer makes it easier for the network to learn the identity mapping and avoid the problem of gradient disappearance or explosion in deep networks. Residual connections allow gradients to flow more smoothly during back propagation, helping the network converge faster.

[0093] S5.4: Dual transformation module:

[0094] S5.4.1: Dual transformation from graph to dual graph: The dual transformation module is part of the convolutional interaction module, which introduces an information exchange mechanism between different graph convolutional modules. The convolutional interaction module relies on the dual transformation module to realize the interaction between different convolutional layers. Through the dual transformation, feature information can be shared or converted between multiple structures, thereby obtaining richer spatial features in spatial convolution. The supernode features of the dual hypergraph correspond to the edge features of the traffic flow graph. Therefore, the features obtained after one convolution of the original graph are input into the dual hypergraph. The dual hypergraph is defined by the edge and node features of the traffic flow graph as follows:

[0095]

[0096] in, Denotes the dual hypergraph G in step S3 d Input features of super nodes; H src and H dst represents the feature matrix of the source node and the target node, respectively, containing information related to traffic flow; W1 and W2 are the learned weight matrices used to adjust the influence of the source node and the target node; Xhigh It is the feature representation obtained from the original image, usually the result obtained after the convolution operation; The distance feature matrix between node pairs is used to represent the spatial relationship between nodes in the graph. A distance matrix is ​​formed by calculating the shortest path length between nodes based on the topological structure of the graph.

[0097] S5.4.2: Dual hypergraph to graph dual transformation: The dual hypergraph to graph dual transformation is to restore the features of the dual hypergraph to the traffic flow graph, and map the features of the super nodes of the dual hypergraph back to the features of the nodes of the traffic flow graph through the following formula: Among them, H is the structural association matrix, which reflects the correspondence between the original traffic flow graph and the dual hypergraph nodes; The feature matrix representing the dual hypergraph is obtained from the convolution operation of the dual hypergraph. W3 is a learnable weight matrix used to adjust the influence of the dual hypergraph features on the restored features. is the parameter matrix required to restore the transformation.

[0098] S6: By generating multiple feature representations through three layers of parallel modules, the model can obtain richer expressions in subsequent feature fusion. This feature enhancement is particularly useful for capturing subtle differences in data. The output layer obtains the output result by continuously linearly transforming the previously obtained features. The two linear layers adjust the features through learnable weights. After each linear layer acts, the distribution of the feature vector in the feature space is further optimized. The existence of the linear layer between the two ReLU layers enables the model to perform more accurate feature selection between different feature channels.

[0099] By iterating the above steps, the training is stopped when the preset number of training times is reached to obtain the traffic flow prediction model, and the trained traffic flow prediction model is used to evaluate on the test set.

[0100] S7: Input the training set into the traffic flow prediction model to train the traffic flow prediction model. Use the preprocessed traffic data in the test set to test the trained traffic flow prediction model to obtain the predicted traffic flow.

[0101] In the training phase, the model is trained according to the following loss function by obtaining the predicted output results of the model and the real data samples collected by the sensor: Among them, Y, Respectively represent the true value and the predicted value; represents the predicted value, Y T represents the true value of traffic, λ is the regularization hyperparameter, L reg represents the L2 regularization term that reduces the risk of overfitting and improves generalization ability.

[0102] The trained model parameters are fixed, and the traffic data in the validation set is input into the trained model to evaluate the model performance. Parameter experiments are conducted to analyze the impact of the parameters on the model, and the validation set data is input into the model to perform future traffic flow prediction tasks.

[0103] The mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) are used to evaluate the test results of the model:

[0104]

[0105] Among them, x i represents the real samples at each sampling time in road i in the road network, represents the predicted data of road i at each future time point in the road network; Ω represents the set of road sensor nodes in the road network.

[0106] like Figure 2 The figure shows the use case description of the present invention, which shows the topological structure diagram of the real road network in Figure (a), the schematic diagram of the process of obtaining the dual hypergraph through the topological graph structure in step S5.4, and using the obtained original graph and dual hypergraph for the subsequent graph convolution operation and hypergraph convolution operation, and fusing the collected information for the downstream multi-head attention module and the downstream traffic flow prediction task. There are two intersections in the real road network, and the roadside sensor units are numbered as 1, 2, 3, 4, 5, 6. Each sensor is identified according to the given number, and according to the connection relationship between the sensors, the initial topological structure modeling of the road network shown in Figure (b) can be obtained. At this time, the edge between sensors 1 and 3 is recorded as c, and the edge between sensors 1 and 4 is recorded as a, and the rest is similar, so as to obtain the following: Figure 2 The edges b, d, e, f, and g marked in (c) are then, according to the duality principle, the nodes in the original road network graph are the edges in the dual hypergraph, and the edges in the original road network graph are the nodes in the dual hypergraph, and the dual hypergraph shown in Figure (c) can be obtained. Then, the training is performed according to the training process of the model. The specific process can be referred to step S5 until the final converged traffic flow prediction model is obtained, and then the subsequent prediction tasks are performed.

[0107] Table 1 Experimental results on METR-LA and PEMS-BAY traffic speed datasets

[0108]

[0109] The present invention is compared with the benchmark model and evaluates the performance of METR-LA and PEMS-BAY datasets at multiple time scales, including the prediction effects of 15 minutes (3 steps), 30 minutes (6 steps) and 60 minutes (12 steps). In Table 1, GMAN comes from the literature [Zheng C, Fan X, Wang C, et al. Gman: A graph multi-attention network for traffic prediction [C] / / Proceedings of the AAAI conference on artificial intelligence. 2020, 34 (01): 1234-1241.], ASTTN comes from the literature [Feng A, Tassiulas L. Adaptive graph spatial-temporal transformer network for traffic forecasting [C] / / Proceedings of the 31st ACM international conference on information & knowledge management. 2022: 3933-3937.], and DCRNN comes from the literature [Li Y, Yu R, Shahabi C, et al. Diffusion convolutional neural network [C] / / Proceedings of the 31st ACM international conference on information & knowledge management. 2022: 3933-3937.] recurrent neural network: Data-driven traffic forecasting [J]. arXiv preprint arXiv: 1707.01926, 2017.] and FC-GAGA are from the literature [Oreshkin BN, Amini A, Coyle L, et al. FC-GAGA: Fully connected gated graph architecture for spatio-temporal traffic forecasting [C] / / Proceedings of the AAAI conference on artificial intelligence. 2021, 35 (10): 9233-9241.]. The MAE, RMSE and MAPE indicators of the present invention at 15 minutes, 30 minutes and 60 minutes prediction time intervals are all the lowest or close to the lowest value.For example, in the 15-minute prediction of the PEMS-BAY data set, the MAE, RMSE and MAPE of the present invention are 1.28, 2.67 and 2.70% respectively, which are better than other models, showing the significant advantages of the present invention in short-term prediction. In different time intervals (15 minutes, 30 minutes, 60 minutes), the error growth of the present invention is relatively small, showing good stability, especially the MAPE of 60 minutes is 3.90%, which still maintains a low error level. This shows that the present invention also has a certain robustness in long-term prediction. In terms of overall performance, the present invention is better than or equal to other models in various indicators, especially in MAE and MAPE, indicating that the model of the present invention can achieve more accurate predictions in multiple time intervals.

[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A traffic flow prediction method based on dual hypergraph neural network, characterized in that: The steps are as follows: S1: pre-processing the traffic data collected by sensors in the traffic network within a certain period of time; S2: The preprocessed traffic data is organized into a dataset and divided into a training set, a test set, and a validation set; S3: Construct the traffic flow graph and dual hypergraph respectively according to the topological graph of the traffic network; S4: Construct a traffic flow prediction model based on the spatiotemporal dual hypergraph convolutional layer. The traffic flow prediction model includes an input layer, a spatiotemporal dual hypergraph convolutional layer, and an output layer connected in sequence. S5: inputting the preprocessed traffic data in the training set into the traffic flow prediction model for training; The trained traffic flow prediction model is tested using the preprocessed traffic data in the test set to obtain the final traffic flow prediction model; the preprocessed traffic data in the validation set is input into the final traffic flow prediction model to obtain the predicted traffic flow.

2. The traffic flow prediction method based on dual hypergraph neural network according to claim 1 is characterized in that: The implementation method of the preprocessing is: using the threshold method to screen and remove abnormal values ​​in the collected traffic data to obtain time series data; using the average interpolation method to supplement the missing values ​​and the traffic data removed due to data anomalies; Assign a unique number to each sensor node to ensure that each sensor node has a unique identifier; According to the location information of sensor nodes, the distance between adjacent sensor nodes is calculated; The training set, test set, and validation set are divided in a ratio of 7:2:

1.

3. The traffic flow prediction method based on dual hypergraph neural network according to claim 1 or 2 is characterized in that: The traffic flow graph is G=(V, E, A), where V represents the set of sensor nodes in the road network, E refers to the edges connecting the sensors, and A represents the adjacency matrix of the road network; The dual hypergraph G d =(V d ,E d ,A d ), where V d represents the set of super nodes, E d refers to the set of hyperedges, A d Represents the adjacency matrix of the dual hypergraph; The traffic network is divided into different areas according to geographical location, and the sensor nodes in adjacent or similar areas are aggregated into supernodes, or supernodes are aggregated through traffic data or feature similarity; supernodes represent the aggregation of sensor nodes in space or traffic patterns, and each supernode contains one or more sensor nodes; if the sensor nodes contained in two supernodes are close in physical space or the traffic characteristics of the two supernodes have a strong correlation, a hyperedge is established between the two supernodes; a hyperedge is a high-order connection relationship between multiple sensor nodes.

4. The traffic flow prediction method based on dual hypergraph neural network according to claim 3 is characterized in that: The adjacency matrix includes an initialization adjacency matrix, a similarity adjacency matrix and an adaptive adjacency matrix, wherein the initialization adjacency matrix is ​​generated based on the geographical location or topological structure between the sensor nodes and is used to represent the fixed spatial relationship of the sensor nodes; The similarity adjacency matrix is ​​generated based on the similarity of the node's traffic mode or flow data to reflect the similarity relationship between nodes; The adaptive adjacency matrix is ​​an adjacency matrix that is dynamically adjusted through model learning, and the relationship weights between nodes are updated in real time as the data input changes; Initialize the element values ​​in the adjacency matrix to be the Euclidean distance information calculated from the node's location information; The Wasserstein distance is used to measure the initial similarity relationship between nodes in the similar adjacency matrix; Based on the low-dimensional feature vector obtained by decomposition based on the vector decomposition principle, the similarity between nodes is calculated according to the low-dimensional feature vector, an adaptive adjacency matrix between the initial nodes is constructed, and subsequent model training is carried out in a data-driven manner.

5. The traffic flow prediction method based on dual hypergraph neural network according to claim 4 is characterized in that: The input layer transforms the preprocessed traffic data into a high-dimensional space using the linear transformation of the linear layer to obtain a high-dimensional feature representation; the number of the space-time dual hypergraph convolutional layers is set to three, the three space-time dual hypergraph convolutional layers are connected in parallel, the high-dimensional feature representation obtained by the input layer is respectively input into the three space-time dual hypergraph convolutional layers, the three space-time dual hypergraph convolutional layers generate a variety of feature representations and then input into the output layer, the output layer obtains the output result through continuous linear transformation of the multiple feature representations; the output layer includes two ReLU activation layers and a linear layer connected in sequence, the two linear layers perform feature adjustment through learnable weights, and the linear layer between the two ReLU activation layers enables the model to perform more accurate feature selection between different feature channels.

6. The traffic flow prediction method based on dual hypergraph neural network according to claim 5 is characterized in that: The spatiotemporal dual hypergraph convolution layer includes a temporal convolution module, a spatiotemporal hypergraph convolution module and a multi-head attention module connected in sequence. The spatiotemporal hypergraph convolution module includes a graph convolution module, a hypergraph convolution module and a convolution interaction module. The convolution interaction module is provided with a dual transformation module. The results output by the graph convolution module, the hypergraph convolution module and the convolution interaction module are transmitted to the multi-head attention module. The multi-head attention module includes a spatial attention mechanism and a temporal attention mechanism. The results obtained by the spatial attention mechanism and the temporal attention mechanism are concatenated and linearly transformed through a linear layer. The feature representation obtained by adding the result of the linear transformation to the high-dimensional feature representation output by the input layer using a residual learning mechanism is used as the output of the spatiotemporal dual hypergraph convolution layer.

7. The traffic flow prediction method based on dual hypergraph neural network according to claim 6 is characterized in that: The implementation method of the graph convolution module is as follows: in the graph convolution operation, the forward and backward adjacency matrices are considered separately, and the dependency relationship and propagation process between nodes are fully captured by weighted summation of the forward adjacency matrix and the backward adjacency matrix of each step, and the feature representation is obtained as follows: Where X represents the intermediate feature representation output by the temporal convolution module, S represents the total number of diffusion steps, represents the nth-order forward adjacency matrix, which is used to capture the information of nodes propagated forward in the network; represents the nth-order backward adjacency matrix, which is used to capture the backward dependency relationship of nodes; W s,f is the weight of the forward adjacency matrix, which is used to weight the influence of forward neighbors during feature propagation; W s,b is the weight of the backward adjacency matrix, which is used to weight the influence of backward neighbors during feature propagation; The convolution interaction module is based on the convolution interaction of the graph convolutional network, and uses the adjacency matrix and feature matrix to perform multi-layer feature fusion. The output is expressed as: Among them, GCN d (X) represents the output of the graph convolution operation, represents the n-th order adaptive adjacency matrix, Both represent learnable weight matrices, K represents the total number of multi-order graph convolution operations, and d represents the depth of graph convolution.

8. The traffic flow prediction method based on dual hypergraph neural network according to claim 6 or 7 is characterized in that: The hypergraph convolution operation of the hypergraph convolution module is: in, Represents the hypergraph convolution operation; represents the hypergraph feature at the dth layer; Θ k is a learnable parameter matrix; E represents the dimension of the output feature matrix; Represents the learnable weight matrices used for different layers of the hypergraph structure.

9. The traffic flow prediction method based on dual hypergraph neural network according to claim 8 is characterized in that: The temporal convolution module includes two parallel dilated convolution branches, each of which is set with a different dilated rate. The output features of the two dilated convolution branches are: in, and denote the one-dimensional convolution operations with dilation rates d1 and d2 respectively, X high Represents the high-dimensional feature representation obtained by the input layer; and Represent the output features of the two dilated convolution branches respectively; Interactively fuse the output features of two parallel dilated convolution branches: Among them, X out represents the intermediate feature representation after fusion, tanh is the activation function, and σ represents the output feature The transformation function to be performed; The weight matrix The implementation method is Among them, D node represents the degree matrix of the supernode in the dual hypergraph, D edge represents the degree matrix of the hyperedge in the dual hypergraph, H represents the traffic flow graph G and the dual hypergraph G d The structural correlation matrix, W adp is the adaptive weight matrix, The structural association matrix H is: Among them, [H] ij is the element in the i-th row and j-th column of the structural association matrix H, v i represents the i-th node in the traffic flow graph G; e j Denote the dual hypergraph H d The jth hyperedge in; the adaptive weight matrix is: Parameter matrix L adp Each element L adp,i Corresponding to the adaptive connection strength of the i-th node in the traffic flow graph G; The adaptive adjacency matrix P adp =SoftMax(ReLU((emb2) T emb1)) is obtained by matrix multiplication of two learnable parameter vectors, where SoftMax function is a normalization function, ReLU is an activation function, emb2 and emb1 are two learnable embedding vectors, and T represents transpose; The multi-head attention module concatenates the output results obtained by the graph convolution module, the convolution interaction module and the hypergraph convolution module, passes through a linear layer and then passes through two activation functions to obtain the input features of the spatial attention mechanism and the temporal attention mechanism respectively. The implementation method is: X temp =Liner(X temp ) X T =tanh(SA(X temp )) X S =σ(SA(X temp )) Among them, X temp is a temporary feature representation, Liner is the linear transformation function of the linear layer, X T and X S are the input features of the spatial attention mechanism and the temporal attention mechanism respectively; SA() is the dependency calculation function; The spatial attention mechanism and the temporal attention mechanism calculate the query matrix, key matrix and value matrix according to the input features respectively, apply the self-attention operation in the time and space dimensions, use the query matrix, key matrix and value matrix to calculate the dependency between time and space, and connect the multi-head attention dependency to obtain the output of the spatial attention mechanism and the temporal attention mechanism; During the training phase, the loss function is: in, Represent the true value and predicted value respectively; represents the predicted value, Y T represents the true value of traffic, λ is the regularization hyperparameter, L reg represents the L2 regularization term that reduces the risk of overfitting and improves generalization ability.

10. The traffic flow prediction method based on dual hypergraph neural network according to claim 8 is characterized in that: The dual transformation module includes a dual transformation from a traffic flow graph to a dual hypergraph and a dual transformation from a dual hypergraph to a traffic flow graph; The dual transformation from the traffic flow graph to the dual hypergraph is implemented as follows: The dual transformation module is part of the convolution interaction module, which introduces an information exchange mechanism between different graph convolution modules. The convolution interaction module relies on the dual transformation module to realize the interaction between different convolution layers. Through the dual transformation, feature information can be shared or converted between multiple structures, thereby obtaining richer spatial features in spatial convolution. The supernode features of the dual hypergraph correspond to the edge features of the traffic flow graph. The features of the traffic flow graph after one convolution are input into the dual hypergraph. The dual hypergraph is defined by the edge and node features of the traffic flow graph as follows: in, Denote the dual hypergraph G d Input features of super nodes; H src and H dst Represent the feature matrices of the source node and the target node respectively. W1 and W2 are the learned weight matrices used to adjust the influence of the source node and the target node. X high Represents the high-dimensional feature representation obtained by the input layer; Represents the distance feature matrix between node pairs; The dual transformation from the dual hypergraph to the traffic flow graph is implemented by restoring the features of the dual hypergraph to the traffic flow graph and mapping the features of the supernodes of the dual hypergraph back to the features of the nodes of the traffic flow graph: Where H is the structural correlation matrix, The feature representation of the dual hypergraph is the supernode feature matrix in the dual hypergraph, W3 is a learnable weight matrix, (W3⊙H) T is the parameter matrix required to restore the transformation.

Citation Information

Patent Citations

  • A Traffic Prediction Method Based on Dual Dynamic Spatiotemporal Graph Convolution

    CN114495500B

Cited By

  • Urban traffic flow prediction method and system

    CN120279728A

  • Coal mine safety monitoring system based on big data

    CN120525351A

  • A coal mine safety monitoring system based on big data

    CN120525351B

  • Flight state monitoring device and method based on electroencephalogram signal data classification

    CN120541591A

  • Flight Status Monitoring Device and Method Based on EEG Signal Data Classification

    CN120541591B