Heterogeneous graph collaborative learning traffic flow prediction method

Through the heterogeneous graph collaborative learning method, combined with the progressive dynamic graph structure learning and positive and negative correlation collaborative modeling, the shortcomings of the existing traffic flow prediction methods in dynamic spatiotemporal dependence modeling, heterogeneous relationship utilization, long-term and short-term feature extraction and calculation efficiency are solved, and accurate and efficient prediction of complex spatiotemporal relationships in the traffic network are achieved.

CN120220418APending Publication Date: 2025-06-27UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202510499917.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The existing traffic flow prediction methods have shortcomings in terms of insufficient dynamic space-time dependency modeling, lack of heterogeneous relationship utilization, difficulty in extracting long and short-term feature, and bottlenecks in computing efficiency.

Method used

By integrating progressive dynamic graph structure learning, positive and negative correlation collaborative modeling and frequency domain-space-time joint optimization mechanisms, a heterogeneous graph collaborative learning method is used to generate spatiotemporal embedding representations, homogeneous and heterogeneous spatiotemporal features are extracted, and collaborative interaction is carried out through the graph collaborative learning module to finally generate traffic flow prediction results.

Benefits of technology

It realizes accurate and efficient prediction of complex space-time relationships in the transportation network, comprehensively captures space-time dependence, strong dynamic adaptability, takes into account long-term and short-term patterns and computing efficiency, and coordinates to enhance the quality of feature representation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120220418A_ABST
    Figure CN120220418A_ABST
Patent Text Reader

Abstract

The invention relates to the field of traffic flow prediction, in particular to a heterogeneous graph collaborative learning traffic flow prediction method. The problems that according to an existing method, dynamic space-time dependence modeling is insufficient, heterogeneous relation utilization is missing, long-term and short-term feature extraction is difficult, and calculation efficiency is bottleneck are solved. The main scheme includes the steps that space-time embedding representation is generated, topological structure information and time features of nodes are fused, and space-time embedding representation STE is obtained; the method comprises the following steps: splicing input time sequence data with STE, filtering out high-frequency noise and enhancing long and short term dependency features through an adaptive spectrum block, and extracting multi-scale homogeneous time features through an interactive convolution block; in combination with adaptive memory attention and progressive graph convolution, spatial dependency is extracted from input data of homogeneous branches, and homogeneous spatial-temporal features are obtained; constructing a heterogeneous adjacency matrix, extracting negative correlation spatiotemporal features through heterogeneous graph spatiotemporal convolution, and performing cooperative interaction with homogeneous spatiotemporal features; and stacking multiple layers of space-time blocks, aggregating the output of each layer, and generating a traffic flow prediction result through an output layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of traffic flow prediction, and particularly to a heterogeneous graph collaborative learning traffic flow prediction method. Background Art

[0002] Traffic flow prediction is a core task in intelligent transportation systems. By analyzing historical traffic data to predict future traffic flow, it provides an important basis for traffic management and planning. Traditional traffic flow prediction methods, such as ARIMA, Historical Average (HA), and Vector Auto-Regression (VAR), mainly rely on time series analysis and assume data stationarity. However, these methods have significant limitations in dealing with complex spatio-temporal dependencies in traffic networks and cannot fully capture the dynamically changing spatial correlations between nodes and the non-stationary characteristics in time series. In recent years, spatio-temporal prediction models based on Graph Neural Networks (GNNs) and Recurrent Neural Networks (RNNs) (such as STGCN, DCRNN, and GraphWaveNet) have significantly improved prediction accuracy by fusing spatial topological structures with time series features. Nevertheless, these models still face challenges in the face of dynamically evolving spatio-temporal dependencies, heterogeneous relationships, and computational efficiency issues in traffic networks.

[0003] In actual traffic networks, the relationships between road network nodes are not only homogeneous (positively correlated) but also widely heterogeneous (negatively correlated). For example, an increase in traffic flow on some sections may lead to a decrease in traffic flow on adjacent sections. This negative correlation contains important dynamic information. However, most existing models mainly focus on the interactions of homogeneous neighbors and ignore the key features that heterogeneous neighbors may provide, resulting in an incomplete modeling of the dynamic relationships in traffic networks. In addition, traffic flow data is usually accompanied by noise interference and non-stationarity. Traditional models often struggle to balance capturing long-term historical patterns and short-term local features. At the same time, although attention mechanism-based models can effectively extract important features, their computational overhead is large, and especially when dealing with large-scale dynamic traffic networks, efficiency becomes a bottleneck.

[0004] In summary, the existing traffic flow prediction technologies have the following deficiencies:

[0005] 1. Insufficient modeling of dynamic spatio-temporal dependencies: Traditional methods and some spatio-temporal models rely on static adjacency matrices and cannot reflect the dynamically evolving associations between nodes in real time, resulting in poor adaptability to traffic flow trend changes.

[0006] 2. Ignoring heterogeneous relationships: Most models only focus on the interactions of positively correlated homogeneous neighbors and fail to fully utilize the information of negatively correlated heterogeneous neighbors, limiting the comprehensive description of the complex relationships in traffic networks.

[0007] 3. Difficulties in extracting long-term and short-term features: The noise and non-stationarity in traffic flow data make it difficult for the model to capture both long-term historical patterns and short-term local features simultaneously, resulting in a decline in prediction accuracy in the medium- and long-term scenarios.

[0008] 4. Bottleneck in computational efficiency: Models based on the attention mechanism have high computational overhead when processing large-scale data, making it difficult to meet the requirements of real-time prediction for dynamic traffic networks. Summary of the Invention

