Traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transform

By employing multi-scale dynamic decomposition and spatiotemporal Transformer methods, traffic flow data is decomposed into trend and seasonal components. Multilayer perceptron and spatiotemporal Transformer are used for modeling, which solves the problems of prediction error accumulation and insufficient dynamic topology adaptability in existing methods, and achieves high-precision and robust traffic flow prediction.

CN121034085AActive Publication Date: 2025-11-28HUNAN NORMAL UNIVERSITY

Patent Information

Application Number
CN202511554144.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2025-11-28
Estimated Expiration
2045-10-29

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods struggle to effectively distinguish between short-term fluctuations and long-term trends, neglect non-Euclidean structural dependencies between traffic nodes, and are ill-suited to dynamic topological relationships, leading to accumulated prediction errors and insufficient modeling of complex spatiotemporal dependencies.

Method used

A multi-scale dynamic decomposition method is adopted to decompose traffic flow data into trend components and seasonal components. Multilayer perceptron and spatiotemporal Transformer are used for modeling respectively. The adaptive SwiGLU gating mechanism and unified spatiotemporal self-attention coding are combined to fuse global trend and seasonal feature representations to generate prediction results.

Benefits of technology

It significantly improves the accuracy and robustness of traffic flow prediction, effectively separates noise from signals, adapts to complex dynamic spatiotemporal dependencies, and enhances the accuracy and robustness of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121034085A_ABST
    Figure CN121034085A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic flow prediction method and system based on multi-scale dynamic decomposition and a space-time Transform. According to the method, firstly, an original traffic flow sequence is decomposed into trend components and seasonal components; then, modeling the trend components by adopting a multi-layer perceptron to capture global changes; and meanwhile, a space-time Transform is used for modeling seasonal components, and the architecture effectively extracts dynamic space-time dependence characteristics by integrating space-time adaptive embedding and an adaptive Switch GLU gating mechanism. And finally, fusing trend and seasonal feature representation to generate a prediction result. According to the method, noise is effectively separated through decomposition, linear enhancement space-time self-adaptive embedding, a self-adaptive Switch GLU gating mechanism and a unified space-time self-attention Transform architecture are integrated, the modeling capacity for complex space-time dependence is enhanced, prediction precision and robustness are remarkably improved, and the method can be widely applied to the field of intelligent traffic management and control.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of intelligent transportation systems, and particularly relates to a traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer. BACKGROUND

[0002] Traffic flow prediction, as a core component of intelligent transportation systems, plays a crucial role in optimizing road resource allocation, alleviating traffic congestion, and improving urban transportation efficiency. Accurate traffic prediction can provide key data support for traffic signal control, path dynamic planning, and congestion management strategies, thereby effectively improving road traffic efficiency, reducing delays, and improving overall traffic conditions.

[0003] However, traffic data contains complex spatio-temporal dependencies, presenting significant prediction challenges: short-term fluctuations (such as accidents, sudden weather changes) and long-term trends (such as holiday traffic surges, commuting routines) are intertwined; spatial heterogeneity (such as the difference in traffic flow between main roads and branch roads) coexists with dynamic topological evolution (such as construction rerouting, changing congestion propagation paths). Traditional statistical methods, such as historical inference (HI) and autoregressive integrated moving average (ARIMA) models, have good performance in time series prediction, but they are difficult to fully capture the non-linear characteristics and complex patterns in traffic data. Machine learning methods such as support vector machines (SVM) and K-nearest neighbors (KNN) have improved prediction accuracy to some extent, but they often ignore the non-Euclidean structural dependencies between traffic nodes and have limited ability to model fine-grained temporal effects and dynamic changes.

[0004] In recent years, deep learning-based models such as Graph WaveNet (GWNet) and Diffusion Convolution Recurrent Neural Network (DCRNN) have integrated spatio-temporal features with graph convolution technology, but they still rely on predefined static graph structures, making it difficult to adapt to the dynamic evolution of topological relationships in the traffic network. Some Transformer-based models such as GTS and PDFormer have performed well in traffic prediction, but they are still mostly based on static or preset graph structures, and have limited ability to model complex dynamic spatio-temporal dependencies. Recent research such as STID and STAEformer attempts to introduce identity embedding to adaptively capture spatio-temporal features, but still faces the problem of failing to effectively separate noise and signal and revealing the internal evolution law of traffic flow.

