A traffic flow prediction method based on double-branch cooperative spatio-temporal enhancement and interleaved feature modeling
By constructing a dual-branch collaborative spatiotemporal augmentation network and combining multi-source spatiotemporal embedding and dynamic graph learning, the problems of insufficient utilization of temporal prior information and insufficient global graph structure representation in existing traffic flow prediction methods are solved, and efficient prediction of complex traffic networks is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAIYIN INSTITUTE OF TECHNOLOGY
- Filing Date
- 2026-05-07
- Publication Date
- 2026-07-31
AI Technical Summary
Existing traffic flow prediction methods suffer from insufficient utilization of prior time information, inadequate representation of global graph structure, and limited ability to collaboratively model complex spatiotemporal dependencies. These limitations make it difficult to adapt to changes in dynamic spatial relationships within complex traffic networks, thus affecting prediction accuracy and robustness.
A traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and interleaved feature modeling is constructed. The spatiotemporal prior information is enhanced by multi-source spatiotemporal embedding coding and spectral domain structure embedding module. Combined with dual-branch collaborative spatiotemporal enhancement network, including residual multilayer perceptron and interleaved spatiotemporal enhancement and dynamic graph learning branches, deep modeling of complex spatiotemporal dependencies is achieved.
It improves the accuracy and robustness of traffic flow prediction, can adapt to different time conditions and node characteristics, enhances the ability to express multi-period time patterns and node spatial differences, and improves the prediction performance of complex traffic networks.
Smart Images

