A non-stationary traffic prediction method based on wave flow decomposition and time lag perception
Through the non-stationary traffic prediction method based on wave current decomposition and delay perception, the decoupling flow layer, delay perception directed graph attention and adaptive graph convolution network are used to solve the shortcomings of traditional traffic prediction methods in non-stationary and space-time delay effects, and more accurate traffic flow prediction is achieved, and the operation efficiency of the intelligent traffic system is improved.
Patent Information
- Application Number
- CN202510899425.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-07-01
AI Technical Summary
Traditional traffic flow prediction methods have insufficient prediction accuracy and poor adaptability to emergencies when dealing with non-stationarity and space-time lag effects, which is difficult to meet the refined and intelligent needs of modern traffic management.
Using a non-stationary traffic prediction method based on wave flow decomposition and delay perception, the spatial and temporal correlation and dynamic change characteristics of traffic flow data are captured by decoupling the flow layer, delay perception directed graph attention and adaptive graph convolution network, and the time-gated convolution module and adaptive graph convolution network are built to integrate short-term fluctuations and long-term trend characteristics.
It improves the accuracy and robustness of traffic flow forecasting, can better cope with complex traffic networks, provide short-term and long-term traffic flow forecasting, and improves the scientific nature of traffic management decisions and the operation efficiency of intelligent traffic systems.
Smart Images

