Traffic flow prediction method based on multi-scale dual hypergraph fusion

By constructing a multi-scale dual hypergraph fusion method, combining hypergraph convolution and dynamic graph convolution, we capture the multi-scale high-order spatial characteristics and temporal dependencies of traffic flow, solve the problems of insufficient prediction accuracy and generalization ability of existing models, and achieve more accurate traffic flow prediction.

CN120673587AActive Publication Date: 2025-09-19YANGTZE DELTA REGION INST (QUZHOU) UNIV OF ELECTRONIC SCI & TECH OF CHINA

Patent Information

Application Number
CN202510759638.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-09-19
Estimated Expiration
2045-06-09

AI Technical Summary

Technical Problem

Existing traffic flow prediction models find it difficult to effectively capture multi-scale high-order spatial characteristics, especially the dynamic changes in micro-individual travel intentions, meso-community commuting, and macro-regional flow conduction, resulting in insufficient prediction accuracy and generalization ability.

Method used

A multi-scale dual hypergraph fusion method is constructed, including dual hypergraphs of micro-travel intentions, meso-community commuting, and macro-regional conduction. Hypergraph convolution and dynamic graph convolution are combined to extract multi-scale spatial features, and global spatial dependencies are modeled through gating mechanisms and multi-head attention mechanisms. The time-expanded causal convolutional network is combined to capture short-term fluctuations and long-term trend characteristics, and finally traffic flow prediction is performed through residual connections.

Benefits of technology

It significantly improves the accuracy and generalization ability of traffic flow prediction, can more accurately reflect the multi-scale high-order spatial characteristics and complex spatiotemporal dynamic interactions of urban roads, and provides a more powerful prediction tool for intelligent transportation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673587A_ABST
    Figure CN120673587A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method based on multi-scale dual hypergraph fusion. Aiming at the problem that an existing traffic flow prediction model is difficult to capture a multi-scale high-order spatial dependency relationship of a traffic road network, the method comprises the following steps of: firstly, constructing an urban road dual hypergraph with three scales of microscopic individual travel intention, mesoscopic community commuting interaction and macroscopic area flow conduction, and then designing a traffic flow prediction method of space-time perception based on the urban road dual hypergraph. Wherein the spatial perception module extracts and fuses a dependency relationship between a high-order local spatial feature and a global spatial feature in a multi-scale dual hypergraph; the time sensing module captures short-term fluctuation and long-term trend of traffic flow; and residual connection is introduced to enhance spatio-temporal feature fusion, and finally multi-step traffic flow prediction is realized. The invention provides a traffic flow prediction model with multi-scale high-order space perception, which adaptively fuses high-order space features of three scales of microcosmic, mesoscopic and macroscopic, and significantly improves the precision and generalization ability of traffic flow prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent transportation, and in particular relates to a traffic flow prediction method based on multi-scale dual hypergraph fusion. Background Art

[0002] With the acceleration of global urbanization, road congestion and frequent traffic accidents have become increasingly prominent and have become major challenges facing modern urban transportation systems. In this context, traffic flow forecasting, a core issue in Intelligent Transportation Systems (ITS), provides a key basis for decision-making in signal timing optimization and traffic flow allocation strategies.

[0003] Traffic flow prediction methods have undergone a continuous evolution from traditional statistical methods to modern deep learning techniques. Early research primarily relied on traditional statistical models, such as regression analysis and time series models, to predict the dynamics of traffic flow. However, these methods have significant limitations in capturing the spatiotemporal dependencies and nonlinear relationships of traffic flow. With the rise of machine learning, researchers introduced algorithms such as support vector machines and random forests, which can address the nonlinear characteristics of traffic flow to some extent, but remain insufficient in modeling spatial dependencies. Subsequently, deep learning technology has driven the development of traffic flow prediction. Deep learning models such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs) excel in capturing temporal dependencies but remain limited in addressing the spatial dependencies of traffic flow. The introduction of graph convolutional networks (GCNs) has provided a groundbreaking solution to this problem. By learning from graph structures, researchers can effectively capture the spatial dependencies between regions in traffic networks. Building on this foundation, several models have been proposed in recent years that are more suitable for high-precision prediction in complex traffic scenarios. For example, DHSTNet uses a dynamic spatiotemporal graph model to combine spatiotemporal dependencies with dynamic graph structures, more comprehensively modeling the dynamic changes of traffic flow. STGHTN proposes a spatiotemporal gated hybrid transformer network, which first uses time-gated convolution and space-gated graph convolution to extract the temporal local features and spatial local features of traffic flow, respectively. It then captures the global spatiotemporal dependencies through the transformer module, significantly improving the accuracy of traffic flow prediction.

[0004] In summary, while significant progress has been made in traffic flow prediction research, existing spatiotemporal prediction frameworks primarily rely on feature learning based on nodes and edges in predefined low-level graph structures or on hyperedge feature learning within a single-scale hypergraph. While these frameworks can capture certain spatiotemporal dependencies, they struggle to effectively represent the multi-scale, high-order spatial features prevalent across road networks, limiting their performance in real-world traffic flow prediction. In reality, the dynamics of real-world traffic flow are influenced by a combination of multi-scale factors, including micro-level travel intentions, meso-level community commuting patterns, and macro-level regional flow transmission. At the micro-level, existing studies generally assume homogeneous scenarios, ignoring the coexistence of diverse travel demands, such as school transportation, medical care, and freight transportation, as well as the significant differences in route choice and time schedules among different groups. At the meso-level, traditional modeling approaches fail to capture the dynamic functional units formed by spatiotemporal behavioral patterns, such as high-frequency commuting corridors and periodic pick-up and drop-off routes. These high-order spatial interaction clusters based on commuting demands essentially define the functional boundaries of a community. In addition, at the macro-conduction level, the static adjacency matrix is ​​difficult to reflect the dynamic conduction effect of cross-regional traffic flow, and there is still the problem of interactive influence caused by detour behavior between directly unconnected areas. Summary of the Invention

[0005] In response to the shortcomings of the existing technology, the present invention provides a traffic flow prediction method with multi-scale high-order spatial perception, which adaptively integrates high-order spatial features at the micro, meso and macro scales, significantly improving the accuracy and generalization ability of traffic flow prediction.

[0006] The purpose of the present invention is achieved through the following technical solutions:

[0007] A traffic flow prediction method based on multi-scale dual hypergraph fusion, the prediction method comprising:

[0008] S1. Based on the actual traffic network topology, we construct a dual hypergraph of travel intentions, a dual hypergraph of functional communities, and a dual hypergraph of regional conduction at three scales: micro-individual travel intentions, meso-community commuting, and macro-regional flow conduction, thus achieving the construction of a multi-scale urban road dual hypergraph.

[0009] S2. Based on the dual hypergraphs of the three scales constructed in step S1 and the historical traffic flow feature matrix, hypergraph convolution and dynamic graph convolution are first used to gradually extract multi-scale spatial features. Multi-scale fusion of high-order local spatial information is achieved through a gating mechanism. Then, a spatial multi-head attention mechanism is combined to model global spatial dependencies, and an adaptive spatial fusion gate is introduced to dynamically adjust the weights of high-order local spatial embeddings and global spatial features, ultimately generating a multi-scale spatial encoding feature sequence.

[0010] S3. Input the multi-scale spatial encoding feature sequence obtained in step S2 into the dynamic time dilation causal convolutional network to extract the short-term fluctuation pattern of traffic flow. At the same time, a temporal multi-head attention mechanism is used to capture the long-term trend characteristics of traffic flow data. Then, an adaptive temporal fusion gate is used to adaptively integrate the short-term dynamics and long-term temporal dependencies of historical traffic flow data to form a spatiotemporal feature representation that combines multi-scale spatial information and long-term and short-term temporal dependencies.