Figure CN122493672A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent traffic prediction and traffic flow analysis technology, specifically relating to a traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling. Background Technology
[0002] With the continuous advancement of urbanization and the increasing number of motor vehicles, urban transportation networks are becoming increasingly complex, and traffic flow exhibits stronger dynamics, coupling, and non-stationarity in both time and space dimensions. Traffic flow prediction, as a key foundational task in intelligent transportation systems, is of great significance for traffic guidance, signal control, congestion warning, route planning, and response to abnormal events.
[0003] Existing traffic flow prediction methods mainly include statistical methods and deep learning methods. Traditional statistical methods have a certain ability to characterize linear patterns, but they are difficult to effectively adapt to nonlinear spatiotemporal relationships in complex road network environments. In recent years, deep learning methods based on graph neural networks, Transformers, and multilayer perceptrons have achieved good results in traffic flow prediction tasks. Among them, graph neural networks can model the spatial topological relationships between nodes, Transformers can capture long-distance dependencies, and multilayer perceptron models have high computational efficiency and good engineering deployment characteristics.
[0004] (1) Although existing methods usually introduce time prior information such as time embedding and day-of-week embedding to enhance the model's ability to perceive periodic patterns, most of them adopt fixed superposition or uniform fusion methods, without fully considering the differences in the contribution of time prior information to the prediction task under different time conditions. In fact, the formation mechanism of traffic flow is significantly different under different time periods and different dates. For example, the traffic operation patterns of weekday morning and evening peaks and weekend off-peak periods are significantly different. If a uniform weight is used for time embedding, it is easy to weaken the model's ability to express complex periodic patterns and dynamic time features.
[0005] (2) Existing methods mainly rely on node adjacency relationships, spatial location encoding, or learnable node embeddings to utilize spatial structure information. These methods can reflect local spatial relationships and node identity differences to a certain extent, but they are still insufficient for expressing the global topology of the road network. Especially in complex traffic networks, relying solely on local adjacency information makes it difficult to fully reveal the positional relationships of nodes in the overall graph structure and potential long-distance connections. This limits the model's ability to utilize prior information in global space and is not conducive to accurately depicting traffic propagation patterns in complex road network scenarios.
[0006] (3) Some existing methods typically use serial or parallel architectures to model temporal and spatial dependencies separately, or perform shallow feature fusion through simple splicing or linear projection. They lack deep collaboration between structured feature transformation and global dependency modeling, making it difficult to balance the efficiency of local feature interaction with the ability to express long-distance dependencies. At the same time, many methods use fixed adjacency matrices to characterize spatial dependencies, while the relationships between nodes in real traffic networks often change dynamically with time, congestion status, and external disturbances. Fixed topology structures are difficult to adapt to the dynamic spatial relationships formed in real traffic networks with changes in time and state, thus affecting the prediction performance and generalization ability in complex scenarios.
[0007] Therefore, there is an urgent need for a traffic flow prediction method that can jointly utilize multi-source spatiotemporal features, take into account both efficient feature fitting and deep spatiotemporal dependency modeling, and adapt to dynamic changes in spatial relationships, so as to improve the accuracy and robustness of traffic flow prediction in complex scenarios. Summary of the Invention
[0008] The purpose of this invention is to address the problems of insufficient utilization of temporal prior information, inadequate global graph structure representation, and limited ability to collaboratively model complex spatiotemporal dependencies in existing traffic flow prediction methods. This invention provides a traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and interleaved feature modeling. This method performs multi-source spatiotemporal embedding encoding on historical traffic flow data, enhances node spatial prior information and periodic temporal prior information through a spatiotemporal prior embedding modulation module, enhances graph structure prior information through a spectral domain structure embedding module, and fuses these with time series embedding to construct a spatiotemporal joint representation. This spatiotemporal joint representation is then input into a dual-branch collaborative spatiotemporal enhancement network for modeling to output traffic flow prediction results for future time periods.
[0009] To achieve the above objectives, the technical solution of the present invention is: a traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling, comprising:
[0010] Obtain raw traffic flow historical sequence data and construct a model input tensor that includes traffic observations, time index information, and spatial structure information;
[0011] Multi-source spatiotemporal embedding encoding is performed on the model input tensor. The spatiotemporal prior embedding modulation module and the spectral domain structure embedding module are used to extract and enhance the node spatial prior information, periodic time prior information and graph structure prior information, respectively. These are then fused with time series embedding to construct a spatiotemporal joint representation.
[0012] Inputting the spatiotemporal joint representation into a two-branch collaborative spatiotemporal augmentation network, the output traffic flow prediction results for future time moments include:
[0013] Construct a dual-branch collaborative spatiotemporal augmentation network;
[0014] Construct a static feature learning branch based on a residual multilayer perceptron;
[0015] An interleaved spatiotemporal augmentation and dynamic graph learning branch is constructed, the branch including an FLP-Transformer interleaved augmentation coding block, a dynamic graph generation unit, and a dynamic graph convolution unit;
[0016] The outputs of the static feature learning branch based on residual multilayer perceptron and the interleaved spatiotemporal enhancement and dynamic graph learning branches are fused, and the final traffic flow prediction result is generated through a regression mapping layer.
[0017] Furthermore, constructing the model input tensor specifically includes:
[0018] The traffic flow observations at each traffic node at historical moments are used to form the input flow tensor;
[0019] Extract time index information from historical traffic flow data; the time index information includes time information and day of the week information.
[0020] Obtain the node identification information and the adjacency matrix between nodes in the traffic network as spatial structure information;
[0021] The flow observations, time index information, and spatial structure information are organized in a unified tensor form to construct the model input tensor.
[0022] Furthermore, multi-source spatiotemporal embedding coding includes the following process:
[0023] The historical traffic flow sequence is rearranged along the time dimension and the feature dimension, and then input into the time series embedding layer. The time series embedding representation is obtained through convolutional mapping.
[0024] The spatiotemporal prior embedding modulation module extracts and enhances the node spatial prior information and the periodic time prior information. Specifically, learnable weight parameters are applied to the learnable node embedding to scale it, thereby obtaining the node spatial prior embedding. Based on the time index and weekday index corresponding to the last time of the historical sequence, the time embedding and weekday embedding are obtained by looking up tables, respectively. Dynamic weights are generated through the time weight network and weekday weight network, respectively, and the time embedding and weekday embedding are weighted and modulated to obtain the periodic time prior embedding.
[0025] The graph structure prior information is extracted and enhanced through the spectral domain structure embedding module. Specifically, a graph Laplacian matrix is constructed based on a preset adjacency relation matrix, the first few orders of Laplacian feature vectors are extracted, and the spectral domain structure embedding representation is obtained through a mapping network.
[0026] The time series embedding representation, node space prior embedding, periodic time prior embedding, and spectral domain structure embedding are spliced and fused along the feature dimension to obtain the spatiotemporal joint representation.
[0027] Furthermore, the static feature learning branch structure based on residual multilayer perceptron is as follows:
[0028] The spatiotemporal joint representation is input into an encoder composed of stacked residual multilayer perceptrons;
[0029] Each residual multilayer perceptron performs nonlinear mapping and local feature interaction learning on the fused high-dimensional spatiotemporal features;
[0030] The static feature learning branch output is obtained by cascading and stacking.
[0031] Furthermore, the interleaved spatiotemporal enhancement and dynamic graph learning branch structure is as follows:
[0032] By performing a dimensionality transformation on the spatiotemporal joint representation, a spatiotemporal sequence representation oriented towards node feature modeling is obtained;
[0033] Construct multiple FLP-Transformer interleaved enhancement coding blocks. Each enhancement coding block includes a factorized linear projection module, a Transformer coding module, and a normalization module.
[0034] In each augmented coding block, the input spatiotemporal sequence representation is first decomposed and linearly transformed using a factorized linear projection module, and the transformation result is then joined with the block input via a first residual connection. Subsequently, the features after the first residual connection are input into a Transformer coding module, which uses a multi-head self-attention mechanism to capture global dependencies, and the Transformer output is joined with its input via a second residual connection. Finally, the features processed alternately by the factorized linear projection module and the Transformer coding module are normalized, and the result of the current augmented coding block is output.
[0035] Multiple enhanced coding blocks are stacked in hierarchical order to form an interleaved enhancement process of factorized linear projection and Transformer;
[0036] The interleaved enhanced hidden features are input into the dynamic graph learning part to generate a dynamic topology and extract dynamic spatial dependency features, thus obtaining the output of the interleaved spatiotemporal enhancement and dynamic graph learning branches.
[0037] Furthermore, the factorized linear projection module includes an input mapping matrix, a latent space transformation matrix, and an output mapping matrix, and its processing includes:
[0038] The input spatiotemporal features are mapped to the latent space to obtain the latent space state representation;
[0039] A linear transformation is performed on the latent space state representation to obtain the transformed latent space features.
[0040] The transformed latent space features are mapped back to the original feature space to obtain the factorized linear projection output.
[0041] Furthermore, the dynamic graph learning part consists of a dynamic graph generation unit and a dynamic graph convolution unit, and its processing includes:
[0042] The hidden features after interleaved augmentation coding are input into the dynamic graph generation unit;
[0043] An adaptive adjacency matrix between nodes is generated based on the similarity relationship between hidden features, and key related edges are retained through an adjacency filtering strategy to form a dynamic topology.
[0044] The dynamic topology is input into the dynamic graph convolutional unit to perform graph convolution propagation on the hidden features;
[0045] Multi-layer dynamic graph convolution is used to extract spatial relationships under dynamic topology layer by layer, and the graph convolution output is residually fused with the hidden features after interleaved augmentation coding to obtain augmented feature representations containing dynamic spatial dependencies.
[0046] Furthermore, the branch fusion and prediction output include the following steps:
[0047] The static feature learning branch output based on residual multilayer perceptron is fused element-wise with the output of interleaved spatiotemporal augmentation and dynamic graph learning branches in the same feature space to obtain a fused feature representation.
[0048] The fused feature representation is input into the regression mapping layer, and the hidden features are projected onto the output space corresponding to the target prediction stride through convolutional mapping.
[0049] Output traffic flow forecasts for one or more future time points.
[0050] Furthermore, the time series embedding layer uses 1×1 convolution to map the rearranged historical traffic flow sequence to obtain a time series embedding representation.
[0051] Furthermore, the adjacency filtering strategy is a Top-k filtering strategy, which retains the top k most similar related edges of each node in the adaptive adjacency matrix to form a dynamic topology structure.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] 1. This invention constructs a dual-branch collaborative spatiotemporal augmentation network. It employs a static feature learning branch and an interleaved spatiotemporal augmentation and dynamic graph learning branch for collaborative modeling, balancing the ability to fit basic features with the expression of complex spatiotemporal dependencies. The static feature learning branch efficiently extracts basic features and stable patterns, while the interleaved spatiotemporal augmentation and dynamic graph learning branches deeply model complex spatiotemporal relationships and dynamic spatial dependencies. The synergistic fusion of these two branches enhances the ability to express higher-order spatiotemporal features while maintaining the ability to fit basic patterns, thereby effectively improving the accuracy and stability of traffic flow prediction.
[0054] 2. This invention constructs a multi-source spatiotemporal embedding coding mechanism, improving the completeness and effectiveness of the input representation through a spatiotemporal prior embedding modulation module and a spectral domain structure embedding module. The spatiotemporal prior embedding modulation module introduces learnable weight scaling for node embedding and dynamic weight modulation for time-day and weekday embedding, enabling the model to adaptively adjust the contribution of prior information according to different time conditions and different node features, thereby enhancing its ability to express multi-period temporal patterns and node spatial differences. The spectral domain structure embedding module introduces global topological prior information represented by graph Laplacian eigenvectors, enhancing the model's perception of the overall structure of the traffic network and potential spatial relationships, and improving the efficiency of multi-source spatiotemporal information utilization.
[0055] 3. This invention designs an FLP-Transformer interleaved augmentation coding structure in the interleaved spatiotemporal augmentation and dynamic graph learning branches, and combines it with a dynamic graph learning mechanism to improve the joint modeling capability for complex spatiotemporal features and dynamic spatial dependencies. Compared with single transformation or attention structures, the model achieves structured interaction of features through factorized linear projection, and then captures global dependencies through Transformer, strengthening feature expression through multi-layer interleaved stacking; at the same time, it adaptively constructs node associations and models dynamic topological relationships through dynamic graph units, breaking away from the limitations of fixed adjacency matrices, better mining potential spatial correlations, and further improving the accuracy and robustness of traffic flow prediction. Attached Figure Description
[0056] Figure 1 This is a flowchart illustrating the overall process framework of the present invention;
[0057] Figure 2 This is a flowchart of the spatiotemporal prior embedding modulation module of the present invention;
[0058] Figure 3 This is a flowchart of the spectral domain structure embedding generation process of the present invention;
[0059] Figure 4 This is a schematic diagram of the FLP-Transformer interleaved enhanced coding block structure of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0061] This invention provides a traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling, comprising:
[0062] Obtain raw traffic flow historical sequence data and construct a model input tensor that includes traffic observations, time index information, and spatial structure information;
[0063] Multi-source spatiotemporal embedding encoding is performed on the model input tensor. The spatiotemporal prior embedding modulation module and the spectral domain structure embedding module are used to extract and enhance the node spatial prior information, periodic time prior information and graph structure prior information, respectively. These are then fused with time series embedding to construct a spatiotemporal joint representation.
[0064] Inputting the spatiotemporal joint representation into a two-branch collaborative spatiotemporal augmentation network, the output traffic flow prediction results for future time moments include:
[0065] Construct a dual-branch collaborative spatiotemporal augmentation network;
[0066] Construct a static feature learning branch based on a residual multilayer perceptron;
[0067] An interleaved spatiotemporal augmentation and dynamic graph learning branch is constructed, the branch including an FLP-Transformer interleaved augmentation coding block, a dynamic graph generation unit, and a dynamic graph convolution unit;
[0068] The outputs of the static feature learning branch based on residual multilayer perceptron and the interleaved spatiotemporal enhancement and dynamic graph learning branches are fused, and the final traffic flow prediction result is generated through a regression mapping layer.
[0069] The following is a detailed implementation process of the present invention.
[0070] like Figure 1 As shown, this invention discloses a traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling. The method includes the following steps:
[0071] S1: Obtain the original historical traffic flow sequence data and construct the model input tensor containing traffic observations, time index information, and spatial structure information.
[0072] First, the raw traffic flow data is loaded, and traffic flow observations at multiple traffic nodes at consecutive historical moments are extracted to form a historical traffic flow input sequence. In this embodiment, the publicly available traffic flow dataset PEMS04 is used as the experimental data source. The input data is organized into a four-dimensional tensor in chronological order, and the tensor dimension can be represented as... Where B represents the batch size, L represents the historical input time step, N represents the number of traffic nodes, and C represents the input feature dimension of each node at each time step.
[0073] Furthermore, traffic flow observations are extracted from the original historical traffic flow data as the main input features of the model, denoted as: .in, This represents the dimension of traffic flow observation features. Simultaneously, based on the original data collection timestamps, the time index and weekday index information corresponding to each time step are extracted. The time index information indicates the current time step's position within a day, and the weekday index information indicates its position within a week. Further, the adjacency matrix corresponding to each node in the traffic network is obtained. And use it as the input model for spatial structure information.
[0074] Therefore, the flow observations, time index information, and spatial structure information are organized in a unified tensor form to construct the model input tensor, which serves as the input basis for subsequent multi-source spatiotemporal embedding coding.
[0075] S2: Perform multi-source spatiotemporal embedding encoding on the input tensor of the model. Extract and enhance the node space prior information, periodic time prior information and graph structure prior information through the spatiotemporal prior embedding modulation module and the spectral domain structure embedding module, respectively, and fuse them with the time series embedding to construct a spatiotemporal joint representation.
[0076] This embodiment first performs time-series embedding encoding on the historical traffic flow sequence. Specifically, the traffic flow observation tensor is... The data is rearranged along the time and feature dimensions, so that the flow observations of each node within the historical time window are expanded and input into the time series embedding layer. The time series embedding layer uses a 1×1 convolutional mapping to map the input into a fixed-dimensional time series embedding representation. .in, This indicates the embedding dimension of the time series.
[0077] Furthermore, such as Figure 2 As shown, this embodiment extracts and enhances node spatial prior information and periodic temporal prior information through a spatiotemporal prior embedding modulation module. Specifically, a learnable node embedding matrix is introduced to represent the spatial identity information of each traffic node. The node embedding matrix can be represented as follows: ,in Indicates the node embedding dimension.
[0078] In this embodiment, a learnable weight parameter α is further introduced into the node embedding to adjust the contribution of the node spatial embedding, resulting in a weighted node embedding representation:
[0079]
[0080] Furthermore, this embodiment dynamically modulates the time prior information to enhance the model's ability to represent multi-period traffic patterns. Specifically, based on the time index corresponding to the last time of the historical sequence, the corresponding time embedding representation is obtained from the static time embedding table. Simultaneously, the time index is input into the Beta weight network to generate dynamic time weights: .in, This represents the time-weighted generation network. Subsequently, the static time-embedded embedding is element-wise weighted using the dynamic weights to obtain the dynamically weighted time-embedded embedding:
[0081] Similarly, based on the weekday index corresponding to the last moment of the historical sequence, the corresponding weekday embedding representation is obtained by looking up the table in the static weekday embedding table. The weekday index is then input into the Gamma weight network to generate dynamic weekday weights. .in, This represents the weekday weight generation network. Further, a dynamic weekday weighted embedding is obtained through element-wise weighting:
[0082]
[0083] The aforementioned node embedding weighting and temporal embedding dynamic modulation together constitute the spatiotemporal prior embedding modulation process, enabling the model to adaptively adjust the contribution of different prior embeddings to the prediction task.
[0084] Furthermore, to enhance the model's ability to represent the global topology of the traffic network, this embodiment introduces spectral domain structure embedding. Specifically, as shown... Figure 3 As shown, firstly, a node degree matrix D is constructed based on the input adjacency matrix A, and then a normalized Laplacian matrix is constructed:
[0085]
[0086] Where I is the identity matrix. Subsequently, eigenvalue decomposition is performed on the normalized Laplacian matrix L to obtain the set of eigenvalues and the set of eigenvectors: Based on the order of eigenvalue magnitudes, the eigenvectors corresponding to the k smallest eigenvalues are selected to form the Laplacian eigenvector matrix. The Laplacian eigenvectors are then input into an embedding mapping network, where nonlinear mapping is performed through linear layers, ReLU activation layers, and another linear layer to obtain the spectral domain structure embedding representation. .in, This indicates the embedding dimension of the spectral domain structure.
[0087] Finally, the time series embedding representation, node-weighted embedding, dynamic time-weighted embedding, dynamic day-of-the-week weighted embedding, and spectral domain structure embedding are concatenated on the feature dimension to obtain the spatiotemporal joint representation. .in, This represents the total feature dimension after fusion.
[0088] S3: Input the spatiotemporal joint representation into the dual-branch collaborative spatiotemporal enhancement network and output the traffic flow prediction results for future moments.
[0089] S3.1: As in this embodiment, a dual-branch collaborative spatiotemporal augmentation network is constructed, including a static feature learning branch and an interleaved spatiotemporal augmentation and dynamic graph coding branch. The two branches model the spatiotemporal joint representation from different perspectives and are fused in subsequent stages.
[0090] S3.1.1: Static Feature Learning Branch Based on Residual Multilayer Perceptron
[0091] The static feature learning branch employs a multilayer perceptron encoding structure to efficiently extract fundamental features and stable patterns from the input spatiotemporal joint representation. Specifically, the spatiotemporal joint representation is input into an encoder composed of multiple residual multilayer perceptrons. Each layer achieves local interaction and nonlinear fitting of high-dimensional features through linear mapping and nonlinear activation, and improves training stability through residual connections.
[0092] After processing by the multilayer perceptron encoder, the static feature learning branch output is obtained. This branch is mainly used to retain the ability to fit basic features and the ability to model features efficiently.
[0093] S3.1.2: Interleaved Spatiotemporal Augmentation and Dynamic Graph Coding Branch
[0094] Another branch in this embodiment is the interleaved spatiotemporal augmentation and dynamic graph coding branch, which is used to enhance the model's ability to express complex spatiotemporal dependencies. First, the spatiotemporal joint representation is transformed in terms of dimensionality to obtain a spatiotemporal sequence representation suitable for node-dimensional feature modeling: Subsequently, multiple FLP-Transformer interleaved enhancement coding blocks are constructed and stacked layer by layer. Each FLP-Transformer interleaved enhancement coding block includes a factorized linear projection module, a Transformer coding module, and a layer normalization module.
[0095] In this module, the factorized linear projection module uses a multi-matrix decomposition form instead of a single linear mapping. For example... Figure 4 As shown, specifically, the input features are first multiplied by the input mapping matrix B to obtain the intermediate state representation; then, the intermediate state is multiplied by the latent space transformation matrix A to obtain the evolution state; and finally, it is multiplied by the output mapping matrix C to obtain the factorized linear projection output. The calculation process can be represented as follows:
[0096]
[0097] Here, B, A, and C are all learnable parameter matrices. Subsequently, the factorized linear projection output is connected to the block input via a first residual connection to obtain the enhanced features. These enhanced features are then further input into the Transformer encoding module, where a multi-head self-attention mechanism captures global dependencies, and a second residual connection is made with the Transformer input. Finally, layer normalization is used to obtain the output of the current enhanced block. By staggering multiple FLP-Transformer enhanced blocks, the model's ability to jointly express local structured feature interactions and global dependencies is gradually improved.
[0098] Furthermore, a dynamic graph learning module is introduced after interleaved augmentation coding. Specifically, the hidden features output by the augmentation block are input into the dynamic graph generator, and an adaptive adjacency matrix is constructed based on the similarity relationships between the hidden features of nodes. .
[0099] In this embodiment, a Top-k adjacency filtering strategy is used to retain key related edges, thereby forming a dynamic topology. Subsequently, this dynamic topology is input into a dynamic graph convolution module, which uses multi-layer dynamic graph convolution to model the dynamic spatial dependencies between nodes, obtaining the dynamic graph convolution output. The residual is then fused with the input of the dynamic graph learning module to obtain the interleaved spatiotemporal augmentation and dynamic graph coding branch output. .
[0100] S3.1.3: Branch Fusion and Output Prediction
[0101] Output the static feature learning branch With interleaved spatiotemporal augmentation and dynamic graph coding branch output Element-wise fusion is performed within the same feature space to obtain the fused feature representation:
[0102]
[0103] Finally, the fused feature representations are input into the regression layer, and the hidden features are projected onto the output space corresponding to the target prediction stride through a 1×1 convolution mapping to obtain the traffic flow prediction results for one or more future time steps: .in This indicates the prediction time step.
[0104] During the training phase, the model parameters are optimized end-to-end using the training set. During the testing phase, the model's predictive performance is evaluated using metrics such as mean squared error, mean absolute error, and root mean square error, thereby verifying the effectiveness of the method of this invention in traffic flow prediction tasks.
[0105] To comprehensively evaluate the prediction accuracy and stability of the traffic flow prediction method described in this invention, the mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE), commonly used in regression prediction tasks, are used as evaluation indicators to assess the model's prediction performance. The calculation formulas are as follows:
[0106] (7)
[0107] (8)
[0108] (9)
[0109] Where n represents the total number of samples; Indicates the first The true value of each sample Indicates the first The predicted value for each sample.
[0110] Mean absolute error (MAE) is the average difference between the true and predicted values, and it can more intuitively judge the accuracy of the model. Generally, the smaller the MAE value, the higher the model accuracy. Mean absolute percentage error (MAPE) better reflects the relative error of the data and is more suitable for comparing different datasets or data of different magnitudes compared to mean absolute error. Root mean square error (RMSE) is easy to optimize and sensitive to large errors, which helps to better fit the data.
[0111] The prediction performance evaluation results of this invention and classic models such as STID, STEP, and STIDGCN under the same experimental conditions are shown in Table 1. The experimental results show that this invention outperforms the benchmark methods in terms of MAE, RMSE, and MAPE.
[0112] Table 1. Performance comparison of the method of this invention with existing models on the PEMS04 dataset.
[0113]
[0114] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling, characterized in that, include: Obtain raw traffic flow historical sequence data and construct a model input tensor that includes traffic observations, time index information, and spatial structure information; Multi-source spatiotemporal embedding encoding is performed on the model input tensor. The spatiotemporal prior embedding modulation module and the spectral domain structure embedding module are used to extract and enhance the node spatial prior information, periodic time prior information and graph structure prior information, respectively. These are then fused with time series embedding to construct a spatiotemporal joint representation. Inputting the spatiotemporal joint representation into a two-branch collaborative spatiotemporal augmentation network, the output traffic flow prediction results for future time moments include: Construct a dual-branch collaborative spatiotemporal augmentation network; Construct a static feature learning branch based on a residual multilayer perceptron; An interleaved spatiotemporal augmentation and dynamic graph learning branch is constructed, the branch including an FLP-Transformer interleaved augmentation coding block, a dynamic graph generation unit, and a dynamic graph convolution unit; The outputs of the static feature learning branch based on residual multilayer perceptron and the interleaved spatiotemporal enhancement and dynamic graph learning branches are fused, and the final traffic flow prediction result is generated through a regression mapping layer.
2. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 1, characterized in that, The specific components of constructing the model input tensor include: The traffic flow observations at each traffic node at historical moments are used to form the input flow tensor; Extract time index information from historical traffic flow data; the time index information includes time information and day of the week information. Obtain the node identification information and the adjacency matrix between nodes in the traffic network as spatial structure information; The flow observations, time index information, and spatial structure information are organized in a unified tensor form to construct the model input tensor.
3. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 2, characterized in that, Multi-source spatiotemporal embedding coding includes the following process: The historical traffic flow sequence is rearranged along the time dimension and the feature dimension, and then input into the time series embedding layer. The time series embedding representation is obtained through convolutional mapping. The spatiotemporal prior embedding modulation module extracts and enhances the node spatial prior information and the periodic time prior information. Specifically, learnable weight parameters are applied to the learnable node embedding to scale it, thereby obtaining the node spatial prior embedding. Based on the time index and weekday index corresponding to the last time of the historical sequence, the time embedding and weekday embedding are obtained by looking up tables, respectively. Dynamic weights are generated through the time weight network and weekday weight network, respectively, and the time embedding and weekday embedding are weighted and modulated to obtain the periodic time prior embedding. The graph structure prior information is extracted and enhanced through the spectral domain structure embedding module. Specifically, a graph Laplacian matrix is constructed based on a preset adjacency relation matrix, the first few orders of Laplacian feature vectors are extracted, and the spectral domain structure embedding representation is obtained through a mapping network. The time series embedding representation, node space prior embedding, periodic time prior embedding, and spectral domain structure embedding are spliced and fused along the feature dimension to obtain the spatiotemporal joint representation.
4. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 1, characterized in that, The static feature learning branch structure based on residual multilayer perceptron is as follows: The spatiotemporal joint representation is input into an encoder composed of stacked residual multilayer perceptrons; Each residual multilayer perceptron performs nonlinear mapping and local feature interaction learning on the fused high-dimensional spatiotemporal features; The static feature learning branch output is obtained by cascading and stacking.
5. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 1, characterized in that, The interleaved spatiotemporal augmentation and dynamic graph learning branch structure is as follows: By performing a dimensionality transformation on the spatiotemporal joint representation, a spatiotemporal sequence representation oriented towards node feature modeling is obtained; Construct multiple FLP-Transformer interleaved enhancement coding blocks. Each enhancement coding block includes a factorized linear projection module, a Transformer coding module, and a normalization module. In each augmented coding block, the input spatiotemporal sequence representation is first decomposed and linearly transformed using a factorized linear projection module, and the transformation result is then joined with the block input via a first residual connection. Subsequently, the features after the first residual connection are input into a Transformer coding module, which uses a multi-head self-attention mechanism to capture global dependencies, and the Transformer output is joined with its input via a second residual connection. Finally, the features processed alternately by the factorized linear projection module and the Transformer coding module are normalized, and the result of the current augmented coding block is output. Multiple enhanced coding blocks are stacked in hierarchical order to form an interleaved enhancement process of factorized linear projection and Transformer; The interleaved enhanced hidden features are input into the dynamic graph learning part to generate a dynamic topology and extract dynamic spatial dependency features, thus obtaining the output of the interleaved spatiotemporal enhancement and dynamic graph learning branches.
6. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 5, characterized in that, The factorized linear projection module includes an input mapping matrix, a latent space transformation matrix, and an output mapping matrix, and its processing includes: The input spatiotemporal features are mapped to the latent space to obtain the latent space state representation; A linear transformation is performed on the latent space state representation to obtain the transformed latent space features. The transformed latent space features are mapped back to the original feature space to obtain the factorized linear projection output.
7. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 5, characterized in that, The dynamic graph learning part consists of a dynamic graph generation unit and a dynamic graph convolution unit, and its processing includes: The hidden features after interleaved augmentation coding are input into the dynamic graph generation unit; An adaptive adjacency matrix between nodes is generated based on the similarity relationship between hidden features, and key related edges are retained through an adjacency filtering strategy to form a dynamic topology. The dynamic topology is input into the dynamic graph convolutional unit to perform graph convolution propagation on the hidden features; Multi-layer dynamic graph convolution is used to extract spatial relationships under dynamic topology layer by layer, and the graph convolution output is residually fused with the hidden features after interleaved augmentation coding to obtain augmented feature representation containing dynamic spatial dependencies.
8. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 1, characterized in that, Branch fusion and prediction output include the following steps: The static feature learning branch output based on residual multilayer perceptron is fused element-wise with the output of interleaved spatiotemporal augmentation and dynamic graph learning branches in the same feature space to obtain a fused feature representation. The fused feature representation is input into the regression mapping layer, and the hidden features are projected onto the output space corresponding to the target prediction stride through convolutional mapping. Output traffic flow forecasts for one or more future time points.
9. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 3, characterized in that, The time series embedding layer uses 1×1 convolution to map the rearranged historical traffic flow sequence to obtain the time series embedding representation.
10. The traffic flow prediction method based on dual-branch collaborative spatiotemporal enhancement and staggered feature modeling according to claim 7, characterized in that, The adjacency filtering strategy is a Top-k filtering strategy, which retains the top k most similar related edges of each node in the adaptive adjacency matrix to form a dynamic topology structure.