Figure CN120409841B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation systems, and in particular to a non-stationary traffic prediction method based on wave flow decomposition and time lag perception. Background Art
[0002] Transportation systems play a vital role in the development of modern cities. However, traffic flow forecasting, as a key component of traffic management and planning, continues to face numerous challenges. Traditional traffic forecasting methods have significant shortcomings in addressing the nonstationarity and spatiotemporal lag effects of traffic systems. Nonstationarity stems from the irregularities in traffic flow over time, such as differences in traffic flow between peak and off-peak hours, and sudden increases or decreases in traffic flow caused by emergencies. Spatiotemporal lag effects manifest themselves in the time delay between the propagation of phenomena such as traffic congestion from one road section to another. These factors hinder the accuracy of traditional methods, making them unable to meet the demands of modern, refined and intelligent traffic management. Furthermore, while end-to-end deep learning models have improved prediction accuracy to a certain extent, they still lack sufficient robustness against issues such as data distribution shifts, such as differences in traffic patterns between holidays and weekdays. Summary of the Invention
[0003] To solve the above problems, the present invention proposes a non-stationary traffic prediction method based on wave flow decomposition and time lag perception, so as to solve the problems existing in traditional traffic flow prediction methods when dealing with the non-stationarity and spatiotemporal lag effects of traffic systems, such as insufficient prediction accuracy and poor adaptability to emergencies. Compared with traditional methods, the present invention can effectively capture the spatiotemporal correlation and dynamic change characteristics of traffic flow data by introducing mechanisms such as decoupled flow layer, time lag-aware directed graph attention and adaptive graph convolutional network, providing more accurate short-term and long-term traffic flow predictions, and providing a more reliable solution for traffic flow prediction in intelligent transportation systems. The technical solutions provided by the present invention are as follows:
[0004] A non-stationary traffic prediction method based on wave flow decomposition and time lag perception includes the following steps:
[0005] Step 1: Represent the traffic network as a directed graph and obtain the traffic data of all sensors in the traffic network;
[0006] Step 2: Construct a decoupled flow layer and use wavelet transform to decouple the flow data into "wave component" and "flow component": the two high-frequency components after wavelet transform are combined into "wave component", which is used to capture short-term fluctuations and event information in the flow data; the low-frequency component after wavelet transform is "flow component", which is used to reflect the long-term trend of the flow data;
[0007] Step 3: Construct a time-gated convolution module TGC1 and input the data obtained in step 2 into TGC1 to capture short-term temporal dependencies and obtain “wave component” and “flow component” features.
[0008] Step 4: Construct a time-delay-aware directed graph attention (DeDGA) and use the “wave component” features output by TGC1 as the input of DeDGA to capture the causal relationship of the “wave component” in the temporal and spatial dimensions.
[0009] Step 5: Construct an adaptive graph convolutional network AdaGCN, use the “flow component” features output by TGC1 as the input of AdaGCN, and extract the global steady-state features contained in the “flow component”;
[0010] Step 6: Construct a time-gated convolution module TGC2, and use TGC2 to further process the features processed by DeDGA and AdaGCN to capture long-term temporal dependencies.
[0011] Step 7: Construct an adaptive event fusion module (AEFM). The weights are calculated by the attention mechanism and learned through backpropagation. Based on the obtained attention weights, the prediction results of the "wave component" and "flow component" are fused to obtain a comprehensive representation of future traffic.
[0012] Step 8: Construct a fully connected layer and use a fully connected neural network to convert the future traffic representation output by AEFM into the desired predicted value;
[0013] Step 9: Output the predicted traffic flow data; use the loss function to evaluate the predicted traffic flow data, calculate the prediction error by comparing it with the true value, and measure the prediction performance.
[0014] Preferably, in step 2, input flow data The wavelet transform of is: ; ; ;in and represents the low-pass filter and high-pass filter of the wavelet, is the convolution operation; is a downsampling operation; in the decoupled flow layer, after completing the wavelet transform, the low-frequency component is obtained and two high-frequency components and ; Perform upsampling and inverse wavelet transform to obtain the "wave component" and "flow component" : ; ;in 、 and 、 are learnable parameters.
[0015] Preferably, the time-gated convolution modules TGC1 and TGC2 are specifically expressed as follows: ; ;in Represents the input node signal characteristics of the time-gated convolution module; It is a one-dimensional convolution operation used to extract local features in the time dimension; It is a split operation that divides the output of the one-dimensional convolution into two parts; and The two tensors are the results of segmentation, which are used for linear transformation and gating operation respectively; is the output feature of the time-gated convolution module, which means The time series features after layer processing; It is an element-level multiplication operation, that is, element-by-element multiplication; Is the activation function, used to map the input value to within the range.
[0016] Preferably, the construction method of DeDGA is specifically as follows:
[0017] Step 4.1, calculate the prior time-lag correlation coefficient, let For the data of sensor nodes, two sensor nodes and The prior time-lagged correlation coefficient between is: ; ; ;in For in time Node business flow; For in time Node business flow; is the sequence length; is the time lag length; is the lag length Sensor nodes and The time-lag correlation coefficient between the initial time-lag length Start calculating the time-lag correlation coefficient and then gradually increase the time-lag length , and calculate the corresponding time-lag correlation coefficient at each increment ;
[0018] Step 4.2, extract dynamic time window features: ; ;in It is the feature output by TGC1 to DeDGA; and is a learnable weight matrix used to map input features to a new feature space; tanh is a hyperbolic tangent function used to introduce nonlinearity and map input values to within the scope of and It is the output feature matrix after linear transformation and nonlinear activation;
[0019] Step 4.3, output feature matrix , where ReLU is the rectified linear unit function, which is used to map the input value to within the scope of
[0020] Step 4.4: Based on the prior lag correlation coefficient and dynamic time window features, a lag-aware directed graph attention mechanism is constructed: ,in is the prior time-lag correlation coefficient obtained through training, is the learnable parameter matrix, This is the “wave component” feature output by DeDGA.
[0021] Preferably, the construction method of AdaGCN is as follows:
[0022] Step 5.1 uses an adaptive graph learning algorithm to dynamically adjust the connection weights between nodes, expressed as: ; ; ;in represents the node adaptive feature, is a learnable parameter; express The self-connection is incorporated into the antisymmetric matrix to determine the weights at the diagonal position; the nonlinear activation function ReLU is used to generate a sparse matrix , the adaptive aggregation module converts the sparse matrix With the existing adjacency matrix Integrate to produce a matrix ,in represents a nonlinear activation function, The convolution kernel is The convolutional layer, Represents Hadamard product multiplication; for the matrix obtained Normalize, where and Corresponding to and The diagonal matrix of ; It is used to eliminate the matrix the threshold of medium-weak ties; is the output matrix of the adaptive graph learning algorithm;
[0023] Step 5.2, based on the graph convolution method of Chebyshev polynomials, performs convolution operation on the node features, which is expressed as: ; Among them, the parameters is the vector of polynomial coefficients; , is the Laplace matrix, is the largest eigenvalue of the Laplacian matrix, is the identity matrix, It is the feature output by TGC1 to AdaGCN; It is the “flow component” feature output by AdaGCN; is a Chebyshev polynomial, which is recursively defined as:
[0024] Preferably, step 7 is specifically as follows: ; ;in Indicates sensor In the time step The predicted traffic flow or speed value at the location; It is the "flow component" prediction result after processing by TGC2, which represents the long-term trend of traffic flow; is the total number of time steps in the historical data, indicating the number of past time steps used by the model; is the number of time steps in the forecast, which represents the number of future time steps predicted by the model; is the attention weight, indicating the time step Place opposite The importance of event data at each time step; It is a weight matrix used to linearly transform the prediction results of the “wave component”; It is the "wave component" prediction result after processing by TGC2, which represents the short-term fluctuation of traffic flow; is a weight matrix used to transform the "flow component" prediction results into query vectors; is a weight matrix used to convert the "wave component" prediction results into key vectors; is the dot product between the query vector and the key vector, used to calculate the "flow component" and "wave component" at the time step and the correlation between The sum of the exponential dot products of all future time steps is used to normalize the attention weight; the set of traffic flow or speed values predicted by the model obtained by fusion is , storing the future All time steps The predicted value of traffic flow or speed from each sensor; The dimension of the set is , Represents the feature dimension of each sensor.
[0025] Preferably, the loss function of step 9 is expressed as: ,in Represents the loss function of traffic prediction, which is used to measure the difference between the model prediction value and the true value; and are the total number of time steps of historical data and the total number of time steps of prediction, respectively; is the index of the time step; is the number of sensors, indicating how many sensors there are in the traffic network; is the index of the sensor, indicating which sensor's prediction error is currently being calculated; is the true value, indicating that at the time step Place The actual value of traffic flow or speed from each sensor; is the predicted value, which means at the time step Place The predicted value of traffic flow or speed from each sensor; is the absolute error, expressed in time steps Place The absolute difference between the true value and the predicted value of each sensor.
[0026] Compared with existing technologies, the present invention achieves the following beneficial effects: through mechanisms such as decoupling flow layers, time-delay-aware directed graph attention, and adaptive graph convolutional networks, it effectively accounts for the spatial dependence of sudden fluctuations and stable propagation characteristics in traffic flow, more accurately capturing the complex temporal relationships between nodes in traffic networks. By decoupling the flow layers, this method overcomes the limitations of traditional methods in terms of prediction accuracy and adaptability to complex traffic networks, effectively addressing the problems of traditional traffic flow prediction methods in intelligent transportation systems, such as insufficient prediction accuracy and inability to reflect the impact of traffic networks.
[0027] A series of validation analyses have demonstrated that the prediction method presented in this paper offers significant advantages in improving prediction accuracy and addressing complex traffic networks. It maintains a certain level of prediction accuracy even in the face of diverse and complex traffic conditions. This method provides more accurate short-term and long-term traffic flow forecasts for intelligent transportation systems, contributing to improved scientific nature of traffic management decisions and the operational efficiency of intelligent transportation systems. It holds great promise for traffic flow forecasting within these systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0029] Figure 1 is a flow chart of the method of the present invention;
[0030] Figure 2 It is a conceptual diagram of the network and entities of the present invention;
[0031] Figure 3 is a schematic diagram of the decoupled flow layer of the present invention;
[0032] Figure 4 Schematic diagram of the time-gated convolution module of the present invention;
[0033] Figure 5 Schematic diagram of the time-delay correlation analysis results of the present invention, wherein Figure a is a heat map of the maximum correlation time-delay coefficient, Figure b is a flow curve diagram of different time-delays between nodes, Figure c is a density distribution diagram of the traffic flow time-delay effect with maximum cross-correlation, and Figure d is a schematic diagram of the optimal time-delay step;
[0034] Figure 6 is a schematic diagram of the adaptive graph learning framework of the present invention;
[0035] Figure 7 is a schematic diagram of the adaptive fusion module of the present invention;
[0036] Figure 8 It is an end-to-end overall framework diagram of the present invention;
[0037] Figure 9 This is a diagram of the wave-current integration network model of the present invention;
[0038] Figure 10 is a graph showing the evolution and attenuation characteristics of traffic flow prediction errors according to the present invention;
[0039] Figure 11 : This is a graph comparing traffic flow prediction values and measured values at different time steps at node 39 of the PeMS04 dataset in an embodiment of the present invention;
[0040] Figure 12 This is a comparison diagram of traffic flow prediction values and measured values at different time steps at node 35 of the PeMS08 dataset of the present invention. DETAILED DESCRIPTION
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0042] In order to make the above-mentioned objects, features and effects of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] Example 1: A non-stationary traffic prediction method based on wave flow decomposition and time lag perception, such as Figure 1 As shown in the figure, the main steps are as follows: construct a traffic network diagram and input historical traffic flow data; construct a decoupled flow layer (WFDM); decouple the original traffic into "wave component" and "flow component"; construct a time-gated convolutional module (Temporal Gated Convolutional Block 1, TGC1); capture short-term dependencies; construct a time-delay-aware directed graph attention (DeDGA); process the spatiotemporal causal chain of the "wave component"; construct an adaptive graph convolutional network (AdaGCN); process the global steady-state characteristics of the "flow component"; construct a time-gated convolutional module (Temporal Gated Convolutional Block 2, TGC2); capture long-term temporal dependencies; construct an adaptive event fusion module (AEFM); construct a fully connected layer; and output the predicted traffic flow data.
[0044] Step 1: Construct a traffic network diagram, such as Figure 2 As shown, the traffic network is represented as a directed graph ,in is a collection of sensors, is the set of edges between adjacent sensors on the traffic network, is the adjacency matrix, specifically Corresponding to The adjacency matrix is used to represent the connection relationship between sensors; data collection is performed to obtain sensor data in the traffic network. This data contains historical traffic flow information and is usually recorded in the form of time series, such as recording flow, speed and other information every 5 minutes.
[0045] The specific operation is as follows: The first The traffic flow or speed value of each sensor is expressed as ,in , means that only single-channel data (e.g., only traffic or only speed) is considered without multi-feature fusion.
[0046] In the time step When , the values of all sensors on the traffic network are expressed as: ,in It is Sensors at time flow or speed value; is the total number of sensors; This means that each sensor has only one characteristic (flow or speed); is a Column vector of time steps The flow or speed values of all sensors at that time.
[0047] Given History The time slice traffic data is: ,in is the sensor data vector at each time step; is the total number of time steps in the historical data; is a A tensor containing the time steps from 1 to All sensor data.
[0048] The purpose of this invention is to predict the Learning so that it can predict the future Traffic data from all sensors within a time slice , specifically: ,in is the future time step predicted by the model The sensor data vector of Represents the learnable parameters in the model, which are optimized through the training process; is the transportation network diagram; is historical sensor data.
[0049] Step 2: Construct the decoupled flow layer (WFDM), such as Figure 3 As shown in FIG, a wavelet basis function suitable for untangling the traffic volume time series (such as Haar Wavelet (Haar), etc.) is selected, and the traffic flow data is decomposed into components of different frequencies using Discrete Wavelet Transform (DWT).
[0050] In the present invention, the input signal is transformed into Decompose into low-frequency components including trends and the high frequency components of the two saved events and . and Represents the low-pass filter and high-pass filter of the wavelet. The wavelet transform of the input traffic data 𝒳 is specifically: ; ; ;in is the convolution operation; It is a downsampling operation; in the decoupled flow layer, after completing the wavelet transform, low-frequency and high-frequency components are obtained, and these components are down-sampled to reduce the number of time slices of the data.
[0051] In order to restore these components to the length of the original time series and convert them back to the time domain, they need to be upsampled and inverse wavelet transformed (IDWT): ; Its fully connected mold body is: , among which 、 and 、 are learnable parameters.
[0052] The original traffic is decoupled into "wave components" and "flow components": the low-frequency components after wavelet transformation are extracted as the "flow components" that characterize stable propagation, thereby reflecting the long-term trend of traffic flow; the high-frequency components after wavelet transformation are extracted and all high-frequency components are merged as the "wave components" that characterize sudden fluctuations, thereby capturing short-term fluctuations and event information in traffic flow.
[0053] Perform upsampling and inverse wavelet transform to upsample the decomposed low-frequency and high-frequency components, and apply inverse wavelet transform to make the data length consistent with the original input, and return the data of different frequencies to the time domain.
[0054] Step 3: Construct the time-gated convolution module (TGC1), as shown in Figure 4 As shown in the figure, a one-dimensional convolution operation is performed on the input sequence along the time dimension to extract the relationship between adjacent time steps and obtain a feature map. A gated linear unit (GLU) is constructed to divide the feature map obtained by the one-dimensional convolution into a linear part and a gated part. The gated part is activated by the Sigmoid function to limit its value to the range of 0 to 1. Then, the importance of the features in the linear part is adjusted to achieve the screening and enhancement of time series features.
[0055] The specific operation can be expressed as: ; ;in Indicates the input node signal characteristics of TGC1; It is a one-dimensional convolution operation used to extract local features in the time dimension; It is a split operation that divides the output of the one-dimensional convolution into two parts; and The two tensors are the results of segmentation, which are used for linear transformation and gating operation respectively; is the output feature of the time-gated convolution module (TGC1), indicating that The time series features after layer processing; It is an element-level multiplication operation, that is, element-by-element multiplication; Is the activation function, used to map the input value to within the range.
[0056] The TGC1 module is used to capture short-term temporal dependencies from the input sequence, i.e., the changing patterns and trends of traffic flow in a short period of time (e.g., a few minutes to more than ten minutes), such as: The output of TGC1 includes the "Wave Component" feature. and the "Flow Component" feature , which are used as inputs for DeDGA and AdaGCN respectively.
[0057] Step 4: Construct the Delay-Aware Directed Graph Attention (DeDGA). The specific steps are as follows.
[0058] Step 4.1: Calculate the a priori time-lag correlation coefficient. Use the training data to calculate the a priori time-lag correlation coefficient between nodes to reflect the long-term stable time-lag pattern of traffic flow between different nodes.
[0059] set up For sensors The business flow sequence, and then the prior time delay information between nodes is obtained as: ; ; ;in For in time Node business flow; For in time Node business flow; is the sequence length; is the time lag length; is the lag length Node and The time-lag correlation coefficient between the initial time-lag length and the time-lag correlation coefficient needs to be calculated using the overall training data. Start calculating the time-lag correlation coefficient and then gradually increase the time-lag length , and calculate the corresponding time-lag correlation coefficient at each increment , the specific results are as follows Figure 5 shown.
[0060] In step 4.2, dynamic time window features are extracted and combined with the directional features of the current time window to enhance the model's adaptability to real-time traffic conditions.
[0061] Specifically, it can be expressed as: ; ;in It is the feature output by TGC1 to DeDGA; and is a learnable weight matrix used to map input features to a new feature space; tanh is a hyperbolic tangent function, a commonly used activation function used to introduce nonlinearity, which maps input values to within the scope of and It is the output feature matrix after linear transformation and nonlinear activation.
[0062] Step 4.3, calculate , where ReLU is the rectified linear unit function, which is used to map the input value to within the scope of It is the final output feature matrix, which represents the relationship between the processed nodes.
[0063] In step 4.4, based on the prior lag correlation coefficient and dynamic time window characteristics, a lag-aware directed graph attention mechanism is constructed. By calculating the attention weights between nodes, the dynamic propagation lag and spatiotemporal causal chain of traffic waves between nodes are captured: ,in is the prior time-lag correlation coefficient obtained through training, which is a learnable parameter matrix; It is the event data feature on the node output by TGC1; It is used to model directionality and capture the dynamic changes of traffic flow.
[0064] To process the spatiotemporal causal chain of the “wave component”, the “wave component” features output by TGC1 are used as the input of DeDGA. DeDGA captures the causal relationship of the “wave component” in the spatiotemporal dimension and extracts the propagation pattern and trend of the traffic wave, which can be expressed as: .
[0065] Step 5: Build an adaptive graph convolutional network (AdaGCN). The specific steps are as follows.
[0066] In step 5.1, an adaptive graph learning algorithm is used to dynamically adjust the connection weights between nodes and update the topology of the transportation network in real time to capture the dynamic spatial interaction patterns between node neighborhoods.
[0067] Specific as Figure 6 As shown, it can be expressed as: ; ; ;in represents the node adaptive feature, is a learnable parameter; express The diagonalization of , the self-connection is incorporated into the antisymmetric matrix to determine the weights at the diagonal positions. Subsequently, the nonlinear activation function ReLU is used to generate a sparse matrix The adaptive aggregation module converts the sparse matrix With the existing adjacency matrix Integrate to produce a matrix ,in represents a nonlinear activation function (e.g., Sigmoid), The convolution kernel is The convolutional layer, Denotes Hadamard product multiplication. Next, in order to further enhance the sparsity of the matrix, the obtained matrix Normalize, where and Corresponding to and The diagonal matrix of ; It is used to eliminate the matrix the threshold of medium-weak ties; is the output matrix of the adaptive graph learning algorithm.
[0068] In step 5.2, a graph convolution method based on Chebyshev polynomials is used to perform convolution operations on node features to extract the global steady-state features of the road network while balancing computational efficiency and model representation capabilities.
[0069] Specifically, it can be expressed as: ; Among them, the parameters is the vector of polynomial coefficients; , is the Laplace matrix, is the largest eigenvalue of the Laplacian matrix, is the identity matrix, is the result of the adaptive graph learning algorithm, is the node feature output by TGC1; is a Chebyshev polynomial, which is recursively defined as: ;in The table shows Chebyshev polynomials of order; is the independent variable of the Chebyshev polynomial, usually a real number with a value range of Inside; is the order of the Chebyshev polynomial, which indicates the complexity of the polynomial.
[0070] Processing the global steady-state characteristics of the “flow component”, the “flow component” characteristics output by TGC1 are used as the input of AdaGCN. AdaGCN is used to extract the global steady-state characteristics contained in the “flow component”, that is, the stable change trend and pattern of traffic flow over a long time range, which can be expressed as: .
[0071] Step 6: Construct a time-gated convolution module (TGC2). After processing the spatial dimension, use the TGC2 module to further process the results of DeDGA and AdaGCN to capture long-term temporal dependencies, that is, the changing patterns and trends of traffic flow over a longer time span (such as several hours).
[0072] Specifically, it can be expressed as: ,in and They are the characteristic representations of the processed “wave component” and “flow component” respectively; and They come from DeDGA and AdaGCN respectively.
[0073] Step 7: Build the Adaptive Event Fusion Module (AEFM), such as Figure 7 As shown in the figure, the attention weight is first calculated, and the events of each time slice in the trend are weighted and summed. The weight is calculated by the attention mechanism, and data-driven event weight adjustment is achieved through back-propagation learning; then the features are fused. According to the calculated attention weight, the prediction results of the "wave component" and "flow component" are adaptively fused, retaining useful event information and discarding useless events to obtain a comprehensive representation of traffic flow.
[0074] Specifically, it can be expressed as: ; ;in Indicates the time step The predicted traffic flow or speed value at the location; It is the "flow component" prediction result obtained by the adaptive graph convolutional network (AdaGCN), which represents the long-term trend of traffic flow; is the total number of time steps in the historical data, indicating the number of past time steps used by the model; is the number of time steps in the forecast, which represents the number of future time steps predicted by the model; is the attention weight, indicating the time step Place opposite The importance of event data at each time step; It is a weight matrix used to linearly transform the prediction results of the “wave component”; It is the prediction result of the “wave component” obtained by Delay-Aware Directed Graph Attention (DeDGA), which represents the short-term fluctuation part of traffic flow; Is a weight matrix used to convert the prediction results of the "flow component" into a query vector (Query Vector); Is a weight matrix used to convert the prediction results of the "wave component" into a key vector (Key Vector); is the dot product between the query vector and the key vector, used to calculate the "flow component" and "wave component" at the time step and the correlation between It is the sum of the exponential dot products of all future time steps and is used to normalize the attention weights.
[0075] Obtain a collection of traffic flow or speed values predicted by the model through fusion , usually a three-dimensional tensor, used here to store future All time steps The predicted value of traffic flow or speed from each sensor; The dimension of the tensor is , that is, there are three dimensions in the tensor, Represents the feature dimension of each sensor (usually Represents a single characteristic, such as flow or speed; represents multiple features).
[0076] Step 8: Construct a fully connected layer and use a fully connected neural network to convert the future traffic representation output by AEFM into the expected predicted value, that is, map the fused features into the traffic flow prediction space, which is expressed as ,in express The set of traffic flow or speed values converted by a fully connected neural network, Indicates the number of features per sensor (usually Represents a single characteristic, such as flow or speed; represents multiple characteristics such as flow rate, speed, and occupancy).
[0077] Step 9: Output predicted traffic flow data: Generate prediction results. After passing through the fully connected layer, the final traffic flow prediction results are obtained, which are usually expressed in the form of a tensor, including the traffic flow prediction values of each sensor in multiple future time steps; evaluate the model, use indicators such as L1 loss to monitor and evaluate the prediction results, and calculate the prediction error by comparing with the true value to measure the prediction performance of the model of the present invention.
[0078] The loss function can be expressed as: ,in The loss function for the traffic prediction task is used to measure the difference between the model prediction value and the true value; and are the total number of time steps of historical data and the total number of time steps of prediction, respectively; is the index of the time step; is the number of sensors, indicating how many sensors there are in the traffic network; is the index of the sensor, indicating which sensor's prediction error is currently being calculated; is the true value, indicating that at the time step Place The actual value of traffic flow or speed from each sensor; is the predicted value, indicating the time step Place The predicted value of traffic flow or speed from each sensor; is the absolute error, expressed in time steps Place The absolute difference between the true value and the predicted value of each sensor.
[0079] In summary, the overall framework of the present invention is as follows Figure 8 As shown in FIG, the present invention is composed of a decoupled flow layer, multiple spatiotemporal blocks (ST blocks) and an adaptive fusion output layer. Figure 9 The WaveFlowNet model shown.
[0080] This example uses four public datasets, including PeMS03, PeMS04, PeMS07, and PeMS08, for experiments. The GPS data in the PeMS datasets is obtained from https: / / PeMS.dot.ca.gov / . This example uses traffic flow as the research object and divides all datasets into training, validation, and test sets in a 6:2:2 ratio based on time. The detailed information and division of the datasets are shown in the following table: .
[0081] PeMS03: The collected data is flow rate (veh / 5min) characteristics, and the time period is from September 1, 2018 to November 30, 2018, a total of 91 days.
[0082] PeMS04: The collected data includes traffic volume (veh / 5 minutes), average speed (mph / 5 minutes), and average occupancy, covering January 1, 2018, to February 28, 2018, a total of 59 days.
[0083] PeMS07: The collected data is flow rate (veh / 5min) characteristics, covering the period from May 1, 2017 to August 31, 2017, a total of 123 days.
[0084] PeMS08: The collected data includes traffic volume (veh / 5 minutes), average speed (mph / 5 minutes), and average occupancy rate, covering July 1, 2016 to August 31, 2016, a total of 62 days.
[0085] This example uses three indicators commonly used in traffic flow prediction tasks, namely root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) to evaluate the prediction accuracy of the proposed model, as shown below: ; ; ;in represents the true value of traffic flow; represents the predicted value of traffic flow; Represents the total number of samples; the lower the three indicators are, the higher the predictive ability of the model is.
[0086] To verify the performance of the WaveFlowNet model proposed in this paper in traffic flow prediction, this experiment evaluates its prediction efficiency on four standard datasets (PeMS03 / 04 / 07 / 08) and compares it with the following models.
[0087] Traditional models: Historical Average (HA), Autoregressive Integrated Moving Average (ARIMA), Support Vector Regression (SVR), and Long Short-Term Memory (LSTM).
[0088] Classic benchmark models: Temporal Convolutional Network (TCN), Spatio-Temporal Graph Convolutional Network (STGCN), Graph WaveNet (GWN), Attention-Based Spatio-Temporal Graph Convolutional Network (Revised), ASTGCN(r).
[0089] Cutting-edge methods: Dual-Stage Spatial-Temporal Graph Neural Network (D2STGNN), Spatio-Temporal Dual-Former (PDFormer), Spatio-Temporal Autoencoder Transformer (STAEformer), Dual-Phase Spatio-Temporal Graph Convolution (DPSTGC).
[0090] Other latest models: Progressive Graph Convolutional Network (PGCN), Contrastive Consistency Learning for Time Series Generative Adversarial Network (CCST-GAN), Long Short-Term Memory Neural Network (LSTNN).
[0091] The performance comparison of the WaveFlowNet model proposed in this application and the above methods after testing is shown in the following table: .
[0092] As can be seen, for the PeMS07 dataset, which has the most nodes, the RMSE of the WaveFlowNet model is 4.54%, 8.92%, 4.51%, and 11.30% lower than those of the CCST-GAN, LSTNN, DPSTGC, and PGCN models, respectively. On the PeMS03 dataset, which has fewer nodes, the RMSE, MAE, and MAPE values of the WaveFlowNet model are 9.22%, 7.37%, and 7.91% lower than those of the STAEformer model, respectively. This demonstrates that the three-stage learning model for modeling spatiotemporal traffic evolution, which integrates dynamic decoupling, time-delay perception, and spatiotemporal resonance, can fully capture the complex dependencies and patterns in the spatiotemporal domain.
[0093] like Figure 10As shown, the error reduction percentage remains low overall (average 8.2% ± 2.3%), confirming the WaveFlowNet model's stable forecasting performance over the full 5-60 minute forecast range. By coupling spatiotemporal features, the model significantly mitigates the cumulative effect of forecast errors (12.8% MAPE reduction for short-term forecasts and 5.3% MAPE reduction for long-term forecasts). This temporal robustness is of great value for intelligent transportation systems (ITS).
[0094] Figure 11 The comparison results of traffic flow prediction and measured values at different time steps (T=1, 6, 12) at 39 nodes of the PeMS04 dataset on February 21, 2018 are shown. Figure 12 This paper presents a comparison of prediction performance at the same scale for node 35 of the PeMS08 dataset on August 24, 2016. WaveFlowNet utilizes a spatiotemporal convolutional gating mechanism to ensure short-term prediction accuracy while also achieving excellent long-term traffic flow prediction results through its attention weight allocation strategy. This demonstrates that the proposed model achieves both microscopic accuracy for short-term predictions and macroscopic reliability for long-term predictions, which holds significant value for intelligent transportation applications such as dynamic routing decisions and congestion warnings.
[0095] Embodiment 2: The computer-readable storage medium of this embodiment stores a computer program thereon, which, when executed by a processor, implements the steps of the non-stationary traffic prediction method based on wave flow decomposition and time lag perception in embodiment 1.
[0096] The computer-readable storage medium of this embodiment may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal; the computer-readable storage medium of this embodiment may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, etc. equipped on the terminal; further, the computer-readable storage medium may also include both an internal storage unit of the terminal and an external storage device.
[0097] The computer-readable storage medium of this embodiment is used to store computer programs and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
[0098] Example 3: The computer device of this embodiment includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the non-stationary traffic prediction method based on wave flow decomposition and time lag perception in Example 1 are implemented.
[0099] In this embodiment, the processor can be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The memory can include read-only memory and random access memory, and provide instructions and data to the processor. A part of the memory can also include non-volatile random access memory. For example, the memory can also store information about the device type.
[0100] Those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above-mentioned technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in various embodiments or certain portions of the embodiments.
[0101] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein with equivalents. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A non-stationary traffic prediction method based on wave flow decomposition and time lag perception, characterized in that: The following steps are involved: Step 1: Represent the traffic network as a directed graph and obtain the traffic data of all sensors in the traffic network; Step 2: Construct a decoupled flow layer and use wavelet transform to decouple the flow data into "wave component" and "flow component". The two high-frequency components after wavelet transform are combined into "wave component", which is used to capture short-term fluctuations and event information in the flow data; the low-frequency component after wavelet transform is "flow component", which is used to reflect the long-term trend of the flow data. Step 3: Construct a time-gated convolution module TGC1 and input the data obtained in step 2 into TGC1 to capture short-term temporal dependencies and obtain "wave component" and "flow component" features. Step 4: Construct a time-delay-aware directed graph attention (DeDGA) and use the "wave component" features output by TGC1 as the input of DeDGA to capture the causal relationship of the "wave component" in the temporal and spatial dimensions. Step 5: Construct an adaptive graph convolutional network AdaGCN, use the "flow component" features output by TGC1 as the input of AdaGCN, and extract the global steady-state features contained in the "flow component"; Step 6: Construct a time-gated convolution module TGC2, and use TGC2 to further process the features processed by DeDGA and AdaGCN to capture long-term temporal dependencies. Step 7: Construct an adaptive event fusion module (AEFM). The weights are calculated by the attention mechanism and learned through backpropagation. Based on the obtained attention weights, the prediction results of the "wave component" and "flow component" are fused to obtain a comprehensive representation of future traffic. Step 8: Construct a fully connected layer and use a fully connected neural network to convert the future traffic representation output by AEFM into the desired predicted value; Step 9: Output the predicted traffic flow data; use the loss function to evaluate the predicted traffic flow data, calculate the prediction error by comparing it with the true value, and measure the prediction performance; The construction method of the time-delay-aware directed graph attention DeDGA is as follows: Step 4.1, calculate the prior time-lag correlation coefficient, let For the data of sensor nodes, two sensor nodes and The prior time-lagged correlation coefficient between is: ; ; ;in For in time Node business flow; For in time Node business flow; is the sequence length; is the time lag length; is the lag length Sensor nodes and The time-lagged correlation coefficient between The time-lag correlation coefficient is calculated from the initial time-lag length Start calculating the time-lag correlation coefficient and then gradually increase the time-lag length , and calculate the corresponding time-lag correlation coefficient at each increment ; Step 4.2, extract dynamic time window features: ; ;in It is the feature output by TGC1 to DeDGA; and is a learnable weight matrix used to map input features to a new feature space; Tanh is the hyperbolic tangent function, which is used to introduce nonlinearity and map the input value to within the scope of and It is the output feature matrix after linear transformation and nonlinear activation; Step 4.3, output feature matrix , where ReLU is the rectified linear unit function, which is used to map the input value to within the scope of Step 4.4: Based on the prior lag correlation coefficient and dynamic time window features, a lag-aware directed graph attention mechanism is constructed: ,in is the prior time-lag correlation coefficient obtained through training, is the learnable parameter matrix, This is the "wave component" feature output by DeDGA.
2. The non-stationary traffic prediction method based on wave flow decomposition and time lag perception according to claim 1 is characterized in that: Enter the traffic data in step 2 The wavelet transform of is: ; ; ;in and represents the low-pass filter and high-pass filter of the wavelet, is the convolution operation; is a downsampling operation; in the decoupled flow layer, after completing the wavelet transform, the low-frequency component is obtained and two high-frequency components and ; Perform upsampling and inverse wavelet transform to obtain "wave components" and "flow component" : ; ;in 、 and 、 are learnable parameters.
3. The non-stationary traffic prediction method based on wave flow decomposition and time lag perception according to claim 1 is characterized in that: The time-gated convolution modules TGC1 and TGC2 are specifically expressed as: ; ;in Represents the input node signal characteristics of the time-gated convolution module; It is a one-dimensional convolution operation used to extract local features in the time dimension; It is a split operation that divides the output of the one-dimensional convolution into two parts; and The two tensors are the results of segmentation, which are used for linear transformation and gating operation respectively; is the output feature of the time-gated convolution module, which means The time series features of the layer after processing; It is an element-level multiplication operation, that is, element-by-element multiplication; Is the activation function, used to map the input value to within the range.
4. The non-stationary traffic prediction method based on wave flow decomposition and time lag perception according to claim 2 is characterized in that: The construction method of AdaGCN is as follows: Step 5.1 uses an adaptive graph learning algorithm to dynamically adjust the connection weights between nodes, expressed as: ; ; ;in represents the node adaptive feature, is a learnable parameter; express The self-connections are incorporated into the antisymmetric matrix to determine the weights at the diagonal positions; Use nonlinear activation function ReLU to generate sparse matrix , the adaptive aggregation module converts the sparse matrix With the existing adjacency matrix Integrate to produce a matrix ,in represents a nonlinear activation function, The convolution kernel is The convolutional layer, Represents Hadamard product multiplication; for the matrix obtained Normalize, where and Corresponding to and The diagonal matrix of ; It is used to eliminate the matrix the threshold of medium-weak ties; is the output matrix of the adaptive graph learning algorithm; Step 5.2, based on the graph convolution method of Chebyshev polynomials, performs convolution operation on the node features, which is expressed as: ; Among them, the parameters is the vector of polynomial coefficients; , is the Laplace matrix, is the largest eigenvalue of the Laplacian matrix, is the identity matrix, It is the feature output by TGC1 to AdaGCN; It is the "flow component" feature output by AdaGCN; is a Chebyshev polynomial, which is recursively defined as: ;in Indicates the Chebyshev polynomials of order; is the independent variable of Chebyshev polynomial, and its value range is Inside; is the order of the Chebyshev polynomial, which indicates the complexity of the polynomial.
5. The non-stationary traffic prediction method based on wave flow decomposition and time lag perception according to claim 1 is characterized in that: Step 7 is as follows: ; ;in Indicates sensor In the time step The predicted traffic flow or speed value at the location; It is the "flow component" prediction result after processing by TGC2, which represents the long-term trend of traffic flow; is the total number of time steps in the historical data, indicating the number of past time steps used by the model; is the number of time steps in the forecast, which represents the number of future time steps predicted by the model; is the attention weight, indicating the time step Place opposite The importance of event data at each time step; Is a weight matrix used to linearly transform the prediction results of the "wave component"; The "wave component" prediction result after TGC2 processing represents the short-term fluctuation of traffic flow; is a weight matrix used to convert the "flow component" prediction results into query vectors; is a weight matrix used to convert the "wave component" prediction results into key vectors; is the dot product between the query vector and the key vector, used to calculate the "flow component" and "wave component" at the time step and the correlation between The sum of the exponential dot products of all future time steps is used to normalize the attention weight; the set of traffic flow or speed values predicted by the model obtained by fusion is , storing the future All time steps The predicted value of traffic flow or speed from each sensor; The dimension of the set is , Represents the feature dimension of each sensor.
6. The non-stationary traffic prediction method based on wave flow decomposition and time lag perception according to claim 5 is characterized in that: The loss function of step 9 is expressed as: ,in Represents the loss function of traffic prediction, which is used to measure the difference between the model prediction value and the true value; and are the total number of time steps of historical data and the total number of time steps of prediction, respectively; is the index of the time step; is the number of sensors, indicating how many sensors there are in the traffic network; is the index of the sensor, indicating which sensor's prediction error is currently being calculated; is the true value, indicating that at the time step Place The actual value of traffic flow or speed from each sensor; is the predicted value, which means at the time step Place The predicted value of traffic flow or speed from each sensor; is the absolute error, expressed in time steps Place The absolute difference between the true value and the predicted value of each sensor.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the non-stationary traffic prediction method based on wave flow decomposition and time delay perception as described in any one of claims 1 to 6 are implemented.
8. A computer device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the non-stationary traffic prediction method based on wave flow decomposition and time delay perception are implemented as described in any one of claims 1-6.
Citation Information
Patent Citations
Traffic prediction method and device based on dynamic space-time diagram convolution attention model
CN113487088A
Road network level traffic flow integrated prediction method based on adaptive time series decomposition
CN116824838A