Traffic jam prediction method based on adaptive multi-sensor data fusion and multistage deep space-time neural network
By using adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural networks, the problems of limited data coverage and insufficient prediction accuracy in existing traffic congestion prediction methods are solved, and high-precision real-time prediction and optimization of traffic congestion status are achieved.
Patent Information
- Application Number
- CN202510759384.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-11-11
AI Technical Summary
Existing traffic congestion prediction methods rely on a single data source and simple models, resulting in limited data coverage, slow response speed, and insufficient prediction accuracy.
Adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural networks are employed to perform temporal modeling and prediction of traffic flow data through multi-sensor data acquisition and pre-fusion, data preprocessing, multi-dimensional feature extraction and depth transformation, combined with hybrid recurrent neural networks and adaptive gating mechanisms.
It has achieved high-precision real-time prediction of traffic congestion, improving prediction accuracy and response speed, and optimizing traffic management decisions and urban operational efficiency.
Smart Images

Figure CN120932436A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic congestion prediction technology, specifically a traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural networks. Background Technology
[0002] With the acceleration of urbanization, traffic congestion has become increasingly serious. Traditional traffic congestion prediction methods usually rely on a single data source and a simple model, which has problems such as limited data coverage, slow response speed and insufficient prediction accuracy.
[0003] With the development of technologies such as the Internet of Things, big data, and artificial intelligence, traffic congestion prediction methods based on multi-sensor data fusion and deep learning have gradually become a research hotspot. Existing traffic congestion prediction methods mainly include time series analysis-based methods and machine learning-based methods. However, existing technologies still have some shortcomings in practical applications, such as incomplete data collection, insufficient feature extraction, and low prediction accuracy. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides a traffic congestion prediction method based on adaptive multi-sensor data fusion and a multi-level deep spatiotemporal neural network, comprising the following steps:
[0005] S10. Multi-sensor data acquisition and pre-fusion: Deploy multiple sensors to collect traffic data, use an edge computing platform to set dynamic thresholds based on the real-time data quality of each sensor, and then perform weighted pre-fusion by correcting and filtering the data through a non-linear weighting function and the correlation between sensors.
[0006] S20. Data preprocessing and augmentation: Standardize, suppress noise, and complete missing data for each sensor data, and generate virtual traffic samples by combining data augmentation techniques.
[0007] S30. Multi-dimensional feature extraction and depth transformation: Using multilinear discriminant analysis and deep feature transformation technology, the preprocessed traffic data is mapped to a high-discriminative feature space, and tensor decomposition technology is used to extract multi-scale and multi-angle features from the traffic data.
[0008] S40. Spatial feature extraction: Local features at different scales are extracted through adaptive multi-scale dynamic convolution branches, key information is enhanced through channel attention mechanism, global long-range dependencies are captured through non-local edge enhancement module, and dynamic weighted integration of features at various scales and levels is achieved through cross-layer residual fusion technology.
[0009] S50. Temporal Modeling: Temporal features of traffic flow data are extracted using a hybrid recurrent neural network. Important information at different times is aggregated through a multi-head self-attention mechanism. Adaptive context gating is used to fuse the final state of the recurrent network with the attention output to generate a comprehensive temporal representation.
[0010] S60, Predictive Output: Multimodal features are fused, and the final prediction result is generated through an adaptive gating mechanism. An online feedback mechanism is used to realize the real-time adjustment and self-optimization of model parameters, and a closed-loop control system is constructed.
[0011] Furthermore, S10 includes:
[0012] S11. Dynamic quality threshold setting; For each sensor, a dynamic quality threshold is set based on the base threshold θ0 and the standard deviation σ of the sensor's measurement data within the most recent time window. i And an adjustment parameter α is introduced for calculation, the formula is:
[0013] θ i (t)=θ0+α·σ i (t)
[0014] In the formula, θ0 is the basic threshold; σ i (t) represents the standard deviation of the measurement data of sensor i within the most recent time window, and α is the adjustment parameter.
[0015] S12. Initial screening of sensors is performed using an indicator function:
[0016]
[0017] In the formula, S i (t) represents the selected state of sensor i at time t; Q i (t) represents the quality score of sensor i at time t; θ i (t) represents the dynamic quality threshold of sensor i.
[0018] S13. Calculate the nonlinear weights using the Logistic function:
[0019]
[0020] In the formula, L i (t) represents the nonlinear mass weight of sensor i at time t, and κ is the control coefficient;
[0021] S14. Correlation correction between sensors: Define the redundancy correction factor for sensor i.
[0022]
[0023] In the formula, ρij (t) is the data correlation coefficient between sensors i and j at time t, Ri i (t) is the redundancy correction factor for sensor i.
[0024] S15. Final weight calculation of the sensor:
[0025] W i (t)=S i (t)·L i (t)·R i (t)
[0026] In the formula, W i (t) represents the final weight of sensor i at time t.
[0027] S16. Weighted pre-fusion data calculation; edge nodes perform local data pre-fusion and calculate the fused data D. f The formula for (t) is:
[0028]
[0029] In the formula, D f (t) represents the weighted pre-fused data output by the edge node at time t, i.e., the fusion result after weighting and averaging all sensor data according to their respective weights; D i (t) represents the data collected by sensor i at time t; N represents the total number of sensors.
[0030] Furthermore, S20 includes:
[0031] S21, Data standardization; For the fused data D output from the edge computing module... f (t) is standardized to transform data with different dimensions into dimensionless variables. The standardization formula is as follows:
[0032]
[0033] In the formula, To achieve D within the preset time window f The mean of (t), Its standard deviation; This is the standardized data.
[0034] S22. Noise Suppression and Smoothing Filtering: Moving average filtering is used to smooth the standardized data. The window width is set to w, and the initial time of the window is k. The filtered data... for:
[0035]
[0036] S24. Data Augmentation Strategy: Gaussian noise is added to the smoothed data to generate new training samples, as shown in the following formula:
[0037]
[0038] In the formula, ∈ represents the Gaussian noise term, simulating random disturbances in the real world, and σ ∈ Parameters for controlling noise amplitude; D aug (t) represents the enhanced data.
[0039] Furthermore, in S20, after S22 and before S24, it also includes:
[0040] S23. Automatic missing value completion; missing values are completed using linear interpolation.
[0041] (when (When missing)
[0042] In the formula, the parameter This refers to the processed data from the moment before the missing data was generated. This represents the processed data at the moment following the missing data.
[0043] Furthermore, S30 includes:
[0044] S31. Data Tensorization: Preprocessing the multidimensional traffic data into a high-order tensor to simultaneously capture the inherent structure of the data in time, space, and feature dimensions. The preprocessed data includes a time step Q, the number of spatial locations S, and the feature dimension F. The constructed tensor... Represented as:
[0045]
[0046] In the formula, x q,s,f This represents the collected value of the f-th feature at time q and position s.
[0047] S32. Multilinear Discriminant Analysis; An improved multilinear discriminant analysis method is used to construct inter-class divergence matrices for each mode in tensor space. and the scatter matrix within categories Where n represents the nth mode of the tensor, and λ is the eigenvalue. The problem is solved by finding the generalized eigenvalues:
[0048]
[0049] Obtain the projection matrix I n For the original dimension, d nTo reduce the dimensionality and make the mapped data more distinguishable between categories, the goal of this step is:
[0050]
[0051] In the formula, U (n) This is the projection matrix, used to project the original I... n -Dimensional feature space reduced to d n -dimensional space; U (n)T For the projection matrix U (n) The transpose of .
[0052] S33. Deep Feature Transform and Tensor Decomposition: Deep feature transform technology is used, and tensor decomposition is employed to extract multi-scale, multi-angle traffic state features. The dimensionality-reduced tensor data is then decomposed to obtain the core tensor. and the orthogonal factor matrix U of each mode (1) U (2) U (3) The decomposition formula is:
[0053]
[0054] In the formula, Represents the original high-order feature tensor; × n This represents the product of a tensor and a matrix on the nth mode.
[0055] Furthermore, S40 includes:
[0056] S41, Multi-scale dynamic convolution branch; This branch processes the input feature tensors after depthwise feature transformation and tensor decomposition. Construct multiple convolutional branches with different scales and dilation rates, where H is the height of the feature map, W is the width of the feature map, and C is the number of channels. For the k-th branch of the l-th layer, a dilated convolution operation is used:
[0057] Y (l,k )=σ(DilatedConv(X;W (l,k) ,r (l,k) )+b (l,k) )
[0058] In the formula, W (l,k) and b (l,k) The kernel and bias of the convolution in the k-th branch of the l-th layer are respectively, r (l,k) Y represents the corresponding expansion rate, and σ(·) is the activation function; (l,k) This is the resulting output feature map.
[0059] S42, Adaptive Channel Attention Enhancement: For each convolutional branch, adaptive channel attention weights are generated using global average pooling combined with nonlinear mapping; for the k-th branch of the l-th layer, the attention vector is calculated:
[0060] A (l,k) =softmax(f(GAP(Y)) (l,k) );θ (l,k) ))
[0061] In the formula, f(·; θ (l,k) ) is a parameter θ (l,k) The nonlinear mapping function converts global statistics into channel weights, A (l,k) The attention weighting coefficients are for the k-th branch of the l-th layer; then the convolution output is weighted:
[0062]
[0063] In the formula, ⊙ represents element-wise product. This is the original attention score for the k-th branch of the l-th layer.
[0064] S43, Multi-scale branch fusion and dynamic weights; introducing fusion weights λ to the outputs of all branches. (l,k) To achieve weighted fusion of multi-scale features:
[0065]
[0066] In the formula, K is the total number of branches k, and λ (l,k) These are learnable scalar weights.
[0067] S44. Adaptive cross-layer residual and non-local edge enhancement; The input features and fused features are weighted and summed using dynamic gating parameters, as shown in the formula:
[0068] Z ′(l) =α (l) ·X+(1-α (l) )·Z (l)
[0069] In the formula, X represents the input feature, and Z... (l) Z represents the multi-scale convolutional features after fusion at layer l. ′(l) For the features after weighted fusion, α (l) This is a dynamic gating parameter, and its value is between 0 and 1.
[0070] Nonlocal modules are used to capture long-range dependency information, and nonlocal corrections are applied to the fused features. The formula is as follows:
[0071]
[0072] In the formula, NL(Z) (l) () represents the feature after nonlocal correction. is the weight matrix of the nonlocal modules, and the softmax(·) function is used to normalize the similarity between features.
[0073] The dynamic gating fusion feature and the nonlocal correction feature are integrated to obtain the output of the l-th layer, and its formula is:
[0074] O (l) =φ(Z′) (l) +β (l) ·NL(Z (l) ))
[0075] In the formula, O (l) For the output features of the l-th layer, β (l) φ is the fusion coefficient for nonlocal enhancement, used to adjust the contribution of nonlocal features, and φ(·) is the activation function used to achieve nonlinear mapping of features.
[0076] Furthermore, it also includes S45 and cross-layer feature integration; if there are multiple convolutional operations, cross-layer residual fusion is introduced to integrate the output of the current layer with the output of the previous layer to further capture deep spatial information:
[0077] H (l) =ψ(O (l) +W r(l) O (l-1) +b r(l) )
[0078] In the formula, H (l) W represents the cross-layer fusion output feature of the l-th layer. r(l) and b r(l) Here, r is a parameter for cross-layer fusion, r is a dedicated learnable parameter for cross-layer residual fusion, and ψ(·) represents the activation or normalization function. (l-1) This is the output of the previous layer.
[0079] Furthermore, the S50 includes:
[0080] S51. Construction of hybrid RNN units; at each time step t, temporal features are extracted using LSTM and GRU units respectively. For the LSTM unit, the state calculation formula is as follows:
[0081] f t =σ(W f [h t-1 ,x t ]+b f )
[0082] i t =σ(W i [ht-1 ,x t ]+b i )
[0083]
[0084] o t =σ(W o [h t-1 ,x t ]+b o )
[0085]
[0086] In the formula, f t Indicates the forget gate; i t Indicates the input gate; Indicates the state of candidate cells; C t Indicates cell state; o t Indicates the output gate; Indicates a hidden state; x t For the current input; h t-1 The hidden state of the previous time step; W f W i W C W o and the corresponding bias b f ,b i ,b C ,b o σ represents the weight parameters of the LSTM unit; σ(·) represents the Sigmoid activation function, tanh(·) represents the hyperbolic tangent function; ⊙ represents the element-wise product.
[0087] For a GRU cell, the state calculation formula is as follows:
[0088] z t =σ(W z [h t-1 ,x t ]+b z )
[0089] r t =σ(W r [h t-1 ,x t ]+b r )
[0090]
[0091] In the formula, z t Indicates the update gate; r t Indicates that the door is being reset; Indicates the candidate hidden state; Indicates a hidden state; W z W r W h and the corresponding bias b z ,b r ,b h These are the weight parameters for the GRU unit.
[0092] The fusion of outputs from hybrid RNN units is achieved through a learnable fusion coefficient γ, where γ ranges from 0 to 1, and the calculation formula is as follows:
[0093]
[0094] In the formula, γ represents the hidden state after mixing; γ is the adaptive fusion coefficient.
[0095] S52, Multi-head Self-Attention Mechanism; for Hidden State Sequences Generated by Hybrid RNNs Perform multi-head self-attention computation; construct query, key, and value matrices:
[0096] Q = HW Q K = HW K V = HW V
[0097] In the formula, Q is the query matrix; Let W be the hidden state matrix. Q W K W V This is a weight matrix for queries, keys, and values.
[0098] Multiply H by each weight matrix to obtain the corresponding matrix; for each attention head i, there are a total of H. head Size, calculate attention output:
[0099]
[0100] In the formula, head i The output of the i-th attention head; Q i ,K i V i These are the query, key, and value matrices corresponding to the i-th header; d k The dimension of the key vector is used for normalization; the softmax(·) function is used to calculate the attention weights.
[0101] After concatenating all attention points, output matrix W is used. O Perform a linear transformation to obtain the final self-attention output:
[0102]
[0103] In the formula, A represents the final output of multi-head attention; W O This is the output weight matrix.
[0104] S53, Adaptive Context Gating Fusion: An adaptive context gating mechanism is used to fuse the final hidden states of the hybrid RNN. Concatenated with the attention output A, it is represented as:
[0105]
[0106] In the formula, C in The input context vector before gating fusion is represented by [;]; then the gating coefficients are calculated:
[0107] g=σ(W g C in +b g )
[0108] In the formula, W g and b g Here, σ(·) represents the weights and biases of the gating mechanism; g is the adaptive gating vector; then, through gating fusion, a comprehensive context vector is generated:
[0109]
[0110] In the formula, ⊙ represents element-wise multiplication; c is the fused context representation.
[0111] S54. Final prediction output generation: The fused context vector c is input into the fully connected layer, and after nonlinear mapping, the final prediction output is generated. The calculation formula is as follows:
[0112] y=φ(W y c+b y )
[0113] In the formula, W y and b y φ represents the weights and biases of the fully connected layer; φ(·) is the activation function; and y represents the predicted output of the system.
[0114] Furthermore, the S60 includes:
[0115] S61, Multimodal feature fusion; integrating spatial features F spatial Temporal context vector c and external auxiliary information F external A unified feature representation is generated by combining adaptive gating and nonlinear fusion, and the fusion formula is as follows:
[0116]
[0117] In the formula, Fspatial For spatial features, c is the temporal context vector, and F is the spatial feature. external To supplement information from external data, σ(·) and tanh(·) are activation functions, and W1,W2 and b1,b2 are parameters to be learned; Z fusion This represents the final unified feature representation of the multimodal systems after fusion.
[0118] S62. Final prediction output generation; The fused features are passed through a fully connected layer to generate the prediction output y:
[0119] y=φ2(W y Z fusion +b y )
[0120] In the formula, W y and b y φ1 and φ2 are the weight matrix and bias of the fully connected layer, respectively; φ2(·) is the activation function.
[0121] S63. Multi-objective loss function design; including prediction error and regularization constraints:
[0122]
[0123] In the formula, y (i) and Let represent the predicted output and the true value of the i-th sample, respectively; M is the total number of samples; Ω(θ) is the regularization term; λ1 and λ2 are coefficients that balance the influence of prediction error and regularization term.
[0124] Furthermore, it also includes: S64, online self-optimizing feedback and dynamic learning rate adjustment; and an improved adaptive gradient update algorithm is used to iteratively update the model parameters, with the update formula being:
[0125]
[0126] In the formula, θ c These are the model parameters at the c-th iteration; and These are the first and second moment estimates of the gradient, respectively; ∈ is the minimum constant; η c The current learning rate; combined with the following formula:
[0127] η c+1 =η c ·exp(-κ·L)
[0128] In the formula, κ is the learning rate decay parameter, which dynamically adjusts the learning rate based on the current loss L value.
[0129] This invention utilizes adaptive multi-sensor data acquisition and fusion, employing intelligent data preprocessing, multi-dimensional feature extraction, and deep feature transformation technologies to acquire and accurately process multi-dimensional traffic flow data in real time. It then leverages a multi-level deep spatiotemporal neural network to achieve high-precision prediction of traffic congestion, effectively improving prediction accuracy and response speed, and optimizing traffic management decisions and urban operational efficiency. This online prediction method, capable of efficiently and accurately predicting traffic congestion and providing real-time feedback, enhances the intelligence level of traffic management. Attached Figure Description
[0130] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0131] Figure 1 This is a flowchart illustrating the present invention;
[0132] Figure 2 This is a diagram of the architecture of a Long Short-Term Memory (LSTM) network.
[0133] Figure 3 This is a diagram of the structure of a recurrent neural network (RNN). Detailed Implementation
[0134] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0135] See Figure 1-3 The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network in this embodiment includes the following steps:
[0136] S10. Adaptive Multi-Sensor Data Acquisition and Fusion. This system comprehensively collects traffic data by deploying multiple sensors (including but not limited to cameras, GPS sensors, LiDAR, and infrared sensors) within the traffic monitoring area. An edge computing platform is used to intelligently acquire and pre-fuse real-time data from these sensors. The system sets dynamic thresholds based on the real-time data quality of each sensor and filters and weights the data using non-linear weighting functions and inter-sensor correlation corrections, eliminating low-quality or redundant data. Finally, through weighted fusion, the generated comprehensive data accurately reflects traffic conditions, providing high-quality input for subsequent data preprocessing and deep learning prediction.
[0137] Specifically, this includes S11, dynamic quality threshold setting. For each sensor, the system sets a dynamic quality threshold to evaluate its data reliability. This threshold is based on a base threshold θ0 and the standard deviation σ of the sensor's measurement data within the most recent time window. i The adjustment parameter α is then introduced for calculation. Subsequently, an indicator function is used to perform preliminary screening of the sensors to ensure that only high-quality data enters the subsequent processing flow.
[0138] θ i (t)=θ0+α·σ i (t)
[0139] In the formula: θ0 is the basic threshold; σ i (t) represents the standard deviation of the measurement data of sensor i within the most recent time window, used to reflect data fluctuation, with α as the adjustment parameter. This formula dynamically adjusts the quality threshold by taking into account the data volatility, ensuring that the threshold is increased when data fluctuations are large, thus filtering out possible outlier data.
[0140] S12. Initial screening of sensors is performed using an indicator function:
[0141]
[0142] In the formula: S i (t) represents the selected state of sensor i at time t; Q i (t) represents the quality score of sensor i at time t; θ i (t) represents the dynamic quality threshold of sensor i. This indicator function is used to perform preliminary screening of sensors based on the sensor's quality score and dynamic threshold.
[0143] S13. Design of Nonlinear Weighting Function. To more precisely reflect the relationship between quality scores and dynamic thresholds, this embodiment uses the Logistic function to calculate nonlinear weights:
[0144]
[0145] In the formula: κ controls the steepness of the curve, ensuring that when Q i (t) is significantly higher than θ i When (t), the weight is close to 1, and vice versa.
[0146] S14. Sensor Correlation Correction. To reduce the redundancy introduced by data collected from multiple sensors, the system considers the correlation between each sensor and other sensors, and defines a redundancy correction factor for sensor i.
[0147]
[0148] In the formula: ρ ij (t) is the data correlation coefficient between sensors i and j at time t, Ri i (t) represents the redundancy correction factor for sensor i. This redundancy correction factor is obtained by statistically calculating the correlation coefficients between sensor i and other sensor data at a specific time. The correlation coefficients reflect the redundancy information between any two sensor data sets; a higher correlation coefficient indicates higher redundancy, thus requiring a lower correction factor value, thereby reducing the weight of that sensor in subsequent data fusion processes. This design effectively reduces the impact of redundant data, improving the accuracy of data fusion and the overall robustness of the system.
[0149] S15. Final Weight Calculation. Combining the aforementioned dynamic quality threshold setting and inter-sensor correlation correction results, the final weight of the sensor at any given time is defined for subsequent data fusion. Specifically, this method multiplies the indicator function indicating whether the sensor meets the quality requirements, the quality weight based on nonlinear mapping, and the inter-sensor redundancy correction factor to obtain the final weight of the sensor:
[0150] W i (t)=S i (t)·L i (t)·R i (t)
[0151] This formula ensures that only sensor data that meets the set quality score is included in the fusion, and appropriately weights the data based on the real-time data quality of each sensor and its redundancy with other sensor data. This effectively reduces the interference of redundant information on the fusion results and improves the accuracy of data fusion and the overall performance of the system.
[0152] S16. Weighted pre-fusion data calculation. Edge nodes perform data pre-fusion locally, calculating the fused data D. f The formula for (t) is:
[0153]
[0154] In the formula: D f(t) represents the data collected by sensor i at time t; N represents the total number of sensors. This formula comprehensively considers the real-time quality, historical fluctuations, and correlations between sensors for each sensor, achieving more intelligent and robust data pre-fusion. It can effectively eliminate low-quality or redundant data and improve the input data quality of subsequent deep learning modules.
[0155] S20. Intelligent Data Preprocessing and Augmentation. The system employs a data cleaning algorithm based on adaptive normalization and deep learning to standardize, suppress noise, and automatically complete missing data from sensor data from different sources. Simultaneously, it combines data augmentation techniques to generate virtual traffic samples, forming a more comprehensive training dataset to adapt to data fluctuations in complex traffic scenarios.
[0156] Specifically, this includes S21, data standardization. This involves the fused data D output from the edge computing module. f (t) Standardization is performed. In this embodiment, the Z-Score standardization method is used to transform data with different dimensions into dimensionless variables. The standardization formula is:
[0157]
[0158] In the formula: For D within a certain time window f The mean of (t), It is its standard deviation. This step can eliminate scale differences between data from different sensors and unify the data distribution.
[0159] S22. Noise Suppression and Smoothing Filtering. To reduce random noise in the data, a moving average filter is used to smooth the standardized data. Setting the window width to w, the filtered data... It can be represented as:
[0160]
[0161] This method can effectively smooth data fluctuations, preserve long-term trends, and reduce the interference of abnormal short-term fluctuations on subsequent processing.
[0162] S23. Missing Value Detection and Automatic Completion. In real-world traffic data, missing data may occur due to sensor malfunctions or communication delays. Linear interpolation is used to complete the missing values.
[0163] (when (When missing)
[0164] Where: parameters This refers to the processed data from the moment before the missing data was generated. This refers to the processed data at the moment after the missing data, and These are the data values after completion using linear interpolation. This method fully utilizes the local linear trend of time series data, restores data continuity through a simple and effective arithmetic averaging method, effectively reduces information loss caused by missing data, and provides complete and reliable basic data for subsequent data preprocessing and input to deep learning models.
[0165] S24. Data Augmentation Strategy. To improve the model's robustness and generalization ability, data augmentation methods are used to expand the training samples. Specifically, a suitable amount of Gaussian noise is added to the smoothed data to generate new training samples, as shown in the following formula:
[0166]
[0167] Where: σ ∈ To control the parameters of noise amplitude, the dataset is expanded by simulating natural data fluctuations, thereby improving the model's adaptability in complex traffic scenarios.
[0168] S30. Multi-dimensional Feature Extraction and Depth Transformation. A traffic data processing method based on multi-dimensional feature extraction and depth transformation is proposed. This embodiment employs an improved multilinear discriminant analysis (M-LDA) method combined with deep feature transformation technology to map the preprocessed multi-dimensional data to a highly discriminative feature space. Simultaneously, tensor decomposition technology is used to extract multi-scale and multi-angle features from the traffic state data, thereby providing richer and more effective input information for subsequent deep learning networks.
[0169] S31. Data Tensorization. The preprocessed multidimensional traffic data is constructed into a high-order tensor to simultaneously capture the inherent structure of the data in the temporal, spatial, and feature dimensions. Specifically, assuming the preprocessed data includes a time step Q, a number of spatial locations S, and a feature dimension F, the constructed tensor can be represented as follows:
[0170]
[0171] In the formula: x q,s,f This represents the collected value of the f-th feature at time q and location s. This process helps preserve multi-dimensional information from the data, laying the foundation for subsequent multi-modal feature extraction.
[0172] S32. Multilinear Discriminant Analysis (M-LDA). To achieve discriminative dimensionality reduction of tensor data, an improved multilinear discriminant analysis method is employed. In the tensor space, a scatter matrix between categories is constructed for each pattern. and the scatter matrix within categories Where n represents the nth mode of the tensor. Then, by solving the generalized eigenvalue problem:
[0173]
[0174] Obtain the projection matrix (I n For the original dimension, d n (This refers to the dimensionality reduction), which makes the mapped data more distinguishable between categories. The goal of this step can be stated as:
[0175]
[0176] This formula ensures that the divergence between categories is maximized and the divergence within categories is minimized under different modes, thereby achieving highly discriminative dimensionality reduction of multidimensional data.
[0177] S33. Deep Feature Transformation and Tensor Decomposition. Building upon multilinear discriminant analysis, this step further employs deep feature transformation technology to extract multi-scale, multi-angle traffic state features through tensor decomposition. Taking Higher-Order Singular Value Decomposition (HOSVD) as an example, the dimensionality-reduced tensor data is decomposed to obtain the core tensor. and the orthogonal factor matrix U of each mode (1) U (2) U (3) , decomposition formula:
[0178]
[0179] In the formula: × n This represents the product of a tensor and a matrix at the nth mode. This decomposition process can effectively extract the main information of the data at various scales and angles, while reducing redundant data, providing richer and more discriminative input features for subsequent deep learning networks.
[0180] S40. Spatial Feature Extraction Module Based on Adaptive Multi-Scale Dynamic Convolution and Non-Local Enhancement. A spatial feature extraction module based on adaptive multi-scale dynamic convolution and non-local enhancement is proposed. The module includes an adaptive multi-scale dynamic convolution branch, a channel attention mechanism, a non-local edge enhancement module, and a cross-layer residual fusion technique to extract deep spatial features from traffic data. The adaptive multi-scale dynamic convolution branch is used to extract local features at different scales, the channel attention mechanism is used to enhance the expression of key information, the non-local edge enhancement module is used to capture global long-range dependencies, and the cross-layer residual fusion technique is used to achieve dynamic weighted integration of features at various scales and levels, thereby providing accurate and rich spatial semantic representations for subsequent temporal modeling and overall system prediction.
[0181] Specifically, this includes: S41, multi-scale dynamic convolution branch. For the input feature map... Construct multiple convolutional branches with different scales and dilation rates. For the k-th branch in the l-th layer, perform a dilated convolution operation:
[0182] Y (l,k) =σ(DilatedConv(X;W) (l,k) ,r (l,k) )+b (l,k) )
[0183] In the formula: W (l,k) and b (l,k) The kernel and bias of the convolution in the k-th branch of the l-th layer are respectively, r (l,k) σ is the corresponding inflation rate, and σ(·) is the activation function (such as ReLU).
[0184] S42. Adaptive Channel Attention Enhancement. For each convolutional branch, adaptive channel attention weights are generated using global average pooling (GAP) combined with a non-linear mapping. For the k-th branch of the l-th layer, the attention vector is calculated as follows:
[0185] A (l,k) =softmax(f(GAP(Y)) (l,k) );θ (l,k) ))
[0186] In the formula: f(·;θ (l,k) ) is a parameter θ (l,k) A nonlinear mapping function is used to convert global statistics into channel weights. The convolution output is then weighted:
[0187]
[0188] In the formula: ⊙ represents element-wise product.
[0189] S43. Multi-scale branch fusion and dynamic weights. A fusion weight λ is introduced into the output of all branches. (l,k) To achieve weighted fusion of multi-scale features:
[0190]
[0191] In the formula: K is the number of branches, λ (l,k) These are learnable scalar weights that reflect the importance of features at each scale.
[0192] S44. Adaptive Cross-Layer Residual Connections and Non-Local Edge Enhancement. To fully utilize the complementary information between input features and multi-scale convolutional features, adaptive residual connections and non-local edge enhancement modules are introduced. Specifically, the input features and fused features are first weighted and summed using dynamic gating parameters, as shown in the formula:
[0193] Z ′(l) =α (l) ·X+(1-α (l) )·Z (l)
[0194] In the formula: X represents the input feature, Z (l) Z represents the multi-scale convolutional features after fusion at layer l. ′(l) The features are the weighted fusion features, and α (l) This is a dynamic gating parameter with a value between 0 and 1, used to balance the contributions of the input and fused features.
[0195] Subsequently, a nonlocal module is used to capture long-range dependency information, and the fused features are then nonlocally corrected. The formula is as follows:
[0196]
[0197] In the formula: NL(Z) (l) () represents the feature after nonlocal correction. The weight matrix is the nonlocal module weight matrix. The softmax(·) function is used to normalize the similarity between features, thereby capturing global information.
[0198] Finally, the dynamic gating fusion features and nonlocal correction features are integrated to obtain the output of the l-th layer, with the following formula:
[0199] O (l) =φ(Z′) (l) +β (l) ·NL(Z (l) ))
[0200] In the formula: O (l) For the output features of the l-th layer, β (l) φ is the fusion coefficient for nonlocal enhancement, used to adjust the contribution of nonlocal features, and φ(·) is the activation function used to achieve nonlinear mapping of features.
[0201] S45. Cross-layer feature integration. If multiple convolutional operations exist, cross-layer residual fusion can be introduced to integrate the output of the current layer with the output of the previous layer, further capturing deep spatial information:
[0202] H (l) =ψ(O (l) +W r(l) O (l-1) +b r(l) )
[0203] Among them W r(l) and b r(l) For parameters of cross-layer fusion, ψ(·) represents the activation or normalization function, O (l-1) This is the output of the previous layer.
[0204] S50. Temporal Modeling Based on Hybrid RNN, Multi-Head Self-Attention, and Adaptive Context Gating. This paper proposes a temporal modeling method based on a hybrid recurrent neural network (combining LSTM and GRU units), multi-head self-attention, and adaptive context gating. The method utilizes a hybrid recurrent neural network to extract temporal features from traffic flow data, aggregates important information from different time points through a multi-head self-attention mechanism, and employs adaptive context gating to intelligently fuse the final state and attention output of the recurrent network, thereby generating a comprehensive temporal representation to support subsequent prediction outputs and achieve high-precision prediction of dynamic traffic conditions.
[0205] Specifically, this includes the construction of S51 and hybrid RNN units. At each time step t, temporal features are extracted using LSTM and GRU units respectively. For the LSTM unit, the state calculation formula is:
[0206] f t =σ(W f [h t-1 ,x t ]+b f )
[0207] i t =σ(W i [h t-1 ,x t ]+b i )
[0208]
[0209] o t =σ(W o [h t-1 ,x t ]+b o )
[0210]
[0211] In the formula: x t For the current input; h t-1 The hidden state of the previous time step; W f W i W C W o and the corresponding bias b f ,b i ,b C ,b o σ represents the weight parameters of the LSTM unit; σ(·) represents the Sigmoid activation function, tanh(·) represents the hyperbolic tangent function; ⊙ represents the element-wise product.
[0212] For a GRU cell, the state calculation formula is as follows:
[0213] z t =σ(W z [h t-1 ,x t ]+b z )
[0214] r t =σ(W r [h t-1 ,x t ]+b r )
[0215]
[0216] In the formula: W z W r W h and the corresponding bias b z ,b r ,b h These are the weight parameters for the GRU unit.
[0217] Subsequently, the outputs of the hybrid RNN units are fused using a learnable fusion coefficient γ (ranging from 0 to 1), calculated as follows:
[0218]
[0219] In the formula: γ represents the hidden state after mixing; γ is the adaptive fusion coefficient used to balance the contributions of the LSTM and GRU unit outputs.
[0220] S52, Multi-head Self-Attention Mechanism. This mechanism addresses the hidden state sequences generated by hybrid RNNs. Perform multi-head self-attention computation. First, construct the query, key, and value matrix:
[0221] Q = HW Q K = HW K V = HW V
[0222] In the formula: W is the hidden state matrix; Q W K W V A weight matrix for queries, keys, and values;
[0223] The corresponding matrix is obtained by multiplying H by each weight matrix. For each attention head i (totaling H...),... head (Height), calculate attention output:
[0224]
[0225] In the formula: Q i ,K i V i These are the query, key, and value matrices corresponding to the i-th header; d k The dimension of the key vector is used for normalization; the softmax(·) function is used to calculate the attention weights.
[0226] After concatenating all attention points, output matrix W is used. O Perform a linear transformation to obtain the final self-attention output:
[0227]
[0228] In the formula: W O This is the output weight matrix.
[0229] S53, Adaptive Context Gating Fusion. To fully utilize the information from the final hidden state of the RNN and the multi-head self-attention output, an adaptive context gating mechanism is adopted. First, the final hidden state of the hybrid RNN is... Concatenated with the attention output A, it is represented as:
[0230]
[0231] In the formula, "[;]" indicates vector concatenation. Next, the gating coefficient is calculated:
[0232] g=σ(W g C in +b g )
[0233] In the formula: W g and b g σ represents the weights and biases of the gating mechanism; σ(·) is the Sigmoid activation function; g is the adaptive gating vector, used to adjust the contribution of each feature.
[0234] Finally, a comprehensive context vector is generated through gated fusion:
[0235]
[0236] In the formula: ⊙ represents element-wise multiplication; c is the fused context representation, reflecting key information in the time series data.
[0237] S54. Final Prediction Output Generation. The fused context vector c is input into the fully connected layer, and after nonlinear mapping, the final prediction output is generated. The calculation formula is as follows:
[0238] y=φ(W y c+b y )
[0239] In the formula: W y and b y φ represents the weights and biases of the fully connected layer; φ(·) is the activation function (e.g., Softmax or Sigmoid) used to achieve the final prediction of traffic congestion status or traffic flow; y represents the system's predicted output.
[0240] S60. System Integration, Predictive Output, and Online Self-Optimization Feedback. The system efficiently fuses the multimodal features output from each module and generates the final prediction result through an adaptive gating mechanism. Simultaneously, an online feedback mechanism enables real-time adjustment and self-optimization of model parameters, thus forming a closed-loop control system to ensure that the traffic congestion prediction system maintains high accuracy and stability in dynamic traffic environments.
[0241] Specifically, this includes: S61, multimodal feature fusion. Based on integrating the outputs of the aforementioned modules, the spatial features F... spatial Temporal context vector c and external auxiliary information F external A unified feature representation is generated by combining adaptive gating and nonlinear fusion, and the fusion formula is as follows:
[0242]
[0243] In the formula: F spatial For spatial features, c is the temporal context vector, and F is the spatial feature. external To supplement information from external data, σ(·) and tanh(·) are activation functions, and W1,W2 and b1,b2 are parameters to be learned.
[0244] S62. Final prediction output generation. The fused features are passed through a fully connected layer to generate the prediction output y:
[0245] y=φ2(W y Z fusion +b y )
[0246] In the formula: W y and b y φ1 and φ2 are the weight matrix and bias of the fully connected layer, respectively; φ2(·) is the activation function (e.g., Softmax or Sigmoid).
[0247] S63. Design of Multi-Objective Loss Function. To achieve online self-optimization feedback, a multi-objective loss function incorporating prediction error and regularization constraints was designed:
[0248]
[0249] In the formula: where y (i) and Let represent the predicted output and the true value of the i-th sample, respectively; M is the total number of samples; Ω(θ) is the parameter regularization term, used to prevent the model from overfitting; λ1 and λ2 are coefficients that balance the influence of prediction error and regularization term.
[0250] S64. Online self-optimization feedback and dynamic learning rate adjustment. The system uses an improved adaptive gradient update algorithm (such as ADAM) to iteratively update the model parameters. The update formula is as follows:
[0251]
[0252] In the formula: θ c These are the model parameters at the c-th iteration; and η represents the first and second moment estimates of the gradient, respectively; ∈ is a minimal constant to prevent division by zero; η c This represents the current learning rate.
[0253] To further achieve dynamic learning rate adjustment, the system incorporates the following formula:
[0254] η c+1 =η c ·exp(-κ·L)
[0255] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural networks, characterized in that, Includes the following steps: S10, Multi-sensor data acquisition and pre-fusion; Multiple sensors are deployed to collect traffic data. An edge computing platform is used to set dynamic thresholds based on the real-time data quality of each sensor. The data is then filtered and weighted by nonlinear weighting functions and the correlation between sensors, and then weighted pre-fusion is performed. S20. Data preprocessing and augmentation: Standardize, suppress noise, and complete missing data for each sensor data, and generate virtual traffic samples by combining data augmentation techniques; S30, Multi-dimensional Feature Extraction and Depth Transformation; A multilinear discriminant analysis method is adopted, combined with deep feature transformation technology, to map the preprocessed traffic data to a high discriminative feature space. Tensor decomposition technology is used to extract multi-scale and multi-angle features from the traffic data. S40. Spatial feature extraction: Local features at different scales are extracted through adaptive multi-scale dynamic convolution branches, key information is enhanced through channel attention mechanism, global long-range dependencies are captured through non-local edge enhancement module, and dynamic weighted integration of features at various scales and levels is achieved through cross-layer residual fusion technology. S50, timing modeling; A hybrid recurrent neural network is used to extract temporal features of traffic flow data. Important information at different times is aggregated through a multi-head self-attention mechanism. Adaptive context gating is used to fuse the final state of the recurrent network with the attention output to generate a comprehensive temporal representation. S60, Predictive Output: Multimodal features are fused, and the final prediction result is generated through an adaptive gating mechanism. An online feedback mechanism is used to realize the real-time adjustment and self-optimization of model parameters, and a closed-loop control system is constructed.
2. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 1, characterized in that, S10 includes: S11. Dynamic quality threshold setting; For each sensor, a dynamic quality threshold is set based on the base threshold θ0 and the standard deviation σ of the sensor's measurement data within the most recent time window. i And an adjustment parameter α is introduced for calculation, the formula is: i i (t)=θ0+α·σ i (t) In the formula, θ0 is the basic threshold; σ i (t) represents the standard deviation of the measurement data of sensor i within the most recent time window, and α is the adjustment parameter; S12. Initial screening of sensors is performed using an indicator function: In the formula, S i (t) represents the selected state of sensor i at time t; Q i (t) represents the quality score of sensor i at time t; θ i (t) represents the dynamic quality threshold of sensor i; S13. Calculate the nonlinear weights using the Logistic function: In the formula, L i (t) represents the nonlinear mass weight of sensor i at time t, and κ is the control coefficient; S14. Correlation correction between sensors: Define the redundancy correction factor for sensor i. In the formula, ρ ij (t) is the data correlation coefficient between sensors i and j at time t, Ri i (t) is the redundancy correction factor for sensor i; S15. Final weight calculation of the sensor: W i (t)=S i (t)·L i (t)·R i (t) In the formula, W i (t) represents the final weight of sensor i at time t; S16. Weighted pre-fusion data calculation; edge nodes perform local data pre-fusion and calculate the fused data D. f The formula for (t) is: In the formula, D f (t) represents the weighted pre-fused data output by the edge node at time t, i.e., the fusion result after weighting and averaging all sensor data according to their respective weights; D i (t) represents the data collected by sensor i at time t; N represents the total number of sensors.
3. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 1, characterized in that, S20 includes: S21, Data standardization; For the fused data D output from the edge computing module... f (t) is standardized to transform data with different dimensions into dimensionless variables. The standardization formula is as follows: In the formula, To achieve D within the preset time window f The mean of (t), Its standard deviation; The data is standardized. S22. Noise Suppression and Smoothing Filtering: Moving average filtering is used to smooth the standardized data. The window width is set to w, and the initial time of the window is k. The filtered data... for: S24. Data Augmentation Strategy: Gaussian noise is added to the smoothed data to generate new training samples, as shown in the following formula: In the formula, ∈ represents the Gaussian noise term, and σ ∈ Parameters for controlling noise amplitude; D aug (t) represents the enhanced data.
4. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 3, characterized in that, In S20, which is after S22 and before S24, it also includes: S23. Automatic missing value completion; missing values are completed using linear interpolation. In the formula, the parameter This refers to the processed data from the moment before the missing data was generated. This represents the processed data at the moment following the missing data.
5. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 1, characterized in that, S30 includes: S31. Data Tensorization: Preprocessing the multidimensional traffic data into a high-order tensor to simultaneously capture the inherent structure of the data in time, space, and feature dimensions. The preprocessed data includes a time step Q, the number of spatial locations S, and the feature dimension F. The constructed tensor... Represented as: In the formula, x q,s,f This represents the collected value of the f-th feature at time q and position s; S32. Multilinear Discriminant Analysis; An improved multilinear discriminant analysis method is used to construct inter-class divergence matrices for each mode in tensor space. and the scatter matrix within categories Where n represents the nth mode of the tensor, and λ is the eigenvalue. The problem is solved by finding the generalized eigenvalues: Obtain the projection matrix I n For the original dimension, d n To reduce the dimensionality and make the mapped data more distinguishable between categories, the goal of this step is: In the formula, U (n) Let U be the projection matrix. (n)T For the projection matrix U (n) The transpose of the matrix; S33. Deep Feature Transform and Tensor Decomposition: Deep feature transform technology is used, and tensor decomposition is employed to extract multi-scale, multi-angle traffic state features. The dimensionality-reduced tensor data is then decomposed to obtain the core tensor. and the orthogonal factor matrix U of each mode (1) U (2) U (3) The decomposition formula is: In the formula, Represents the original high-order feature tensor; × n This represents the product of a tensor and a matrix on the nth mode.
6. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 1, characterized in that, S40 includes: S41, Multi-scale dynamic convolution branch; This branch processes the input feature tensors after depthwise feature transformation and tensor decomposition. Construct multiple convolutional branches with different scales and dilation rates, where H is the height of the feature map, W is the width of the feature map, and C is the number of channels. For the k-th branch of the l-th layer, a dilated convolution operation is used: Y (l,k) =σ(DilatedConv(X;W (l,k) ,r (l,k) )+b (l,k) ) In the formula, W (l,k) and b (l,k) The kernel and bias of the convolution in the k-th branch of the l-th layer are respectively, r (l,k) Y represents the corresponding expansion rate, and σ(·) is the activation function; (l,k) The resulting output feature map; S42, Adaptive Channel Attention Enhancement: For each convolutional branch, adaptive channel attention weights are generated using global average pooling combined with nonlinear mapping; for the k-th branch of the l-th layer, the attention vector is calculated: A (l,k) =softmax(f(GAP(Y (l,k) );i (l,k) )) In the formula, f(·; θ (l,k) ) is a parameter θ (l,k) The nonlinear mapping function converts global statistics into channel weights, A (l,k) The attention weighting coefficients are for the k-th branch of the l-th layer; then the convolution output is weighted: In the formula, ⊙ represents element-wise product. This is the original attention score for the k-th branch of the l-th layer; S43, Multi-scale branch fusion and dynamic weights; introducing fusion weights λ to the outputs of all branches. (l,k) To achieve weighted fusion of multi-scale features: In the formula, K is the total number of branches k, and λ (l,k) These are learnable scalar weights; S44. Adaptive cross-layer residual and non-local edge enhancement; The input features and fused features are weighted and summed using dynamic gating parameters, as shown in the formula: WITH ′(l) =α (l) X+(1-α (l) )·WITH (l) In the formula, X represents the input feature, and Z... (l) Z represents the multi-scale convolutional features after fusion at layer l. ′(l) For the features after weighted fusion, α (l) This is a dynamic gating parameter, and its value is between 0 and 1; Nonlocal modules are used to capture long-range dependency information, and nonlocal corrections are applied to the fused features. The formula is as follows: In the formula, NL(Z) (l) () represents the feature after nonlocal correction. Here is the weight matrix of the nonlocal module, and the softmax(·) function is used to normalize the similarity between features. The dynamic gating fusion feature and the nonlocal correction feature are integrated to obtain the output of the l-th layer, and its formula is: ABOUT (l) =φ(Z ′(l) +β (l) ·NL(Z (l) )) In the formula, O (l) For the output features of the l-th layer, β (l) φ is the fusion coefficient for nonlocal enhancement, used to adjust the contribution of nonlocal features, and φ(·) is the activation function used to achieve nonlinear mapping of features.
7. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 6, characterized in that, It also includes S45 and cross-layer feature integration; If multiple convolutional operations exist, cross-layer residual fusion is introduced to integrate the output of the current layer with the output of the previous layer, further capturing deep spatial information: H (l) =ψ(O (l) +W r(l) The (l-1) +b r(l) ) In the formula, H (l) W represents the cross-layer fusion output feature of the l-th layer. r(l) and b r(l) Here, r is a parameter for cross-layer fusion, r is a dedicated learnable parameter for cross-layer residual fusion, and ψ(·) represents the activation or normalization function. (l-1) This is the output of the previous layer.
8. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 1, characterized in that, S50 includes: S51. Construction of hybrid RNN units; at each time step t, temporal features are extracted using LSTM and GRU units respectively. For the LSTM unit, the state calculation formula is as follows: f t =σ(W f [h t-1 ,x t ]+b f ) i t =σ(W i [h t-1 ,x t ]+b i ) the t =σ(W o [h t-1 ,x t ]+b o ) In the formula, f t Indicates the forget gate; i t Indicates the input gate; Indicates the state of candidate cells; C t Indicates cell state; o t Indicates the output gate; Indicates a hidden state; x t For the current input; h t-1 The hidden state of the previous time step; W f W i W C W o and the corresponding bias b f ,b i ,b C ,b o σ represents the weight parameters of the LSTM unit; σ(·) represents the Sigmoid activation function, tanh(·) represents the hyperbolic tangent function; ⊙ represents element-wise product; For a GRU cell, the state calculation formula is as follows: z t =σ(W z [h t-1 ,x t ]+b z ) r t =σ(W r [h t-1 ,x t ]+b r ) In the formula, z t Indicates the update gate; r t Indicates that the door is being reset; Indicates the candidate hidden state; Indicates a hidden state; W z W r W h and the corresponding bias b z ,b r ,b h These are the weight parameters of the GRU unit; The fusion of outputs from hybrid RNN units is achieved through a learnable fusion coefficient γ, where γ ranges from 0 to 1, and the calculation formula is as follows: In the formula, The hidden state is the result of the mixture; γ is the adaptive fusion coefficient. S52, Multi-head Self-Attention Mechanism; for Hidden State Sequences Generated by Hybrid RNNs Perform multi-head self-attention computation; construct query, key, and value matrices: Q=HW Q ,K=HW K ,V=HW V In the formula, Q is the query matrix; Let W be the hidden state matrix. Q W K W V A weight matrix for queries, keys, and values; Multiply H by each weight matrix to obtain the corresponding matrix; for each attention head i, there are a total of H. head Size, calculate attention output: In the formula, head i The output of the i-th attention head; Q i ,K i V i These are the query, key, and value matrices corresponding to the i-th header; d k The dimension of the key vector is used for normalization; the softmax(·) function is used to calculate the attention weights. After concatenating all attention points, output matrix W is used. O Perform a linear transformation to obtain the final self-attention output: In the formula, A represents the final output of multi-head attention; W O To output the weight matrix; S53, Adaptive Context Gating Fusion: An adaptive context gating mechanism is used to fuse the final hidden states of the hybrid RNN. Concatenated with the attention output A, it is represented as: In the formula, C in The input context vector before gating fusion is represented by [;]; then the gating coefficients are calculated: g=σ(W g C in +b g ) In the formula, W g and b g Here, σ(·) represents the weights and biases of the gating mechanism; g is the adaptive gating vector; then, through gating fusion, a comprehensive context vector is generated: In the formula, ⊙ represents element-wise multiplication; c is the fused context representation; S54. Final prediction output generation: The fused context vector c is input into the fully connected layer, and after nonlinear mapping, the final prediction output is generated. The calculation formula is as follows: y=φ(W y c+b y ) In the formula, W y and b y φ represents the weights and biases of the fully connected layer; φ(·) is the activation function; and y represents the predicted output of the system.
9. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 1, characterized in that, S60 includes: S61, Multimodal feature fusion; integrating spatial features F spatial Temporal context vector c and external auxiliary information F external A unified feature representation is generated by combining adaptive gating and nonlinear fusion, and the fusion formula is as follows: In the formula, F spatial For spatial features, c is the temporal context vector, and F is the spatial feature. external To supplement information from external data, σ(·) and tanh(·) are activation functions, and W1,W2 and b1,b2 are parameters to be learned; Z fusion This represents the final unified feature representation of the multimodal systems after fusion. S62. Final prediction output generation; The fused features are passed through a fully connected layer to generate the prediction output y: y=φ2(W y Z fusion +b y ) In the formula, W y and b y φ1 and φ2 are the weight matrix and bias of the fully connected layer, respectively; φ2(·) is the activation function. S63. Multi-objective loss function design; including prediction error and regularization constraints: In the formula, y (i) and Let represent the predicted output and the true value of the i-th sample, respectively; M is the total number of samples; Ω(θ) is the regularization term; λ1 and λ2 are coefficients that balance the influence of prediction error and regularization term.
10. The traffic congestion prediction method based on adaptive multi-sensor data fusion and multi-level deep spatiotemporal neural network according to claim 9, characterized in that, It also includes: S64, online self-optimizing feedback and dynamic learning rate adjustment; and an improved adaptive gradient update algorithm is used to iteratively update the model parameters, with the update formula being: In the formula, θ c These are the model parameters at the c-th iteration; and These are the first and second moment estimates of the gradient, respectively; ∈ is the minimum constant; η c The current learning rate; combined with the following formula: or c+1 =the c ·exp(-κ·L) In the formula, κ is the learning rate decay parameter, which dynamically adjusts the learning rate based on the current loss L value.
Citation Information
Cited By
Remote auxiliary diagnosis and treatment system and data processing method
CN121862355A