[0011] S4. Based on the spatiotemporal feature representation obtained in step S3, the spatiotemporal feature fusion is enhanced through residual connection and input into the convolutional prediction layer, and finally the multi-step traffic flow prediction result is output.

[0012] Furthermore, the actual traffic network topology structure in step S1 is specifically:

[0013] The actual traffic network topology is modeled as a weighted directed graph G = (V, ε, A), where the node set V = {v1, v2, ..., v N} represents N road segments, i.e. |V| = N; the edge set ε = {e1, e2, ..., e E} describes the connection relationship of E roads, that is, |ε|=E, the adjacency matrix A∈R N×N The spatial distance weights between encoding road segments; In addition, the historical traffic flow feature matrix of T time steps is X∈R T×N×d , where d represents the traffic feature dimension of each road node.

[0014] Specifically, constructing the travel intention dual hypergraph in step S1 includes:

[0015] All points starting from the same road node and all nodes ending at the same road node are respectively formed into hyperedges; the dual hypergraph of travel intention is represented by Gt = (V t , ε t , H t ), whose adjacency matrix H t The definition is as follows:

[0016]

[0017] in, is the adjacency matrix H t The element in row i and column j of Superedge Travel intention dual hypergraph adjacency matrix H t It can be divided into two parts: in Represents the hyperedge connection relationship built based on the starting point, Represents the hyperedge connection relationship built based on the end point; the two together constitute the complete topological structure of the travel intention dual hypergraph;

[0018] Specifically, constructing the functional community dual hypergraph in step S1 includes:

[0019] First, we select the K road nodes with the highest degree of overlap in the destination to form the destination hyperedge, and then select the K road nodes with the highest degree of overlap in the departure to form the departure hyperedge. In the node selection process, we constrain the total spatial distance of the nodes inside the hyperedge to be the shortest, so as to construct the dual hyperedge of the functional community dual hypergraph. To quantify the functional similarity between nodes, we reconstruct the new functional association matrix A based on the original weight adjacency matrix A. c , calculated as follows:

[0020]

[0021] in is the element in row i and column j of the functional association matrix, N is the number of nodes, The size of the value is related to the node v i and v j The functional similarity of is negatively correlated; Based on this, the K-nearest neighbor algorithm is used to c For each node i, the most similar C neighbors are selected to form a functional community Finally, the dual hypergraph G is constructed c =(V c ,ε c ,H c ), adjacency matrix H c The definition is as follows:

[0022]

[0023] in, is the adjacency matrix H c The element in row i and column j of Superedge Functional community dual hypergraph adjacency matrix H c It can be divided into two parts, namely Represents all hyperedge connection relationships built based on the overlap of departure nodes, and It represents the hyperedge connection relationship constructed based on the overlap of arrival nodes, and the two together constitute the complete topological structure of the functional community dual hypergraph.

[0024] Specifically, constructing the regional conductive dual hypergraph in step S1 includes:

[0025] First, the top K most influential neighbor nodes are selected through the Top-K sampling method to construct the node influence adjacency matrix A r , the specific calculation is as follows:

[0026] idx=Top-K(-A i,: ,K),

[0027] idy=Top-K(-A :,j K),

[0028] A r =A[idx,idy],

[0029] Among them, idx and idy∈R N×K They represent the K most influential neighbor nodes selected from the starting point and the K most influential neighbor nodes selected from the end point respectively; then, the Top-K influential neighbor set of each node is used as a hyperedge, and the node influence matrix A is used to calculate the top-K influential neighbor set of each node. r Constructing the regional conductive dual hypergraph G r =(V r , ε r , H r ), its adjacency matrix H r The definition is as follows:

[0030]

[0031] in, is the adjacency matrix H r The element in row i and column j of Superedge Regional conduction dual hypergraph adjacency matrix H r Can be divided into two parts: in, and The hyperedge relationships corresponding to the starting point and the end point respectively constitute the complete topological structure of the regional conduction dual hypergraph.

[0032] Furthermore, in step S2, hypergraph convolution and dynamic graph convolution are used to gradually extract multi-scale spatial features, and a gating mechanism is used to achieve multi-scale fusion of high-order local spatial information, as follows:

[0033] First, construct the multi-scale hyperedge feature matrix X h , the original traffic flow features X∈R T×N×d The specific process of integrating into the constructed multi-scale dual hypergraph is formally expressed as follows:

[0034] X h =[(W1x)[ind src ,:];(W2χ)([ind dst ,:]]∈R E×2d′ ,

[0035] Among them, [·;·] is the splicing operation, W1,W2∈RT×d×d′ is a learnable parameter used to linearly transform the original traffic flow feature X, d′ is the hyperedge feature dimension, and after applying these parameters to X, the result is W1X, W2X∈R N×d′ ; Thus, (W1X)[ind src ,:]: is the hyperedge feature slice tensor constructed based on the starting hyperedge relationship; (W2X)[ind dst ,:] is the hyperedge feature slice tensor constructed based on the endpoint hyperedge relationship; next, the interaction relationship between super nodes is further aggregated through convolution operation:

[0036] X h′ =Conv 1×1 (X h )∈R E×d″ ,

[0037] Among them, Conv 1×1 (·) represents the convolution operation using a 1×1 convolution kernel to update the features of the supernode, and d″ is the feature dimension of the supernode. To enhance the adaptability of the model, the diagonal adaptive learning parameter of the dual hypergraph is defined as follows:

[0038] W adp =diag(L adp )∈R N×N ,

[0039] Among them, L adp ∈R N is the weight vector used for hyperedge adaptive learning; based on this, the dual hypergraph adaptive adjacency matrix is ​​defined as follows:

[0040]

[0041] Among them, D hv is the hyperdiagonal matrix, D he is the diagonal matrix of hypernode degrees, and H is the dual hypergraph adjacency matrix;

[0042] Then, the adaptive adjacency matrix W h Input into the hypergraph convolutional network to aggregate the high-order information of the hyperedge. The calculation process is as follows:

[0043]

[0044] It should be noted that Θ=[Θ0,...,Θ N-1 ]∈R N×d" is the parameter to be learned; further, the Reshape() function is used to map the output of the hypergraph convolutional network into a sparse matrix, which is calculated as follows:

[0045]

[0046] On this basis, the reverse correlation matrix is ​​constructed A dynamic graph convolutional network is used to aggregate high-level local information of traffic flow, as shown below:

[0047]

[0048] Among them, A f =A / rowsum(A) is the row-normalized adjacency matrix, is the column-normalized adjacency matrix, is an adaptive adjacency matrix, and E1, E2∈R N ×c is a learnable parameter, Θ' f =[Θ′ 0,f ,....,Θ′ N-1,f ]∈R N×d×1 Θ′ b =[Θ′ 0,b ,...,Θ′ N-1,b ]∈R N ×d×1 and Θ′ adp =[Θ′ 0,adp ,...,Θ′ N-1,adp ]∈R N×d×1 is a learnable parameter;

[0049] Then, multiple dynamic graph convolutional networks (DGCNs) are used to enable the model to fully learn the high-order local spatial information of the multi-scale dual hypergraph. The specific calculation is as follows:

[0050] Z t =DGCN t (X),Z c =DGCN c (X), Z r =DGCN r (X),

[0051] Among them, Z t , Z c and Z r They represent the high-order spatial embeddings of the travel intention dual hypergraph, the community commuting dual hypergraph, and the regional conduction dual hypergraph, respectively.

[0052] Finally, a gating mechanism is introduced to avoid the overfitting problem of high-order spatial embedding during the aggregation process. The specific process is as follows:

[0053] Z cr =Sigmoid(Z c )☉Tamh(Z r ),

[0054] gh =Sigmoid(Z cr +Z t ),

[0055] Z h =g h ☉Z cr +(1-g h )☉Z t ,

[0056] Among them, ⊙ represents the element-by-element product, and the adaptive weight g h It is obtained by the Sigmoid activation function, between 0 and 1, Z cr Represents the high-order spatial embedding of the community commuting dual hypergraph and the regional conduction dual hypergraph, Z h represents the final generated high-order local space embedding;

[0057] Furthermore, in step S2, the global spatial dependency is modeled in combination with the spatial multi-head attention mechanism, as follows:

[0058] First, the input feature X∈R T×N×d The query matrix Q is generated through three independent linear transformation layers S , bond matrix K S Sum matrix V S , the specific calculation is as follows:

[0059]

[0060] in, and are used to generate the query matrix Q S , bond matrix K S Sum matrix V S The linear layer can learn the parameter matrix;

[0061] On this basis, the attention scores between nodes in the spatial dimension are calculated by introducing a scaling factor To stabilize the gradient calculation and prevent the dot product result from being too large, which will cause the softmax function output to be saturated, the attention score matrix is ​​calculated as follows:

[0062]

[0063] in, K S The transpose of ; Due to the limited expressive power of a single attention mechanism, a multi-head attention mechanism is further introduced to capture the feature interactions of different subspaces. Specifically, the outputs of multiple attention heads are concatenated and linearly transformed to obtain the final output:

[0064]

[0065] Where m represents the number of attention heads, W S is the output projection matrix, Concat() is the splicing operation;

[0066] Finally, a feature interaction mechanism is designed to enhance the expressiveness of local features. This mechanism stabilizes the training process through residual connections and layer normalization, while introducing nonlinear transformations to enhance feature representation, thereby obtaining global spatial features. The calculation process is as follows:

[0067]

[0068] Among them, Relu is the activation function and Layernorm is the layer normalization function.

[0069] Furthermore, in step S2, an adaptive spatial fusion gate is introduced to dynamically adjust the weights of high-order local spatial embedding and global spatial features, as follows:

[0070] The Entangle fusion mechanism is introduced to adaptively balance high-order local spatial embedding and global spatial dependency. This mechanism dynamically adjusts the contribution of the two features through gating weights, thereby obtaining the final output feature that contains both local and global spatial information:

[0071]

[0072] Among them, the adaptive weight g s It is obtained through the Sigmoid activation function and is between 0 and 1;

[0073] Specifically, step S3 includes the following contents:

[0074] (3.1) Extracting short-term traffic flow fluctuation patterns through dynamic time dilation causal convolution, specifically:

[0075] Given the multi-scale spatial encoding feature sequence obtained in step S2 and filter F = {f1, f2, ..., f k}∈R K , calculate the dilated causal convolution at x time step t as follows:

[0076]

[0077] Among them, u is the expansion factor, which controls the jump distance and can control the receptive field of the model in the time dimension, making it easier to learn the short-term temporal dependency of traffic flow data;

[0078] At the same time, a gating mechanism is used to control the output of the information flow, and the gated activation unit is used to extract the short-term features of the output of the dilated causal convolution layer in parallel to reduce the influence of external noise. Specifically, it is expressed as:

[0079] Z T =Sigmoid(Φ1*X S +a)☉Tanh(Φ2*X S +b)

[0080] Among them, Φ1 and Φ2 are independent one-dimensional dilated causal convolution operations in the time dimension, a and b are learnable offset parameters, Sigmoid() is the activation function used to determine the proportion of information passed to the next layer, Tanh() is the activation function for implementing nonlinear transformation, and Z T ∈R N×T×d′ It is a feature representation with enhanced time perception;

[0081] (3.2) The temporal multi-head attention mechanism is used to capture the long-term trend characteristics of traffic flow data, specifically:

[0082] First, the query matrix Q is mapped to the query matrix through three independent linear transformation layers T , bond matrix K T Sum matrix V T , specifically defined as follows:

[0083]

[0084] in, and are used to generate the query matrix Q T , bond matrix K T Sum matrix V T The learnable parameter matrix of

[0085] On this basis, the attention scores between nodes in the time dimension are calculated by introducing a scaling factor To stabilize the gradient calculation and prevent the dot product result from being too large, which will cause the softmax function output to be saturated, the attention score matrix is ​​calculated as follows:

[0086]

[0087] in, K S Considering the limited expressive power of a single attention mechanism, a multi-head attention mechanism is further introduced to capture the feature interactions of different subspaces. Specifically, the outputs of multiple attention heads are concatenated and linearly transformed to obtain the final output:

[0088]

[0089] Where m represents the number of attention heads, W T It is a linear transformation matrix used to map the output of the temporal multi-head attention to the required output dimension, and Concat() is a concatenation operation;

[0090] Finally, a feature interaction mechanism is designed to enhance the expressiveness of local features and solve the problem that the temporal multi-head attention mechanism is insensitive to short-term time changes, thereby obtaining long-term temporal dependency features. The calculation process is as follows:

[0091]

[0092] Among them, Relu() is the activation function and Layernorm() is the normalization function;

[0093] (3.3) The adaptive time fusion gate is used to integrate the short-term dynamics and long-term temporal dependencies of historical traffic flow data, specifically:

[0094] The Entangle fusion mechanism is introduced to dynamically adjust the short-term dynamic and long-term temporal dependency contributions of historical traffic flow data through gating weights, thereby obtaining a spatiotemporal feature representation that combines multi-scale spatial information and long- and short-term temporal dependency characteristics.

[0095]

[0096] Among them, the adaptive weight g t It is obtained by the activation function Sigmoid, and the value is between 0 and 1;

[0097] Furthermore, the step S4 specifically includes the following contents:

[0098] First, the multi-scale spatiotemporal feature representations output by each layer are fused through the skip connection mechanism. The calculation process is expressed as follows:

[0099]

[0100] Among them, W a 、W b is a trainable parameter matrix, M represents the number of network layers, Layernorm() is the layer normalization function, and finally the fused features are mapped to the prediction results through a 1×1 convolutional layer:

[0101]

[0102] in, is the traffic flow prediction sequence for the next P time steps.

[0103] Compared with the prior art, the present invention has the following beneficial effects:

[0104] Existing spatiotemporal prediction frameworks mainly learn features based on nodes and edges of predefined low-order graph structures or rely on hyperedge feature learning of a single-scale hypergraph. Although they can capture certain spatiotemporal dependencies, they are difficult to effectively represent the multi-scale high-order spatial features that are prevalent between road networks, limiting their performance in actual traffic flow prediction. To address the above problems, the present invention proposes a traffic flow prediction method with multi-scale high-order spatial perception, which has the following core advantages: First, by constructing a dual hypergraph representation framework of micro (individual travel intention), meso (commuting in the community), and macro (regional flow conduction), it achieves accurate modeling of the multi-scale high-order spatial features of urban roads; second, it designs a spatiotemporal perception method based on multi-scale hypergraph feature fusion, and adopts an adaptive fusion mechanism to effectively integrate spatial features of different scales, significantly improving the model's ability to capture complex spatiotemporal dynamic interaction features; finally, the model achieves high-precision traffic flow prediction by dynamically fusing multi-scale high-order spatial features with complex temporal dependencies. This innovative method breaks through the limitations of traditional single-scale modeling and provides a more powerful prediction tool for intelligent transportation systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0105] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings.

[0106] Figure 1 The traffic flow prediction model diagram based on multi-scale hypergraph fusion of the present invention;

[0107] Figure 2 Schematic diagram of constructing a multi-scale dual hypergraph of the present invention;

[0108] Figure 3 Schematic diagram of high-order spatial perception of the present invention;

[0109] Figure 4 This is a schematic diagram of the spatial multi-head attention of the present invention;

[0110] Figure 5 Schematic diagram of the adaptive spatial fusion gate of the present invention;

[0111] Figure 6 This is a schematic diagram of time perception enhancement according to the present invention;

[0112] Figure 7 This is a schematic diagram of the temporal multi-head attention of the present invention;

[0113] Figure 8 Schematic diagram of the adaptive time fusion gate of the present invention;

[0114] Figure 9 This is a schematic diagram of the model output of the present invention. DETAILED DESCRIPTION

[0115] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application provided below in conjunction with the drawings is not intended to limit the scope of protection of the present application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. The present invention is further described below in conjunction with the drawings.

[0116] This paper proposes a traffic flow prediction method based on multi-scale dual hypergraph fusion to address the problem that existing traffic flow prediction models rely on predefined low-order graphs or single-scale hypergraphs, making it difficult to capture the multi-scale high-order spatial dependencies of traffic networks. First, the model constructs a dual hypergraph of urban roads at three scales: microscopic individual travel intentions, mesoscopic community commuting, and macroscopic regional flow conduction. Based on this, a traffic flow prediction method combining spatial and temporal awareness is designed. The spatial awareness module, consisting of high-order spatial perception and spatial multi-head attention, extracts and fuses high-order local spatial features and global spatial dependencies from the multi-scale dual hypergraph. The temporal awareness module, consisting of temporal awareness enhancement and temporal multi-head attention, captures short-term fluctuations and long-term trends in traffic flow. Finally, by stacking the spatial and temporal awareness modules and introducing a residual connection mechanism, multi-step spatiotemporal feature fusion and traffic flow prediction are achieved. This model adaptively integrates high-order spatial features at the micro, meso, and macro scales, significantly improving the accuracy and generalization of traffic flow prediction.

[0117] This example uses four real-world traffic flow datasets, PEMS03, PEMS04, PEMS07, and PEMS08, collected by the California Department of Transportation through its Highway Performance Measurement System (PEMS), as input for actual traffic operation data. This data is used to construct and verify the multiscale dual hypergraph construction process and spatiotemporal feature fusion mechanism in the proposed model. Basic statistical information for these four datasets is shown in Table 1.

[0118] Table 1

[0119]

[0120] After obtaining and processing the required data sets, the overall process of model construction is as follows: Figure 1As shown, the specific steps include:

[0121] like Figure 1 As shown, the specific steps include:

[0122] Step 1: Model the actual traffic network topology as a weighted directed graph G = (V, ε, A), where the node set V = {v1, v2, ..., v N} represents N road segments, i.e. |V| = N; the edge set ε = {e1, e2, ..., e E} describes the connection relationship of E roads, that is, |ε|=E, the adjacency matrix A∈R N×N The spatial distance weight between encoding road sections; the traffic feature matrix X∈R of T time steps T×N×d , where d represents the traffic characteristic dimension of each road node (such as speed, flow, etc.);

[0123] Step 2: Construct a dual hypergraph of travel intentions at the micro scale: Existing traffic flow prediction studies generally adopt homogeneous scenario assumptions. For example, it is assumed that all travelers during the morning rush hour go to work in the central business district. This assumption compels people's travel intentions to be compressed into a single commuting purpose. However, in the real traffic system, there are multiple types of travel demands such as school drop-off, medical treatment, and freight during the same period, and different groups have significant differences in route selection and time arrangements. Therefore, it is difficult for existing models to accurately depict the spatiotemporal distribution characteristics of traffic flow caused by the diversity of individual travel intentions. In order to better understand the impact of individual diversified travel intentions on traffic flow at the micro level, this paper proposes a dual hypergraph of travel intentions. Specifically, if Figure 2 As shown in (a), all points starting from the same road node and all nodes ending at the same road node constitute hyperedges. The dual hypergraph of travel intention is represented by G t =(V t ,ε t ,H t ), whose adjacency matrix H t The definition is as follows:

[0124]

[0125] in, is the adjacency matrix H t The element in row i and column j of Superedge Travel intention dual hypergraph adjacency matrix H t It can be divided into two parts: in Represents the hyperedge connection relationship built based on the starting point, represents the hyperedge connection relationship built based on the end point. Together, they constitute the complete topological structure of the travel intention dual hypergraph.

[0126] Step 3: Construct a dual hypergraph of functional communities at the mesoscopic scale: Existing traffic flow prediction studies generally ignore the high-order spatial correlation characteristics of the mesoscopic functional community level when modeling urban spatial relationships. However, in real urban systems, communities do not strictly follow administrative divisions, but are dynamic functional units constructed by spatiotemporal behavior patterns such as high-frequency commuting corridors and periodic pick-up and drop-off lines. For example, regular commuting corridors are formed between educational areas and surrounding residential areas. Such high-order spatial interaction clusters formed based on commuting needs essentially define the functional boundaries of the community. In order to study the impact of the spatial correlation characteristics of such dynamic functional units on traffic flow, this paper proposes a dual hypergraph of functional communities. Specifically, if Figure 2 As shown in (b), we first select the K road nodes with the highest degree of destination overlap to form the destination hyperedge, and then select the K road nodes with the highest degree of departure overlap to form the departure hyperedge. In the node selection process, we constrain the total spatial distance of the nodes inside the hyperedge to be the shortest, thereby constructing the dual hyperedge of the functional community hypergraph. To quantify the functional similarity between nodes, we reconstruct the new functional association matrix A based on the original weight adjacency matrix A. c , calculated as follows:

[0127]

[0128] in is the element in row i and column j of the functional association matrix, N is the number of nodes, The size of the value is related to the node v i and v j Based on this, the K-nearest neighbor algorithm is used to obtain the function similarity of A. c For each node i, the most similar C neighbors are selected to form a functional community Finally, the dual hypergraph G is constructed c =(V c , ε c , H c ), adjacency matrix H c The definition is as follows:

[0129]

[0130] in, is the adjacency matrix H c The element in row i and column j of Superedge Functional community dual hypergraph adjacency matrix H c It can be divided into two parts, namely here Represents all hyperedge connection relationships built based on the overlap of departure nodes, and It represents the hyperedge connection relationship constructed based on the overlap of arrival nodes, and the two together constitute the complete topological structure of the functional community dual hypergraph.

[0131] Step 4: Construct a macro-scale regional conduction dual hypergraph: Traditional urban spatial modeling methods often ignore the macro-influence mechanism of cross-regional traffic flow conduction. For example, in urban traffic, even if there is no direct road connection between two regions, when a traffic accident occurs in one area, drivers may choose to detour, thereby indirectly affecting the traffic flow in another area. This dynamic macro-conduction effect is difficult to capture with a static adjacency matrix. To address this challenge, this paper proposes to construct a regional conduction dual hypergraph to learn the macro-influence relationship between regions. Specifically, Figure 2 As shown in (c), we first select the top K most influential neighbor nodes through the Top-K sampling method to construct the node influence adjacency matrix A r , the specific calculation is as follows:

[0132]

[0133] Among them, idx and idy∈R N×K They represent the K most influential neighbor nodes selected from the starting point and the K most influential neighbor nodes selected from the end point. Subsequently, the Top-K influential neighbor set of each node is used as a hyperedge, and the regional conduction dual hypergraph G is constructed based on the node influence matrix Ar. r =(V r , ε r , H r ), its adjacency matrix H r The definition is as follows:

[0134]

[0135] in, is the adjacency matrix H r The element in row i and column j of Superedge Regional conduction dual hypergraph adjacency matrix H r It can be divided into two parts: in, and The hyperedge relationships corresponding to the starting point and the end point respectively constitute the complete topological structure of the regional conduction dual hypergraph.

[0136] Step 5: Gradually extract multi-scale high-order local spatial features through hypergraph convolution and dynamic graph convolution: Figure 3As shown in the high-order spatial perception diagram, first, a multi-scale hyperedge feature matrix X is constructed. h , the original traffic flow features X∈R T×N×d The specific process of integrating into the constructed multi-scale dual hypergraph can be formally expressed as:

[0137]

[0138] Among them, [·;·] is the splicing operation, W1, W2∈R T×d×d′ is a learnable parameter used to linearly transform the original traffic flow feature X, d′ is the hyperedge feature dimension, and after applying these parameters to X, the result is W1X,W2X∈R N×d′ . Therefore, (W1X)[ind sre ,:] is the hyperedge feature slice tensor constructed based on the starting hyperedge relationship; (W2X)[ind dst ,:] is the hyperedge feature slice tensor constructed based on the endpoint hyperedge relationship; next, the interaction relationship between super nodes is further aggregated through convolution operation:

[0139] X h′ =Conv 1×1 (X h )∈R E×d″ (7)

[0140] Among them, Conv 1×1 (·) indicates that a 1×1 convolution kernel is used to perform a convolution operation to update the features of the supernode, and d″ is the feature dimension of the supernode. To enhance the adaptability of the model, the diagonal adaptive learning parameters of the dual hypergraph are defined as follows:

[0141] W adp =diag(L adp )∈R N×N (8)

[0142] Among them, L adp ∈R N is the weight vector used for hyperedge adaptive learning; based on this, the dual hypergraph adaptive adjacency matrix is ​​defined as follows:

[0143]

[0144] Among them, D hv is the hyperdiagonal matrix, D he is the diagonal matrix of hypernode degrees, and H is the dual hypergraph adjacency matrix.

[0145] Then, the adaptive adjacency matrix W h Input into the hypergraph convolutional network to aggregate the high-order information of the hyperedge. The calculation process is as follows:

[0146]

[0147] It should be noted that Θ=[Θ0,...,Θ N-1 ]∈R N×d″ is the parameter to be learned; further, the Reshape() function is used to map the output of the hypergraph convolutional network into a sparse matrix, which is calculated as follows:

[0148]

[0149] On this basis, the reverse correlation matrix is ​​constructed A dynamic graph convolutional network is used to aggregate high-level local information of traffic flow, as shown below:

[0150]

[0151] Among them, A f =A / rowsum(A) is the row-normalized adjacency matrix, is the column-normalized adjacency matrix, is an adaptive adjacency matrix, and E1,E2∈R N ×c is a learnable parameter, Θ′ f =[Θ′ 0,f ,...,Θ′ N-1,f ]∈R N×d×1 Θ′ b =[Θ′ 0,b ,...,Θ′ N-1,b ]∈R N ×d×1 and Θ′ adp =[Θ′ 0,adp ,..,Θ′ N-1,adp ]∈R N×d×1 is a learnable parameter;

[0152] Finally, multiple dynamic graph convolutional networks (DGCNs) are used to enable the model to fully learn the high-order local spatial information of the multi-scale dual hypergraph. The specific calculation is as follows:

[0153] Z t =DGCN t (X),Z c =DGCN c (X),Z r =DGCN r (X) (13)

[0154] Among them, Z t , Z c and Z rRepresenting high-order spatial embeddings of travel intention dual hypergraph, community commuting dual hypergraph, and regional conduction dual hypergraph respectively;

[0155] Step 6: Implement multi-scale fusion of high-order local spatial information through gating mechanism: Figure 3 As shown in the diagram of high-order spatial perception, a gating mechanism is introduced to avoid the overfitting problem that may occur in the aggregation process of high-order spatial embedding. The specific process is as follows:

[0156]

[0157] Among them, ⊙ represents the element-by-element product, and the adaptive weight g h It is obtained by the Sigmoid activation function, between 0 and 1, Z h represents the final generated high-order local space embedding;

[0158] Step 7: Combine the spatial multi-head attention mechanism to model global spatial dependencies: Figure 4 As shown in the spatial multi-head attention diagram, first, the input feature X∈R T×N×d The query matrix Q is generated through three independent linear transformation layers S , bond matrix K S Sum matrix V S , the specific calculation is as follows:

[0159]

[0160] in, and It is used to generate the query matrix Q S , bond matrix K S Sum matrix V S The learnable parameter matrix of the linear layer;

[0161] On this basis, the attention scores between nodes in the spatial dimension are calculated by introducing a scaling factor To stabilize the gradient calculation and prevent the dot product result from being too large, which will cause the softmax function output to be saturated, the attention score matrix is ​​calculated as follows:

[0162]

[0163] in, K S Considering the limited expressive power of a single attention mechanism, a multi-head attention mechanism is further introduced to capture the feature interactions of different subspaces. Specifically, the outputs of multiple attention heads are concatenated and linearly transformed to obtain the final output:

[0164]

[0165] Where m represents the number of attention heads, W S is the output projection matrix, Concat() is the splicing operation;

[0166] Finally, a feature interaction mechanism is designed to enhance the expressiveness of local features. This mechanism stabilizes the training process through residual connections and layer normalization, while introducing nonlinear transformations to enhance feature representation, thereby obtaining global spatial features. The calculation process is as follows:

[0167]

[0168] Among them, Relu is the activation function and Layernorm is the layer normalization function;

[0169] Step 8: Dynamically adjust the weights of high-order local spatial embedding and global spatial features through adaptive spatial fusion gate: Figure 5 The adaptive spatial fusion gate shown introduces the Entangle fusion mechanism to adaptively balance high-order local spatial embedding and global spatial dependency. This mechanism dynamically adjusts the contribution of the two features through gating weights, thereby obtaining the final output feature that contains both local and global spatial information:

[0170]

[0171] Among them, the adaptive weight g s It is obtained by the Sigmoid activation function, between 0 and 1, and the output feature X s ∈R N ×T×d It not only retains high-order local spatial details, but also incorporates global spatial dependencies, providing a richer spatial feature representation for subsequent traffic flow prediction.

[0172] Step 9: Extract short-term traffic flow fluctuation patterns through dynamic time dilation causal convolution: Figure 6 The time perception enhancement diagram shown in the figure is given by the multi-scale spatial coding feature sequence obtained in step 8. and filter The dilated causal convolution at x time step t is calculated as follows:

[0173]

[0174] Among them, u is the expansion factor, which controls the jump distance and can control the receptive field of the model in the time dimension, making it easier to learn the short-term temporal dependency of traffic flow data;

[0175] At the same time, a gating mechanism is used to control the output of the information flow, and the gated activation unit is used to extract the short-term features of the output of the dilated causal convolution layer in parallel to reduce the influence of external noise. Specifically, it is expressed as:

[0176] Z T =Sigmoid(Φ1*X S +α)☉Tanh(Φ2*X S +b) (21)

[0177] Among them, Φ1 and Φ2 are independent one-dimensional dilated causal convolution operations in the time dimension, a and b are learnable offset parameters, Sigmoid() is the activation function used to determine the proportion of information passed to the next layer, Tanh() is the activation function for implementing nonlinear transformation, and Z T ∈R N×T×d ′ is the time-aware enhanced feature representation.

[0178] Step 10: Use the temporal multi-head attention mechanism to capture the long-term trend characteristics of traffic flow data: Figure 7 The temporal multi-head attention diagram shown in the figure first maps the query matrix Q through three independent linear transformation layers. T , bond matrix K T Sum matrix V T , specifically defined as follows:

[0179]

[0180] in, and are used to generate the query matrix Q T , bond matrix K T Sum matrix V T The learnable parameter matrix of

[0181] On this basis, the attention scores between nodes in the time dimension are calculated by introducing a scaling factor To stabilize the gradient calculation and prevent the dot product result from being too large, which will cause the softmax function output to be saturated, the attention score matrix is ​​calculated as follows:

[0182]

[0183] in, K T Considering the limited expressive power of a single attention mechanism, a multi-head attention mechanism is further introduced to capture the feature interactions of different subspaces. Specifically, the outputs of multiple attention heads are concatenated and linearly transformed to obtain the final output:

[0184]

[0185] Where m represents the number of attention heads, W T It is a linear transformation matrix used to map the output of the temporal multi-head attention to the required output dimension, and Concat() is a concatenation operation;

[0186] Finally, a feature interaction mechanism is designed to enhance the expressiveness of local features and solve the problem that the temporal multi-head attention mechanism is insensitive to short-term time changes, thereby obtaining long-term temporal dependency features. The calculation process is as follows:

[0187]

[0188] Among them, Relu() is the activation function and Layernorm() is the normalization function;

[0189] Step 11: Integrate the short-term dynamics and long-term temporal dependencies of historical traffic flow data through adaptive time fusion gates: Figure 8 The adaptive time fusion gate shown in the figure introduces the Entangle fusion mechanism to dynamically adjust the short-term dynamic and long-term temporal dependency contributions of historical traffic flow data through gate weights, thereby obtaining a spatiotemporal feature representation that combines multi-scale spatial information and long-term and short-term temporal dependency characteristics.

[0190]

[0191] Among them, the adaptive weight g t It is obtained by the activation function Sigmoid, and its value is between 0 and 1.

[0192] The step of S4 specifically includes the following:

[0193] like Figure 9 The model output diagram shown in the figure fuses the multi-scale spatiotemporal feature representations output by each layer through a skip connection mechanism. The calculation process is expressed as follows:

[0194]

[0195] Among them, W a 、W b is a trainable parameter matrix, M represents the number of spatiotemporal perception stacking layers, Layernorm() is the layer normalization function, and finally the fused features are mapped to the prediction results through a 1×1 convolutional layer:

[0196]

[0197] in, is the traffic flow prediction sequence for the next P time steps.

[0198] This paper designs a spatiotemporal perception method based on multi-scale dual hypergraph fusion. First, a multi-scale urban road dual hypergraph construction method is proposed to accurately characterize the high-order spatial characteristics of urban roads from three scales: microscopic individual travel intention, mesoscopic community commuting, and macroscopic regional flow conduction. Specifically, the travel intention dual hypergraph G t , constructed through individual travel intention analysis, capturing micro-scale spatial associations; functional community dual hypergraph G c Based on community division, it characterizes the functional synergy relationship at the mesoscopic scale; the regional conductive dual hypergraph G r By constructing the law of road flow transmission, the large-scale spatial interaction characteristics of the macro scale are characterized. On this basis, the high-order spatial characteristics of the micro, meso and macro scales are integrated through the gating mechanism, as shown in formula (14), which effectively improves the modeling ability of the traffic flow prediction model for complex spatiotemporal dependencies, thereby achieving accurate capture of the dynamic changes of traffic flow. For example, when predicting the traffic flow of a commercial district during the morning rush hour, the micro-scale G t It can capture the commuting behavior of individuals in the surrounding residential areas, and the mesoscopic scale G c It can reflect the synergistic relationship between the commercial area and the adjacent office area, while the macro-scale G r It can characterize the traffic flow transmission effect of urban main roads in the area. By integrating the characteristics of the three, the model can more accurately predict the traffic flow change trend in the commercial area.

[0199] In order to fully verify the effectiveness and adaptability of the model in different traffic scenarios, this paper selects 14 representative traffic flow prediction methods as shown in Table 2 as comparison baseline methods, and conducts comparative experiments on four datasets: PEMS03, PEMS04, PEMS07, and PEMS08.

[0200] Table 2

[0201] Model abbreviation Year of publication introduce FC-LSTM 2015 Fully connected LSTM structure, focusing on time series modeling DCRNN 2017 Bidirectional random walks and encoder-decoder framework STGCN 2018 Fully convolutional graph structure, efficient spatiotemporal modeling Graph WaveNet 2019 Adaptive Dependency Matrix and Dilated Convolution STSGCN 2020 Synchronous spatiotemporal modeling and time period heterogeneity processing OGCRNN 2020 Data-driven graph structure optimization STGODE 2021 Tensor differential equations and semantic adjacency matrices STFGNN 2021 Spatiotemporal Graph Fusion and Gated Convolution GMSDR 2022 Explicitly modeling multi-step dependencies FEDformer 2022 Frequency domain enhancement and seasonal trend decomposition HSTGCNT 2023 Fusion of Hierarchical Transformer and Hypergraph Convolution AGFCRN 2024 Adaptive hypergraph fusion and attention mechanism DS-STGCN 2024 Dynamic multi-scale spatiotemporal modeling CDAGF 2024 Contrastive Learning and Residual Enhanced Decomposition

[0202] To ensure the reliability and fairness of the comparison results, the experiments adhered to the publicly available optimal parameter configurations of each comparison model and divided the raw data into training, validation, and test sets in a 6:2:2 ratio. Model performance was evaluated using three key metrics: mean absolute error (MAE), mean absolute percentage error (MAPE), and root mean square error (RMSE). Lower values ​​for each metric indicate higher prediction accuracy.

[0203] Table 3 shows the comparative experimental results of various models for 60-minute traffic flow prediction on the PEMS03, PEMS04, PEMS07, and PEMS08 datasets. The proposed model utilizes a hypergraph convolution mechanism to incorporate multi-scale, high-order information, such as individual travel intentions, community commuting patterns, and regional flow conduction, into the modeling process, accurately capturing the spatial correlation characteristics of complex urban traffic. Experimental results show that the proposed model achieves state-of-the-art prediction performance on all datasets. Taking the PEMS03 dataset as an example, the proposed model achieves a MAE of 14.12, an RMSE of 22.52, and a MAPE of 12.95, respectively, compared to the next-best baseline model. These improvements are 11.9% (MAE), 14.7% (RMSE), and 10.7% (MAPE). This trend is also confirmed on other datasets, further demonstrating the superiority, adaptability, and robustness of the proposed method in various traffic scenarios. At the same time, since the hypergraph convolutional structure in the model can effectively capture high-order dependencies in complex traffic networks, the prediction performance of the proposed model on large-scale datasets (such as PEMS03 and PEMS07) is more outstanding than that on small-scale datasets (such as PEMS04 and PEMS08), further demonstrating its advantages in processing complex and large-scale traffic data.

[0204] Table 3

[0205]

[0206] The foregoing description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein and should not be construed as excluding other embodiments. Rather, the present invention is capable of various other combinations, modifications, and improvements, and is capable of modifications within the scope of the concepts described herein, through the above teachings, or through techniques or knowledge in the relevant fields. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention are intended to be within the scope of the appended claims.

Claims

1. A traffic flow prediction method based on multi-scale dual hypergraph fusion, characterized by: The prediction method comprises: S1. Based on the actual traffic network topology, we construct a dual hypergraph of travel intentions, a dual hypergraph of functional communities, and a dual hypergraph of regional conduction at three scales: micro-individual travel intentions, meso-community commuting, and macro-regional flow conduction, thus achieving the construction of a multi-scale urban road dual hypergraph. S2. Based on the dual hypergraphs of the three scales constructed in step S1 and the historical traffic flow feature matrix, hypergraph convolution and dynamic graph convolution are first used to gradually extract multi-scale spatial features. Multi-scale fusion of high-order local spatial information is achieved through a gating mechanism. Then, a spatial multi-head attention mechanism is combined to model global spatial dependencies, and an adaptive spatial fusion gate is introduced to dynamically adjust the weights of high-order local spatial embeddings and global spatial features, ultimately generating a multi-scale spatial encoding feature sequence. S3. Input the multi-scale spatial encoding feature sequence obtained in step S2 into the dynamic time dilation causal convolutional network to extract the short-term fluctuation pattern of traffic flow. At the same time, a temporal multi-head attention mechanism is used to capture the long-term trend characteristics of traffic flow data. Then, an adaptive temporal fusion gate is used to adaptively integrate the short-term dynamics and long-term temporal dependencies of historical traffic flow data to form a spatiotemporal feature representation that combines multi-scale spatial information and long-term and short-term temporal dependencies. S4. Based on the spatiotemporal feature representation obtained in step S3, the spatiotemporal feature fusion is enhanced through residual connection and input into the convolutional prediction layer, and finally the multi-step traffic flow prediction result is output.

2. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: The actual traffic network topology structure in step S1 is specifically: The actual traffic network topology is modeled as a weighted directed graph G = (V, ε, A), where the node set V = {v1, v2, ..., v N } represents N road segments, i.e. |V| = N; the edge set ε{e1, e2, ..., e E } describes the connection relationship of E roads, that is, |ε|=E, the adjacency matrix A∈R N×N The spatial distance weights between encoding road segments; In addition, the historical traffic flow feature matrix of T time steps is X∈R T×N×d , where d represents the traffic feature dimension of each road node.

3. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: The step S1 of constructing the travel intention dual hypergraph includes: All points starting from the same road node and all nodes ending at the same road node are respectively formed into hyperedges; the dual hypergraph of travel intention is represented by G t =(V t , ε t , H t ), whose adjacency matrix H t The definition is as follows: in, is the adjacency matrix H t The element in row i and column j of Superedge Travel intention dual hypergraph adjacency matrix H t Can be divided into two parts: in Represents the hyperedge connection relationship built based on the starting point, Represents the hyperedge connection relationship built based on the end point; the two together constitute the complete topological structure of the travel intention dual hypergraph.

4. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: The step S1 of constructing the functional community dual hypergraph includes: First, the K road nodes with the highest destination overlap are selected to form the destination hyperedge, and then the K road nodes with the highest departure overlap are selected to form the departure hyperedge. In the node selection process, the total spatial distance of the nodes inside the hyperedge is constrained to be the shortest, thereby constructing the dual hyperedge of the functional community dual hypergraph; in order to quantify the functional similarity between nodes, a new functional association matrix A is reconstructed based on the original weight adjacency matrix A. c , calculated as follows: in is the element in row i and column j of the functional association matrix, N is the number of nodes, The size of the value is related to the node v i and v j The functional similarity of is negatively correlated; Based on this, the K-nearest neighbor algorithm is used to c For each node i, the most similar C neighbors are selected to form a functional community Finally, the dual hypergraph G is constructed c =(V c , ε c , H c ), adjacency matrix H c The definition is as follows: in, is the adjacency matrix H c The element in row i and column j of Superedge Functional community dual hypergraph adjacency matrix H c It can be divided into two parts, namely Represents all hyperedge connection relationships built based on the overlap of departure nodes, and It represents the hyperedge connection relationship constructed based on the overlap of arrival nodes, and the two together constitute the complete topological structure of the functional community dual hypergraph.

5. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: The step S1 of constructing the regional conductive dual hypergraph includes: First, the top K most influential neighbor nodes are selected through the Top-K sampling method to construct the node influence adjacency matrix A r , the specific calculation is as follows: idx=Top-K(-A i,: ,K), ids=Top-K(-A :,j ,TO), A r =A[idx,idy], Among them, idx and idy∈R N×K They represent the K most influential neighbor nodes selected from the starting point and the K most influential neighbor nodes selected from the end point respectively; then, the Top-K influential neighbor set of each node is used as a hyperedge, and the node influence matrix A is used to calculate the top-K influential neighbor set of each node. r Constructing the regional conductive dual hypergraph G r =(V r , ε r , H r ), its adjacency matrix H r The definition is as follows: in, is the adjacency matrix H r The element in row i and column j of Superedge Regional conduction dual hypergraph adjacency matrix H r Can be divided into two parts: in, and The hyperedge relationships corresponding to the starting point and the end point respectively constitute the complete topological structure of the regional conduction dual hypergraph.

6. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: In step S2, hypergraph convolution and dynamic graph convolution are used to gradually extract multi-scale spatial features, and a gating mechanism is used to achieve multi-scale fusion of high-order local spatial information, as follows: First, construct the multi-scale hyperedge feature matrix X h , the original traffic flow features X∈R T×N×d The specific process of integrating into the constructed multi-scale dual hypergraph is formally expressed as follows: Among them, [·;·] is the splicing operation, W1, W2∈R T×d×d′ is a learnable parameter used to linearly transform the original traffic flow feature X, d′ is the hyperedge feature dimension, and after applying these parameters to X, the result is W1X, W2X∈R N×d′ ; Thus, (W1X)[ind src ,:] is the hyperedge feature slice tensor constructed based on the starting hyperedge relationship; (W2X)[ind dst ,:] is the hyperedge feature slice tensor constructed based on the endpoint hyperedge relationship; next, the interaction relationship between super nodes is further aggregated through convolution operation: X h ′=Conv 1×1 (X h )∈R E×d″ , Among them, Conv 1×1 (·) represents the convolution operation using a 1×1 convolution kernel to update the features of the supernode, and d″ is the feature dimension of the supernode. To enhance the adaptability of the model, the diagonal adaptive learning parameter of the dual hypergraph is defined as follows: W adp =diag(L adp )∈R N×N , Among them, L adp ∈R N is the weight vector used for hyperedge adaptive learning; based on this, the dual hypergraph adaptive adjacency matrix is ​​defined as follows: Among them, D hv is the hyperdiagonal matrix, D he is the diagonal matrix of hypernode degrees, and H is the dual hypergraph adjacency matrix; Then, the adaptive adjacency matrix W h Input into the hypergraph convolutional network to aggregate the high-order information of the hyperedge. The calculation process is as follows: It should be noted that Θ=[Θ0,...,Θ N-1 ]∈R N×d" is the parameter to be learned; further, the Reshape() function is used to map the output of the hypergraph convolutional network into a sparse matrix, which is calculated as follows: On this basis, the reverse correlation matrix is ​​constructed A dynamic graph convolutional network is used to aggregate high-level local information of traffic flow, as shown below: Among them, A f =A / rowsum(A) is the row-normalized adjacency matrix, is the column-normalized adjacency matrix, is an adaptive adjacency matrix, and E1, E2∈R N×c is a learnable parameter, Θ′ f =[Θ′ 0,f ,...,Θ′ N-1,f ]∈R N×d×1 Θ′ b =[Θ′ 0,b ,...,Θ′ N-1,b ]∈R N×d×1 and Θ′ adp =[Θ′ 0,adp ,...,Θ′ N-1,adp ]∈R N×d×1 is a learnable parameter; Then, multiple dynamic graph convolutional networks (DGCNs) are used to enable the model to fully learn the high-order local spatial information of the multi-scale dual hypergraph. The specific calculation is as follows: Z t =DGCN t (X),Z c =DGCN c (X),Z r =DGCN,(X), Among them, Z t , Z c and Z r Representing high-order spatial embeddings of travel intention dual hypergraph, community commuting dual hypergraph, and regional conduction dual hypergraph respectively; Finally, a gating mechanism is introduced to avoid the overfitting problem of high-order spatial embedding during the aggregation process. The specific process is as follows: Z cr =Sigmoid(Z c )☉Tanh(Z r ), g h =Sigmoid(Z cr +Z t ), Z h =g h ☉Z cr +(1-g h )☉Z t , Among them, ⊙ represents the element-by-element product, and the adaptive weight g h It is obtained by the Sigmoid activation function, between 0 and 1, Z cr Represents the high-order spatial embedding of the community commuting dual hypergraph and the regional conduction dual hypergraph, Z h represents the final generated high-order local space embedding.

7. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: In step S2, the global spatial dependency is modeled by combining the spatial multi-head attention mechanism, specifically as follows: First, the input feature X∈R T×N×d The query matrix Q is generated through three independent linear transformation layers s , bond matrix K S Sum matrix V S , the specific calculation is as follows: in, and are used to generate the query matrix Q S , bond matrix K S Sum matrix V S The linear layer can learn the parameter matrix; On this basis, the attention scores between nodes in the spatial dimension are calculated by introducing a scaling factor To stabilize the gradient calculation and prevent the dot product result from being too large, which will cause the softmax function output to be saturated, the attention score matrix is ​​calculated as follows: in, K S The transpose of ; Due to the limited expressive power of a single attention mechanism, a multi-head attention mechanism is further introduced to capture the feature interactions of different subspaces. Specifically, the outputs of multiple attention heads are concatenated and linearly transformed to obtain the final output: Where m represents the number of attention heads, W s is the output projection matrix, Concat() is the splicing operation; Finally, a feature interaction mechanism is designed to enhance the expressiveness of local features. This mechanism stabilizes the training process through residual connections and layer normalization, while introducing nonlinear transformations to enhance feature representation, thereby obtaining global spatial features. The calculation process is as follows: Among them, Relu is the activation function and Layernorm is the layer normalization function.

8. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: In step S2, an adaptive spatial fusion gate is introduced to dynamically adjust the weights of high-order local spatial embedding and global spatial features, as follows: The Entangle fusion mechanism is introduced to adaptively balance high-order local spatial embedding and global spatial dependency. This mechanism dynamically adjusts the contribution of the two features through gating weights, thereby obtaining the final output feature that contains both local and global spatial information: Among them, the adaptive weight g s It is obtained through the Sigmoid activation function and is between 0 and 1.

9. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1 is characterized in that: The step S3 includes the following contents: (3.1) Extracting short-term traffic flow fluctuation patterns through dynamic time dilation causal convolution, specifically: Given the multi-scale spatial encoding feature sequence obtained in step S2 and filter The dilated causal convolution at x time step t is calculated as follows: Among them, u is the expansion factor, which controls the jump distance and can control the receptive field of the model in the time dimension, making it easier to learn the short-term temporal dependency of traffic flow data; At the same time, a gating mechanism is used to control the output of the information flow, and the gated activation unit is used to extract the short-term features of the output of the dilated causal convolution layer in parallel to reduce the influence of external noise. Specifically, it is expressed as: Z T =Sigmoid(Φ1*X S +a)☉Tanh(Φ2*X S +b) Among them, φ1 and φ2 are independent one-dimensional dilated causal convolution operations in the time dimension, a and b are learnable offset parameters, Sigmoid() is the activation function used to determine the proportion of information passed to the next layer, Tanh() is the activation function for implementing nonlinear transformation, and Z T ∈R N×T×d′ It is a feature representation with enhanced time perception; (3.2) The temporal multi-head attention mechanism is used to capture the long-term trend characteristics of traffic flow data, specifically: First, the query matrix Q is mapped to the query matrix through three independent linear transformation layers T , bond matrix K T Sum matrix V T , specifically defined as follows: in, and are used to generate the query matrix Q T , bond matrix K T Sum matrix V T The learnable parameter matrix of On this basis, the attention scores between nodes in the time dimension are calculated by introducing a scaling factor To stabilize the gradient calculation and prevent the dot product result from being too large, which will cause the softmax function output to be saturated, the attention score matrix is ​​calculated as follows: in, K S Considering the limited expressive power of a single attention mechanism, a multi-head attention mechanism is further introduced to capture the feature interactions of different subspaces. Specifically, the outputs of multiple attention heads are concatenated and linearly transformed to obtain the final output: Where m represents the number of attention heads, W T It is a linear transformation matrix used to map the output of the temporal multi-head attention to the required output dimension, and Concat() is a concatenation operation; Finally, a feature interaction mechanism is designed to enhance the expressiveness of local features and solve the problem that the temporal multi-head attention mechanism is insensitive to short-term time changes, thereby obtaining long-term temporal dependency features. The calculation process is as follows: Among them, Relu() is the activation function and Layernorm() is the normalization function; (3.3) The adaptive time fusion gate is used to integrate the short-term dynamics and long-term temporal dependencies of historical traffic flow data, specifically: The Entangle fusion mechanism is introduced to dynamically adjust the short-term dynamic and long-term temporal dependency contributions of historical traffic flow data through gating weights, thereby obtaining a spatiotemporal feature representation that combines multi-scale spatial information and long- and short-term temporal dependency characteristics. Among them, the adaptive weight g t It is obtained by the activation function Sigmoid, and its value is between 0 and 1.

10. The traffic flow prediction method based on multi-scale dual hypergraph fusion according to claim 1, characterized in that: The step S4 specifically includes the following contents: First, the multi-scale spatiotemporal feature representations output by each layer are fused through the skip connection mechanism. The calculation process is expressed as follows: Among them, W a 、W b is a trainable parameter matrix, M represents the number of network layers, Layernorm() is the layer normalization function, and finally the fused features are mapped to the prediction results through a 1×1 convolutional layer: in, Traffic flow prediction sequence for the next P time steps.

Citation Information

Patent Citations

  • Traffic state prediction method based on adaptive dynamic space-time diagram convolutional network

    CN118116194A

  • Expressway prediction and control method based on graph convolutional neural network

    CN118430264A

  • Deep learning traffic flow prediction method based on time perception hypergraph

    CN118968784A

  • Traffic flow prediction method based on dual hypergraph neural network

    CN119670004A

  • Traffic condition supervision in traffic network, undertaking inquiry of current position and / or prognosis of future position of flank between area of free traffic and area of synchronized traffic continuously

    DE19944077A1

Cited By

  • Traffic flow prediction method and device based on multi-level space-time and perception fusion

    CN121092937A

  • Abnormal traffic flow prediction method and system based on multi-scale spatial-temporal feature fusion

    CN121583097A

  • A multi-scale controlled traffic flow prediction method and system for urban road network

    CN122551574A