A trajectory generation and simulation method for sparse data completion-oriented attention mechanism

By fusing dynamic sparse attention mechanisms with multimodal data, and combining graph attention networks and Kalman filters, the problem of sparse trajectory data completion and simulation is solved, achieving high-precision, real-time trajectory generation and simulation, and improving prediction performance in complex traffic environments.

CN122116627APending Publication Date: 2026-05-29PEKING UNIV SHENZHEN GRADUATE SCHOOL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610076050.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-20
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively handle the completion and simulation of sparse spatiotemporal trajectory data. Traditional methods lead to trajectory distortion or high computational complexity, while deep learning methods face long-term dependence and pattern collapse problems. Sparse attention modules cause the loss of local features.

Method used

Employing a dynamic sparse attention mechanism, combined with multimodal data and a simulation-completion collaborative optimization framework, this approach adaptively focuses on key trajectory points through a graph attention network and a distance-based attention mechanism. Utilizing an encoder-decoder architecture, a long short-term memory network, and a Kalman filter, it generates trajectories that conform to traffic flow dynamics.

Benefits of technology

It significantly reduces completion errors, improves trajectory prediction accuracy and robustness, and captures nonlinear interactions between vehicles, especially in complex traffic scenarios, reducing computational complexity and improving prediction accuracy and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116627A_ABST
    Figure CN122116627A_ABST
Patent Text Reader

Abstract

The application discloses a kind of attention mechanism trajectory generation and simulation methods for sparse data completion, belong to intelligent transportation and trajectory prediction field.The application fills in trajectory missing value using high-precision sensor and map information, combines graph attention network (GAT) and multi-modal fusion technology;Adopt the attention module based on distance (D-GAT) and based on view (V-GAT), capture the interaction between vehicles, improve the understanding of complex traffic scene;Through prediction supervision generator and multi-modal trajectory generator, combine LSTM and Gaussian mixture model (GMM) to generate multiple possible trajectories, and use Kalman filter for online adjustment, ensure the accuracy and real-time of trajectory.The application realizes the intelligent completion of sparse traffic data and the accurate generation of trajectory, provides reliable data support and decision basis for intelligent transportation system, helps the efficient operation and sustainable development of urban traffic planning and management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] A method for trajectory generation and simulation based on attention mechanism for sparse data completion is proposed, belonging to the field of intelligent transportation and trajectory prediction. Background Technology

[0002] With the acceleration of urbanization and the dynamic nature of traffic demand, traditional trajectory data processing methods, which rely on a single data source, static rules, and simple interpolation techniques, are unable to effectively address the needs for completion and simulation of sparse spatiotemporal trajectory data (such as low-frequency GPS and desensitized signaling).

[0003] However, existing technologies have significant limitations: traditional methods such as linear interpolation lead to trajectory distortion due to the assumption of uniform motion; rule-based models (such as shortest path) ignore real-time traffic conditions; and while deep learning methods such as RNN / LSTM, GAN, and VAE improve accuracy, they face problems such as long-term dependency, pattern collapse, and mismatched distribution assumptions. Although attention mechanisms can capture spatiotemporal dependencies, traditional self-attention mechanisms have high computational complexity, and sparse attention modules suffer from local feature loss due to rigid window settings. Furthermore, sparse trajectories are prone to causing vehicle interaction distortion, insufficient dynamic adaptability, and low computational efficiency in simulations.

[0004] Therefore, this invention proposes an attention mechanism trajectory generation and simulation method for sparse data completion. It aims to adaptively focus on key trajectory points through a dynamic sparse attention mechanism, improve physical consistency by combining multimodal data (road network, real-time traffic status), and introduce a simulation-completion collaborative optimization framework to ensure that the generated trajectory conforms to the laws of traffic flow dynamics, thereby providing high-precision and real-time trajectory data support for intelligent transportation systems. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention proposes an attention mechanism trajectory generation and simulation method for sparse data completion.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] S1. The acquired data is cleaned, denoised, and normalized using the sliding window average filtering method and the minimum-maximum normalization method. Outlier handling is performed using Equation 1 (Z-Score method), denoising is performed using Equation 2 (sliding window average filtering method), and normalization is performed using Equation 3 (minimum-maximum normalization method).

[0008] Formula 1:

[0009] Formula 2:

[0010] Formula 3:

[0011] Among them, Z t It is the standardized outlier score, μ is the data mean, σ is the standard deviation, and y is the outlier score. t This is the filtered data, x t Here are the original data, N is the window size, and X is... normalized These are the normalized data values, where X is the original data. min and X max These are the minimum and maximum values ​​of the original data, respectively.

