Traffic and atmospheric pollution two-way coupling flow prediction method based on double-path dynamic fusion

By adopting a two-way coupled traffic and air pollution flow prediction method with dynamic fusion of two paths, the problem of insufficient traffic flow prediction accuracy in pollution-sensitive scenarios is solved, high-precision end-to-end prediction is achieved, and the adaptability and generalization ability of the model are improved.

CN121938205BActive Publication Date: 2026-06-02EAST CHINA JIAOTONG UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
EAST CHINA JIAOTONG UNIVERSITY
Filing Date
2026-03-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods lack accuracy in pollution-sensitive scenarios, fail to effectively characterize the two-way feedback mechanism between traffic and pollution, exhibit prominent feature entanglement problems, and have poor adaptability to static fusion strategies, leading to a decline in prediction performance.

Method used

A two-way coupled traffic and air pollution flow prediction method with dynamic fusion of dual paths is adopted. Through spatiotemporal alignment and normalization, traffic flow and air pollutant data are separated. Local temporal features are extracted by gated convolution and probabilistic sparse self-attention. Feature interaction is carried out by combining reversible coupling transformation and cross attention, and feature weights are dynamically adjusted to achieve end-to-end prediction.

Benefits of technology

It significantly improves prediction accuracy and environmental perception capabilities in pollution-sensitive scenarios. The model can adaptively adjust feature weights according to real-time pollution intensity, thereby improving generalization ability and prediction performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121938205B_ABST
    Figure CN121938205B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent transportation and Internet of Vehicles, in particular to a traffic and atmospheric pollution two-way coupling flow prediction method based on double-path dynamic fusion. The method comprises the following steps: collecting traffic flow and air pollutant concentration data, and performing spatio-temporal alignment and reversible instance normalization; dividing the data into two branches, extracting time-dependent features through gated convolution and probabilistic sparse self-attention in the first branch, and obtaining variable interaction features through dimension reshaping, context extraction and reversible coupling transformation in the second branch; performing two-way feature interaction through cross-attention, dynamically generating weights based on channel attention, and performing residual connection after weighted fusion; linearly mapping the fused features and performing inverse normalization to obtain traffic flow prediction values. The present application significantly improves the prediction accuracy and robustness in pollution-sensitive scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation and vehicle networking technology, specifically a two-way coupled traffic and air pollution flow prediction method based on dual-path dynamic fusion. Background Technology

[0002] With the development of 5G vehicle-to-everything (V2X) technology, traffic flow prediction has become a core technology of intelligent transportation systems. Its prediction accuracy directly affects the scientific nature of traffic resource scheduling and environmental governance decisions. Traffic flow and atmospheric environment form a two-way asymmetric dynamic coupling mechanism, in which traffic flow growth leads to the accumulation of pollutant emissions, air quality decline inhibits residents' willingness to travel, and thus leads to a reduction in traffic flow. This mechanism is particularly significant in pollution-sensitive scenarios.

[0003] However, existing technologies have three major drawbacks: First, the two-way coupling modeling is insufficient, with most models treating air quality as a static exogenous variable or ignoring it completely, failing to characterize the two-way feedback mechanism between traffic and pollution; second, the feature entanglement problem is prominent, with single-path architectures struggling to distinguish between the inherent temporal features of traffic and the features of environmental disturbances; and third, the static fusion strategy has poor adaptability, with fixed weight allocations unable to dynamically adjust feature contributions according to pollution intensity, resulting in a significant drop in prediction performance in complex scenarios. Summary of the Invention

[0004] This invention provides a two-way coupled traffic and air pollution flow prediction method with dynamic fusion of two paths, aiming to solve the problem of insufficient accuracy of existing traffic flow prediction methods in pollution-sensitive scenarios.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] The present invention provides a dual-path dynamic fusion method for bidirectional coupled traffic and air pollution flow prediction, comprising:

[0007] S100: Collect traffic flow data and air pollutant concentration data of the target area, and after spatiotemporal alignment and normalization, divide it into two branches: the first branch extracts traffic flow data to form a traffic flow time series, and the second branch retains traffic flow data and all air pollutant concentration data.

[0008] S200: Extract local time-series features and model long-term dependencies from the traffic flow time-series sequence to obtain time-dependent features;

[0009] S300: The second branch data is dimensionally reshaped to generate a traffic-pollution alternation sequence. After extracting contextual features, it is divided into a traffic subsequence and a pollution subsequence. The traffic subsequence and the pollution subsequence are reversibly coupled and transformed. The transformed traffic subsequence and the pollution subsequence are fused to obtain variable interaction features.

[0010] S400: Perform bidirectional feature interaction on the time-dependent feature and the variable interaction feature through cross-attention calculation, dynamically generate time feature weights and interaction feature weights based on channel attention, multiply the time-dependent feature with the time feature weights, multiply the variable interaction feature with the interaction feature weights and add them together, and perform residual connection with the time-dependent feature to obtain the fused feature;

[0011] S500: Perform linear mapping on the fused features and inverse normalization to obtain traffic flow prediction values.

[0012] As a preferred embodiment of the present invention, the normalization process employs reversible instance normalization, specifically including:

[0013] Calculate the mean and standard deviation over time for the spatiotemporally aligned traffic flow data and air pollutant concentration data;