[0005] The existing methods mainly face the following bottlenecks: on the one hand, short-term fluctuations and long-term trends are intertwined, making it difficult for the model to distinguish between effective information and noise, and the prediction error is prone to accumulate over time; on the other hand, the propagation path of traffic flow and the correlation between nodes change dynamically over time, and show obvious multi-periodicity, how to effectively model such complex and evolving spatio-temporal dependencies is still a key problem to be solved in the current traffic prediction field SUMMARY

[0006] The purpose of the present application is to provide a traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer, to overcome the shortcomings of the prior art in noise sensitivity, dynamic topology adaptability and multi-period modeling, and to improve prediction accuracy and robustness. To solve the above problems existing in the prior art, effectively improve the road traffic efficiency, reduce the delay and improve the overall traffic condition.

[0007] In order to achieve the above purpose, the present application provides the following scheme:

[0008] The present application provides a traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer, comprising the following steps:

[0009] S1: obtaining the input original traffic flow time series data, using a multi-scale dynamic decomposition method to decompose the original traffic flow data into trend components and seasonal components ;

[0010] S2: using a multi-layer perception to model the trend components to obtain global trend feature representation ;

[0011] S3: using a space-time Transformer to model the seasonal components to extract their dynamic space-time dependence features to obtain seasonal feature representation ; the space-time Transformer integrates an embedding layer, a time and space self-attention mechanism, an adaptive SwiGLU gated feedforward module and a unified space-time self-attention encoding method;

[0012] S4: fusing the global trend feature representation and seasonal feature representation , and generating the final traffic flow prediction result through an output layer ;

[0013] Further, in S1, the input original traffic flow time series data is obtained, and a multi-scale dynamic decomposition method is used to decompose the original traffic flow data into trend components and seasonal components :

[0014] Specifically, first, the original data of the traffic flow input is subjected to a sliding average operation of different kernel sizes to obtain candidate trend items . Subsequently, the time dimension of these candidate trend items is compressed by time average pooling, and a learnable parameter matrix The implicit relationship between the model node dimension and the kernel scale is established. Next, the kernel scale dimension is... Normalization is used to generate dynamic weights, enabling adaptive fusion of multi-scale trend components. Finally, the dynamic weights are... With candidate trend items Perform channel-by-channel Hadamard products and weighted summation to generate the final trend term that integrates multi-scale information. The seasonal term can be obtained by subtracting the trend term from the original data. It can be formalized as:

[0015] In the above formula It is a moving average operation. =12 is the time step size. It is Hadamaji.

[0016] Furthermore, in S2, a multilayer perceptron is used to model the trend components to obtain a global trend feature representation. :

[0017] Specifically, a multilayer perceptron (MLP) structure consisting of three fully connected layers is used to obtain the predicted output of the trend term. This simple structure is sufficient to effectively capture trend changes while avoiding introducing excessive model complexity; it can be formulated as follows:

[0018] In the above formula For learnable weight matrix, This is the activation function.

[0019] Furthermore, in S3, the seasonal component is modeled using a spatiotemporal Transformer to extract its dynamic spatiotemporal dependency features, thus obtaining a seasonal feature representation. The spatiotemporal Transformer consists of three core components: an embedding layer, a spatiotemporal self-attention mechanism, and an adaptive SwiGLU gating mechanism. To enhance the interaction between temporal and spatial information, we integrate temporal and spatial self-attention within the same encoder structure to achieve unified spatiotemporal loop modeling. Specifically, this includes:

[0020] S3.1, Data Embedding Layer:

[0021] First, in order to retain seasonal items We map the raw feature information into feature embeddings using a linear layer. It can be formalized as:

[0022] where is the learnable weight matrix, is the bias vector.

[0023] Second, to model the periodicity in traffic flow, we design a dual embedding mechanism that combines the weekly pattern and the intra-day pattern. Specifically, we initialize two learnable embedding tables: the weekday embedding table and the timestamp embedding table . The weekday index and the intra-day timestamp data of a traffic time series are denoted as and , respectively, with the time range of . According to these indices, we extract the corresponding weekday embedding and the intra-day timestamp embedding from the embedding tables. By concatenation and broadcasting operations, we fuse the two to obtain the periodic embedding to capture the spatio-temporal representation of the weekly period and the intra-day fine-grained time pattern.