[0009] The present invention aims to solve the problems of insufficient dynamic spatio-temporal dependence modeling, lack of utilization of heterogeneous relationships, difficulties in extracting long-term and short-term features, and bottleneck in computational efficiency in existing methods. By integrating progressive dynamic graph structure learning, positive and negative correlation collaborative modeling, and frequency domain-spatio-temporal joint optimization mechanism, accurate and efficient prediction of complex spatio-temporal relationships in traffic flow is achieved.

[0010] To achieve the above object, the present invention adopts the following technical means:

[0011] The present invention provides a heterogeneous graph collaborative learning traffic flow prediction method, including the following steps:

[0012] Step S1: Generate spatio-temporal embedding representation, fuse the topological structure information of nodes and time features to obtain the spatio-temporal embedding representation STE;

[0013] Step S2: Concatenate the input time series data with STE, filter out high-frequency noise and enhance long-term and short-term dependence features through an adaptive spectral block, and then extract multi-scale homogeneous time features through an interactive convolution block;

[0014] Step S3: Adopt a dual-path architecture, combine adaptive memory attention and progressive graph convolution to extract spatial dependence from the input data of the homogeneous branch to obtain homogeneous spatio-temporal features;

[0015] Step S4: Construct a heterogeneous adjacency matrix, extract negative correlation spatio-temporal features through heterogeneous graph spatio-temporal convolution, and perform collaborative interaction with the homogeneous spatio-temporal features;

[0016] Step S5: Stack multiple layers of spatio-temporal blocks, aggregate the outputs of each layer and generate traffic flow prediction results through an output layer.

[0017] In the above solution, the spatio-temporal embedding generation step of step S1 specifically includes:

[0018] Step S11: Graph structure embedding learning, construct a traffic network graph G=(V,E) based on the adjacency matrix, use the Node2Vec algorithm to generate a node sequence through random walks with controllable parameters p and q, optimize the node embedding vector using the Skip-Gram model, and output the spatial embedding SE' after enhancement by two fully connected layers and the GELU activation function;

[0019] Step S12: Temporal feature embedding. Perform one-hot encoding on the temporal features including the week cycle and time period division, and generate a temporal embedding TE' after conversion through two fully connected layers and the GELU activation function;

[0020] Step S13: Spatiotemporal fusion. Perform element-wise addition fusion on the spatial embedding SE' and the temporal embedding TE' to generate a spatiotemporal embedding representation STE containing topological structure and temporal features.

[0021] In the above solution, the homogeneous temporal feature extraction step in step S2 specifically includes:

[0022] S21: Adaptive spectrum processing. Concatenate the input time series data with the spatiotemporal embedding representation STE in terms of feature dimension, convert it to the frequency domain through Fourier transform to generate a frequency domain signal, calculate a learnable threshold based on the energy median to generate a high-frequency mask, and reconstruct the time domain signal through inverse Fourier transform;

[0023] S22: Interactive convolution enhancement. Apply convolution kernels of different scales to the reconstructed time domain signal in parallel, realize multi-scale feature interaction through GELU activation and element-wise product, and output homogeneous temporal features after linear fusion.

[0024] In the above solution, the homogeneous spatial feature extraction step in step S3 specifically includes:

[0025] S31: Dual-path adaptive attention processing. Generate spatial memory attention through a learnable memory embedding, calculate spatial attention weights in combination with a dynamically generated adaptive adjacency matrix, and realize non-linear feature selection using a GLU gated feed-forward network;

[0026] S32: Dynamic progressive graph convolution. Generate a progressive adjacency matrix based on the normalized vector of the real-time traffic flow signal, and fuse diffusion convolution frameworks of different orders to extract multi-order spatial dependence features;

[0027] S33: Multi-source feature fusion. Concatenate the channels of the output of the adaptive attention and the output of the progressive convolution, and generate homogeneous spatial features after linear transformation and GELU activation

[0028] In the above solution, the dual-path adaptive attention processing in step S31 specifically includes:

[0029] S311: Generation of spatial memory attention. Generate key-value pairs based on the learnable memory embedding vectors d m and Ψ m Generate a query matrix Q and a value matrix V through the linear transformation of the homogeneous temporal feature H t and extract long-term spatial dependence features through approximate attention calculation in combination with the memory key K;

[0030] S312: Spatial Adaptive Attention Fusion. Generate a dynamic adjacency matrix A based on the learnable node vectors ε1 and ε2. adp , and after selectively combining it with the prior adjacency matrix adj, enhance the attention through element-wise multiplication of the attention weights and the memory embedding Ψ m ;

[0031] S313: Gated Feature Selection. Perform a non-linear transformation on the enhanced attention output through a gated linear unit, which is formulated as:

[0032] GLU(X) = (W v X) ⊙ σ(W u X)

[0033] where W v , W u are learnable parameters, σ(·) is the Sigmoid function, ⊙ represents the element-wise multiplication operation, and X is the attention output.

[0034] In the above solution, the step S32 of dynamic progressive graph convolution specifically includes:

[0035] S321: Dynamic Adjacency Matrix Generation. Calculate the trend similarity between nodes i and j based on the normalized signal vector of node i at time t through the learnable transformation matrix W adj :

[0036]

[0037] is the normalized signal vector of node i at time t, is the normalized signal vector of node j at time t, ReLU(·) represents the rectified linear unit activation function, and softmax(·) represents the normalized exponential function;

[0038] S322: Multi-order Progressive Convolution Operation. Combine the dynamic adjacency matrix with the diffusion convolution of the static adjacency matrix, which is formulated as:

[0039]

[0040] where P is the normalized transition matrix of the static adjacency matrix, W k,1 , W k,2 , W k,3 are the learnable weight parameters for each diffusion order, P is the normalized transition matrix based on the static adjacency matrix, represents the transpose of matrix P;