[0014] The normalized data is obtained by subtracting the mean from the traffic flow data and air pollutant concentration data and then dividing by the sum of the standard deviation and a preset constant.

[0015] The mean and standard deviation are stored for the inverse normalization.

[0016] As a preferred embodiment of the present invention, the local temporal feature extraction is achieved through gated convolution, specifically including:

[0017] The first one-dimensional convolutional layer is applied to the traffic flow time series to obtain convolutional features;

[0018] A second one-dimensional convolutional layer is applied to the traffic flow time series and gating weights are obtained by applying a Sigmoid activation function;

[0019] The convolutional features are multiplied element-wise with the gating weights to obtain local temporal features.

[0020] As a preferred embodiment of the present invention, the long-term dependency modeling employs a probabilistic sparse self-attention mechanism, specifically including:

[0021] The local temporal features are transformed linearly to generate query vector, key vector, and value vector, respectively.

[0022] The dispersion of attention scores is calculated by randomly sampling a portion of the key vectors, and high-importance query vectors are selected based on the dispersion.

[0023] Calculate the attention score of the high-importance query vector and all key vectors, normalize the attention score using Softmax, and then sum the attention score with the value vector to obtain the attention output of the high-importance query vector.

[0024] For query vectors that are not of high importance, the global average value of the value vector is reused as the attention output;

[0025] The time-dependent features are obtained by performing residual connection and layer normalization on the local temporal features and the attention output.

[0026] As a preferred embodiment of the present invention, the generation of the traffic-pollution alternation sequence specifically includes:

[0027] The dimensions of the data in the second branch are replaced by swapping the variable dimension and the time dimension.

[0028] The replaced data is dimensionally reshaped to form a traffic-pollution alternation sequence.

[0029] As a preferred embodiment of the present invention, the extraction of contextual features employs dilated one-dimensional convolution.

[0030] As a preferred embodiment of the present invention, the reversible coupling transformation specifically includes:

[0031] The traffic subsequence is transformed through the first gated subnet, and its exponent is obtained. Then, the exponent is multiplied element-wise with the pollution subsequence to obtain the first intermediate variable.

[0032] The pollution subsequence is transformed through the second gated subnet, and its exponent is obtained. Then, it is multiplied element-wise with the traffic subsequence to obtain the second intermediate variable.

[0033] The first intermediate variable is transformed through the first projection subnet and then added to the second intermediate variable to obtain the transformed traffic subsequence;

[0034] The second intermediate variable is transformed through the second projection subnet, and the transformed polluted subsequence is obtained by subtracting the transformation result from the first intermediate variable.

[0035] As a preferred embodiment of the present invention, both the first gated subnet and the second gated subnet are composed of two multilayer perceptrons, and both the first projection subnet and the second projection subnet are composed of one-dimensional convolutional layers.

[0036] As a preferred embodiment of the present invention, the bidirectional feature interaction specifically includes:

[0037] Using the time-dependent feature as the query and the variable interaction feature as the key and value, the first interaction feature is obtained through multi-head attention computation.

[0038] Using the variable interaction feature as the query and the time dependency feature as the key and value, the second interaction feature is obtained through multi-head attention calculation.

[0039] The attention feature is obtained by adding the first interaction feature and the second interaction feature.

[0040] As a preferred embodiment of the present invention, the dynamic generation of temporal feature weights and interaction feature weights based on channel attention specifically includes:

[0041] Local channel features are obtained by sequentially performing batch normalization, ReLU activation, and a first one-dimensional convolution on the attention features.

[0042] After adaptive average pooling, the attention features are sequentially subjected to batch normalization, ReLU activation, and a second one-dimensional convolution to obtain global channel features;

[0043] The local channel features are added to the global channel features to obtain the channel attention score;

[0044] The channel attention scores and their inverses are Softmax normalized to obtain the temporal feature weights and the interaction feature weights, respectively.

[0045] The beneficial effects of this invention are:

[0046] 1. This invention achieves decoupling extraction of time-dependent features and variable interaction features through a dedicated dual-path architecture. Combined with reversible coupling transformation, it explicitly models the asymmetric bidirectional coupling relationship between traffic flow and pollutants, accurately characterizing the cumulative effect of traffic on pollution and the inhibitory effect of pollution on traffic. Experiments show that this invention significantly outperforms existing models in pollution-sensitive scenarios, improving prediction accuracy and environmental perception capabilities.

[0047] 2. This invention achieves dynamic feature fusion through bidirectional cross-attention and competitive channel attention mechanisms, enabling the model to adaptively adjust the weight ratio of temporal features and environmental features based on real-time pollution intensity. This dynamic fusion strategy overcomes the limitations of traditional static weight allocation, maintaining stable predictive performance under different pollution levels and improving the model's generalization ability.

[0048] 3. This invention employs a probabilistic sparse self-attention mechanism to reduce the computational complexity of long-term dependent modeling. By combining gated convolution local feature extraction and reversible coupled transformation bidirectional modeling, an efficient end-to-end prediction framework is constructed, providing real-time high-precision prediction support for pollution-sensitive intelligent traffic management. Attached Figure Description

[0049] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0050] Figure 1This is a flowchart illustrating the bidirectional coupled traffic and air pollution flow prediction method based on the dynamic fusion of dual paths of the present invention. Detailed Implementation