[0024] Considering the indistinguishability of samples in time and space, to enable the model to adaptively learn the temporal and spatial information of each node and represent more complex dynamic spatio-temporal features, we propose a linearly enhanced spatio-temporal adaptive embedding . Specifically, we first initialize a random embedding matrix , and then project it to a decoupled feature space through a linear layer to obtain the enhanced embedding , which improves the model's representation ability for complex spatio-temporal relationships. We model complex spatio-temporal relationships in a unified manner, rather than using predefined or dynamic adjacency matrices for spatial modeling

[0025] Finally, by concatenating the above embeddings along the feature dimension, we obtain the hidden spatio-temporal representation , as follows:

[0026] where means concatenation, and the hidden dimension = .

[0027] S3.2, Time and Space Self-Attention Mechanism Layer:

[0028] First, the hidden spatio-temporal representation given by the embedding layer is , where is the number of time steps, is the number of spatial nodes. We query, key, and value matrices in advance through the time Transformer layer, as follows:

[0029] where are learnable weight matrices. Then we compute the self-attention scores as:

[0030] where capture the temporal relationship in different spatial nodes. Finally, the output of the temporal self-attention layer is , which is computed as:

[0031] Similarly, we obtain the query, key, and value matrices through the spatial Transformer layer as follows:

[0032] where are learnable weight matrices. Then we compute the self-attention scores as:

[0033] where only focus on the spatial dimension, which is used to capture the spatial dependency between nodes. Finally, we obtain the output of the spatial self-attention layer as , which is computed as:

[0034] It is worth noting that we also apply layer normalization, residual connections, and the multi-head mechanism.

[0035] S3.3, Adaptive SwiGLU gated feed-forward layer:

[0036] We propose an Adaptive SwiGLU gated feed-forward layer to replace the FFN in vanilla transformer. It is a feed-forward unit that introduces a dynamic gating enhancement mechanism, aiming to improve the model's ability to capture effective signals in seasonal terms while effectively suppressing noise interference. First, let's assume that the input of this module is Z∈ We will input it through two independent linear transformations to generate a gating signal and a numerical vector, as follows:

[0037] where are learnable weight matrices, and the SiLU (Sigmoid Linear Unit) activation function is defined as:

[0038] The activation function has smoothness and nonlinearity, which helps to improve the expression ability of the model. Then, we introduce a learnable scalar parameter , dynamically adjusts the strength of the gate, and the gated output is input to the last linear layer after Dropout operation to obtain the final output , as shown below:

[0039] In the above formula, is a learnable weight matrix.

[0040] Further, in S4, the global trend feature representation and the seasonal feature representation are fused, and the final traffic flow prediction result is generated through the output layer :

[0041] Specifically, first, we fuse the trend item predicted by the multi-layer perception module and the seasonal item predicted by the ST-Transformer module to obtain , as shown below:

[0042] Finally, in order to adjust the amplitude and deviation of the prediction result, make it better adapt to the real data distribution and enhance the robustness and training stability of the model, we perform a simple linear transformation on , and then add a residual connection to obtain the final output of the model , as shown below:

[0043] In the above formula, is a learnable weight matrix.

[0044] In addition, the present application also provides a traffic flow prediction system based on multi-scale dynamic decomposition and space-time Transformer, which comprises a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the traffic flow prediction method based on multi-scale dynamic decomposition and space-time Transformer.

[0045] In addition, the present application also provides a computer readable storage medium, which stores a computer program or instructions, and the computer program or instructions are programmed or configured to execute the traffic flow prediction method based on multi-scale dynamic decomposition and space-time Transformer through a processor.

[0046] In addition, the application also provides a computer program product comprising a computer program or instructions programmed or configured to execute the traffic flow prediction method based on multi-scale dynamic decomposition and space-time Transformer by a processor