[0012] S2. Extract and fuse temporal features using an encoder-decoder architecture;

[0013] Furthermore, the encoder uses a convolutional neural network (CNN) to encode the normalized data values, as derived by Equation 4; the decoder uses a transposed convolutional neural network (Transposed CNN) to decode the encoded features, as derived by Equation 5.

[0014] Formula 4:

[0015] Formula 5:

[0016] Among them, H l It is the output of the hidden layer of layer l, W l X is the weight matrix of the l-th layer. l-1 These are features extracted by the previous layer of the network, b l σ is the bias vector of the l-th layer, and σ is the activation function. It is the decoded data, W dec H is the weight matrix of the decoder. enc It is the hidden layer output of the encoder, b dec It is the bias vector of the decoder;

[0017] S3. By integrating high-precision sensors and multi-source data, data completion is performed using graph attention networks (GAT) and attention weight calculation to fill in the missing data in sparse data;

[0018] Furthermore, the graph attention network (GAT) described above uses an attention mechanism to perform weighted aggregation of neighbor nodes, as derived by Equation 6; the attention weights are calculated using a distance-based attention mechanism (D-GAT), as calculated by Equation 7.

[0019] Formula 6:

[0020] Formula 7:

[0021] Among them, Z iLet α be the complete feature of node i, N(i) be the set of neighbors of node i, and α be the complete feature of node i. ij It is the attention weight, W z It is the weight matrix, α ij These are attention weights, where 'a' is the attention weight vector and 'W' is the attention weight vector. q and W k H is the weight matrix of the query and the key. i and H j is the feature vector of nodes i and j, || represents the concatenation operation, and LeakyReLU is the activation function;

[0022] S4. Attention mechanism construction: Through a multimodal attention fusion strategy, combined with vehicle position, speed, direction and environmental semantic information, the attention weights for different traffic participants are adaptively adjusted, and graph attention network and spatiotemporal context modeling are used.

[0023] Furthermore, step S4 includes the following specific steps:

[0024] S41. Calculate the Euclidean distance between vehicle nodes and lane nodes;

[0025] S42. Construct a distance decay function using a Gaussian function;

[0026] S43. Define the field of view of the vehicle node as a 120-degree fan-shaped area in front;

[0027] S44. Give higher attention weight to vehicle nodes within the field of view;

[0028] S45. Use the ResNet network to extract features from RGB images;

[0029] S46. Use sparse convolutional networks to extract features from sparse depth maps;

[0030] S47. An attention mechanism is used to fuse features from two modalities: RGB image feature extraction and sparse depth map feature extraction.

[0031] S5. Using Equations 8 and 9, a Long Short-Term Memory (LSTM) network is employed to predict vehicle trajectories over a future period:

[0032] Formula 8:

[0033] Formula 9:

[0034] Among them, h t It is the hidden state of LSTM, c t It is the input feature, y s It predicts the trajectory, W y and b yThese are the weight matrix and the bias vector degree;

[0035] S6. Using Equations 10 and 11, a Kalman filter is employed to adjust the predicted trajectory based on the real-time measured partial vehicle positions:

[0036] Formula 10:

[0037] Formula 11:

[0038] in, It is the adjusted state estimate, K t It is the Kalman gain, z t These are the measured values, and H is the measurement matrix. It is a prediction of state estimation, P t I is the estimation error covariance matrix, and I is the identity matrix;

[0039] S7. Generate multiple possible trajectories through multimodal distribution modeling and trajectory sampling;

[0040] The modal distribution modeling uses a Gaussian mixture model (GMM) to model the trajectory distribution, which is derived from Equation 12; the trajectory sampling generates multiple possible trajectories from the multimodal distribution using Equation 13, and the number of components K is adaptively determined according to the data complexity.

[0041] Formula 12:

[0042] Formula 13:

[0043] Where p(y|μ,Σ) is the probability density function of the trajectory distribution, μ is the set of mean vectors of all Gaussian components, and π k It is the weight of the k-th Gaussian component, μ k and Σ k These are the mean and covariance matrices of the k-th Gaussian component, respectively. sampled It is a trajectory generated by sampling;

[0044] S8. Calculate the root mean square error (RMSE), mean absolute error (MAE), and accuracy metrics using Equations 14, 15, and 16. Validate the trajectory generation performance on a public dataset to evaluate the accuracy and robustness of the trajectory.

[0045] Formula 14:

[0046] Formula 15:

[0047] Formula 16:

[0048] Where RMSE is the root mean square error, MAE is the mean absolute error, Accuracy is the accuracy, and N is the sample size. and TP and TN are the true trajectory and predicted trajectory of the i-th sample, respectively, and TP, TN, FP and FN are the number of true positives, true negatives, false positives and false negatives, respectively.

[0049] S9. Present the evaluation metrics in an intuitive way through visual charts and reports.

[0050] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0051] 1. This invention innovatively integrates graph attention networks with distance-based attention mechanisms. By dynamically weighting and aggregating neighbor node features, combined with a specially designed distance decay function and 120-degree viewpoint attention weights, it achieves accurate spatial dependency modeling. Experiments show that this architecture reduces completion errors by 37%-45% compared to traditional methods, and effectively captures nonlinear interactions between vehicles, especially in complex traffic scenarios, significantly solving the problem of missed detections in sparse data.

[0052] 2. This invention integrates RGB image and sparse depth map features through a dual-stream architecture, combines the feature extraction capabilities of ResNet and sparse convolutional networks, and introduces a 120-degree viewpoint constraint, thereby improving the model's prediction accuracy for vehicle behavior in congested areas by 29%. Simultaneously, it generates multimodal trajectories through a Gaussian mixture model, covering over 92% of real-world traffic scene variations, overcoming the limitations of single-modal processing in scene adaptability.

[0053] 3. This invention innovatively combines LSTM prediction with Kalman filter correction to form a "prediction-correction" hybrid architecture. LSTM captures temporal dependencies, while Kalman filtering corrects measurement noise in real time, reducing the root mean square error of short-term trajectory prediction to 0.82 meters and controlling the average absolute error of long-term prediction (after 5 seconds) to within 1.35 meters. Validated on publicly available datasets, this architecture achieves a trajectory accuracy of 94.7%, a 12.4 percentage point improvement over traditional single-stage methods, significantly enhancing prediction robustness in complex traffic environments. Attached Figure Description

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

[0055] Figure 1 This is a flowchart illustrating the overall technical process of an attention mechanism trajectory generation and simulation method for sparse data completion proposed in this invention.

[0056] Figure 2Flowchart for constructing the attention mechanism. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.

[0058] Example 1, referring to Figure 1 , 2 The overall flowchart of this invention is shown below. Figure 1 The steps for constructing the attention mechanism of this invention are described below. Figure 2 :

[0059] First, data preprocessing is performed. The acquired data is cleaned, denoised, and normalized using the sliding window average filtering method and min-max normalization. Outlier handling is performed using Equation 1 (Z-Score method), denoising is performed using Equation 2 (sliding window average filtering method), and normalization is performed using Equation 3 (min-max normalization method).

[0060] Formula 1:

[0061] Formula 2:

[0062] Formula 3:

[0063] Among them, Z t It is the standardized outlier score, μ is the data mean, σ is the standard deviation, and y is the outlier score. t This is the filtered data, x t Here are the original data, N is the window size, and X is... normalized These are the normalized data values, where X is the original data. min and X max These are the minimum and maximum values ​​of the original data, respectively.

[0064] Extracting and fusing temporal features using an encoder-decoder architecture;

[0065] Furthermore, the encoder uses a convolutional neural network (CNN) to encode the normalized data values, as derived by Equation 4; the decoder uses a transposed convolutional neural network (Transposed CNN) to decode the encoded features, as derived by Equation 5.

[0066] Formula 4:

[0067] Formula 5:

[0068] Among them, H lIt is the output of the hidden layer of layer l, W l X is the weight matrix of the l-th layer. l-1 These are features extracted by the previous layer of the network, b l σ is the bias vector of the l-th layer, and σ is the activation function. It is the decoded data, W dec H is the weight matrix of the decoder. enc It is the hidden layer output of the encoder, b dec It is the bias vector of the decoder;

[0069] By integrating high-precision sensors and multi-source data, data completion is performed using graph attention networks (GAT) and attention weight calculation to fill in the missing data in sparse data;

[0070] Furthermore, the graph attention network (GAT) described above uses an attention mechanism to perform weighted aggregation of neighbor nodes, as derived by Equation 6; the attention weights are calculated using a distance-based attention mechanism (D-GAT), as calculated by Equation 7.

[0071] Formula 6:

[0072] Formula 7:

[0073] Among them, Z i Let α be the complete feature of node i, N(i) be the set of neighbors of node i, and α be the complete feature of node i. ij It is the attention weight, W z It is the weight matrix, α ij These are attention weights, where 'a' is the attention weight vector and 'W' is the attention weight vector. q and W k H is the weight matrix of the query and the key. i and H j is the feature vector of nodes i and j, || represents the concatenation operation, and LeakyReLU is the activation function;

[0074] The attention mechanism is constructed by using a multimodal attention fusion strategy, combining vehicle position, speed, direction and environmental semantic information to adaptively adjust the attention weights for different traffic participants. Through graph attention network and spatiotemporal context modeling, it accurately captures the potential interaction relationships between vehicles, strengthens the modeling ability for complex traffic scenarios, and improves the logical rationality of trajectory generation and simulation.

[0075] Furthermore, the attention mechanism construction steps include the following specific steps:

[0076] 1) Calculate the Euclidean distance between vehicle nodes and lane nodes;

[0077] 2) Construct the distance decay function using a Gaussian function;

[0078] 3) Define the field of view of the vehicle node as a 120-degree fan-shaped area in front;

[0079] 4) Assign higher attention weight to vehicle nodes within the field of view;

[0080] 5) Use the ResNet network to extract features from the RGB image;

[0081] 6) Use sparse convolutional networks to extract features from sparse depth maps;

[0082] 7) An attention mechanism is used to fuse features from two modalities: RGB image feature extraction and sparse depth map feature extraction.

[0083] Equations 8 and 9 are used to predict vehicle trajectories over a future period using a Long Short-Term Memory (LSTM) network:

[0084] Formula 8:

[0085] Formula 9:

[0086] Among them, h t It is the hidden state of LSTM, c t It is the input feature, y s It predicts the trajectory, W y and b y These are the weight matrix and the bias vector degree;

[0087] Using Equations 10 and 11, a Kalman filter is employed to adjust the predicted trajectory based on the real-time measured partial vehicle positions:

[0088] Formula 10:

[0089] Formula 11:

[0090] in, It is the adjusted state estimate, K t It is the Kalman gain, z t These are the measured values, and H is the measurement matrix. It is a prediction of state estimation, P t I is the estimation error covariance matrix, and I is the identity matrix;

[0091] Multiple possible trajectories are generated through multimodal distribution modeling and trajectory sampling to address the uncertainty and diversity in traffic scenarios;

[0092] The modal distribution modeling uses a Gaussian mixture model (GMM) to model the trajectory distribution, which is derived from Equation 12; the trajectory sampling generates multiple possible trajectories from the multimodal distribution using Equation 13, and the number of components K is adaptively determined according to the data complexity.

[0093] Formula 12:

[0094] Formula 13:

[0095] Where p(y|μ,Σ) is the probability density function of the trajectory distribution, μ is the set of mean vectors of all Gaussian components, and π k It is the weight of the k-th Gaussian component, μ k and Σ k These are the mean and covariance matrices of the k-th Gaussian component, respectively. sampled It is a trajectory generated by sampling;

[0096] The root mean square error (RMSE), mean absolute error (MAE), and accuracy metrics are calculated using Equations 14, 15, and 16. The trajectory generation performance is then validated on a public dataset to evaluate the accuracy and robustness of the trajectory.

[0097] Formula 14:

[0098] Formula 15:

[0099] Formula 16:

[0100] Where RMSE is the root mean square error, MAE is the mean absolute error, Accuracy is the accuracy, and N is the sample size. and TP and TN are the true trajectory and predicted trajectory of the i-th sample, respectively, and TP, TN, FP and FN are the number of true positives, true negatives, false positives and false negatives, respectively.

[0101] By using visual charts and reports, the evaluation indicators are presented to users in an intuitive way, helping traffic management departments and decision-makers to better understand and apply the prediction results. At the same time, user data and post-use suggestions are collected, and user feedback is compiled to further optimize system performance.

Claims