[0051] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0052] Example 1: Refer to Figure 1 As shown, the dual-path dynamic fusion traffic and air pollution bidirectional coupled flow prediction method of the present invention includes:

[0053] S100: Collect traffic flow data and air pollutant concentration data of the target area, and after spatiotemporal alignment and normalization, divide it into two branches: the first branch extracts traffic flow data to form a traffic flow time series, and the second branch retains traffic flow data and all air pollutant concentration data.

[0054] Furthermore, the normalization process employs reversible instance normalization, specifically including:

[0055] Calculate the mean and standard deviation over time for the spatiotemporally aligned traffic flow data and air pollutant concentration data;

[0056] The normalized data is obtained by subtracting the mean from the traffic flow data and air pollutant concentration data and then dividing by the sum of the standard deviation and a preset constant.

[0057] The mean and standard deviation are stored for the inverse normalization.

[0058] Specifically, firstly, traffic flow data and air pollutant concentration data for the target area are collected. Traffic flow data includes information such as vehicle volume and speed at different monitoring points at different times, while air pollutant concentration data includes concentration values ​​of various pollutants such as PM2.5, PM10, NO2, SO2, CO, and O3.

[0059] Collect historical traffic flow data and corresponding historical air quality data for the target area to construct the dataset required for training and testing.

[0060] Traffic flow data is collected through roadside sensors, vehicle GPS, traffic monitoring platforms, etc. The core data includes time-series data such as traffic volume, average vehicle speed, and traffic occupancy, which is denoted as traffic flow time series. ,in This represents the length of the historical time window. This invention uses only traffic flow data for prediction.

[0061] Air quality data is collected through urban environmental monitoring stations and distributed air quality sensors. Core data include fine particulate matter (PM2.5), ozone (O3), and nitrogen oxides (NOx). x The time-series data of pollutant concentrations such as sulfur dioxide (SO2) and carbon dioxide (CO2) are denoted as the exogenous environmental variable series. ,in This refers to the types and quantities of pollutants.

[0062] Data alignment is based on timestamps to align traffic flow data with air quality data in time and space, ensuring a one-to-one correspondence between traffic status and pollution concentration data at the same time step; for cross-regional data, spatial consistency is achieved through geographic coordinate matching.

[0063] The collected raw dataset is preprocessed to eliminate the effects of noise, missing values, and differences in data distribution. The specific process is as follows:

[0064] Missing values ​​were filled in traffic flow and air quality data using linear interpolation. For data with consecutive missing values ​​≤ 3 time steps, the missing values ​​were estimated using the linear trend of adjacent valid data; for data with consecutive missing values ​​> 3 time steps, the missing values ​​were filled in using the historical mean of the same time period to ensure the continuity of the data sequence.

[0065] Reversible instance normalization is used to mitigate the non-stationarity of traffic flow and pollution data. This is applied to the aligned fused dataset. Perform instance normalization, where For batch size, This represents the total number of variables. The normalization formula is as follows:

[0066] ;

[0067] in, and These represent the mean and standard deviation of the data over the time dimension. This is a numerical stability constant. Storage. and It is used for inverse normalization in the prediction stage to restore the true value scale.

[0068] After normalization, the data is divided into two branches for parallel processing. The first branch extracts only traffic flow data, forming a traffic flow time series for time-dependent feature extraction. The second branch retains complete traffic flow data and all air pollutant concentration data, forming a multivariate time series for variable interaction feature extraction. This dual-branch design enables the model to simultaneously capture the time-dependent characteristics of traffic flow and the coupling relationship between traffic and pollution.

[0069] S200: Extract local time-series features and model long-term dependencies from the traffic flow time-series sequence to obtain time-dependent features;

[0070] Furthermore, the local temporal feature extraction is achieved through gated convolution, specifically including:

[0071] The first one-dimensional convolutional layer is applied to the traffic flow time series to obtain convolutional features;

[0072] A second one-dimensional convolutional layer is applied to the traffic flow time series and gating weights are obtained by applying a Sigmoid activation function;

[0073] The convolutional features are multiplied element-wise with the gating weights to obtain local temporal features.

[0074] Furthermore, the long-term dependency modeling employs a probabilistic sparse self-attention mechanism, specifically including:

[0075] The local temporal features are transformed linearly to generate query vector, key vector, and value vector, respectively.

[0076] The dispersion of attention scores is calculated by randomly sampling a portion of the key vectors, and high-importance query vectors are selected based on the dispersion.

[0077] Calculate the attention score of the high-importance query vector and all key vectors, normalize the attention score using Softmax, and then sum the attention score with the value vector to obtain the attention output of the high-importance query vector.

[0078] For query vectors that are not of high importance, the global average value of the value vector is reused as the attention output;

[0079] The time-dependent features are obtained by performing residual connection and layer normalization on the local temporal features and the attention output.

[0080] Specifically, the preprocessed normalized data Branching and feature embedding are performed according to the requirements of the dual-path architecture.

[0081] Data branching includes: traffic flow from Extract the target traffic flow variables to form a univariate sequence. Used for temporal feature modeling of time-dependent paths; multivariate flow reserve All variables (traffic flow + all pollutants) in the dataset are obtained through dimensional permutation and reshaping. It is used for modeling the coupling relationship of variable interaction paths.