[0047] Compared with the prior art, the application mainly has the following advantages: the application comprises decoupling original traffic flow time series data into trend components and seasonal components by a multi-scale dynamic decomposition method, and modeling the trend components and the seasonal components by a multi-layer perceptron and a space-time Transformer respectively, and finally fusing output prediction results: obtaining input original traffic flow time series data; decomposing the original traffic flow data into trend components and seasonal components by a multi-scale dynamic decomposition method; modeling the trend components by a multi-layer perceptron to obtain global trend feature representation; modeling the seasonal components by a space-time Transformer to extract dynamic space-time dependence features thereof to obtain seasonal feature representation; and fusing the global trend feature representation and the seasonal feature representation to generate final traffic flow prediction results. The application effectively separates noise and signals by a multi-scale decomposition method, and significantly improves the modeling capability of complex dynamic space-time dependence in traffic flow by means of integrated linear enhanced space-time adaptive embedding, adaptive SwiGLU gate mechanism and unified space-time self-attention Transformer architecture, greatly improves the prediction accuracy and robustness, and can be applied to intelligent traffic control, dynamic path planning and urban traffic management and other fields. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 FIG. 1 is a basic flowchart of the method of the embodiment of the application;

[0049] Figure 2 FIG. 2 is an algorithm framework diagram of the traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer provided by the embodiment of the application;

[0050] Figure 3 FIG. 5 is a comparison of model performance in the PEMS03, PEMS04, PEMS07 and PEMS08 data sets in the embodiment of the application;

[0051] Figure 4 FIG. 8 is a prediction effect visualization diagram under the PEM08 data set in the embodiment of the application;

[0052] Figure 5 FIG. 9 is a prediction effect visualization diagram under the PEM08 data set in the embodiment of the application;

[0053] Figure 6 FIG. 10 is a prediction effect visualization diagram under the PEM08 data set in the embodiment of the application; DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0055] The core of the present application is to provide a traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer to solve the problems in the prior art.

[0056] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.

[0057] Figure 1 The basic flowchart of a traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer provided by the embodiments of the present application is shown in FIG. 1, which includes the following steps: Figure 1

[0058] S1: Obtain the input original traffic flow time series data, and decompose the original traffic flow data into trend components and seasonal components by using a multi-scale dynamic decomposition method.

[0059] S2: Model the trend components by using a multi-layer perception machine to obtain a global trend feature representation.

[0060] S3: Model the seasonal components by using a space-time Transformer to extract dynamic space-time dependent features thereof and obtain a seasonal feature representation; the space-time Transformer is integrated with an embedding layer, a time and space self-attention mechanism, an adaptive SwiGLU gated feedforward module and a unified space-time self-attention encoding method.

[0061] S4: Fuse the global trend feature representation and the seasonal feature representation, and generate a final traffic flow prediction result through an output layer.

[0062] Figure 2 ​​​​​​​​This invention provides a traffic flow prediction method and system algorithm framework based on multi-scale dynamic decomposition and spatiotemporal Transformer. The invention includes decoupling the original traffic flow time series data into trend and seasonal components using a multi-scale dynamic decomposition method, and modeling these components using a multilayer perceptron and a spatiotemporal Transformer respectively. The final prediction result is then fused and output. The process involves: acquiring the input original traffic flow time series data; decomposing the original traffic flow data into trend and seasonal components using a multi-scale dynamic decomposition method; modeling the trend component using a multilayer perceptron to obtain a global trend feature representation; modeling the seasonal component using a spatiotemporal Transformer to extract its dynamic spatiotemporal dependency features to obtain a seasonal feature representation; and fusing the global trend feature representation and the seasonal feature representation to generate the final traffic flow prediction result. This invention effectively separates noise and signal through a multi-scale decomposition method and significantly improves the modeling ability for complex dynamic spatiotemporal dependencies in traffic flow by leveraging a Transformer architecture that integrates linearly enhanced spatiotemporal adaptive embedding, adaptive SwiGLU gating mechanism, and unified spatiotemporal self-attention. This greatly improves prediction accuracy and robustness and can be applied to fields such as intelligent traffic control, dynamic path planning, and urban traffic management. The specific implementation steps are as follows:

[0063] In step S1 of this embodiment, the original traffic flow time series data is obtained, and the original traffic flow data is decomposed into trend components using a multi-scale dynamic decomposition method. With seasonal ingredients :