[0041] S323: Multi-order Feature Iterative Generation. H tare fed into the progressive graph convolution module to obtain HS3:

[0042] Subsequently, the model further stacks and processes through progressive graph convolution to obtain HS4:

[0043]

[0044] In the above solution, the heterogeneous graph spatio-temporal convolution and collaborative learning steps in step S4 specifically include:

[0045] S41: Heterogeneous graph spatio-temporal feature extraction. Based on the spatio-temporal embedding STE, a negatively correlated heterogeneous adjacency matrix is generated. A heterogeneous graph structure is constructed through dynamic inner product similarity calculation and normalization operations, and multi-period heterogeneous graph convolution is performed to capture negatively correlated spatio-temporal features;

[0046] S42: Collaborative feature interaction update. The feature outputs of the homogeneous branch and the heterogeneous branch are subjected to hierarchical pooling and upsampling processing. Cross-branch feature fusion is achieved through the gated linear unit GLU, and a residual difference calculation and gated update mechanism are used to complete the collaborative enhancement of the dual-branch features.

[0047] In the above solution, the construction of the heterogeneous adjacency matrix and the spatio-temporal convolution operation in the heterogeneous graph spatio-temporal convolution and collaborative learning steps of step S4 specifically include:

[0048] S411: Generation of the dynamic heterogeneous adjacency matrix. The inner product similarity is calculated based on the node embedding vectors in the spatio-temporal embedding representation STE, and through processing with a negatively correlated factor, threshold screening, and the tanh activation function, a dynamic heterogeneous adjacency matrix reflecting the negatively correlated relationship between nodes is generated, denoted as the output of the heterogeneous branch

[0049] S412: Multi-period heterogeneous convolution. The input features are divided into current-period and historical-period data along the time dimension, and are respectively subjected to graph convolution operations with the heterogeneous adjacency matrices of the corresponding periods, and the heterogeneous spatio-temporal features are output after being fused through residual connection.

[0050] In the above solution, the graph collaborative learning module in step S4 specifically includes:

[0051] S421: Extractable feature refinement. Perform hierarchical pooling, upsampling, and 1×1 convolution operations on the output of the homogeneous spatio-temporal feature branch and the output of the heterogeneous spatio-temporal feature branch respectively to generate fusion-prepared features

[0052] S422: Gated feature fusion. and Concatenate along the feature dimension, and generate the fused feature through the linear transformation of the gated linear unit and the sigmoid activation function

[0053] S423: Residual difference calculation, subtract the fused feature from the preliminary feature respectively to obtain the residual difference and

[0054] S424: Gated residual update, perform gated weighted superposition on and through the GLU unit to generate the updated homogeneous feature Meanwhile, perform weighted superposition on and through the GLU unit to generate the updated heterogeneous feature

[0055] In the above solution, the specific steps of step S5 include:

[0056] Stack the spatio-temporal blocks composed of step S2, step S3, and step S4 for L layers. The homogeneous output and heterogeneous output of each layer are used as the input of the next layer. Aggregate the outputs of all layers through skip connections, and input the final aggregated result into an output layer to generate the final traffic flow prediction result.

[0057] Since the present invention adopts the above technical means, it has the following beneficial effects:

[0058] 1. Comprehensively capture spatio-temporal dependencies: Through the heterogeneous graph collaborative learning module, the positive (homogeneous) and negative (heterogeneous) relationships between nodes are modeled simultaneously, and the complex and diverse mutual influences in the traffic network are characterized more comprehensively.

[0059] 2. Strong dynamic adaptability: The progressive graph convolution module can dynamically generate the adjacency matrix according to the real-time traffic flow trend, effectively capture the time-varying node correlation, and is superior to the method relying on the static topological structure.

[0060] 3. Consider both long-term and short-term patterns and efficiency: The adaptive graph memory attention stores historical patterns through the memory embedding mechanism, combines approximate attention calculation, effectively models long-term dependencies, and reduces the computational complexity at the same time. The adaptive spectral block processes noise in the frequency domain and captures long-term and short-term time dependencies, and the interactive convolution block refines the multi-scale temporal feature extraction.

[0061] 4. Collaborative Enhanced Feature Representation: The graph collaborative learning module enables the homogeneous and heterogeneous branches to complement each other and learn collaboratively through a gated residual update mechanism, avoiding information conflicts or redundancies that may arise from simple fusion and enhancing the quality of the final feature representation. Brief Description of the Drawings

[0062] Figure 1 FGMNet model architecture diagram;

[0063] Figure 2 Structural diagram of the homogeneous spatio-temporal feature extraction module;

[0064] Figure 3 Structural diagram of the time feature extraction module;

[0065] Figure 4 Structural diagram of the space feature extraction module;

[0066] Figure 5 Structural diagram of the graph collaborative learning module. Detailed Implementation Manner

[0067] The following will give a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with some specific implementation manners, it should be noted that the present invention is not limited to these implementation manners only. On the contrary, any modifications or equivalent replacements made to the present invention shall be covered by the scope of the claims of the present invention.

[0068] In addition, in order to better illustrate the present invention, numerous specific details are given in the following detailed implementation manners. Those skilled in the art will understand that the present invention can also be implemented without these specific details.

[0069] The present invention achieves this goal by constructing a multi-module collaborative framework: First, the spatio-temporal embedding generator is used to fuse the topological and time initial information of the nodes; then, parallel learning paths are designed, where the homogeneous learning branch uses an innovative time feature extraction module (combining frequency domain and convolution) and a space feature extraction module (fusing progressive graph convolution and adaptive memory attention) to capture the mainstream positive correlation dynamic dependencies; at the same time, the heterogeneous learning branch mines potential negative correlation information through specialized heterogeneous graph spatio-temporal convolution; finally, the graph collaborative learning module promotes effective information interaction and complementary enhancement between the homogeneous and heterogeneous branches, and integrates the multi-layer learned deep spatio-temporal representations for final traffic flow prediction. The specific steps include:

[0070] S1: Generate spatio-temporal embedding representations, which aims to fuse the topological structure information and time features of the nodes to provide a unified initial representation STE for subsequent spatio-temporal feature extraction.

[0071] S2: Input the time series data x inConcatenate with the spatio-temporal embedding representation STE obtained in S1 and obtain the input of S2 through a fully connected layer. Use a module that combines the frequency domain and convolution to extract homogeneous temporal features and extract temporal dependencies from the input data of the homogeneous branch.

[0072] S3: Use the output result of S2 after extracting the homogeneous temporal features as the input of S3. This step adopts a dual-path architecture, combines adaptive memory attention and progressive graph convolution, and extracts spatial dependencies from the input data of the homogeneous branch and the spatio-temporal embedding.

[0073] S4: Perform heterogeneous graph spatio-temporal convolution and collaborative learning. This step takes the input time series data x in and the time embedding representation STE as the input of the heterogeneous branch (negatively correlated), learns heterogeneous spatio-temporal features, and performs collaborative interaction with the homogeneous spatio-temporal features output by S3.

[0074] S5: Multilayer stacking and prediction output.

[0075] In the above technical solution, the specific description of S1 is as follows:

[0076] S11: Perform graph structure embedding learning. Use the adjacency matrix to construct the graph G=(V,E). Adopt the Node2Vec algorithm, and simulate the generation of node sequences through random walks by controlling the return parameter p and the exploration parameter q to capture local and global structure information. This random walk process follows a specific transition probability π νx to determine which neighbor node to visit next, and its definition is as follows:

[0077]

[0078] where π vx represents the edge weight between node v and node x (1 if the graph has no weights), z∈N(ν) means that node z is a neighbor node of node v, and the summation term is a normalized calculation for all neighbor nodes of v.

[0079] where α pq (t,x) takes 1 / p, 1 or 1 / q according to the relationship between node x and the predecessor node t. Use the generated sequence to train the Skip-Gram model and optimize the objective function to obtain the node embedding vector E∈R |V| ×d

[0080] where

[0081] H1 = GELU(W3SE + b3), SE′ = GELU(W4H1 + b4)

[0082] Among them, W3 and W4 are the weight matrices of the first and second fully connected layers respectively, and b3 and b4 are the corresponding bias vectors. The GELU activation function introduces non-linearity to enhance the expressive power of the model.

[0083] S12: Perform temporal feature embedding. For the temporal features (such as day of the week and time period) are one-hot encoded and processed through two fully connected layers and the GELU activation function.

[0084] TE one-hot = OneHot(TE)

[0085] Convert the temporal features (such as day of the week and time period) into binary vector form for neural network processing. This encoding method ensures that the temporal features of each category have a unique and non-overlapping representation in the vector space.

[0086] H2 = GELU(W5TE one-hot + b5)

[0087] Through the linear transformation W5 and the bias b5, project the one-hot encoded temporal features into an intermediate space, and apply the GELU activation function to introduce non-linearity to capture the complex patterns of the temporal features.

[0088] TE′ = GELU(W6H2 + b6)

[0089] Further process the temporal feature representation H2 through another layer of linear transformation and the GELU activation function to ensure that the temporal embedding undergoes two layers of non-linear transformation and has stronger dynamic expressive power.

[0090] S13: Perform element-wise addition of the processed spatial embedding SE′ and the temporal embedding TE′ to generate a comprehensive spatio-temporal embedding representation STE.

[0091] STE = SE′ + TE′

[0092] In the above technical solution, the specific description of S2 is as follows:

[0093] S21: Apply the adaptive spectrum block; first, concatenate the input time series data x in (with dimensions B×N×C, where B is the batch size, N is the length of the time series, and C is the feature dimension) and the spatio-temporal embedding representation STE obtained in S1 in the feature dimension to fuse the sequence data and its spatio-temporal context information. Then, process the concatenated features through the fs layer transformation and the GELU activation function to generate the final input representation X for subsequent use in the adaptive spectrum block. Then, convert it to the frequency domain through the fast Fourier transform (FFT) to obtain the frequency domain representation X[k]. Calculate the energy |X[k]| of each frequency component k2 Calculate the median of all frequency energies, median(|X[k]| 2 ). Calculate the normalized energy based on the median energy:

[0094]

[0095] where median(·) represents the function for calculating the median, which acts on the set of energies |X[k]| of all frequency components k 2 and ε is a small positive number (e.g., 1×10 -6 ) to ensure numerical stability. Use a learnable threshold θ learned during training to generate an adaptive high-frequency mask freq_mask according to the following formula to identify and retain important frequency components:

[0096]

[0097] Apply the mask freq_mask to the frequency-domain signal X[k] to obtain the masked frequency-domain signal X masked [k] = X[k] · freq_mask[k]. Optionally, the X high can be further adjusted by a learnable high-frequency weighting parameter W masked For example, calculate X weighted [k] = X masked [k] + X masked [k] · W high [k] or other fusion methods to obtain the final weighted frequency-domain signal X weighted [k]. Finally, transform the processed frequency-domain signal X weighted [k] back to the time domain through the inverse fast Fourier transform (IFFT) to obtain the time series feature x′ that has been denoised in the frequency domain and enhanced with long short-term dependence features.

[0098] S22: Apply the interactive convolution block; convolve x′ or its subsequent representation using two convolutional kernels Conv1 and Conv2 of different sizes. Implement the interaction through the GELU activation function φ and element-wise multiplication ⊙:

[0099]

[0100] A2 = φ(Conv2(x′)) ⊙ Conv1(x′)

[0101] Add the interaction results and output through another convolutional layer Conv to further capture multi-scale time patterns:

[0102] H t = Conv3(A1 + A2)

[0103] H t The homogeneous time feature finally obtained as S2.

[0104] In the above technical solution, the specific description of S3 is:

[0105] S31: Apply adaptive graph memory attention

[0106] S311: Calculate spatial memory attention. Introduce a learnable memory embedding d m and Ψ m . Using the homogeneous time feature H of S2 t as input, generate query Q = W Q H t and value V = W V H t , use the memory embedding d m as key K. Adopt approximate attention calculation (SMA), such as the method based on random feature mapping δ(·):

[0107] SMA(Q, K, V) ≈ (δ(Q)δ(K) T )V

[0108] where Q represents the query, K represents the key, V represents the value, and δ(·) represents the softmax function;

[0109] S312: Calculate spatial adaptive attention. Use learnable node vectors ε1, ε2 to generate an adaptive adjacency matrix Optionally combine the prior adjacency matrix adj, then multiply the result of adding the spatial adaptive attention and the adaptive graph memory attention element-wise with the memory embedding Ψ m and add the residual connection H t . Incorporate A adp into the attention calculation:

[0110] H s ′ = (δ(Q)(δ(K) T V + ψ(A adp )V)) ⊙ Ψ m + H t

[0111] where ψ(·) is the process of optionally combining the prior adjacency matrix.

[0112] S313: Apply the GLU gated feed-forward network. Perform non-linear transformation and feature selection on the attention output through the gated linear unit (GLU):

[0113] GLU(X) = (W ν X) ⊙ σ(W u X)

[0114] where W ν and W ν are learnable linear transformations, and X is the attention output

[0115] Repeatedly applying the adaptive graph memory attention to obtain HS1 and HS2.

[0116] S32: Apply progressive graph convolution;

[0117] S321: Calculate the dynamic progressive adjacency matrix. Using the output H of S21 t as the input, assuming there are N nodes in the network, and the signal of node i at time t is represented by the vector First, perform min-max normalization on this vector, and then divide it by the Euclidean norm to obtain the unit vector:

[0118]

[0119] where is the normalized signal vector of node i at time t, represents the vector after min-max normalization.

[0120] Calculate the trend similarity between nodes i and j through the learnable transformation matrix W adj and generate the progressive adjacency matrix

[0121]

[0122] is the normalized signal vector of node i at time t.

[0123] S322: Perform progressive graph convolution operations. Incorporate into the K-order diffusion convolution framework. Let P be the normalized transition matrix based on the static adjacency matrix, and H t be the input feature, and W k,1 , W k,2 , W k,3 be the learnable weights:

[0124]

[0125] Repeatedly applying progressive graph convolution to obtain HS3 and HS4:

[0126] The progressive graph convolution module is used to capture the time-varying relationships between nodes. In this part, the model calculates the progressive adjacency matrix at each time step and uses this matrix for feature aggregation in the time dimension.

[0127] First, H t is fed into the progressive graph convolution module to obtain HS3:

[0128]

[0129] Subsequently, the model obtains HS4 through further stacking of progressive graph convolutions:

[0130]

[0131] S33: Fuse spatial features. Concatenate the outputs

[0132] (HS1 and HS2) and the outputs of progressive graph convolutions (HS3 and HS4), and obtain the final homogeneous branch spatio-temporal features through a linear layer and the GELU activation function

[0133] In the above technical solution, the specific description of S4 is as follows:

[0134] S411: Construct a heterogeneous adjacency matrix. Use the node embeddings node_embedding and node_embedding_t derived from STE, calculate the inner product and multiply by p_or_n = -1 to focus on negative correlations. Apply the threshold δ and the tanh activation function, and perform normalization to obtain the heterogeneous adjacency matrices A of the current time period t and the past time period t-k t and A t-k , and for this purpose, the heterogeneous adjacency matrix A is used to represent:

[0135] A = I - Normalize(tanh(InnerProduct ⊙ (InnerProduct > δ)))

[0136] where Normalize represents the graph matrix normalization operation (such as symmetric normalization or row normalization), tanh represents the hyperbolic tangent activation function, and InnerProduct represents the matrix of the inner product calculation results between node embeddings.

[0137] S412: Perform spatio-temporal convolution. Divide the input feature X into X corresponding to the time periods t and X t-k . Perform graph convolution (such as σ(A·X·W)) on (X t , A t ) and (X t-k , A t-k ) respectively, where W is the learnable weight, and obtain h1 and h2 through processing by the convolutional layer. Add the two to obtain the heterogeneous spatio-temporal feature h st = h1 + h2, denoted as the heterogeneous branch output

[0138] S42: Execute the graph collaborative learning module. Let the output of the homogeneous spatio-temporal branch obtained in S3 be and the output of the heterogeneous branch obtained in S41 be

[0139] S421: Refine the fusible features. Apply hierarchical pooling, upsampling, and 1×1 convolution to and to obtain the features in the fusible ready state and

[0140] S422: Gated fusion. After concatenating with , pass it through a GLU unit (parameters W c1 , b c1 , W c2 , b c2 ) to obtain the fused features

[0141] S423: Calculate the residual difference. Calculate the difference between the fusion result and the respective original fusible information: and

[0142] S424: Gated residual update. Use another set of GLU units (parameters W p1 , b p1 , W p2 , b p2 and W n1 , b n1 , W n2 , b n2 ) to add the residual differences and back to the original branch features and respectively to obtain the updated features and