[0082] Time-location coding embedding of traffic flow Time position encoding is added to preserve temporal sequence information. The encoding formula is as follows:

[0083] PE(t,d)= ;

[0084] in, For time step index, Indexed by feature dimensions, For the embedding dimension, the location code is added to the traffic flow features to obtain the embedded sequence. .

[0085] Local temporal feature extraction is achieved through gated convolution, which can capture local change patterns in traffic flow data within a short time window. The gated convolution mechanism adaptively controls information flow and filters out irrelevant information by introducing gating units. The specific implementation steps are as follows:

[0086] First, for the embedded sequence Applying the first one-dimensional convolutional layer, we obtain convolutional features. :

[0087] ;

[0088] Here, Conv1d represents a one-dimensional convolution operation, where the convolution kernel slides along the time dimension to extract feature representations within a local time window. The kernel size is typically set to 3 or 5 to capture local dependencies between adjacent time steps.

[0089] Meanwhile, for the embedded sequence A second one-dimensional convolutional layer is applied, and the gated weights are obtained through the Sigmoid activation function. :

[0090] ;

[0091] in, This represents the Sigmoid activation function. Gating weights. The range of values ​​is This is used to control the importance of features at each time step.

[0092] Convolutional features With gate weights Element-wise multiplication is performed to obtain local temporal features. :

[0093] ;

[0094] in, This represents element-wise multiplication. Through gating mechanisms, the model can adaptively select important local temporal patterns and suppress noise and redundant information.

[0095] After obtaining local temporal features, a probabilistic sparse self-attention mechanism is used for long-term dependency modeling. The traditional self-attention mechanism has a computational complexity of... When the time series length When the size is large, the computational cost is high. The probabilistic sparse self-attention mechanism selects high-importance query vectors through probabilistic sampling, significantly reducing the computational complexity to [amount missing]. At the same time, it maintains the ability to capture long-term dependencies. The specific implementation steps are as follows:

[0096] First, local temporal features Query vectors are generated through linear transformations. Key vector Sum value vector :

[0097] ;

[0098] in, This is a learnable weight matrix.

[0099] Sparsity evaluation calculates the attention score dispersion by randomly sampling a subset of key vectors, thus filtering for high-importance query vectors. Specifically, from... Random sampling There are n key vectors, where , This is a constant factor, typically taking a value of 5. For each query vector... Calculate its attention score with respect to the sampled key vector, and calculate the dispersion. Used to measure the importance of query vectors. The greater the dispersion, the greater the difference in attention the query vector pays to different key vectors, and thus the higher its importance. Ranked queries are then filtered based on dispersion. The query vector is used as the high-importance query vector, where .

[0100] During attention computation, high-importance query vectors are given attention along with all key vectors, while the remaining query vectors reuse the global context. The sparse attention output is:

[0101] ;

[0102] in, Represents a high-importance query vector. This represents the dimension of the key vector. This represents the global average of the value vectors, used for attention output on non-highly important query vectors.

[0103] Finally, local temporal features Residual connections and layer normalization are performed with the sparse attention output to obtain time-dependent features. :

[0104] ;

[0105] Here, LayerNorm represents the layer normalization operation, used to stabilize the training process and accelerate convergence. Time-dependent features It integrates local temporal patterns and long-term dependencies, providing a temporal dimension representation for subsequent feature fusion.

[0106] S300: The second branch data is dimensionally reshaped to generate a traffic-pollution alternation sequence. After extracting contextual features, it is divided into a traffic subsequence and a pollution subsequence. The traffic subsequence and the pollution subsequence are reversibly coupled and transformed. The transformed traffic subsequence and the pollution subsequence are fused to obtain variable interaction features.

[0107] Furthermore, the generation of the traffic-pollution alternation sequence specifically includes:

[0108] The dimensions of the data in the second branch are replaced by swapping the variable dimension and the time dimension.

[0109] The replaced data is dimensionally reshaped to form a traffic-pollution alternation sequence.

[0110] Specifically, for multivariable streams Dimensional reshaping and replacement are performed to generate a traffic-pollution alternation sequence. First, [the sequence is then...]. Perform the dimension permutation operation (Permute) to adjust the dimension order. The original Dimension order adjusted to This places the time dimension in the middle. Then, the permuted data is reshaped to generate a traffic-pollution alternation sequence:

[0111] ;

[0112] The Permute operation adjusts dimensions in the following order: After reshaping, the input format is adapted for convolution. This operation allows traffic flow variables and pollutant variables to alternate in the sequence, preparing for subsequent coupled transformations.

[0113] Furthermore, the extraction of contextual features employs dilated one-dimensional convolution.

[0114] Specifically, local contextual features are extracted by dilating one-dimensional convolutions. Dilated convolutions expand the receptive field without increasing the number of parameters by inserting holes between kernel elements, thus capturing a wider range of spatiotemporal dependencies. For alternating sequences... Application context feature extraction function :

[0115] ;

[0116] Among them, the context feature extraction function It includes dilated one-dimensional convolutions and activation functions to generate contextual representations. The expansion rate is typically set to 2 or 4 to enable the model to capture features at different time scales.

