Long-term traffic flow prediction method and system based on frequency domain decomposition and time series modeling
By employing frequency domain decomposition and time series modeling methods, and utilizing learnable wavelet transform and dynamic weight controllers, the problem of multi-scale spatiotemporal feature fusion in long-term traffic flow forecasting was solved, achieving efficient and accurate forecasting results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG JIAOTONG UNIV
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies struggle to adaptively capture and fuse multi-scale spatiotemporal features of traffic flow in long-term traffic flow forecasting, making it difficult to achieve both forecast accuracy and efficiency.
By employing learnable wavelet transform, dynamic weight controller, bidirectional selective state space modeling, and frequency interactive attention, multi-scale feature extraction and fusion of traffic flow data are achieved through frequency domain decomposition and temporal modeling.
It significantly improves the accuracy and efficiency of long-term traffic flow forecasting, and can adaptively adjust the contribution of different frequency components, thereby enhancing the robustness and adaptability of the model.
Smart Images

Figure CN121354357B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent transportation, in particular to a long-term traffic flow prediction method and system based on frequency domain decomposition and time series modeling. BACKGROUND
[0002] With the acceleration of urbanization and the continuous growth of motor vehicle ownership, traffic congestion has become an important factor restricting the sustainable development of cities. Accurate traffic flow prediction is a core component of the intelligent transportation system (ITS) and is of great significance for traffic management decision-making, path planning optimization, congestion warning, etc. According to the different prediction time ranges, traffic flow prediction can be divided into short-term prediction (5-30 minutes), medium-term prediction (30 minutes-1 hour) and long-term prediction (1-8 hours). Among them, long-term traffic flow prediction (1-8 hours) has become a research hotspot due to its important application value in traffic planning, emergency management and travel decision-making, but it also faces unique challenges: traffic flow data has long-range dependence, multi-scale periodicity (such as daily cycle, weekly cycle) and complex nonlinearity, which puts high requirements on the representation and computational ability of the prediction model.
[0003] Currently, prediction methods based on deep learning, such as Transformer, perform well in sequence modeling, but the high computational complexity of its self-attention mechanism restricts its application efficiency in long sequence prediction. Emerging state space models (SSM) can handle sequences with linear complexity, but lack targeted design for traffic flow data characteristics. The bottleneck of the prior art is that the feature extraction and fusion strategy is often fixed or empirical, which is difficult to adaptively capture and fuse the multi-scale spatio-temporal features of traffic flow, resulting in difficulty in achieving accuracy and efficiency in long-term prediction. SUMMARY
[0004] In order to solve the technical problems of fixed feature extraction and fusion strategy and difficulty in adaptively capturing multi-scale spatio-temporal characteristics of traffic flow in the background art, the present application introduces the technical features of learnable wavelet transform, dynamic weight controller, bidirectional selective state space modeling and frequency interaction attention, etc. to provide a long-term traffic flow prediction method and system based on frequency domain decomposition and time series modeling, which realizes accurate and efficient prediction of complex traffic patterns.
[0005] To achieve the above purpose, the first aspect of the present application provides a long-term traffic flow prediction method based on frequency domain decomposition and time series modeling, comprising:
[0006] Obtaining historical traffic flow data of N monitoring nodes in the to-be-predicted road section or road network;
[0007] preprocessing the historical traffic flow data to obtain standardized traffic flow data wherein B is batch size, T is historical observation time window length, N is the number of monitoring nodes, and 1 represents a single traffic flow feature dimension;
[0008] inputting the standardized traffic flow data X into a wavelet transform module comprising a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features wherein D is a hidden feature dimension;
[0009] inputting the multi-scale wavelet fusion features into a spatial feature extraction module comprising a depth separable convolution layer and a convolution dynamic weight controller to obtain enhanced convolution features ;
[0010] inputting the enhanced convolution features into a bidirectional selective state space model to obtain bidirectional time sequence features that fuse forward and reverse time sequence dependencies ∈ ;
[0011] inputting the bidirectional time sequence features into a frequency interaction attention module for cross-band feature fusion to obtain prediction features ;
[0012] generating a traffic flow prediction result for a specified time length in the future according to the prediction features .
[0013] Further, the preprocessing the historical traffic flow data to obtain standardized traffic flow data comprises:
[0014] performing data cleaning on the historical traffic flow data, including filling missing values and smoothing abnormal values;
[0015] reshaping the cleaned data according to a preset time window T and node dimension N;
[0016] independently calculating the mean μ and standard deviation σ of the historical data of each sensor node, and performing Z-score standardization on the data of the node using the mean μ and standard deviation σ to obtain the standardized traffic flow data .
[0017] Further, the inputting the standardized traffic flow data into a wavelet transform module comprising a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features comprises:
[0018] The standardized traffic flow data is input into a learnable wavelet transform layer, recursively decomposed through a multi-level parameterized convolution filter to obtain low-frequency components, medium-frequency components and high-frequency components respectively;
[0019] The low-frequency components, medium-frequency components and high-frequency components are respectively input into a Flash Attention mechanism for feature enhancement to obtain enhanced low-frequency features for representing long-term trends and daily, weekly changes of traffic flow , medium-frequency features for representing intraday periodic fluctuations of traffic flow , and high-frequency features for representing short-term random fluctuations and sudden abnormalities of traffic flow ;
[0020] The enhanced low-frequency features, medium-frequency features and high-frequency features are input into a wavelet dynamic weight controller to generate corresponding low-frequency fusion weights , medium-frequency fusion weights , and high-frequency fusion weights ;
[0021] According to the low-frequency fusion weights, medium-frequency fusion weights and high-frequency fusion weights, the enhanced low-frequency features, medium-frequency features and high-frequency features are weighted fused and spliced to obtain the multi-scale wavelet fusion features
[0022] , wherein represents element-wise multiplication.
[0023] Further, the multi-scale wavelet fusion features are input into a spatial feature extraction module comprising a depth separable convolution layer and a convolution dynamic weight controller to obtain enhanced convolution features, including:
[0024] The multi-scale wavelet fusion features are input into the depth separable convolution layer; wherein the depth separable convolution layer shares depth convolution parameters for low-frequency, medium-frequency and high-frequency components in the input multi-scale wavelet fusion features, and uses independent point-by-point convolution parameters for each component for channel fusion to obtain low-frequency spatial features , medium-frequency spatial features , and high-frequency spatial features ;
[0025] Each frequency band feature processed by the depth separable convolution layer is input into a convolution dynamic weight controller to generate corresponding low-frequency convolution weights , medium-frequency convolution weights , and high-frequency convolution weights ;
[0026] According to the low-frequency convolution weight, the medium-frequency convolution weight and the high-frequency convolution weight, each frequency band feature is weighted, fused and spliced to obtain the enhanced convolution feature .
[0027] Further, the enhanced convolution feature is input into a bidirectional selective state space model to obtain a bidirectional time sequence feature fused with forward and reverse time sequence dependencies, including:
[0028] The enhanced convolution feature is respectively input into a forward Mamba block and a reverse Mamba block;
[0029] Through the forward Mamba block, the enhanced convolution feature is processed in time order by using a selective state space equation to obtain a forward time sequence feature .
[0030] Through the reverse Mamba block, the enhanced convolution feature is processed in reverse order by using a selective state space equation to obtain a reverse time sequence feature .
[0031] The forward time sequence feature and the reverse time sequence feature are dynamically weighted and fused through a gating fusion mechanism to obtain the bidirectional time sequence feature , wherein, is an adaptive fusion weight obtained by learning.
[0032] Further, the bidirectional time sequence feature is input into a frequency interaction attention module for cross-frequency band feature fusion to obtain a prediction feature, including:
[0033] The bidirectional time sequence feature is decomposed into a low-frequency representation , a medium-frequency representation , and a high-frequency representation . ;
[0034] The low-frequency representation, the medium-frequency representation and the high-frequency representation are spliced in the feature dimension to form a multi-frequency joint representation;
[0035] The multi-frequency joint representation is projected in the feature dimension to obtain a frequency feature of a uniform dimension;
[0036] A multi-head self-attention mechanism is applied to the frequency feature of the uniform dimension to calculate the interaction relationship between different frequency components to obtain an attention enhanced feature;
[0037] The attention enhanced feature is processed by a sublayer including a residual connection and a feedforward network to output the prediction feature .
[0038] The second aspect of the present application provides a long-term traffic flow prediction system based on frequency domain decomposition and time series modeling, comprising:
[0039] a data acquisition unit configured to acquire historical traffic flow data of N monitoring nodes in a road section or road network to be predicted;
[0040] a preprocessing unit configured to preprocess the historical traffic flow data to obtain standardized traffic flow data , wherein B is the batch size, T is the length of the historical observation time window, N is the number of monitoring nodes, and 1 represents a single traffic flow feature dimension;
[0041] a multi-scale frequency domain decomposition unit configured to input the standardized traffic flow data X into a wavelet transform module comprising a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features , wherein D is the hidden feature dimension;
[0042] a spatial feature extraction unit configured to input the multi-scale wavelet fusion features into a spatial feature extraction module comprising a depth separable convolution layer and a convolution dynamic weight controller to obtain enhanced convolution features ;
[0043] a bidirectional time series modeling unit configured to input the enhanced convolution features into a bidirectional selective state space model to obtain bidirectional time series features that fuse forward and reverse time series dependencies ;
[0044] a cross-frequency band feature fusion unit configured to input the bidirectional time series features into a frequency interaction attention module for cross-frequency band feature fusion to obtain prediction features ;
[0045] a prediction unit configured to generate traffic flow prediction results for a specified time length in the future according to the prediction features .
[0046] The third aspect of the present application provides an electronic device comprising a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor implements the steps of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling according to the first aspect of the present application when executing the program.
[0047] The fourth aspect of the present application provides a computer readable storage medium having a program stored thereon, wherein the program is executed by a processor to implement the steps of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling according to the first aspect of the present application.
[0048] The fifth aspect of the present application provides a computer program product comprising software code, wherein the programs in the software code perform the steps in the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling according to the first aspect of the present application.
[0049] Compared with the prior art, the long-term traffic flow prediction method and system based on frequency domain decomposition and time series modeling provided by the present application has the following beneficial effects:
[0050] (1) The learnable wavelet transform layer provided by the present application replaces the fixed wavelet basis with a parameterized neural network, which can learn the optimal frequency domain decomposition mode end-to-end according to the input data. This adaptive adjustment of the decomposition strategy can more accurately strip out the trend (low frequency), periodic (medium frequency) and fluctuation (high frequency) components in the traffic flow, realizing the transition from fixed empirical decomposition to automatic learning of the optimal representation under different scales without manual setting of the decomposition parameters, thereby significantly improving the discriminability of feature extraction and the prediction accuracy.
[0051] (2) The present application adopts a bidirectional selective state space model (bidirectional Mamba) to perform forward and reverse time series modeling using the selective state space mechanism of its linear complexity. This mechanism dynamically filters the redundant part of the historical information through a learnable selection matrix, and integrates the past and future context through a gating mechanism, realizing the selective key information retention and fusion while efficiently processing long sequences, effectively improving the time series dependence capturing ability and computational efficiency of the model.
[0052] (3) The present application adopts a wavelet dynamic weight controller and a convolution dynamic weight controller to dynamically generate the fusion weights of each frequency component by analyzing the global characteristics of the input data. This dynamic weight mechanism enables the model to adaptively adjust the contribution of different frequency components (such as trend, periodicity, and noise) in the final prediction according to the specific traffic conditions (such as off-peak and peak periods), realizing the transition from static fusion to dynamic adaptive fusion, thereby enhancing the robustness and adaptability of the model to complex and variable traffic patterns. BRIEF DESCRIPTION OF DRAWINGS
[0053] The accompanying drawings, which form a part of this disclosure, are included to provide a further understanding of the disclosure, illustrative embodiments of the disclosure, and explanations of the disclosure intended to explain, not to limit, the present disclosure.
[0054] Figure 1 The flowchart of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling provided for the first embodiment of the present application.
[0055] Figure 2A bidirectional Mamba model structure diagram of the long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective time series modeling is provided for the first embodiment of the present application.
[0056] Figure 3 A dynamic weight generator structure diagram of the long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective time series modeling is provided for the first embodiment of the present application.
[0057] Figure 4 A frequency interaction attention mechanism flow chart of the long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective time series modeling is provided for the first embodiment of the present application.
[0058] Figure 5 A model structure diagram of the long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective time series modeling is provided for the first embodiment of the present application.
[0059] Figure 6 An architecture diagram of the long-term traffic flow prediction system based on frequency domain decomposition and time series modeling is provided for the second embodiment of the present application. DETAILED DESCRIPTION
[0060] It should be noted that the following detailed description is merely exemplary in nature and is intended to provide further description of the present application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0061] It is to be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments consistent with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.
[0062] The embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0063] All data acquisition of the present embodiment is based on compliance with laws and regulations and user consent, and legal application of data.
[0064] Embodiment one
[0065] As Figure 1 , the present embodiment provides a long-term traffic flow prediction method based on frequency domain decomposition and time series modeling, comprising:
[0066] obtain historical traffic flow data of N monitoring nodes in a road section or road network to be predicted;
[0067] preprocess the historical traffic flow data to obtain standardized traffic flow data , wherein B is batch size, T is the length of the historical observation time window, N is the number of monitoring nodes, and 1 represents a single traffic flow feature dimension;
[0068] input the standardized traffic flow data X into a wavelet transform module comprising a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features , wherein D is the hidden feature dimension;
[0069] input the multi-scale wavelet fusion features into a spatial feature extraction module comprising a depth separable convolution layer and a convolution dynamic weight controller to obtain enhanced convolution features ;
[0070] input the enhanced convolution features into a bidirectional selective state space model to obtain bidirectional time sequence features that fuse forward and reverse time sequence dependencies ∈ ;
[0071] input the bidirectional time sequence features into a frequency interaction attention module for cross-band feature fusion to obtain prediction features ;
[0072] generate traffic flow prediction results for a specified time length in the future according to the prediction features .
[0073] Specifically, the preprocessing of the historical traffic flow data to obtain standardized traffic flow data comprises:
[0074] data cleaning of the historical traffic flow data, including filling of missing values and smoothing of abnormal values;
[0075] reshaping the cleaned data according to a preset time window T and node dimension N;
[0076] independently calculating the mean μ and standard deviation σ of the historical data of each sensor node, and performing Z-score standardization on the data of the node using the mean μ and standard deviation σ to obtain the standardized traffic flow data .
[0077] The original heterogeneous and noisy sensor data is transformed into regular and comparable tensor form through three steps of data cleaning, reshaping and node-independent standardization. Among them, node-independent standardization preserves the local traffic characteristic distribution of different sensor nodes, avoiding the problem that global standardization may eliminate the differences between nodes. The data quality and feature alignment effect are improved, laying a data foundation for stable training and effective feature extraction of subsequent models.
[0078] Specifically, the standardized traffic flow data is input into a wavelet transform module including a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features, including:
[0079] The standardized traffic flow data is input into the learnable wavelet transform layer to perform recursive decomposition through a multi-level parameterized convolution filter to obtain low-frequency components, medium-frequency components and high-frequency components, respectively;
[0080] The low-frequency components, medium-frequency components and high-frequency components are input into a Flash Attention mechanism for feature enhancement to obtain enhanced low-frequency features for representing long-term trends and daily and weekly periodic changes of traffic flow , medium-frequency features for representing intra-day periodic fluctuations of traffic flow , and high-frequency features for representing short-term random fluctuations and sudden abnormalities of traffic flow ;
[0081] The enhanced low-frequency features, medium-frequency features and high-frequency features are input into a wavelet dynamic weight controller to generate corresponding low-frequency fusion weights , medium-frequency fusion weights , and high-frequency fusion weights ;
[0082] According to the low-frequency fusion weights, medium-frequency fusion weights and high-frequency fusion weights, the enhanced low-frequency features, medium-frequency features and high-frequency features are weighted and fused and spliced to obtain the multi-scale wavelet fusion features
[0083] where ⊙ represents element-wise multiplication.
[0084] The learnable wavelet transform layer optimizes the convolution filter parameters through gradient backpropagation, adaptively learns the frequency domain decomposition basis that best matches the traffic flow data, and solves the poor adaptability of the fixed wavelet basis. The Flash Attention mechanism models the long-range dependencies within each frequency band feature, enhancing the feature representation capability of each frequency band. The wavelet dynamic weight controller analyzes and generates the fusion weights of each frequency band based on the global characteristics of the input data through a small neural network (such as a multi-layer perceptron), achieving adaptive fusion of the importance of each frequency band according to the current traffic mode.
[0085] Specifically, the multi-scale wavelet fusion feature is input into a spatial feature extraction module containing a depth separable convolution layer and a convolution dynamic weight controller to obtain enhanced convolution features, including:
[0086] The multi-scale wavelet fusion feature is input into a depth separable convolution layer; wherein the depth separable convolution layer shares depth convolution parameters for low, medium, and high frequency components in the input multi-scale wavelet fusion feature, and uses independent point-by-point convolution parameters for each component for channel fusion to obtain low frequency spatial features , medium frequency spatial features , and high frequency spatial features .
[0087] Each frequency band feature processed by the depth separable convolution layer is input into a convolution dynamic weight controller to generate corresponding low frequency convolution weights , medium frequency convolution weights , and high frequency convolution weights .
[0088] According to the low frequency convolution weights, medium frequency convolution weights, and high frequency convolution weights, the frequency band features are weighted and fused and spliced to obtain the enhanced convolution features .
[0089] Depth convolution parameter sharing is based on the observation that different frequency components have commonality in extracting local spatial / temporal patterns, greatly reducing the parameter amount and improving the computational efficiency. Independent point-by-point convolution retains customized channel mixing capabilities for each frequency band to capture frequency-specific global features. The convolution dynamic weight controller further performs adaptive fusion at the spatial feature level, determining the contribution of each frequency band spatial feature based on data characteristics.
[0090] Specifically, the enhanced convolution features are input into a bidirectional selective state space model to obtain bidirectional temporal features that fuse forward and backward temporal dependencies, including:
[0091] The enhanced convolution features input into the forward Mamba block and the backward Mamba block, respectively;
[0092] by the forward Mamba block, the enhanced convolutional features are processed in time forward order using a selective state space equation to obtain forward temporal features ;
[0093] by the backward Mamba block, the enhanced convolutional features are processed in time reverse order using a selective state space equation to obtain backward temporal features ;
[0094] the forward temporal features and the backward temporal features are dynamically weighted fused through a gated fusion mechanism to obtain the bidirectional temporal features , wherein, is an adaptive fusion weight obtained through learning.
[0095] The linear computational complexity advantage of the selective state space model (such as Mamba) is utilized to perform forward (history to future) and backward (future to history) temporal scanning in parallel. The selective mechanism enables the model to dynamically decide which part of the historical information to remember or ignore through a learnable parameterized function, thereby effectively filtering redundant noise. The gated fusion mechanism (such as using a Sigmoid gate) learns how to balance the contributions of forward causality and backward future context information to the prediction of the current time.
[0096] Specifically, the bidirectional temporal features are input into a frequency interaction attention module for cross-band feature fusion to obtain prediction features, including:
[0097] the bidirectional temporal features are decomposed into low-frequency representations , medium-frequency representations , and high-frequency representations ;
[0098] the low-frequency representations, the medium-frequency representations, and the high-frequency representations are spliced in the feature dimension to form a multi-frequency joint representation;
[0099] the multi-frequency joint representation is subjected to feature projection to obtain frequency features of a unified dimension;
[0100] a multi-head self-attention mechanism is applied to the frequency features of the unified dimension to calculate the interaction relationship between different frequency components to obtain attention enhanced features;
[0101] the attention enhanced features are processed through a sub-layer containing a residual connection and a feedforward network to output the prediction features .
[0102] The different frequency features with rich spatio-temporal information processed by the preceding modules are globally interacted and integrated in the last stage of the model. Through splicing and projection operations, all frequency band information is placed in the same feature space, and then the complex collaborative relationship between low-frequency trends, medium-frequency periods, and high-frequency fluctuations (for example, how the traffic surge in peak hours affects the overall daily cycle pattern) is modeled using a multi-head self-attention mechanism. Residual connections and feedforward networks are used to stabilize training and enhance the model's nonlinear representation capabilities.
[0103] In one specific embodiment, the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling includes:
[0104] Step 1: Data acquisition and preprocessing
[0105] Obtain historical traffic flow data of multiple monitoring nodes in the road section or road network to be predicted, including:
[0106] (1) Monitoring node location information;
[0107] (2) Traffic flow observation values collected at fixed time intervals, with time intervals of 5 minutes, 10 minutes, or 15 minutes;
[0108] (3) Flow sequence data for a continuous time period, with a length of 1 week to 3 months;
[0109] Preprocess the historical traffic flow data, including:
[0110] (1) Data cleaning: identify and process missing values and outliers;
[0111] (2) Time window division: divide the continuous time series into multiple training samples according to the historical observation window length T;
[0112] (3) Node-level standardization: independently calculate the mean μ and standard deviation σ of the historical data for each monitoring node, and normalize using the Z-score standardization method;
[0113] (4) Batch organization: organize the standardized data by batch size B;
[0114] Obtain standardized traffic flow data , where:
[0115] B is the batch size, with a value range of 16-128, preferably 32 or 64;
[0116] T is the historical observation time window length, representing the number of historical time steps used for prediction, with a value range of 12-288, corresponding to 1 hour to 24 hours of historical data, preferably 12, 24, or 48;
[0117] N is the number of monitoring nodes, representing the total number of traffic flow monitoring points in the road network;
[0118] 1 represents a single traffic flow feature dimension;
[0119] Step 2: Multi-scale frequency domain decomposition
[0120] The standardized traffic flow data is input into a wavelet transform module containing a learnable wavelet transform layer and a wavelet dynamic weight controller for multi-scale frequency domain decomposition:
[0121] (1) The input sequence is decomposed at multiple levels by the learnable wavelet transform layer to extract different frequency components:
[0122] Low-frequency component : Captures long-term trends and macro periodic patterns, including daily, weekly, and other regular changes;
[0123] Medium-frequency component : Captures intra-day periodic fluctuations, including hourly changes during morning and evening peak hours;
[0124] High-frequency component : Captures short-term sudden changes and random fluctuations, including sudden accidents, weather anomalies, and other abnormal events;
[0125] Where D is the hidden feature dimension, with a value range of 32-256, preferably 64 or 128;
[0126] (2) The three frequency components are input into the Flash Attention mechanism for feature enhancement:
[0127] Enhanced low-frequency feature
[0128] Enhanced medium-frequency feature
[0129] Enhanced high-frequency feature
[0130] (3) The wavelet dynamic weight controller adaptively generates fusion weights:
[0131] Low-frequency fusion weight
[0132] Medium-frequency fusion weight
[0133] High-frequency fusion weight
[0134] Satisfy the normalization constraint: + + =1
[0135] (4) Perform weighted fusion to obtain multi-scale wavelet fusion features :
[0136] ;
[0137] wherein ⊙ represents element-wise multiplication (Hadamard product);
[0138] Step 3: Spatial feature enhancement
[0139] input the multi-scale wavelet fusion features to a spatial feature extraction module containing a depth separable convolution layer and a convolution dynamic weight controller:
[0140] (1) Spatial modeling of different frequency band features is performed through the depth separable convolution layer, respectively obtaining:
[0141] low-frequency spatial features ∈
[0142] medium-frequency spatial features ∈
[0143] high-frequency spatial features ∈
[0144] (2) Spatial fusion weights are generated through the convolution dynamic weight controller:
[0145] low-frequency spatial weights ∈
[0146] medium-frequency spatial weights ∈
[0147] high-frequency spatial weights ∈
[0148] satisfy the normalization constraint: + + =1
[0149] (3) Enhanced convolution features ∈ are obtained:
[0150] = ⊙ + ⊙ + ⊙
[0151] Step 4: Bidirectional temporal dependency modeling
[0152] The enhanced convolutional features are input into a bidirectional selective state space model:
[0153] (1) The forward Mamba block processes in time forward order to obtain forward temporal features ∈ , capturing causal temporal dependency;
[0154] (2) The reverse Mamba block processes in time reverse order to obtain reverse temporal features ∈ , capturing global contextual information;
[0155] (3) The bidirectional temporal features ∈ are adaptively fused through a gating fusion mechanism:
[0156] =α⊙ +(1-α)⊙
[0157] where α∈ is an adaptive weight learned through a gating network;
[0158] Step 5: Cross-band feature fusion
[0159] The bidirectional temporal features are input into a frequency interaction attention module:
[0160] (1) The bidirectional temporal features are decomposed into band-wise representations:
[0161] Low-frequency representation ∈
[0162] Mid-frequency representation ∈
[0163] High-frequency representation ∈
[0164] (2) Cross-band interaction weights are calculated through a multi-head self-attention mechanism for inter-frequency information interaction;
[0165] (3) Prediction features ∈ are obtained;
[0166] Step 6: Prediction output
[0167] The predicted features are dimensionally transformed through a linear mapping layer to obtain a traffic flow prediction result for a future specified time length:
[0168] wherein T' is a prediction time window length, and the value range is 3-12, corresponding to a prediction of 15 minutes to 1 hour in the future, preferably 3, 6 or 12;
[0169] The prediction result is subjected to inverse standardization processing to obtain a final traffic flow prediction value:
[0170]
[0171] wherein μ and σ are the historical mean and standard deviation of each node in step 1.
[0172] To verify the superiority of the learnable wavelet module used in the method provided by the present application compared with the traditional fixed wavelet, the following comparative experiment is specially designed.
[0173] 1. Experimental setup
[0174] Model architecture: the architecture is completely consistent with that of the WaveletMamba of the present application; the fixed wavelet does not have a wavelet weight generator because it uses a fixed wavelet basis function.
[0175] Comparison object: the learnable wavelet module in the present application is replaced by three classical fixed wavelet functions for comparison, including: Haar wavelet, DB2 wavelet and DB4 wavelet.
[0176] Control variable: except for the wavelet module, all other modules, hyperparameters, training data set, training period and optimizer of the model remain completely the same to ensure that the performance difference is only due to the difference of the wavelet module.
[0177] Evaluation index: on the PEMS08 public data set, MSE and MAE are used as the core evaluation indexes, and the prediction time length is 1 hour, 2 hours, 4 hours and 8 hours.
[0178] 2. Experimental results
[0179]
[0180] 3. Experimental conclusion and analysis
[0181] From the above table data, it can be seen that:
[0182] Under the model framework proposed in the application, the learning wavelet module is significantly better than all the compared fixed wavelets in terms of MSE, and the performance is improved by 10.9% compared with the best fixed wavelet (DB4).
[0183] In terms of MAE, the application also achieves the best result, and the value is lower than all the compared schemes, and the performance is improved by 11.32% compared with the best fixed wavelet (DB4), indicating that the learning wavelet has better ability in improving the overall prediction accuracy of long-term traffic flow.
[0184] The above experimental results fully prove that the learning wavelet module introduced in the application can adaptively learn and optimize the wavelet transform base best matched with the downstream task through an end-to-end training process, thereby overcoming the inherent defects of the traditional fixed wavelet (such as Haar, DB2, DB4, etc.) that the function form is fixed and cannot be optimized for specific tasks and data. This adaptive characteristic enables the model to extract more discriminative features from the data, and finally realizes significant performance improvement in the long-term traffic flow prediction task.
[0185] In order to verify the superiority of the model structure provided by the application compared with other deep learning models, the following comparative experiments are specially designed.
[0186] Comparison object:
[0187] iTransformer: A redesigned Transformer architecture for multivariate time series prediction. By inverting the attention mechanism, attention is applied to the time dimension rather than the variable dimension, so that each time series variable is processed as an independent token;
[0188] Autoformer: A Transformer based on sequence decomposition and autocorrelation mechanism. The time series is decomposed into trend and seasonal components, and the autocorrelation is used to replace the dot product attention, which better discovers the periodic dependence relationship of the time series;
[0189] S-Mamba: An innovative model that applies the Mamba architecture (selective state space model) to time series prediction. By introducing a selective scanning mechanism and a hardware-aware parallel algorithm, it effectively models long sequence dependencies while maintaining linear computational complexity
[0190] Evaluation index: On the PEMS08 public dataset, MSE and MAE are used as the core evaluation index, and the prediction time is 1 hour, 2 hours, 4 hours, and 8 hours.
[0191] 2. Experimental results
[0192]
[0193] The application is further described as follows:
[0194] After preprocessing, the data enters the learnable wavelet transform layer. The learnable wavelet transform uses data-driven learnable filters for multi-scale frequency domain decomposition, effectively realizing joint time-frequency analysis. In the learnable wavelet transform, the original traffic data is initially input in the form of a tensor , where represents the batch size, represents the time step, represents the number of nodes, represents the feature dimension.
[0195] Subsequently, recursive decomposition is performed through 3 layers of learnable convolution filters, and the Flash Attention mechanism further enhances the features of each frequency band to generate three main frequency band feature matrices; the wavelet dynamic weight controller calculates adaptive fusion weights based on global pooling and multi-layer perceptron , and finally outputs the fused features, realizing task-oriented frequency adaptive modeling.
[0196] The depth separable convolution module efficiently models the spatial-channel decoupling of the wavelet fused features, significantly improving the parameter efficiency of the model. This module receives the output of the wavelet transform layer as input, reduces the complexity of the model through depth convolution and point-wise convolution, uses a partial parameter sharing mechanism to retain the model's ability to model different frequency components; at the same time, the convolution dynamic weight generator further generates dynamic weights for the convolution based on the output of the wavelet weight layer, in order to further capture the features of each frequency.
[0197] The bidirectional Mamba module receives the features output by the depth separable convolution as input, captures historical information flow through the forward SSM, and captures future information flow through the backward SSM. The hidden states in both directions are dynamically fused through a gating mechanism to generate bidirectional time series representation . The selective SSM mechanism dynamically filters irrelevant historical information through a learnable selection matrix , effectively compressing the context on long sequences.
[0198] Subsequently, the frequency interaction attention module models the bidirectional features across frequency bands, capturing the synergistic relationship between different frequency components through a multi-head attention mechanism, further improving the model's ability to represent complex spatio-temporal patterns.
[0199] Finally, the linear projection layer maps the enhanced features to the prediction space, completing the traffic flow prediction task.
[0200] The application provides a long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective time series modeling, and a learnable wavelet frequency decomposition and frequency splicing process comprises:
[0201] (1) Learnable wavelet decomposition and Flash-attention mechanism
[0202] The learnable wavelet is optimized by gradient descent, and the frequency decomposition mode most suitable for the traffic flow prediction task is automatically learned, while the fixed wavelet needs to be manually tried with multiple wavelet bases; the traditional discrete wavelet transform (DWT) uses a predefined mother wavelet function and scale function to perform signal decomposition, and the learnable wavelet transform uses a parameterized convolutional neural network to replace the fixed filter, and the module adopts a recursive multi-level decomposition strategy to capture time series patterns at different scales; for an input tensor where B is the batch size, T is the time series length, N is the number of nodes, and D is the hidden dimension, the wavelet decomposition process is performed in the following manner.
[0203] In the first level decomposition (decomposition level), the system generates low-frequency and high-frequency components, the low-frequency component captures the trend information of the signal, and the high-frequency component retains the detail changes:
[0204]
[0205]
[0206] wherein, is the initial signal, is the input signal of the next level, the filter parameters correspond to the low-pass and high-pass filters respectively, the convolution kernel size k=2 and the step size s=2 are set to realize down-sampling; after each level of decomposition is completed, batch normalization and activation functions are applied to enhance the non-linear expression ability and stabilize the training process:
[0207]
[0208]
[0209] Through this recursive decomposition strategy, the system can effectively separate different frequency components and provide a good foundation for subsequent feature enhancement.
[0210] As shown in Figure 2 , the application provides a bidirectional Mamba model structure diagram of a long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective time series modeling.
[0211] The bidirectional Mamba layer processes the input sequence in parallel by two independent Mamba blocks in forward and reverse directions, respectively capturing past-to-future and future-to-past dependencies; for the output of the depthwise separable convolution The bidirectional processing procedure is as follows.
[0212] (1) Forward Mamba processing
[0213]
[0214]
[0215] (2) Reverse Mamba processing
[0216]
[0217]
[0218] (3) Gating fusion mechanism
[0219]
[0220]
[0221] (4) Linear transformation
[0222]
[0223] The forward Mamba processes the sequence in time forward direction, capturing the influence of history information on the current time. In formula (5), denotes the forward hidden state at the k-th time, is the state transition matrix, is the input projection matrix, is the input feature at the current time. In formula (6), is the output projection matrix, is the forward output.
[0224] The reverse Mamba processes the sequence in time reverse direction, capturing the influence of future information on the current time. In formulas (7)-(8), is the reverse hidden state, are the state transition matrix, input projection matrix and output projection matrix of the reverse processing, respectively, with the same dimensions as the forward parameters; the processing in the two directions uses independent parameter sets, ensuring flexible modeling of different directional time series patterns.
[0225] To effectively fuse bidirectional information, the system uses a gating mechanism to adaptively adjust the contribution of forward and reverse features; in formula (9), [·||·] represents the feature concatenation operation, which combines and Concatenate in feature dimension , is a gating weight matrix, is a bias vector, is a sigmoid activation function, is a learned gating weight; the gating mechanism realizes dynamic feature selection by learning input-related weights. is the gated fused feature, this gating mechanism allows the model to dynamically adjust the weight of bidirectional information according to the specific traffic flow pattern; in formula (11), the gated fused feature is further transformed by a linear layer to enhance the expression ability, where, is a linear transformation weight matrix, is a bias vector, is the final output.
[0226] As shown in Figure 3 , the application provides a dynamic weight generator structure diagram of a long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective time series modeling.
[0227] The dynamic weight controller adaptively adjusts the fusion weight of the frequency component according to the comprehensive characteristics of the input data, realizes a data-driven feature fusion strategy, and the mechanism first extracts a global feature representation through adaptive average pooling:
[0228]
[0229]
[0230]
[0231]
[0232]
[0233] wherein, is a weight matrix, is a learnable reference weight, = 1 is an adjustment coefficient, the network adopts a two-layer fully connected structure, extracts key information through dimension compression, and the final weight is calculated through the combination of the reference weight and the adjustment amount, this design allows the model to realize adaptive adjustment while maintaining stability, the final output fuses three main frequency components through dynamic weight, realizes effective integration of multi-scale features; this adaptive fusion mechanism enables the model to dynamically adjust the contribution of different frequency components according to the real-time characteristics of the input data, thereby improving the prediction accuracy.
[0234] AsFigure 4 As shown, the present application provides a frequency interaction attention mechanism flow chart of a long-term traffic flow prediction method based on adaptive frequency domain decomposition and selective timing modeling.
[0235] The frequency interaction attention module is located in the last stage of the model, receives three frequency band features (low frequency, medium frequency, high frequency) from the bidirectional Mamba layer, and outputs the fused unified representation, which contains four key components in its core design:
[0236] The frequency feature projection layer first concatenates the features of the three frequencies in the channel dimension to form a joint representation containing complete spectral information; then it maps the concatenated 3H-dimensional features back to the H-dimensional space through linear projection. The concatenation operation preserves the original information of each frequency, avoiding information loss caused by early fusion.
[0237] After various frequencies enter the frequency interaction attention module, they are first reshaped, and the formula is:
[0238]
[0239]
[0240]
[0241]
[0242]
[0243]
[0244]
[0245] In formula (17), represents the th frequency component, which is reshaped by the reshape operation , where B is the batch size, T is the time step, N is the number of nodes, and H is the hidden dimension; formula (18) concatenates the three frequency components in the feature dimension, [;] represents the concatenation operation along the feature dimension, and gets ; formula (19) projects the concatenated features back to the original dimension through the projection matrix and the bias vector to restore the dimension of the data for the next data transmission, and gets the unified frequency feature .
[0246] Multi-head attention is the core mechanism of frequency interaction. Unlike standard attention, the query, key and value in this paper come from unified frequency features, realizing full-connection interaction between frequency components, multi-head parallel processing, and each attention head focusing on different frequency interaction modes. Formula (20) shows the standard attention calculation process, where Q, K and V represent the query, key and value matrices, is the dimension of the attention key, used to scale the dot product to stabilize the gradient; in formula (21), Q, V and V are obtained by linear transformation of the frequency unified feature , MultiHeadAttention represents the multi-head attention operation, and the output .
[0247] The double-layer residual structure ensures stable propagation of the gradient and cumulative learning of the feature; formula (22) realizes shallow residual connection, adds the attention output to the original input , and then performs LayerNorm normalization to obtain , the shallow residual keeps the original frequency feature and prevents over-smoothing.
[0248] The feedforward network FFN provides additional nonlinear transformation capability; in formula (23), the feature is expanded from H dimensions to 2H dimensions to increase the model capacity, and then compressed back to H dimensions, is the corresponding bias term, the GELU activation function is used to provide smooth nonlinearity, which is suitable for processing continuous traffic flow data, and Dropout is used to prevent overfitting and improve generalization ability. Deep residual accumulates the enhanced features of attention and FFN.
[0249] Formula (24) realizes deep residual connection, adds the FFN output to the first normalized result , and then performs LayerNorm normalization again, and finally restores the feature to the original four-dimensional shape [B, T, N, H] through reshape operation, to obtain the final output .
[0250] As shown in Figure 5 , the application provides a long-term traffic flow prediction method model structure diagram based on adaptive frequency domain decomposition and selective time series modeling.
[0251] The model mainly has seven modules: a data preprocessing module, a learnable wavelet transform module, a wavelet dynamic weight generator module, a deep separable convolution module, a convolution weight generator module, a bidirectional Mmba module, and a frequency interaction attention weighted prediction output module. In the learnable wavelet transform module, the learnable convolution filter adaptively decomposes the input signal into three subbands of low frequency, medium frequency and high frequency, captures multi-scale time sequence features, and the Flash Attention mechanism enhances the feature representation ability of each frequency band. Through the wavelet dynamic weight generator module, the fusion proportion of different frequency components is adaptively adjusted according to the input characteristics, thereby significantly improving the accuracy of feature extraction. The deep separable convolution module decouples the spatial and channel dimensions of feature learning, uses a partial parameter sharing mechanism, significantly reduces the parameter amount and computational overhead while maintaining the expression ability. In addition, the bidirectional Mamba model is characterized by its selective state space mechanism, which effectively captures long-range temporal dependencies while maintaining linear computational complexity, overcoming the efficiency bottleneck of traditional prediction models based on Transformer in long sequence modeling. The frequency interaction attention weighted prediction output module models the cross-frequency collaborative relationship in the frequency domain, further enhancing the model's ability to represent complex spatiotemporal patterns and selecting the optimal feature fusion splicing method.
[0252] Based on the introduction of the Figure 1 、 Figure 2 、 Figure 3 of the present application, the following is the model mechanism information not introduced in Figure 4 , other mechanisms are the same as the above content, please refer to the above introduction, the following will not be repeated.
[0253] (1) The principle of the Flash-attention attention mechanism is as follows: after the data is processed by the learnable wavelet transform, each frequency component is enhanced by the Flash Attention to capture long-range temporal dependencies. For frequency component , the calculation process of the attention mechanism is shown in equations (25)-(28).
[0254]
[0255]
[0256]
[0257]
[0258] wherein, is the projection matrix. H is the number of attention heads. To implement the multi-head attention mechanism, the query, key, and value matrices are reshaped into a multi-head format so that each attention head can focus on different feature subspaces. The Flash Attention algorithm significantly reduces the memory complexity of attention computation by using a block computation strategy and IO optimization techniques. The algorithm reduces the memory complexity of attention computation from to , making it possible to process long sequences. After attention enhancement, the frequency components are further processed by a frequency enhancement network, which uses a two-layer feedforward structure to enhance feature representation.
[0259] The principle of deep separable convolution is as follows:
[0260] Deep separable convolution decomposes the standard convolution into two steps: depthwise convolution and pointwise convolution, thereby significantly reducing the number of parameters and computational complexity; for input features where B is the batch size, L is the sequence length, and D is the hidden dimension. The calculation process of deep separable convolution is as follows.
[0261] The depthwise convolution stage performs convolution operations independently for each channel, maintaining the independence between channels:
[0262]
[0263] where is the depthwise convolution kernel, K is the convolution kernel size, and each channel is independently convolved to effectively capture local temporal patterns.
[0264] The pointwise convolution stage achieves information fusion between channels through 1x1 convolution:
[0265]
[0266] where is the 1x1 convolution kernel, is the bias term. This decomposition strategy reduces the number of parameters while maintaining frequency specificity, enabling the model to efficiently process large-scale traffic flow data.
[0267] To reduce the number of parameters while maintaining frequency specificity, this module uses a partial sharing strategy. For the three frequency components , the partial sharing mechanism is implemented as follows.
[0268] Shared depthwise convolution layer:
[0269] The core innovation of the partial sharing mechanism is the selective sharing of parameters between different frequency components. The system defines shared depthwise convolution kernels , where K = 5. For all frequency components The same depth convolution is performed:
[0270]
[0271]
[0272] where, , with proper padding to keep the dimension unchanged. This sharing mechanism is based on the observation that different frequency components have similar local temporal pattern extraction.
[0273] Independent point-wise convolution operation:
[0274] While the depth convolution parameters are shared across different frequencies, the point-wise convolution remains independent to capture frequency-specific global features. A separate set of point-wise convolution parameters is configured for each frequency component where,
[0275]
[0276]
[0277] To enhance the model's ability to model different frequency features, the system introduces a frequency-specific enhanced convolution mechanism. This mechanism further enhances feature expression capability through residual connection and grouped convolution:
[0278]
[0279]
[0280]
[0281] where, is the residual coefficient, is the frequency-specific convolution kernel size (low frequency = 7, medium frequency = 5, high frequency = 3), represents the grouped convolution, and the number of groups is set to D / 4, achieving an optimization between balancing computational efficiency and expression ability.
[0282] Each frequency branch contains batch normalization, activation function, and Dropout regularization to enhance the model's nonlinear expression ability and prevent overfitting. The final output is obtained through layer normalization and residual connection, ensuring stable propagation of gradients.
[0283] Embodiment Two
[0284] As Figure 6The embodiment provides a long-term traffic flow prediction system based on frequency domain decomposition and time series modeling, comprising: a data acquisition unit configured to acquire historical traffic flow data of N monitoring nodes in a to-be-predicted road section or road network;
[0285] a preprocessing unit configured to preprocess the historical traffic flow data to obtain standardized traffic flow data , wherein B is batch size, T is the length of a historical observation time window, N is the number of monitoring nodes, and 1 represents a single traffic flow feature dimension;
[0286] a multi-scale frequency domain decomposition unit configured to input the standardized traffic flow data X into a wavelet transform module comprising a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features , wherein D is a hidden feature dimension;
[0287] a spatial feature extraction unit configured to input the multi-scale wavelet fusion features into a spatial feature extraction module comprising a depth separable convolution layer and a convolution dynamic weight controller to obtain enhanced convolution features ;
[0288] a bidirectional time series modeling unit configured to input the enhanced convolution features into a bidirectional selective state space model to obtain bidirectional time series features fused with forward and reverse time series dependencies ∈ ;
[0289] a cross-frequency band feature fusion unit configured to input the bidirectional time series features into a frequency interaction attention module for cross-frequency band feature fusion to obtain prediction features ;
[0290] a prediction unit configured to generate a traffic flow prediction result for a future specified time length according to the prediction features .
[0291] Embodiment three
[0292] The embodiment three provides an electronic device.
[0293] An electronic device comprises a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor implements the steps in the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling as described in the embodiment one of the application.
[0294] The detailed steps are the same as those in the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling provided in the embodiment one, and will not be repeated here.
[0295] Embodiment four
[0296] Embodiment four of the present application provides a computer readable storage medium.
[0297] A computer readable storage medium, having stored thereon a program, which when executed by a processor implements the steps of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling according to embodiment one of the present application.
[0298] The detailed steps are the same as the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling provided in embodiment one, which will not be repeated here.
[0299] Embodiment five
[0300] Embodiment five of the present application provides a computer program product.
[0301] A computer program product, comprising software code, the program in the software code performing the steps of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling according to embodiment one of the present application.
[0302] The detailed steps are the same as the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling provided in embodiment one, which will not be repeated here.
[0303] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages, such as object-oriented programming languages Java and interpreted scripting language JavaScript, etc.
[0304] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks
[0305] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 flow or flows and / or blocks Figure 1 of the functions specified in the flow or flows and / or blocks in the block or blocks.
[0306] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 flow or flows and / or blocks Figure 1 of the functions specified in the flow or flows and / or blocks in the block or blocks.
[0307] The above only describes the preferred embodiments of the present embodiment and is not intended to limit the present embodiment. The present embodiment can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present embodiment shall be included in the protection scope of the present embodiment.
Claims
1. A long-term traffic flow prediction method based on frequency domain decomposition and time series modeling, characterized in that, include: Obtain historical traffic flow data from N monitoring nodes in the road segment or road network to be predicted; The historical traffic flow data is preprocessed to obtain standardized traffic flow data. Where B is the batch size, T is the length of the historical observation time window, N is the number of monitoring nodes, and 1 represents a single traffic flow feature dimension; The standardized traffic flow data X is input into a wavelet transform module containing a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features. Where D is the dimension of the hidden features; The process of inputting the standardized traffic flow data into a wavelet transform module containing a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features includes: The standardized traffic flow data is input into a learnable wavelet transform layer, and recursively decomposed through a multi-level parameterized convolutional filter to extract different frequency components, thereby obtaining low-frequency components that capture long-term trends and macro-periodic patterns. Capture the mid-frequency components of intraday periodic fluctuations. And capture high-frequency components of short-term sudden changes and random fluctuations ; The low-frequency, mid-frequency, and high-frequency components are respectively input into the Flash Attention mechanism for feature enhancement, resulting in enhanced low-frequency features that characterize the long-term trend and daily and weekly variations of traffic flow. Mid-frequency characteristics used to characterize intraday periodic fluctuations in traffic flow and high-frequency features used to characterize short-term random fluctuations and sudden anomalies in traffic flow. ; The enhanced low-frequency, mid-frequency, and high-frequency features are input into the wavelet dynamic weight controller to generate the corresponding low-frequency fusion weights. Mid-frequency fusion weight and high-frequency fusion weights Satisfies the normalization constraint: + + =1; Based on the low-frequency fusion weight, mid-frequency fusion weight, and high-frequency fusion weight, the enhanced low-frequency features, mid-frequency features, and high-frequency features are weighted, fused, and concatenated to obtain the multi-scale wavelet fusion features. = ⊙ + ⊙ + ⊙ , where ⊙ represents element-wise multiplication; The multi-scale wavelet fusion features The input is fed into a spatial feature extraction module that includes depthwise separable convolutional layers and a dynamic convolutional weight controller to obtain enhanced convolutional features. ; The enhanced convolutional features Inputting into a bidirectional selective state-space model yields bidirectional temporal features that integrate forward and backward temporal dependencies. ∈ ; The bidirectional timing features The input is fed into the frequency interaction attention module for cross-frequency band feature fusion to obtain the predicted features. ; Based on the predicted features It generates traffic flow predictions for a specified future time period.
2. The method as described in claim 1, characterized in that, The preprocessing of the historical traffic flow data to obtain standardized traffic flow data includes: The historical traffic flow data is cleaned, including filling in missing values and smoothing outliers. The cleaned data is reshaped according to a preset time window T and node dimension N; For each sensor node, the mean μ and standard deviation σ of its historical data are calculated independently, and the data of that node is standardized using Z-scores based on the mean μ and standard deviation σ to obtain the standardized traffic flow data. .
3. The method as described in claim 1, characterized in that, The process of inputting the multi-scale wavelet fusion features into a spatial feature extraction module containing depthwise separable convolutional layers and a dynamic convolutional weight controller yields enhanced convolutional features, including: The multi-scale wavelet fusion features The input is fed into a depthwise separable convolutional layer; wherein the depthwise separable convolutional layer shares depthwise convolution parameters for the low-frequency, mid-frequency, and high-frequency components of the input multi-scale wavelet fusion features, and performs channel fusion on each component using independent pointwise convolution parameters to obtain low-frequency spatial features. ∈ Mid-frequency spatial characteristics ∈ and high-frequency spatial characteristics ∈ ; The frequency band features processed by the depthwise separable convolutional layer are input into the convolutional dynamic weight controller to generate corresponding low-frequency convolutional weights. ∈ Intermediate frequency convolution weights ∈ and high-frequency convolution weights ∈ ; Based on the low-frequency, mid-frequency, and high-frequency convolution weights, the features of each frequency band are weighted, fused, and concatenated to obtain the enhanced convolutional features. = ⊙ + ⊙ + ⊙ .
4. The method as described in claim 1, characterized in that, The enhanced convolutional features are input into a bidirectional selective state-space model to obtain bidirectional temporal features that fuse forward and backward temporal dependencies, including: The enhanced convolutional features Input to the forward Mamba block and the reverse Mamba block respectively; The enhanced convolutional features are processed sequentially along time using the forward Mamba block and a selective state-space equation to obtain forward temporal features. ; By using the inverted Mamba block, the enhanced convolutional features are processed in reverse temporal order using the selective state-space equation to obtain inverted temporal features. ; The forward temporal features and the reverse temporal features are dynamically weighted and fused using a gated fusion mechanism to obtain the bidirectional temporal features. = α⊙ +(1-α)⊙ , where α∈ These are the adaptive fusion weights obtained through learning.
5. The method as described in claim 1, characterized in that, The step of inputting the bidirectional temporal features into the frequency interaction attention module for cross-frequency band feature fusion to obtain predicted features includes: The bidirectional timing features Decomposed into low-frequency representation ∈ Intermediate frequency representation ∈ and high frequency representation ∈ ; The low-frequency, mid-frequency, and high-frequency representations are concatenated along the feature dimension to form a multi-frequency joint representation. The multi-frequency joint representation is subjected to feature projection to obtain frequency features of a unified dimension. A multi-head self-attention mechanism is applied to the frequency features of the unified dimension to calculate the interaction relationship between different frequency components, thereby obtaining attention-enhanced features. The attention-enhanced features are processed through a sub-layer containing residual connections and a feedforward network to output the predicted features. .
6. A long-term traffic flow prediction system based on frequency domain decomposition and time series modeling, characterized in that, include: The data acquisition unit is used to acquire historical traffic flow data from N monitoring nodes in the road segment or road network to be predicted. The preprocessing unit is used to preprocess the historical traffic flow data to obtain standardized traffic flow data. Where B is the batch size, T is the length of the historical observation time window, N is the number of monitoring nodes, and 1 represents a single traffic flow feature dimension; The multi-scale frequency domain decomposition unit is used to input the standardized traffic flow data X into a wavelet transform module containing a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features. Where D is the dimension of the hidden features; The process of inputting the standardized traffic flow data into a wavelet transform module containing a learnable wavelet transform layer and a wavelet dynamic weight controller to obtain multi-scale wavelet fusion features includes: The standardized traffic flow data is input into a learnable wavelet transform layer, and recursively decomposed through a multi-level parameterized convolutional filter to extract different frequency components, thereby obtaining low-frequency components that capture long-term trends and macro-periodic patterns. Capture the mid-frequency components of intraday periodic fluctuations. And capture high-frequency components of short-term sudden changes and random fluctuations ; The low-frequency, mid-frequency, and high-frequency components are respectively input into the Flash Attention mechanism for feature enhancement, resulting in enhanced low-frequency features that characterize the long-term trend and daily and weekly variations of traffic flow. Mid-frequency characteristics used to characterize intraday periodic fluctuations in traffic flow and high-frequency features used to characterize short-term random fluctuations and sudden anomalies in traffic flow. ; The enhanced low-frequency, mid-frequency, and high-frequency features are input into the wavelet dynamic weight controller to generate the corresponding low-frequency fusion weights. Mid-frequency fusion weight and high-frequency fusion weights Satisfies the normalization constraint: + + =1; Based on the low-frequency fusion weight, mid-frequency fusion weight, and high-frequency fusion weight, the enhanced low-frequency features, mid-frequency features, and high-frequency features are weighted, fused, and concatenated to obtain the multi-scale wavelet fusion features. = ⊙ + ⊙ + ⊙ , where ⊙ represents element-wise multiplication; The spatial feature extraction unit is used to extract the multi-scale wavelet fusion features. The input is fed into a spatial feature extraction module that includes depthwise separable convolutional layers and a dynamic convolutional weight controller to obtain enhanced convolutional features. ; A bidirectional temporal modeling unit is used to process the enhanced convolutional features. Inputting into a bidirectional selective state-space model yields bidirectional temporal features that integrate forward and backward temporal dependencies. ∈ ; The cross-band feature fusion unit is used to fuse the bidirectional timing features. The input is fed into the frequency interaction attention module for cross-frequency band feature fusion to obtain the predicted features. ; Prediction unit, used to predict based on the predicted features It generates traffic flow predictions for a specified future time period.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the steps of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling as described in any one of claims 1 to 5.
9. A computer program product, comprising software code, characterized in that, The program in the software code performs the steps of the long-term traffic flow prediction method based on frequency domain decomposition and time series modeling as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Urban traffic flow prediction method based on multiple time-space characteristics of road network
CN120913415A