[0143]

[0144]

[0145] In the above technical solution, the specific description of S5 is:

[0146] Stack the spatio-temporal block (ST-Block) composed of S2, S3, and S4 for L layers, and use the homogeneous output and the heterogeneous output of each layer as the input of the next layer. Aggregate the outputs of all layers through skip connections and input the final aggregated result into an output layer (such as a fully connected layer) to generate the final traffic flow prediction result.

[0147] Experimental Example:

[0148] All experiments were completed in a Linux environment with the following specific configurations: The CPU used was an 18-core vCPU AMD EPYC 9754 128-core processor, the GPU selected was an NVIDIA RTX4090D (with 24GB of video memory), the operating system was Ubuntu 22.04, the Python version was 3.10, and the Cuda version was 12.1. All experiments were built based on the PyTorch 2.1.0 platform. To ensure the fairness of the experiments, unless otherwise stated, all experiments were run on the same computing node.

[0149] The hyperparameters used by the model on the PEMS-BAY and METR-LA datasets are shown in Table 1. In the experimental settings, the historical time step P = 12 and the prediction time step Q = 12. The dataset was divided into a training set, a validation set, and a test set in a ratio of 7:1:2, with N t = 325 and N t = 207 time series samples respectively. The model was trained using the Adam optimizer, the batch size was set to 16 or 32, and the patience value for early stopping was set to patience = 10 = 10 = 10. The maximum number of training epochs for the model was 100. The dimension of the hidden state was 64, and the stacked homogeneous and heterogeneous learning branches were 4 layers. The learning rate was 0.001, the weight decay coefficient was set to {1×10 -4 , 1×10 -5}, the random seed value was set to 3407, the number of layers in the frequency convolution module was {2, 3, 4}, the dropout value was set to 0.0, the threshold of the heterogeneous graph was set to 0.02, and the dimension of the embedding vector for generating the heterogeneous graph node embeddings was 5. The performance of the model was evaluated using the MAE, RMSE, and MAPE metrics.

[0150] Table 1 Experimental Hyperparameter Settings Table (FGMNet Model)

[0151] Hyperparameter Setting value Historical time step (P) 12 Prediction time step (Q) 12 Batch size (batch_size) {16,32} Dropout rate (dropout) 0.0 Hidden layer dimension 64 Number of layers in the frequency convolution module {2,3,4} Threshold of the heterogeneous graph 0.02 Node embedding dimension 5 Learning rate (learning_rate) 0.0001 Weight decay coefficient {1e-4, 1e-5} Maximum number of training epochs (epocks) 100 Patience value (patience) 10 Optimizer Adam Random seed value 3407

[0152] Three commonly used metrics in traffic prediction were used in the experiments to test the model performance: (1) Mean Absolute Error (MAE), (2) Root Mean Square Error (RMSE), (3) Mean Absolute Percentage Error (MAPE), which are defined as follows:

[0153]

[0154] where y i and represent the true value and the predicted value respectively, and N represents the length of the prediction window, which was set to N = 12 in the experiment

[0155] 1. Comparative experiment

[0156] As shown in Table 2, the proposed FGMNet model was systematically compared with traditional time series methods (ARIMA, HARVAR) and various mainstream spatio-temporal prediction models (STGCN, DCRNN, GraphWaveNet, ASTGCN, AGCRN, STSGCN, MTGNN, GMAN, PDFormer, DGCRN, etc.). FGMINet achieved the best results in medium- and long-term predictions (such as 6-step and 12-step), and was also comparable to the optimal accuracy in the contrast methods in short-term prediction, demonstrating the superiority of this model.

[0157] The FGMNet model of the present invention has shown significant technical advantages in spatio-temporal prediction tasks, especially in traffic flow prediction. Systematic comparison shows that compared with traditional time series methods (ARIMA, HA, HARVAR) that mainly rely on linear or average assumptions and are difficult to capture complex spatial correlations, resulting in poor performance in long-term prediction (such as Horizon 6 and Horizon 12), and early spatio-temporal prediction models that introduce graph structures (such as STGCN based on CNN / GCN, DCRNN introducing diffusion convolution to process directed graphs) but mostly rely on static road topology priors and cannot adapt to dynamic trend similarities, FGMNet has achieved leading results in medium- and long-term prediction and reached the optimal accuracy level in short-term prediction. To overcome the deficiencies of the fixed adjacency matrix, subsequent methods such as GraphWaveNet and AGCRN introduced adaptive adjacency matrices to mine hidden spatial correlations, and ASTGCN combined spatio-temporal attention to expand the capabilities of GCN, but there are still limitations in aspects such as full adaptability at the graph structure level, effectiveness of time dimension feature extraction, or multi-step prediction error accumulation, which limit the long-term prediction accuracy. For example, although DGCRN performs excellently in short-term prediction (such as METR-LA Horizon 3) by fusing adaptive adjacency and RNN, the medium- and long-term errors increase over time; MTGNN has balanced performance but is not designed specifically for dynamic time-varying dependencies, resulting in insufficient long-term accuracy; PDFormer introduces the Transformer mechanism, but faces problems of computational overhead and noise amplification when dealing with noise mutations, complex periodicity, and suddenness commonly found in traffic flow, and has requirements for data scale and stationarity. The superiority of FGMNet, especially its excellent performance on the PEMS-BAY and METR-LA datasets, is attributed to its unique design and integration capabilities in heterogeneous relationship learning, long-term historical pattern extraction, noise interference reduction, and dynamic graph learning, effectively overcoming the above limitations of the existing technologies and achieving precise capture of complex dynamic spatio-temporal dependencies and robust long-term prediction.