[0117] Context features by parity index The sequence is divided into traffic-related subsequences and pollution-related subsequences. Specifically, features at even-numbered index positions are extracted to form the traffic-related subsequences. Features at odd-indexed positions are extracted to form contamination-related subsequences. :

[0118] ;

[0119] This segmentation operation separates the originally alternating traffic and pollution features, providing input for the reversible coupled transformation.

[0120] Furthermore, the reversible coupling transformation specifically includes:

[0121] The traffic subsequence is transformed through the first gated subnet, and its exponent is obtained. Then, the exponent is multiplied element-wise with the pollution subsequence to obtain the first intermediate variable.

[0122] The pollution subsequence is transformed through the second gated subnet, and its exponent is obtained. Then, it is multiplied element-wise with the traffic subsequence to obtain the second intermediate variable.

[0123] The first intermediate variable is transformed through the first projection subnet and then added to the second intermediate variable to obtain the transformed traffic subsequence;

[0124] The second intermediate variable is transformed through the second projection subnet, and the transformed polluted subsequence is obtained by subtracting the transformation result from the first intermediate variable.

[0125] Furthermore, both the first gating subnet and the second gating subnet are composed of two multilayer perceptrons, and both the first projection subnet and the second projection subnet are composed of one-dimensional convolutional layers.

[0126] Specifically, through four sub-networks This model establishes an asymmetric, bidirectional coupling relationship between traffic flow and pollutants. The reversible coupling transformation accurately characterizes the cumulative effect of "traffic → pollution" and the inhibitory effect of "pollution → traffic." The specific transformation process is as follows:

[0127] First, the traffic-related subsequences Through the first gated subnet After transformation, the exponent is taken, and the subsequences related to pollution are obtained. Perform element-wise multiplication to obtain the first intermediate variable. :

[0128] ;

[0129] in, The first gating subnet, consisting of two multilayer perceptrons, is used to learn the impact patterns of traffic flow on pollutants. An exponential function ensures a positive output, and element-wise multiplication is used to implement gating modulation.

[0130] At the same time, pollution-related subsequences Through the second gated subnet After transformation, the exponent is taken, and the subsequence is related to traffic. Perform element-wise multiplication to obtain the second intermediate variable. :

[0131] ;

[0132] in, The second gated subnet, also composed of two layers of multilayer sensors, is used to learn the impact patterns of pollutants on traffic flow.

[0133] Then, the first intermediate variable Through the first projection subnet After transformation and the second intermediate variable Adding them together yields the transformed traffic-related subsequence. :

[0134] ;

[0135] in, The first projection subnet, consisting of one-dimensional convolutional layers, is used to project intermediate variables onto the target feature space.

[0136] Finally, the second intermediate variable Through the second projection subnet Transformation is performed, the first intermediate variable Subtracting the transformation result yields the transformed pollution-related subsequence. :

[0137] ;

[0138] in, The second projection subnet is also composed of one-dimensional convolutional layers.

[0139] This reversible coupling transformation models nonlinear interaction relationships through a gated subnet and achieves flexible mapping of the feature space through a projection subnet. It can effectively capture the accumulation of pollutants caused by traffic flow growth and the inhibitory effect of high pollution on traffic demand.

[0140] The transformed subsequences are fused with the original segmentation features, and the time dimension is recovered through average pooling. First, the transformed traffic-related subsequences are... Transformed pollution-related subsequences Original traffic-related subsequences Subsequences related to the original pollution Adding them together yields the fusion characteristics. :

[0141] ;

[0142] This fusion operation combines the features after the coupling transformation with the original features, preserving the interaction information between variables and their respective independent features.

[0143] Then, the fusion features Perform average pooling to restore the time dimension and obtain the variable interaction features. :

[0144] ;

[0145] Here, AvgPool represents the average pooling operation, used for dimensionality reduction along a specific dimension. Variable interaction features. The bidirectional coupling relationship between traffic flow and pollutants is encoded, providing a representation of the variable interaction dimension for subsequent dynamic feature fusion.

[0146] S400: Perform bidirectional feature interaction on the time-dependent feature and the variable interaction feature through cross-attention calculation, dynamically generate time feature weights and interaction feature weights based on channel attention, multiply the time-dependent feature with the time feature weights, multiply the variable interaction feature with the interaction feature weights and add them together, and perform residual connection with the time-dependent feature to obtain the fused feature;

[0147] Furthermore, the bidirectional feature interaction specifically includes:

[0148] Using the time-dependent feature as the query and the variable interaction feature as the key and value, the first interaction feature is obtained through multi-head attention computation.

[0149] Using the variable interaction feature as the query and the time dependency feature as the key and value, the second interaction feature is obtained through multi-head attention calculation.

[0150] The attention feature is obtained by adding the first interaction feature and the second interaction feature.

[0151] Furthermore, the dynamic generation of temporal feature weights and interaction feature weights based on channel attention specifically includes:

[0152] Local channel features are obtained by sequentially performing batch normalization, ReLU activation, and a first one-dimensional convolution on the attention features.

[0153] After adaptive average pooling, the attention features are sequentially subjected to batch normalization, ReLU activation, and a second one-dimensional convolution to obtain global channel features;

[0154] The local channel features are added to the global channel features to obtain the channel attention score;

[0155] The channel attention scores and their inverses are Softmax normalized to obtain the temporal feature weights and the interaction feature weights, respectively.