[0064] Specifically, the first step is to analyze the raw data of traffic flow input. Apply Apply moving average operations with different kernel sizes to obtain candidate trend terms. Subsequently, the time dimension of these candidate trend terms is compressed using temporal average pooling, and a learnable parameter matrix is ​​utilized. The implicit relationship between the model node dimension and the kernel scale is established. Next, the kernel scale dimension is... Normalization is used to generate dynamic weights, enabling adaptive fusion of multi-scale trend components. Finally, the dynamic weights are... With candidate trend items Perform channel-by-channel Hadamard products and weighted summation to generate the final trend term that integrates multi-scale information. The seasonal term can be obtained by subtracting the trend term from the original data. It can be formalized as:

[0065] In the above formula It is a moving average operation. =12 is the time step size. It is Hadamaji.

[0066] In step S2 of this embodiment, a multilayer perceptron is used to model the trend components to obtain a global trend feature representation. ;

[0067] Specifically, a multilayer perceptron (MLP) structure consisting of three fully connected layers is used to obtain the predicted output of the trend term. This simple structure is sufficient to effectively capture trend changes while avoiding introducing excessive model complexity; it can be formulated as follows:

[0068] In the above formula For learnable weight matrix, This is the activation function.

[0069] In step S3 of this embodiment, the seasonal component is modeled using a spatiotemporal Transformer to extract its dynamic spatiotemporal dependency features, thereby obtaining a seasonal feature representation. The spatiotemporal Transformer consists of three core components: an embedding layer, a spatiotemporal self-attention mechanism, and an adaptive SwiGLU gating mechanism. To enhance the interaction between temporal and spatial information, we integrate temporal and spatial self-attention within the same encoder structure to achieve unified spatiotemporal loop modeling. Specifically, this includes:

[0070] S3.1, Data Embedding Layer:

[0071] First, in order to retain seasonal items We map the raw feature information into feature embeddings using a linear layer. It can be formalized as:

[0072] In the above formula For learnable weight matrix, This is the bias vector.

[0073] Second, to model the periodic characteristics of traffic flow, we designed a dual embedding mechanism combining weekly cycles and intraday patterns. Specifically, we initialized two learnable embedding tables: a weekday embedding table and a weekday embedding table. and timestamp embedded table The weekday index and intraday timestamp data for traffic time series are represented as follows: and Its time range is Based on these indexes, we extract the corresponding weekday embeddings from the embedding table. and daily timestamp embedding . By concatenation and broadcast operation, both are fused to get periodic embedding to capture the spatio-temporal representation of weekly periodicity and intra-daily fine-grained temporal patterns.

[0074] Considering the indistinguishability of samples in time and space, to enable the model to adaptively learn the temporal and spatial information of each node and represent more complex dynamic spatio-temporal features, we propose a linearly enhanced spatio-temporal adaptive embedding . Specifically, we first initialize a random embedding matrix , and then project it to a decoupled feature space through a linear layer to obtain an enhanced embedding , which improves the model's representation ability for complex spatio-temporal relationships. We model complex spatio-temporal relationships in a unified way rather than using pre-defined or dynamic adjacency matrices for spatial modeling

[0075] Finally, by concatenating the above embedding along the feature dimension, we get the hidden spatio-temporal representation , which is as follows:

[0076] In the above equation, means concatenation, and the hidden dimension = .

[0077] S3.2, temporal and spatial self-attention mechanism layer:

[0078] First, the hidden spatio-temporal representation given by the embedding layer is , where is the number of time steps, is the number of spatial nodes. We obtain the query, key, and value matrices by the temporal Transformer layer as follows:

[0079] In the above equation, is the learnable weight matrix. Then we compute the self-attention score as:

[0080] In the above equation, captures the temporal relationship among different spatial nodes. Finally, the output of the temporal self-attention layer is , which is computed as:

[0081] Similarly, we obtain the query, key, and value matrices by the spatial Transformer layer as follows:

[0082] in the above equation is a learnable weight matrix. Then we compute the self-attention score as:

[0083] in the above equation only focus on the spatial dimension, which is used to capture the spatial dependency between nodes. Finally, we get the output of the spatial self-attention layer , which is shown as follows:

[0084] It is worth noting that we also apply layer normalization, residual connection and multi-head mechanism.

[0085] S3.3, adaptive SwiGLU gated feed-forward layer:

[0086] We propose an adaptive SwiGLU gated feed-forward layer to replace the FFN in vanilla transformer. It is a kind of feed-forward unit that introduces a dynamic gating enhancement mechanism, aiming to improve the model's ability to capture effective signals in seasonal terms while effectively suppressing noise interference. First, let the input of this module be Z∈ We will input it through two independent linear transformations to generate a gating signal and a numerical vector, as shown below:

[0087] in the above equation is a learnable weight matrix, and the SiLU (Sigmoid Linear Unit) activation function is defined as:

[0088] This activation function has both smoothness and nonlinearity, which helps to improve the model's expression ability. Then we introduce a learnable scalar parameter to dynamically adjust the gating strength. After the gating output is subjected to a Dropout operation, it is input to the last linear layer to obtain the final output , which is shown as follows:

[0089] in the above equation is a learnable weight matrix.

[0090] In step S4 of this embodiment, the global trend feature representation and the seasonal feature representation and generate the final traffic flow prediction result through the output layer :

[0091] Specifically, first, we fuse the trend term predicted by the multi-layer perception module and the seasonal term predicted by the ST-Transformer module to obtain , which is specifically shown as follows:

[0092] Finally, in order to adjust the amplitude and deviation of the prediction result, so that it better fits the real data distribution and enhances the robustness and training stability of the model, we perform a simple linear transformation on , and then add a residual connection to obtain the final output of the model , which is specifically shown as follows:

[0093] In the above formula, is a learnable weight matrix.

[0094] In order to verify the traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer of the embodiment, the data sets used in the experiment in the embodiment are PEMS data sets, specifically including PEMS03 data set, PEMS04 data set, PEMS07 data set and PEMS08 data set, and the evaluation indexes used are mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) Figure 3 are the performance comparisons of different models on PEMS03 data set, PEMS04 data set, PEMS07 data set and PEMS08 data set in the embodiment, respectively.

[0095] As can be seen from Figure 3 , the traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer of the embodiment are superior to existing traffic flow prediction methods in terms of performance in all aspects;

[0096] In order to further illustrate the effectiveness of the traffic flow prediction method and system based on multi-scale dynamic decomposition and space-time Transformer of the embodiment, in order to more deeply understand the performance of the model, we perform a visual analysis on the true value and the predicted value. First, we randomly select node 012 from the PeMS08 data set, and draw the actual flow and predicted flow curves within 12 hours. As shown in FIG. 4, there is a long-term downward trend on top of the obvious seasonal fluctuations. The experimental results show that our model can accurately capture the periodic changes and overall downward trend, effectively simulating the internal dynamics of traffic flow.

[0097] Secondly, we select two nodes 054 and 107 from the PeMS08 dataset, whose seasonal fluctuations are particularly significant and large in amplitude, to show the prediction curves of STAEformer and our model respectively. As shown in Figures 5 and 6, MDDSTFormer performs better in signal and noise separation and reveals the underlying patterns of traffic flow more truly.

[0098] To sum up, the traffic flow prediction method and system algorithm framework based on multi-scale dynamic decomposition and space-time Transformer of the embodiment, the application comprises: decoupling the original traffic flow time series data into trend components and seasonal components by using a multi-scale dynamic decomposition method, and modeling the trend components and seasonal components by using a multilayer perceptron and a space-time Transformer respectively, and finally fusing and outputting a prediction result: obtaining input original traffic flow time series data; decomposing the original traffic flow data into trend components and seasonal components by using a multi-scale dynamic decomposition method; modeling the trend components by using a multilayer perceptron to obtain global trend feature representation; modeling the seasonal components by using a space-time Transformer to extract dynamic space-time dependence features thereof and obtain seasonal feature representation; and fusing the global trend feature representation and the seasonal feature representation to generate a final traffic flow prediction result. The application effectively separates noise and signal by using a multi-scale decomposition dynamic method, and significantly improves the modeling capability for complex dynamic space-time dependence in traffic flow by means of an integrated linear enhanced space-time adaptive embedding, an adaptive SwiGLU gate mechanism and a unified space-time self-attention Transformer architecture, greatly improves the prediction accuracy and robustness, and can be applied to intelligent traffic control, dynamic path planning and urban traffic management and other fields.

[0099] In addition, the application also provides a traffic flow prediction system based on multi-scale dynamic decomposition and space-time Transformer, which comprises a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the traffic flow prediction method based on multi-scale dynamic decomposition and space-time Transformer.