[0158] Table 2 Comparison of Traffic Prediction Performance of FGMNet Model Based on PEMS-BAY and METR-LA Datasets

[0159]

[0160]

[0161]

[0162] 2. Ablation Experiments

[0163] The effectiveness of the proposed model on the PEMS-BAY dataset was evaluated through ablation experiments. To ensure the fairness of the experiments, all comparative experiments were conducted under the same hyperparameter settings and repeated 5 times, and the average value was taken as the evaluation benchmark. The four main components of the model are: adaptive spectrum block, interactive convolution module, adaptive graph memory attention, and progressive graph convolution. To verify the effectiveness of the proposed components, four variants were proposed in the ablation experiments: w / oASCB, w / oASMA, w / oHGL, and w / oPGC. Among them:

[0164] 1. w / oASCB (w / o adaptive frequency convolution block): The adaptive frequency convolution block in the model was removed.

[0165] 2. w / oASMA (w / o adaptive graph memory attention): The adaptive graph memory attention module in the model was removed, and only progressive graph convolution and homogeneous graph convolution were used for spatial feature extraction.

[0166] 3. w / oPGC (w / o progressive graph convolution): The progressive graph convolution module in the model was removed, and only the adaptive graph memory attention module and homogeneous graph convolution were used for spatial feature extraction.

[0167] 4. w / oHGL (w / o heterogeneous graph learning): The heterogeneous learning branch in the model was removed, and only the homogeneous learning branch was used for learning.

[0168] Table 3 Results of Ablation Experiments of FGMNet Model (PEMS-BAY Dataset)

[0169] Model Dataset Horizon 3 Horizon 6 Horizon 12 FGMNet PEMS-BAY 2.69 1.28 2.64 Without ASMA PEMS-BAY 2.79 1.30 2.72 Without ASCB PEMS-BAY 2.86 1.33 2.81 Without PGC PEMS-BAY 2.78 1.30 2.70 Without HGL PEMS-BAY 2.88 1.33 2.79

[0170] The results are shown in Table 3. Compared with w / o ASCB, FGMNet achieved better performance, indicating the effectiveness of the adaptive frequency convolution block in frequency domain denoising, capturing long-term dependencies of time series, interacting with multi-scale convolution kernels to extract temporal features, and enhancing the model's ability to model complex temporal patterns. The performance advantage of FGMINet over w / c ASMA demonstrates the key role of the adaptive graph memory attention in capturing historical spatio-temporal patterns and enhancing spatial attention. In addition, the performance of FGMINet is better than w / o PGC, verifying the effectiveness of progressive graph convolution in dynamically updating the adjacency matrix and capturing time-varying correlations between nodes. The performance of FGMNet is better than w / o HGL, demonstrating the effectiveness of the heterogeneous graph learning branch in complementing the original homogeneous learning branch. These ablation experiment results fully verify the importance and complementarity of each module of the proposed FGMNet model in spatio-temporal traffic flow prediction.

Claims

1. A heterogeneous graph collaborative learning traffic flow prediction method, characterized in that: The following steps are involved: Step S1: Generate spatiotemporal embedding representation, integrate the topological structure information and time characteristics of the nodes, and obtain the spatiotemporal embedding representation STE; Step S2: concatenate the input time series data with STE, filter out high-frequency noise and enhance long- and short-term dependency features through adaptive spectrum blocks, and then extract multi-scale homogeneous time features through interactive convolution blocks; Step S3: A dual-path architecture is adopted to combine adaptive memory attention and progressive graph convolution to extract spatial dependencies from the input data of the homogeneous branch and obtain homogeneous spatiotemporal features; Step S4: construct a heterogeneous adjacency matrix, extract negatively correlated spatiotemporal features through spatiotemporal convolution of heterogeneous graphs, and interact with homogeneous spatiotemporal features; Step S5: stack multiple layers of spatiotemporal blocks, aggregate the outputs of each layer and generate traffic flow prediction results through the output layer.

2. The method according to claim 1, characterized in that The step S1 of generating spatiotemporal embedding specifically includes: Step S11: graph structure embedding learning, constructing a traffic network graph G = (VE) based on the adjacency matrix, using the Node2Vec algorithm to generate a node sequence through random walks of controllable parameters p and q, using the Skip-Gram model to optimize the node embedding vector, and outputting the spatial embedding SE after two layers of fully connected layers and GELU activation function enhancement; Step S12: Time feature embedding, one-hot encoding the time features including the week cycle and time period division, and generating the time embedding TE after conversion through two layers of fully connected layers and GELU activation function; Step S13: spatiotemporal fusion, performing element-level addition fusion on the spatial embedding SE' and the temporal embedding TE' to generate a spatiotemporal embedding representation STE containing topological structure and temporal features.

3. The traffic flow prediction method according to claim 1, characterized in that: The step S2 of extracting homogeneous time features specifically includes: S21: Adaptive spectrum processing, concatenating the input time series data with the spatiotemporal embedding representation STE in feature dimensions, converting them to the frequency domain through Fourier transform to generate frequency domain signals, calculating a learnable threshold based on the energy median to generate a high-frequency mask, and reconstructing the time domain signal through inverse Fourier transform; S22: Interactive convolution enhancement, which applies convolution kernels of different scales to the reconstructed time domain signal in parallel, realizes multi-scale feature interaction through GELU activation and element-wise product, and outputs homogeneous time features after linear fusion.