[0156] Specifically, bidirectional multi-head cross-attention enables mutual perception between time-dependent features and variable interaction features. The cross-attention mechanism allows two types of features to pay attention to each other's important information, thereby capturing the deep correlation between them.

[0157] First, based on time-dependent characteristics As a query, with variable interaction features The first interaction feature is obtained by multi-head attention computation, serving as both key and value. :

[0158] ;

[0159] Here, MHA stands for Multi-Head Attention. This operation enables time-dependent features to pay attention to relevant information in variable interaction features, capturing the influence of environmental factors on time-series patterns.

[0160] At the same time, with variable interaction features As a query, based on time-dependent features The second interaction feature is obtained by multi-head attention, serving as both key and value. :

[0161] ;

[0162] This operation enables variable interaction features to focus on relevant information in time-dependent features, capturing the impact of temporal patterns on environmental coupling.

[0163] The first interactive feature With the second interaction feature Add them together to obtain the attention features. :

[0164] ;

[0165] attention characteristics The bidirectional interactive information, which integrates two types of features, provides a foundation for the subsequent generation of channel attention weights.

[0166] The model dynamically generates temporal and interaction feature weights based on channel attention, enabling it to adaptively adjust the contribution ratio of these two types of features according to the real-time pollution intensity. The channel attention mechanism extracts channel-dimensional feature representations through both local and global branches.

[0167] Local channel attention extracts local channel features through two layers of one-dimensional convolution. Attention features are then processed. Batch normalization, ReLU activation, and the first one-dimensional convolution are performed sequentially to obtain local channel features. :

[0168] ;

[0169] Here, BatchNorm represents batch normalization, used to stabilize the training process; ReLU is the activation function, introducing non-linearity; Conv1d is a one-dimensional convolution, with a kernel size of usually 1, used for feature transformation in the channel dimension.

[0170] Global channel attention extracts global features through adaptive average pooling and one-dimensional convolution. Attention features... After adaptive average pooling, batch normalization, ReLU activation, and a second one-dimensional convolution are performed sequentially to obtain global channel features. :

[0171] ;

[0172] Here, AvgPool represents the adaptive average pooling operation, which compresses features into a global representation and captures overall channel information.

[0173] Local channel features With global channel features Add them together to get the channel attention score. :

[0174] ;

[0175] Channel attention score It integrates local and global channel information to assess the importance of features.

[0176] The weighting of time-dependent features and variable interaction features is dynamically adjusted through a competitive weighting allocation mechanism. Channel attention scores are also considered. and its opposite Softmax normalization is performed to obtain the time feature weights. and interaction feature weights :

[0177] ;

[0178] in, This ensures the normalization of weight competition. This mechanism allows for competition based on channel attention scores. When the time feature weight is large, Increase the interaction feature weights When the time series is reduced, the model tends to rely more on temporal patterns; conversely, when the time series is increased, the model tends to rely more on temporal patterns. When the size is small, the model tends to rely more on information from environmental interactions.

[0179] The time-dependent feature is multiplied by its weight, and the interaction feature is multiplied by its weight, then summed and joined with the time-dependent feature using residual connections to obtain the fused feature. Specifically:

[0180] ;

[0181] in, This represents element-wise multiplication. The formula first modulates the contributions of the two types of features through weights, and then adds the residual term. Residual connections preserve the inherent temporal trends of traffic flow, preventing the loss of original temporal dependency information during fusion, while improving the stability and convergence speed of model training.

[0182] Fusion features By combining time-dependent features and variable interaction features, and through dynamic weight allocation, adaptive modeling of different pollution intensity scenarios is achieved, providing high-quality feature representations for the final traffic flow prediction.

[0183] S500: Perform linear mapping on the fused features and inverse normalization to obtain traffic flow prediction values.

[0184] Specifically, the fusion features Input a linear layer to generate the future Traffic flow forecasts at each time step, of which To predict the time window length, firstly, the fused features... The multidimensional feature tensor is flattened into a one-dimensional vector, and then mapped through a linear layer to obtain a normalized predicted value. :

[0185] ;

[0186] The Flatten operation flattens the time and feature dimensions of the fused features into a single dimension; the Linear operation is a fully connected linear layer that maps the flattened features to the future. The prediction space at each time step. The output dimension of the linear layer is... Corresponding to the future Traffic flow forecasts for each time step. At this point, the system is still in a normalized space and requires inverse normalization to restore it to the true traffic flow scale.

[0187] Perform inverse normalization to restore the predicted values ​​in the normalized space to the dimensions of the original data. The mean calculated during the normalization process has already been stored in step S100. and standard deviation The inverse normalization formula is the inverse operation of the normalization formula:

[0188] ;

[0189] in, The normalized predicted value is the output of the linear layer. and These represent the mean and standard deviation of the data over the time dimension. This is the numerical stability constant. The formula first multiplies the normalized predicted value by the standard deviation (plus the stability constant), and then adds the mean, thereby restoring the scale and distribution of the original data.

[0190] The result obtained after inverse normalization This is the final traffic flow forecast, and its dimensions are: This indicates that each sample in the batch will be in the future. The traffic flow forecast results are obtained at each time step. These forecasts can be directly used in practical applications such as traffic management decisions, congestion warnings, and route planning.