[0100] In addition, the application also provides a computer readable storage medium, which stores a computer program or instructions, and the computer program or instructions are programmed or configured to execute the traffic flow prediction method based on multi-scale dynamic decomposition and space-time Transformer by means of a processor.

[0101] In addition, the application also provides a computer program product, which comprises a computer program or instructions, and the computer program or instructions are programmed or configured to execute the traffic flow prediction method based on multi-scale dynamic decomposition and space-time Transformer by means of a processor

[0102] Those skilled in the art will appreciate that embodiments of the present application can be readily used as software, hardware, or a combination of software and hardware. In a software embodiment, the methods can be tangibly embodied in a machine-readable storage medium having stored thereon instructions that can be used to program a processing system to perform the methods. The machine-readable storage medium can be magnetic (e.g., magnetic disks), optical (e.g., optical discs), electrical (e.g., electrical ROM, EEPROM, etc.), magneto-optical (e.g., magneto-optical discs), semiconductor (e.g., solid state memory), etc. The instructions may, in some embodiments, be stored in the memory 110 and implemented entirely in software such that the instructions are executed by the processor(s) 112 to implement the functions described herein. In some embodiments, the instructions can be executed by the processor(s) 112 to cause the machine to perform the functions described herein. Figure 1 one or more functions specified by any one or more of the flow or flows and / or blocks Figure 1 one or more functions specified by any one or more of the flow or flows and / or blocks Figure 1 one or more functions specified by any one or more of the flow or flows and / or blocks Figure 1 one or more functions specified by any one or more of the flow or flows and / or blocks Figure 1 one or more functions specified by any one or more of the flow or flows and / or blocks Figure 1 one or more functions specified by any one or more of the flow or flows and / or blocks

[0103] The above description is only preferred embodiments of the application. The protection scope of the application is not limited to the above-mentioned embodiments. Any technical scheme falling within the idea of the application should be considered as falling within the protection scope of the application. It should be noted that some improvements and refinements made by those skilled in the art without departing from the principles of the application should also be considered as falling within the protection scope of the application.

Claims

1. A traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer, characterized in that, This includes using a pre-trained multi-scale dynamic decomposition and spatiotemporal Transformer model to obtain output traffic flow prediction results from raw traffic flow time series data. The multi-scale dynamic decomposition and spatiotemporal Transformer model generates prediction results through the following steps: S1: Obtain the input raw traffic flow time series data, and use a multi-scale dynamic decomposition method to decompose the raw traffic flow data into trend components. With seasonal ingredients ; S2: Model the trend components using a multilayer perceptron to obtain a global trend feature representation. ; S3: Model the seasonal components using a spatiotemporal Transformer, extract their dynamic spatiotemporal dependency features, and obtain the seasonal feature representation. The spatiotemporal Transformer integrates an embedding layer, temporal and spatial self-attention mechanisms, an adaptive SwiGLU gated feedforward module, and a unified spatiotemporal self-attention coding method. S4: Integrate the global trend feature representation Seasonal characteristics The final traffic flow prediction result is generated through the output layer. .

2. The traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer according to claim 1, characterized in that, In S1, the original traffic flow time series data is acquired, and the original traffic flow data is decomposed into trend components using a multi-scale dynamic decomposition method. With seasonal ingredients : S1.1, Multi-scale dynamic decomposition method: First, the raw data of traffic flow input. Apply Apply moving average operations with different kernel sizes to obtain candidate trend terms. Subsequently, the time dimension of these candidate trend terms is compressed using temporal average pooling, and a learnable parameter matrix is ​​utilized. Model the implicit relationship between the node dimension and the kernel scale; then, perform [further steps] on the kernel scale dimension. Normalization is used to generate dynamic weights, enabling adaptive fusion of multi-scale trend components; finally, the dynamic weights are... With candidate trend items Perform channel-by-channel Hadamard products and weighted summation to generate the final trend term that integrates multi-scale information. ; The seasonal term can be obtained by subtracting the trend term from the original data. .

3. The traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer according to claim 1, characterized in that, In S2, a multilayer perceptron is used to model the trend components to obtain a global trend feature representation. : S2.1 employs a multilayer perceptron structure consisting of three fully connected layers to obtain the predicted output of the trend term. This simple structure is sufficient to effectively capture trend changes while avoiding the introduction of excessive model complexity.