4. The traffic flow prediction method according to claim 1, characterized in that: The step S3 of homogeneous space feature extraction specifically includes: S31: Dual-path adaptive attention processing, generating spatial memory attention through learnable memory embedding, calculating spatial attention weights in combination with dynamically generated adaptive adjacency matrix, and implementing nonlinear feature selection using GLU gated feedforward network; S32: Dynamic progressive graph convolution, which generates a progressive adjacency matrix based on the normalized vector of real-time traffic flow signals and integrates diffusion convolution frameworks of different orders to extract multi-order spatial dependency features; S33: Multi-source feature fusion, channel splicing of the adaptive attention output and the progressive convolution output, and generating homogeneous spatial features after linear transformation and GELU activation 5. The traffic flow prediction method according to claim 4, characterized in that: The step S31 dual-path adaptive attention processing specifically includes: S311: Spatial memory attention generation based on learnable memory embedding vector d m and m Generate key-value pairs, using homogeneous time features H t The linear transformation generates the query matrix Q and the value matrix V, and the long-term spatial dependency features are extracted by combining the approximate attention calculation with the memory key K; S312: Spatial adaptive attention fusion, generating a dynamic adjacency matrix A based on the learnable node vectors ε1 and ε2 adp , after selectively combining it with the prior adjacency matrix adj, it is embedded in Ψ through attention weight superposition and memory m Element-wise multiplication of achieves attention enhancement; S313: Gated feature selection, the enhanced attention output is transformed nonlinearly through a gated linear unit, which is formulated as: GLU(X)=(W v X)⊙σ(W u X) Where W v , W u is a learnable parameter, σ(·) is the Sigmoid function, ⊙ represents the element-wise multiplication operation, and X is the attention output.

6. The traffic flow prediction method according to claim 5, characterized in that: The step S32 of dynamic progressive graph convolution specifically includes: S321: Dynamic adjacency matrix generation based on the normalized signal vector of node i at time t Through the learnable transformation matrix W adj Calculate the trend similarity between nodes i and j: is the normalized signal vector of node i at time t, is the normalized signal vector of node j at time t, ReLU(·) represents the rectified linear unit activation function, and softmax(·) represents the normalized exponential function; S322: multi-order progressive convolution operation, converting the dynamic adjacency matrix Combined with the diffusion convolution of the static adjacency matrix, the formula is expressed as: Where P is the normalized transfer matrix of the static adjacency matrix, W k,1 , W k,2 , W k,3 is the learnable weight parameter of each diffusion order, P is the normalized transfer matrix based on the static adjacency matrix, represents the transpose of the matrix P; S323: Multi-order feature iteration generation, H t It is fed into the progressive graph convolution module to obtain HS3: The model is then further stacked through progressive graph convolution to obtain HS4 7. The traffic flow prediction method according to claim 1, characterized in that: The step S4 of heterogeneous graph spatiotemporal convolution and collaborative learning specifically includes: S41: Extract spatiotemporal features of heterogeneous graphs. Generate negatively correlated heterogeneous adjacency matrices based on spatiotemporal embedding (STE). Construct heterogeneous graph structures through dynamic inner product similarity calculation and normalization operations. Perform multi-period heterogeneous graph convolution to capture negatively correlated spatiotemporal features. S42: Collaborative feature interactive update, hierarchical pooling and upsampling of the feature outputs of homogeneous branches and heterogeneous branches, cross-branch feature fusion through gated linear unit GLU, and collaborative enhancement of dual-branch features using residual difference calculation and gated update mechanism.

8. The traffic flow prediction method according to claim 7, characterized in that: The heterogeneous adjacency matrix construction and spatiotemporal convolution operation in the step S41 heterogeneous graph spatiotemporal convolution and collaborative learning step specifically include: S411: Dynamic heterogeneous adjacency matrix generation, based on the node embedding vector in the spatiotemporal embedding representation STE, the inner product similarity is calculated, and the dynamic heterogeneous adjacency matrix reflecting the negative correlation between nodes is generated through negative correlation factors, threshold screening and tanh activation function processing, which is recorded as heterogeneous branch output S412: Multi-period heterogeneous convolution, divides the input features into current period and historical period data according to the time dimension, performs graph convolution operations with the heterogeneous adjacency matrices of the corresponding time periods, and outputs heterogeneous spatiotemporal features after residual connection fusion.

9. The traffic flow prediction method according to claim 8, characterized in that: The collaborative learning module in step S4 specifically includes: S421: can integrate feature extraction and output homogeneous spatiotemporal feature branches With heterogeneous spatiotemporal feature branch output Perform layered pooling, upsampling, and 1×1 convolution operations to generate fusion preparatory features and ; S422: Gated feature fusion, and Splicing along the feature dimension, generating fusion features through linear transformation of gated linear units and sigmoid activation function S423: Residual difference calculation, fusion features With the preparatory features Differences are made separately to obtain residual differences and S424: Update the gated residual. and Gated weighted superposition is performed through the GLU unit to generate updated homogeneous features At the same time and Generate updated heterogeneous features through weighted superposition of GLU units 10. The traffic flow prediction method according to claim 1, characterized in that: The step S5 specifically includes: The spatiotemporal blocks formed by step S2, step S3, and step S4 are stacked in L layers, and the homogeneous output of each layer is and heterogeneous output As the input of the next layer, the outputs of all layers are aggregated through skip connections, and the final aggregation result is input into an output layer to generate the final traffic flow prediction result.

Citation Information

Cited By

  • Urban inland inundation risk multi-level prediction method and device based on space-time diagram learning, storage medium and computer program product

    CN120542667A

  • Multi-level prediction method, device, storage medium and computer program product for urban waterlogging risk based on spatiotemporal graph learning

    CN120542667B

  • Traffic flow prediction method based on deep learning

    CN121281279A

  • PMinversion method and system based on dynamic multi-scale graph modeling driving

    CN122347042A

  • Parallel graph learning and dynamic channel fused water treatment space-time anomaly detection method

    CN122412922A