[0191] In practical applications, the model can be used for real-time traffic flow prediction. First, real-time traffic flow data and real-time air quality data for the target area are collected. Then, missing value imputation and instance normalization preprocessing are performed on the real-time data. Next, input branching and feature embedding are performed. Time-dependent features and variable interaction features are extracted through a dual-path network, and fused features are obtained through CrossAFF dynamic fusion. Finally, the future traffic flow prediction is obtained through linear mapping and inverse normalization at the output layer. The system provides short-term traffic flow predictions at each time step. The entire prediction process can respond in real time to changes in traffic and environmental data, providing high-precision prediction support for intelligent transportation systems.

[0192] Example 2:

[0193] The intelligent transportation management center of a certain city faced the problem of insufficient accuracy in traffic flow prediction during pollution-sensitive periods. When O3 concentrations exceeded standards in the summer afternoons, traditional prediction models failed to consider the two-way coupling relationship between air pollution and traffic flow, leading to a significant increase in prediction errors and affecting the scientific validity of traffic signal optimization and emergency traffic restriction strategies. To solve this problem, the city adopted the dual-path dynamic fusion method for predicting traffic and air pollution flow based on the two-way coupling of traffic and air pollution, as described in this invention.

[0194] This embodiment is validated using real datasets from City A (5-minute sampling interval, August-September 2014) and City B (15-minute sampling interval, January-February 2023). The datasets include traffic flow data and concentration data of pollutants such as PM2.5, O3, NO2, SO2, and CO2. Data preprocessing, dual-path feature extraction, and dynamic fusion are performed according to the method described in Embodiment 1 to finally generate traffic flow prediction values.

[0195] To verify the effectiveness of the method of this invention, the DP-BiTPF method was compared with existing mainstream models, including CARD (Channel Alignment Robust Hybrid Transformer), PatchMLP (Patch-based MLP), PDF (Periodic Decoupling Framework), and TimeXer (Time Series Transformer with Exogenous Variables). The evaluation metrics used were MAE (Mean Absolute Error) and MSE (Mean Squared Error), with smaller values ​​indicating higher accuracy. The experimental results are shown in Table 1.

[0196] Table 1 Comparison of prediction performance of different models on two city datasets

[0197]

[0198] The terms and indicators in Table 1 are explained as follows:

[0199] CARD (Channel-Aligned Robust Hybrid Transformer): By using channel-aligned attention, token mixing modules, and robust loss functions, it resolves the contradiction between channel independence and dependency in time series prediction, thereby improving the performance of multi-task prediction.

[0200] PatchMLP (Patch-based MLP): Through multi-scale patch embedding, feature decomposition, and cross-variable interaction MLP, it achieves efficient long-term time series prediction without the need for complex attention mechanisms.

[0201] PDF (Period Decoupling Framework): It uses frequency domain analysis to filter periods, converts 1D sequences into 2D tensors, and performs parallel modeling with dual transformations, balancing the accuracy of time series prediction with computational efficiency.

[0202] TimeXer (including exogenous variable time series Transformer): Through differential embedding of exogenous and inogenous variables, global tokens, and self / cross attention, it adapts to irregular data and efficiently models time series predictions with exogenous variables.

[0203] DP-BiTPF: The dual-path dynamic fusion network proposed in this invention. The "traffic" row in the table represents the prediction results when the model only inputs traffic flow data; the "O3," "CO2," "PM," "SO2," and "NO2" rows represent the prediction results when the model fuses traffic flow data with the corresponding pollutant data, respectively.

[0204] Evaluation indicators: It reflects the mean absolute deviation; the smaller the value, the higher the accuracy. The error is amplified by squaring to penalize larger deviations; the smaller the value, the higher the accuracy.

[0205] As shown in Table 1, the DP-BiTPF method of this invention achieved optimal MSE and MAE indices in most configurations of the two city datasets. On the City A dataset, the DP-BiTPF model, which integrates CO2, SO2, and PM pollutant data, reduced MSE by at least 6.4% and MAE by at least 2.2% compared to the control model, significantly improving prediction accuracy. On the City B dataset, the DP-BiTPF model, which integrates O3, PM, and NO2 pollutant data, performed even better, reducing MSE by at least 23.2% and MAE by at least 5.6%, demonstrating stronger robustness in pollution-sensitive scenarios.

[0206] Of particular note is that even with only traffic flow data in the traffic configuration, the method of this invention still achieved the best MSE index on the City B dataset, demonstrating the effectiveness of the dual-path architecture and dynamic fusion mechanism for pure time-series prediction tasks. Furthermore, when pollutant data is fused, the prediction performance is further improved, verifying that the bidirectional coupling modeling mechanism of this invention can effectively capture the interaction between traffic and pollution.

[0207] By applying the method of this invention, the city's intelligent transportation management center has achieved a significant improvement in the accuracy of traffic flow prediction, providing reliable data support for traffic signal optimization, emergency traffic restriction strategy formulation, and low-carbon transportation planning, and promoting the sustainable development of the urban transportation system under complex environmental constraints.

[0208] The above experiments verify that the bidirectional coupled traffic and air pollution flow prediction method based on dual-path dynamic fusion proposed in this invention has substantial innovation, and its prediction performance is significantly better than the existing technology, demonstrating outstanding technical effects.