4. The traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer according to claim 1, characterized in that, In S3, the seasonal components are modeled using a spatiotemporal Transformer to extract their dynamic spatiotemporal dependency features, thus obtaining a seasonal feature representation. The spatiotemporal Transformer integrates an embedding layer, temporal and spatial self-attention mechanisms, an adaptive SwiGLU gated feedforward module, and a unified spatiotemporal self-attention coding method, specifically including: S3.1, Embedding layer fusion mechanism to construct hidden spatiotemporal representation: First, the seasonal term is mapped to feature embeddings through a linear layer. To preserve the original feature information; secondly, a dual embedding mechanism combining periodic and intraday patterns is designed, extracting periodic features through a learnable weekday embedding table and a timestamp embedding table and fusing them into a single embedding. Furthermore, a linearly enhanced spatiotemporal adaptive embedding is proposed. By initializing a random embedding matrix and projecting it through a linear layer, the model can adaptively learn the spatiotemporal information of nodes and represent complex dynamic features. Finally, by concatenating the above embeddings along the feature dimension, a unified hidden spatiotemporal representation is formed. This allows for the effective modeling of complex spatiotemporal relationships without relying on predefined graph structures; S3.2, the spatiotemporal self-attention mechanism layer, is used to capture complex temporal and spatial dependencies from the hidden spatiotemporal representation. This layer analyzes the dynamic correlation between different time steps through the temporal self-attention module, effectively identifying long-term and short-term temporal patterns in traffic flow. At the same time, the spatial self-attention module automatically learns the global spatial correlation between nodes without relying on a predefined graph structure. Both modules adopt layer normalization, residual connections, and multi-head mechanisms to enhance training stability and representational ability, and finally output an enhanced representation that integrates spatiotemporal features, providing key information support for subsequent predictions. S3.3, the adaptive SwiGLU-gated feedforward layer, replaces the standard feedforward network in the traditional Transformer. By introducing a dynamic gating mechanism, it enhances the model's ability to extract effective information from seasonal components and suppress noise. This module first uses the SiLU activation function and linear transformation to generate gating signals and numerical vectors, respectively, and then uses learnable scalar parameters to dynamically adjust the gating strength, thereby flexibly controlling the flow of information. Finally, the enhanced feature representation is output through Dropout and linear projection, which effectively improves the model's ability to express complex traffic time series patterns and its robustness.

5. The traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer according to claim 1, characterized in that, In S4, the global trend feature representation is fused. Seasonal characteristics The final traffic flow prediction result is generated through the output layer. ; S4.1, the feature fusion and output layer, is used to integrate the trend prediction and seasonal prediction results and generate the final traffic flow prediction. This module first adds the trend term output by the multilayer perceptron and the seasonal term output by the spatiotemporal Transformer directly to achieve preliminary fusion of multi-scale features. Then, through a linear transformation layer with residual connections, the magnitude and bias of the prediction results are dynamically adjusted to better adapt to the real data distribution and effectively improve the accuracy, robustness and training stability of the model output.

6. A traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer, comprising interconnected microprocessors and memory, characterized in that, The microprocessor is programmed or configured to execute the traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer as described in any one of claims 1 to 5.

7. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer as described in any one of claims 1 to 5.

8. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the traffic flow prediction method based on multi-scale dynamic decomposition and spatiotemporal Transformer as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Power risk prediction method based on lama2 big language model

    CN118313657A

  • WSN anomaly detection method fusing time-frequency characteristics and space-time correlation

    CN118890626A

  • Traffic flow prediction method based on space-time decomposition and attention mechanism

    CN119479288A

  • High-speed traffic flow prediction method based on long-short period Transform fusion trend and seasonal characteristics

    CN119540887A

  • Transform-based traffic flow prediction method and device capable of sensing local-global time-space relationship

    CN119990191A

Cited By

  • Traffic flow prediction method, system and equipment based on neural component decomposition and dynamic adaptive fusion

    CN121260013A

  • Traffic flow prediction method, system and device based on neural component decomposition and dynamic adaptive fusion

    CN121260013B

  • Long-term power system load prediction method and system based on multi-scale decomposition fusion

    CN121301820A

  • Industrial control anomaly detection method and system based on dual-path noise adjustment

    CN121523311A

  • Computer science network traffic prediction method and system based on big data

    CN122069117A