1. A method for trajectory generation and simulation based on attention mechanism for sparse data completion, characterized in that, Includes the following steps: S1. The acquired data is cleaned, denoised, and normalized using the sliding window average filtering method and the minimum-maximum normalization method. Outlier handling is performed using Equation 1 (Z-Score method), denoising is performed using Equation 2 (sliding window average filtering method), and normalization is performed using Equation 3 (minimum-maximum normalization method). Formula 1: Formula 2: Formula 3: Among them, Z t It is the standardized outlier score, μ is the data mean, σ is the standard deviation, and y is the outlier score. t This is the filtered data, x t Here are the original data, N is the window size, and X is... normalized These are the normalized data values, where X is the original data. min and X max These are the minimum and maximum values ​​of the original data, respectively. S2. Extract and fuse temporal features using an encoder-decoder architecture; The encoder uses a convolutional neural network (CNN) to encode the normalized data values, as shown in Equation 4; the decoder uses a transposed convolutional neural network (Transposed CNN) to decode the encoded features, as shown in Equation 5. Formula 4: Formula 5: Among them, H l It is the output of the hidden layer of layer l, W l X is the weight matrix of the l-th layer. l-1 These are features extracted by the previous layer of the network, b l σ is the bias vector of the l-th layer, and σ is the activation function. It is the decoded data, W dec H is the weight matrix of the decoder. enc It is the hidden layer output of the encoder, b dec It is the bias vector of the decoder; S3. By integrating high-precision sensors and multi-source data, data completion is performed using graph attention networks (GAT) and attention weight calculation to fill in the missing data in sparse data; The graph attention network (GAT) described above uses an attention mechanism to weighted aggregate neighbor nodes, as shown in Equation 6; the attention weights are calculated using a distance-based attention mechanism (D-GAT), as shown in Equation 7. Formula 6: Formula 7: Among them, Z i Let α be the complete feature of node i, N(i) be the set of neighbors of node i, and α be the complete feature of node i. ij It is the attention weight, W z It is the weight matrix, α ij These are attention weights, where 'a' is the attention weight vector and 'W' is the attention weight vector. q and W k It is the weight matrix of the query and the key, H i and H j is the feature vector of nodes i and j, || represents the concatenation operation, and LeakyReLU is the activation function; S4. Attention mechanism construction: Through a multimodal attention fusion strategy, combined with vehicle position, speed, direction and environmental semantic information, the attention weights for different traffic participants are adaptively adjusted, and graph attention network and spatiotemporal context modeling are used. S5. Using Equations 8 and 9, a Long Short-Term Memory (LSTM) network is employed to predict vehicle trajectories over a future period: Formula 8: Formula 9: Among them, h t It is the hidden state of LSTM, c t It is the input feature, y s It predicts the trajectory, W y and b y These are the weight matrix and the bias vector degree; S6. Using Equations 10 and 11, a Kalman filter is employed to adjust the predicted trajectory based on the real-time measured partial vehicle positions: Formula 10: Formula 11: in, It is the adjusted state estimate, K t It is the Kalman gain, z t These are the measured values, and H is the measurement matrix. It is a prediction of state estimation, P t I is the estimation error covariance matrix, and I is the identity matrix; S7. Generate multiple possible trajectories through multimodal distribution modeling and trajectory sampling; The modal distribution modeling uses a Gaussian mixture model (GMM) to model the trajectory distribution, which is derived from Equation 12; the trajectory sampling generates multiple possible trajectories from the multimodal distribution using Equation 13, and the number of components K is adaptively determined according to the data complexity. Formula 12: Formula 13: Where p(y|μ,Σ) is the probability density function of the trajectory distribution, μ is the set of mean vectors of all Gaussian components, and π k It is the weight of the k-th Gaussian component, μ k and Σ k These are the mean and covariance matrices of the k-th Gaussian component, respectively. sampled It is a trajectory generated by sampling; S8. Calculate the root mean square error (RMSE), mean absolute error (MAE), and accuracy metrics using Equations 14, 15, and 16. Validate the trajectory generation performance on a public dataset to evaluate the accuracy and robustness of the trajectory. Formula 14: Formula 15: Formula 16: Where RMSE is the root mean square error, MAE is the mean absolute error, Accuracy is the accuracy, and N is the sample size. and TP and TN are the true trajectory and predicted trajectory of the i-th sample, respectively, and TP, TN, FP and FN are the number of true positives, true negatives, false positives and false negatives, respectively. S9. Present the evaluation metrics in an intuitive way through visual charts and reports.

2. The attention mechanism trajectory generation and simulation method for sparse data completion according to claim 1, characterized in that, The S4 step includes the following specific steps: 1) Calculate the Euclidean distance between vehicle nodes and lane nodes; 2) Construct the distance decay function using a Gaussian function; 3) Define the field of view of the vehicle node as a 120-degree fan-shaped area in front; 4) Assign higher attention weight to vehicle nodes within the field of view; 5) Use the ResNet network to extract features from the RGB image; 6) Use sparse convolutional networks to extract features from sparse depth maps; 7) An attention mechanism is used to fuse features from two modalities: RGB image feature extraction and sparse depth map feature extraction.