[0209] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A dual-path dynamic fusion method for bidirectional coupled traffic and air pollution flow prediction, characterized in that, include: S100: Collect traffic flow data and air pollutant concentration data of the target area, and after spatiotemporal alignment and normalization, divide it into two branches: the first branch extracts traffic flow data to form a traffic flow time series, and the second branch retains traffic flow data and all air pollutant concentration data. S200: Extract local time-series features and model long-term dependencies from the traffic flow time-series sequence to obtain time-dependent features; S300: The second branch data is dimensionally reshaped to generate a traffic-pollution alternation sequence. After extracting contextual features, it is divided into a traffic subsequence and a pollution subsequence. The traffic subsequence and the pollution subsequence are reversibly coupled and transformed. The transformed traffic subsequence and the pollution subsequence are fused to obtain variable interaction features. S400: Perform bidirectional feature interaction on the time-dependent feature and the variable interaction feature through cross-attention calculation, dynamically generate time feature weights and interaction feature weights based on channel attention, multiply the time-dependent feature with the time feature weights, multiply the variable interaction feature with the interaction feature weights and add them together, and perform residual connection with the time-dependent feature to obtain the fused feature; S5 00: Linearly map the fused features and perform inverse normalization to obtain traffic flow prediction values; The long-term dependency modeling employs a probabilistic sparse self-attention mechanism, specifically including: The local temporal features are transformed linearly to generate query vector, key vector, and value vector, respectively. The dispersion of attention scores is calculated by randomly sampling a portion of the key vectors, and high-importance query vectors are selected based on the dispersion. Calculate the attention score of the high-importance query vector and all key vectors, normalize the attention score using Softmax, and then sum the attention score with the value vector to obtain the attention output of the high-importance query vector. For query vectors that are not of high importance, the global average value of the value vector is reused as the attention output; The local temporal features are residually connected to the attention output and then layer normalized to obtain the temporal dependent features. The reversible coupling transformation specifically includes: The traffic subsequence is transformed through the first gated subnet, and its exponent is obtained. Then, the exponent is multiplied element-wise with the pollution subsequence to obtain the first intermediate variable. The pollution subsequence is transformed through the second gated subnet, and its exponent is obtained. Then, it is multiplied element-wise with the traffic subsequence to obtain the second intermediate variable. The first intermediate variable is transformed through the first projection subnet and then added to the second intermediate variable to obtain the transformed traffic subsequence; The second intermediate variable is transformed through the second projection subnet, and the first intermediate variable is subtracted from the transformation result to obtain the transformed contaminated subsequence; The bidirectional feature interaction specifically includes: Using the time-dependent feature as the query and the variable interaction feature as the key and value, the first interaction feature is obtained through multi-head attention computation. Using the variable interaction feature as the query and the time dependency feature as the key and value, the second interaction feature is obtained through multi-head attention calculation. The attention feature is obtained by adding the first interaction feature and the second interaction feature; The dynamic generation of temporal feature weights and interaction feature weights based on channel attention specifically includes: Local channel features are obtained by sequentially performing batch normalization, ReLU activation, and a first one-dimensional convolution on the attention features. After adaptive average pooling, the attention features are sequentially subjected to batch normalization, ReLU activation, and a second one-dimensional convolution to obtain global channel features; The local channel features are added to the global channel features to obtain the channel attention score; The channel attention scores and their inverses are Softmax normalized to obtain the temporal feature weights and the interaction feature weights, respectively.

2. The dual-path dynamic fusion method for bidirectional coupled traffic and air pollution flow prediction according to claim 1, characterized in that, The normalization process employs reversible instance normalization, specifically including: Calculate the mean and standard deviation over time for the spatiotemporally aligned traffic flow data and air pollutant concentration data; The normalized data is obtained by subtracting the mean from the traffic flow data and air pollutant concentration data and then dividing by the sum of the standard deviation and a preset constant. The mean and standard deviation are stored for the inverse normalization.

3. The dual-path dynamic fusion method for bidirectional coupled traffic and air pollution flow prediction according to claim 1, characterized in that, The local temporal feature extraction is achieved through gated convolution, specifically including: The first one-dimensional convolutional layer is applied to the traffic flow time series to obtain convolutional features; A second one-dimensional convolutional layer is applied to the traffic flow time series and gating weights are obtained by applying a Sigmoid activation function; The convolutional features are multiplied element-wise with the gating weights to obtain local temporal features.

4. The dual-path dynamic fusion method for bidirectional coupled traffic and air pollution flow prediction according to claim 1, characterized in that, The generation of the traffic-pollution alternation sequence specifically includes: The dimensions of the data in the second branch are replaced by swapping the variable dimension and the time dimension. The replaced data is dimensionally reshaped to form a traffic-pollution alternation sequence.

5. The dual-path dynamic fusion method for bidirectional coupled traffic and air pollution flow prediction according to claim 1, characterized in that, The extraction of contextual features employs dilated one-dimensional convolution.

6. The dual-path dynamic fusion method for bidirectional coupled traffic and air pollution flow prediction according to claim 1, characterized in that, Both the first gated subnet and the second gated subnet consist of two multilayer perceptrons, and both the first projection subnet and the second projection subnet consist of one-dimensional convolutional layers.