Vehicle trajectory prediction method and system based on multi-attention fusion and graph structure modeling

CN123012410APending Publication Date: 2026-10-30WUHAN COMPREHENSIVE TRANS RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611130426.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

这种“一刀切”的融合方式导致模型无法自适应调整特征权重,降低了不同场景下的预测精度

Benefits of technology

[0059]本发明具体涉及高速公路场景下的短期(未来5秒)车辆轨迹预测方法。通过融合车辆多维度运动特征(位置、速度、加速度)的时序动态与车辆间动态交互关系,实现对目标车辆未来位置、速度、加速度的精准预测,为自动驾驶系统的路径规划、碰撞风险评估及协同驾驶提供关键决策依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012410A_ABST
    Figure CN123012410A_ABST
Patent Text Reader

Abstract

The application belongs to but is not limited to the technical field of automatic driving trajectory prediction, and discloses a vehicle trajectory prediction method and system based on multi-attention fusion and graph structure modeling, which comprises the following steps: collecting and preprocessing vehicle position, speed and other data to construct a motion state vector; extracting and fusing each feature time sequence information through a parallel bidirectional LSTM-attention encoder; calculating the distance and relative features between vehicles to construct dynamic interaction edges; fusing the context interaction features and target vehicle features through a CBOW inspired module; aggregating the 'time + space' features by using a GAT encoder; outputting a complete trajectory in the next 5 seconds through a multi-task Transformer decoder, and jointly optimizing the position, speed and acceleration losses. The application strengthens feature correlation and interaction modeling, improves the accuracy and generalization of trajectory prediction in complex scenarios, and is suitable for highway driving scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to, but is not limited to, the field of autonomous driving trajectory prediction technology, and particularly relates to a vehicle trajectory prediction method and system based on multi-attention fusion and graph structure modeling. Background Technology

[0002] With the continuous growth of car ownership and the rapid iteration of autonomous driving technology, vehicle trajectory prediction has become one of the core research topics in intelligent transportation systems. Its core objective is to accurately predict the vehicle's trajectory (including key parameters such as position, speed, and acceleration) over a future period based on historical vehicle motion data and current environmental conditions. The performance of this technology directly affects traffic safety and efficiency. In autonomous driving scenarios, reliable trajectory prediction can help vehicles avoid collision risks in advance; in traffic management scenarios, it can optimize signal timing by predicting traffic flow evolution, thus alleviating road congestion. Currently, vehicle trajectory prediction technology has been widely applied in key aspects such as autonomous driving decision-making and control, roadside intelligent perception, and high-precision map updates, serving as a crucial cornerstone for promoting vehicle-road cooperation and intelligent transportation development.

[0003] To achieve accurate trajectory prediction, the industry has developed various technical solutions, which can be broadly categorized into two main schools: traditional methods and deep learning methods. Early traditional methods mainly included two types of solutions: those based on physical models and those based on statistical models. Methods based on physical models establish vehicle dynamics equations (such as Newton's laws of motion) and combine them with algorithms such as Kalman filtering and particle filtering for state estimation. These methods rely on explicit physical priors but lack robustness in complex traffic interaction scenarios. Methods based on statistical models (such as ARIMA and Hidden Markov Models) predict by mining statistical patterns in historical data. Although they can adapt to certain nonlinear scenarios, their generalization ability is limited by data distribution and they are difficult to deal with sudden traffic events.

[0004] With the development of deep learning technology, data-driven methods have gradually become the mainstream for trajectory prediction, among which models represented by Recurrent Neural Networks (RNN), Long Short-Term Memory Networks (LSTM), and Graph Neural Networks (GNN) have shown outstanding performance. LSTM and its variants, due to their ability to capture temporal dependencies, are widely used to extract the temporal features of vehicle historical motion and can effectively model the continuous motion trends of vehicles such as acceleration and deceleration. Graph models such as Graph Convolutional Networks (GCN) and Graph Attention Networks (GAT) model the spatial interaction relationships of vehicles by abstracting vehicles as nodes and the relationships between vehicles as edges, making them suitable for trajectory prediction in multi-vehicle cooperative scenarios. To take into account both spatiotemporal features, some studies have attempted to combine LSTM and GCN to form a hybrid architecture of "temporal encoding + spatial encoding," trying to capture features in both the temporal and spatial dimensions simultaneously.

[0005] Despite the progress made in existing technologies, there are still many technical shortcomings that need to be addressed in complex and dynamic real-world traffic environments (especially in multi-vehicle interaction scenarios on highways). These shortcomings can be summarized in the following four aspects:

[0006] (1) Coarse kinematic feature fusion: The motion state of a vehicle is determined by kinematic features such as position, speed, and acceleration. However, traditional methods often treat these features as homogeneous inputs and directly concatenate or simply weight them, without considering the dynamic differences in the importance of features in different scenarios. For example, in overtaking scenarios, acceleration features directly reflect the vehicle's overtaking intention and power performance, and are the core factor determining the trajectory; while in following scenarios, speed stability and the speed difference with the vehicle in front have a more critical impact on the trajectory. This "one-size-fits-all" fusion method makes it impossible for the model to adaptively adjust feature weights, reducing the prediction accuracy in different scenarios.

[0007] (2) Static Vehicle Interaction Modeling: The interaction relationship between vehicles is dynamic, but most existing methods rely on fixed rules to model this relationship, or use preset distance thresholds (such as only considering vehicles within 50 meters) to determine whether there is an interaction, or use static edge weights to describe the relationship between vehicles, which cannot adapt to the dynamic evolution of traffic scenarios. In scenarios such as sudden deceleration, rapid lane cutting by vehicles in adjacent lanes, and continuous lane changes by multiple vehicles, fixed rules are difficult to update the interaction intensity and priority between vehicles in real time, which can easily lead to misjudgment of the interaction relationship and thus affect the reliability of trajectory prediction.

[0008] (3) Fragmented spatiotemporal dependency modeling: The essence of vehicle trajectory is the result of the coupling effect of "temporal motion trend" and "spatial interaction influence" - the future motion of a vehicle is constrained by its own historical motion state (such as the inertia of uniform speed driving) and affected by the interaction behavior of surrounding vehicles (such as the deceleration of the vehicle in front causing the following vehicle to decelerate). However, existing technologies often treat the two separately: LSTM alone can only capture temporal features and cannot model the spatial interaction of multiple vehicles; GCN alone can only extract spatial relationships and is difficult to capture the temporal continuity of vehicle motion; even simple hybrid models are mostly feature-level splicing, without achieving deep synergy of spatiotemporal features, and cannot effectively model the coupling dependency relationship between the two.

[0009] (4) Insufficient prediction consistency: There is a clear physical relationship between position, velocity, and acceleration (position is the integral of velocity, and velocity is the integral of acceleration), but existing methods mostly predict these three as independent targets, without reinforcing this physical constraint in the model design. This often leads to kinematic dimension contradictions in the prediction results. For example, when the velocity prediction value is 0, the position continues to shift; or when the acceleration is negative, the velocity continues to increase. Such contradictions seriously reduce the credibility of trajectory prediction and cannot meet the actual needs of scenarios such as autonomous driving.

[0010] Based on the above analysis, the urgent technical problem to be solved by the existing technology is: how to construct a vehicle trajectory prediction method that can adaptively adjust kinematic feature weights, dynamically model vehicle interaction relationships, collaboratively capture spatiotemporal coupling dependencies, and ensure the physical consistency of multi-dimensional prediction results, so as to improve the accuracy and reliability of trajectory prediction in complex traffic scenarios. Summary of the Invention

[0011] To address the problems existing in the prior art, this invention provides a vehicle trajectory prediction method and system based on multi-attention fusion and graph structure modeling. It is particularly suitable for high-precision vehicle trajectory prediction tasks in complex and dynamic traffic scenarios such as highways, and provides core technical support for autonomous driving decision-making, traffic flow control and collision risk warning.

[0012] This invention is implemented as follows: a vehicle trajectory prediction method based on multi-attention fusion and graph structure modeling, comprising the following steps:

[0013] S1, Historical trajectory data acquisition and preprocessing:

[0014] Step 1.1: Select a public dataset containing real driving scenarios on highways, divide the data into segments according to "3 seconds of historical observation + 5 seconds of future prediction", and obtain 15 historical time frames and 25 future time frames by downsampling with a step size of 0.2s. Collect the vehicle's position, speed, acceleration and vehicle ID information.

[0015] Step 1.2: Based on physical constraints, outliers are removed, and Min-Max normalization is used to map each feature to the [0,1] interval. A set of historical trajectories consisting of 6-dimensional motion state vectors of the target vehicle and surrounding vehicles is defined.

[0016] S2, LSTM - Attention Temporal Encoder:

[0017] Step 2.1: Construct three parallel bidirectional LSTM sub-encoders to process position, velocity, and acceleration features respectively, and output the hidden state sequence and global temporal features of each feature.

[0018] Step 2.2: Project the three types of global temporal features to the same intermediate feature space through three independent linear layers;

[0019] Step 2.3: The aligned features are concatenated into a fusion vector. The normalized weights of various features are calculated through additive attention, and the weighted sum is used to obtain the temporal features of the target vehicle and surrounding vehicles.

[0020] S3, Interactive Edge Encoder:

[0021] Step 3.1: Calculate the Euclidean distance between the target vehicle and surrounding vehicles, and determine the set of interacting vehicles by combining the forward and backward interaction thresholds and the lateral lane width condition.

[0022] Step 3.2: Calculate the relative angle and map it to 8 directional sectors for one-hot encoding; calculate the speed difference and Euclidean distance as interactive features.

[0023] Step 3.3: Convert the direction, velocity difference, and distance features into the same dimension through independent linear layers, and sum them to obtain the dynamic interaction edge features;

[0024] S4, CBOW model-inspired contextual feature fusion:

[0025] Step 4.1: Project the interactive vehicles and temporal features to the intermediate feature space using linear projection and ReLU activation;

[0026] Step 4.2: Calculate feature similarity through dot product, and obtain normalized attention weights through Softmax.

[0027] Step 4.3: Weighted aggregation of the temporal features of the interactive vehicles to obtain contextual interaction features, which are then added to the temporal features of the target vehicle itself to achieve fusion;

[0028] S5, GAT encoder:

[0029] Step 5.1: Construct a directed graph with the target vehicle and the interacting vehicles as nodes and the interaction relationship as edges;

[0030] Step 5.2: Project the node fusion features and edge features to the same latent space using a shared weight matrix;

[0031] Step 5.3: Concatenate node and edge features, calculate interaction weights through multi-head graph attention, aggregate neighbor features and average the multi-head outputs to obtain the "temporal motion + spatial interaction" fused features;

[0032] S6, Multi-tasking Transformer Decoder:

[0033] Step 6.1: Perform layer normalization on the GAT output features and project them onto the position, velocity, and acceleration prediction feature space through three independent weight matrices;

[0034] Step 6.2 adopts a hierarchical decoding strategy of "coarse-grained trend prediction + fine-grained autoregressive correction", and uses a random masking strategy to enhance generalization during training.

[0035] Step 6.3: Define the MSE loss for position, velocity, and acceleration, obtain the total loss function by weighted summation, and perform joint optimization to ensure kinematic dimension consistency;

[0036] Step 6.4: Output the complete trajectory of the target vehicle's position, speed, and acceleration for the next 5 seconds;

[0037] S7, Model Training and Parameter Optimization: Train the model based on the preset hardware environment, software framework and hyperparameters, and optimize key parameters such as interaction distance threshold, feature dimension, and number of attention heads.

[0038] Furthermore, the public dataset mentioned in step 1.1 is the CQSkyEyeX dataset, with a data sampling frequency of 25Hz, a time series frame number corresponding to the historical observation duration of 15 frames, a time series frame number corresponding to the future prediction duration of 25 frames, and a time resolution of Δt=0.2s.

[0039] Furthermore, the specific conditions for outlier removal in step 1.2 are: remove |a x |>5m / s 2 Or |aᵧ|>3m / s 2 Acceleration anomalies, remove v x For speed anomalies >35m / s, location anomalies exceeding the road boundary are removed. The road boundary is determined based on a lane width of 3.75m.

[0040] Furthermore, the LSTM sub-encoder described in step 2.1 has 2 layers, a dropout probability of 0.2, an input dimension of [15,2] for the position encoder, an input dimension of [15,2] for both the velocity and acceleration encoders, and a hidden layer dimension of D=128.

[0041] Furthermore, the normalized weights mentioned in step 2.3 are calculated using the Softmax function, satisfying α p +αᵥ+α a =1, where α p αᵥ represents the position feature weight, αᵥ represents the velocity feature weight, and αᵥ represents the velocity feature weight. a As the acceleration feature weight, α in the overtaking scenario a The value is larger, and the value of αᵥ is larger in the following vehicle scenario.

[0042] Furthermore, in step 3.1, the forward interaction threshold D_front=100m, the backward interaction threshold D_rear=60m, and the lateral interaction determination condition is |yᵢ-y0|≤3.75m, where yᵢ is the y-axis coordinate of the surrounding vehicles and y0 is the y-axis coordinate of the target vehicle.

[0043] The angle ranges of the eight directional sectors mentioned in step 3.2 are as follows: front (F) [-π / 12, π / 12], front right (FR) (π / 12, 5π / 12], right (R) (5π / 12, 7π / 12], back right (RR) (7π / 12, 11π / 12], back (R) (11π / 12, π]∪[-π, -11π / 12], back left (RL) (-11π / 12, -7π / 12], left (L) (-7π / 12, -5π / 12], and front left (FL) (-5π / 12, -π / 12). Each directional sector corresponds to an 8-dimensional one-hot encoding.

[0044] Furthermore, the ReLU activation function described in step 4.1 satisfies ReLU(x)=max(0,x), and the attention weight βᵢ described in step 4.2 satisfies 0≤βᵢ≤1 and Σβᵢ=1, where i is the index of the interactive vehicle.

[0045] Furthermore, in step 5.3, the GAT has 4 attention heads K_head, a latent space dimension F=256, and uses the LeakyReLU activation function (negative slope=0.2) and the Sigmoid activation function in single-head attention calculation. The multi-head outputs are averaged and fused to obtain the final node features.

[0046] Furthermore, in step 6.2, the number of Transformer encoder layers for coarse-grained prediction is 2, the number of attention heads is 8, the FeedForward dimension is 512, and dropout=0.2; the random masking strategy is to randomly mask 30% of the historical correction value during training, and only calculate the loss for unmasked frames;

[0047] The total loss function mentioned in step 6.3 is:

[0048]

[0049] in For location MSE loss, For speed MSE loss, To accelerate MSE loss, , , This is the weight balancing parameter.

[0050] Another objective of this invention is to provide a vehicle trajectory prediction system based on multi-attention fusion and graph structure modeling, comprising:

[0051] The data acquisition and preprocessing module is used to select a public dataset containing real driving scenarios on highways, divide the data into segments according to "3 seconds of historical observation + 5 seconds of future prediction" and downsample it, collect vehicle position, speed, acceleration and vehicle ID information, remove outliers based on physical constraints, process features through Min-Max normalization and define a set of historical trajectories.

[0052] The LSTM-attention temporal coding module is used to construct three parallel bidirectional LSTM sub-encoders to extract temporal features of each motion feature. Cross-modal feature alignment is achieved through linear layers, and additive attention is used to calculate feature weights and fuse them to obtain the temporal features of the target vehicle and surrounding vehicles.

[0053] The interactive edge encoding module is used to calculate the Euclidean distance between the target vehicle and surrounding vehicles and determine the set of interactive vehicles. It encodes interactive features such as direction, speed difference, and distance, and obtains dynamic interactive edge features through linear layer transformation and fusion.

[0054] The CBOW context fusion module is used to linearly project and activate the temporal features of interactive vehicles, calculate weights through dot product attention, aggregate context features and fuse them with the features of the target vehicle itself.

[0055] The GAT encoding module is used to construct a directed graph of traffic interaction, projecting node and edge features onto the same latent space, aggregating neighbor features through multi-head graph attention, and outputting a fused feature of "temporal motion + spatial interaction".

[0056] The multi-task Transformer decoding module is used to perform layer normalization and task projection on the fused features. It adopts a "coarse-grained + fine-grained" layered decoding strategy and optimizes the multi-task loss function to output the complete trajectory of the target vehicle's position, velocity, and acceleration for the next 5 seconds.

[0057] The model training optimization module is used to train the model based on the preset hardware environment, software framework and hyperparameters, and optimize key parameters such as interaction distance threshold, feature dimension, number of attention heads, etc., to ensure the model's prediction accuracy and stability.

[0058] In combination with the above technical solutions and the technical problems solved, the significant advancements and unexpected technical effects of the technical solution to be protected by this invention are as follows:

[0059] This invention specifically relates to a short-term (future 5 seconds) vehicle trajectory prediction method in highway scenarios. By integrating the temporal dynamics of multi-dimensional vehicle motion characteristics (position, speed, acceleration) with the dynamic interaction relationships between vehicles, it achieves accurate prediction of the future position, speed, and acceleration of a target vehicle, providing key decision-making basis for path planning, collision risk assessment, and cooperative driving in autonomous driving systems.

[0060] (1) Achieve scene adaptive fusion of kinematic features to improve the feature representation accuracy under different traffic scenarios;

[0061] (2) Construct dynamic interactive edge coding to accurately depict the interactive effects of direction, distance, and speed differences between vehicles;

[0062] (3) Integrating LSTM and GAT to achieve spatiotemporal dependency collaborative modeling, while capturing temporal motion patterns and spatial interaction dynamics;

[0063] (4) Ensure the consistency of kinematic dimension prediction through multi-task learning and reduce long-term prediction error.

[0064] The vehicle trajectory prediction method protected by this invention represents a significant technological advancement and yields unexpected technical benefits compared to traditional methods that rely solely on a single historical position sequence or simple neighbor distance modeling. Firstly, this invention simultaneously incorporates information such as position, velocity, acceleration, and vehicle ID into the historical trajectory data. Through physical constraint outlier removal and normalization, the input data maintains kinematic consistency while reducing noise interference with the prediction results, providing a stable and reliable data foundation for subsequent models.

[0065] This invention employs three parallel bidirectional LSTM sub-encoders to process position, velocity, and acceleration features respectively, and adaptively allocates weights for different motion features through additive attention. This design does not simply concatenate multi-source features, but rather automatically highlights key motion information based on different driving scenarios. For example, in scenarios involving rapid acceleration, deceleration, or lane-changing precursors, velocity and acceleration features receive higher attention, thereby improving the model's ability to capture changes in vehicle motion trends and achieving prediction results superior to single-time-series encoding.

[0066] This invention transforms the distance, relative direction, and speed difference between the target vehicle and surrounding vehicles into dynamic interactive edge features through an interactive edge encoder, and further constructs a directed graph structure, enabling explicit modeling of the spatial interaction relationships between vehicles. This approach overcomes the shortcomings of traditional gridded neighborhood or fixed neighbor vehicle filtering methods in expressing interaction relationships, and can more accurately distinguish the different influences of the preceding vehicle, following vehicle, and vehicles in adjacent lanes on the future trajectory of the target vehicle.

[0067] This invention introduces a contextual feature fusion mechanism inspired by the CBOW model. By aggregating the temporal features of interacting vehicles through attention weights, it enables deep fusion of the target vehicle's own motion state with the surrounding traffic context. This mechanism can automatically identify neighboring vehicles that have a significant impact on the target vehicle's trajectory in complex traffic scenarios, avoid interference from irrelevant vehicle features, and improve the model's adaptability to scenarios such as dense traffic flow, car-following, and lane merging.

[0068] This invention utilizes a multi-head graph attention network that integrates edge features for spatial interaction encoding, and combines it with a multi-task Transformer decoder to simultaneously predict future position, velocity, and acceleration, achieving unified modeling of "temporal motion features—spatial interaction features—multi-motion prediction." In particular, the hierarchical decoding strategy that combines coarse-grained trend prediction with fine-grained autoregressive correction can correct local errors while ensuring the overall trajectory trend is reasonable, reducing error accumulation in long-term prediction.

[0069] This invention not only improves the accuracy, stability, and generalization ability of vehicle trajectory prediction for the next 5 seconds, but also maintains kinematic consistency between position, velocity, and acceleration through multi-task joint optimization, reducing the occurrence of abrupt changes, drifts, or deviations from vehicle motion patterns in the predicted trajectory. These effects cannot be achieved simply by superimposing existing single LSTM, ordinary attention mechanisms, or traditional graph neural networks; rather, they are the result of the synergistic effects of multi-attention fusion, dynamic interaction edge modeling, context aggregation, and multi-task hierarchical decoding, demonstrating significant substantive features and remarkable progress. Attached Figure Description

[0070] Figure 1 This is a flowchart of the vehicle trajectory prediction method based on multi-attention fusion and graph structure modeling provided in the embodiments of the present invention;

[0071] Figure 2 This is a multi-vehicle traffic scene diagram provided in an embodiment of the present invention; black vehicles represent target vehicles, and other vehicles represent vehicles around them;

[0072] Figure 3 This is a schematic diagram of an LSTM timing encoder provided in an embodiment of the present invention;

[0073] Figure 4 This is a schematic diagram of the interaction distance threshold provided in an embodiment of the present invention;

[0074] Figure 5 This is a schematic diagram of the CBOW model provided in an embodiment of the present invention;

[0075] Figure 6 This is an influence diagram of surrounding vehicle nodes on the target vehicle provided in an embodiment of the present invention;

[0076] Figure 7 This is a schematic diagram of a transformer-based trajectory decoder provided in an embodiment of the present invention. Detailed Implementation

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

[0078] like Figure 1 As shown, this embodiment of the invention provides a vehicle trajectory prediction method based on multi-attention fusion and graph structure modeling, including the following steps:

[0079] S1, Historical trajectory data acquisition and preprocessing;

[0080] Step 1.1, Data Sources and Collection Standards;

[0081] (1) Dataset selection: The CQSkyEyeX public dataset was used. This dataset contains real-world driving scenarios on highways, with a data sampling frequency of 25Hz (1 frame every 0.04 seconds), and includes the following vehicles:

[0082] Location: x / y coordinates of the center point of the vehicle's boundingbox (unit: m);

[0083] Velocity: longitudinal / lateral velocity along the x / y axis (unit: m / s);

[0084] Acceleration: Longitudinal / lateral acceleration along the x / y axis (unit: m / s²) 2 );

[0085] Vehicle ID: A unique identifier that supports matching the trajectories of multiple vehicles.

[0086] (2) Data segment division: The original trajectory is divided into fixed-length segments according to "3 seconds of historical observation + 5 seconds of future prediction", where:

[0087] Historical observation duration After downsampling with a step size of 0.2s (keeping 1 frame out of every 5 frames), the following is obtained: One time frame;

[0088] Future prediction duration After downsampling, the following results were obtained. Each time frame (with the same time resolution as historical frames) ).

[0089] like Figure 2 As shown, in a multi-vehicle traffic scenario, the black vehicle represents the target vehicle, and the other vehicles represent the vehicles around it.

[0090] Step 1.2, Data cleaning and standardization;

[0091] (1) Outlier removal: Filtering outliers based on physical constraints

[0092] Acceleration: Eliminate or The point (maximum longitudinal acceleration of vehicles on highways is approximately ±5m / s²) 2 Lateral movement approximately ±3m / s2 );

[0093] Speed: Elimination (126km / h, exceeding the highway speed limit) point;

[0094] Location: Points exceeding the road boundary were removed (based on the lane width of 3.75m and y-axis coordinate range provided by the dataset). ).

[0095] (2) Feature standardization: Min-Max normalization is used to map each feature to the [0,1] interval, as shown in the formula:

[0096]

[0097] in , These are the minimum and maximum values ​​of the corresponding features in the training set.

[0098] (3) Input format definition: The historical trajectory set is represented as

[0099]

[0100] In the formula, For the target vehicle, For vehicles surrounding the target vehicle within its perception range; For the first The car is The 6-dimensional motion state vector at time t.

[0101] S2, LSTM - Attention Temporal Encoder;

[0102] Step 2.1, Design of Single-Mode LSTM Sub-Encoder

[0103] (1) Structure configuration: Construct three parallel LSTM sub-encoders (one each for position, velocity, and acceleration), with uniform parameters for each sub-encoder;

[0104] Hidden layer dimensions ;

[0105] Number of LSTM layers = 2 (bidirectional LSTM, forward pass to capture future trends, backward pass to trace historical dependencies);

[0106] Dropout probability = 0.2 (to prevent overfitting);

[0107] Input dimension: Position encoder input (15 frames × x / y axis position), speed / accelerometer inputs are all .

[0108] (2) Temporal feature extraction: Each sub-encoder outputs two types of features;

[0109] Hidden state sequence: (Location), (speed), (Acceleration);

[0110] Global temporal features: Take the hidden state of the last frame of the LSTM, i.e. (Location), (speed), (Acceleration), used for subsequent fusion.

[0111] Step 2.2, cross-modal feature alignment;

[0112] Linear projection layer design: Three independent linear layers project three types of global temporal features onto the same intermediate feature space (dimension). To ensure feature comparability, the formula is:

[0113]

[0114] In the formula, (Weight matrix, randomly initialized and optimized through training); (Bias vector, initialized to 0); These are the aligned feature vectors.

[0115] Step 2.3, additive attention fusion;

[0116] (1) Attention query calculation: The aligned 3 types of features are concatenated into a fusion vector, and the importance score of each type of feature is calculated by additive attention;

[0117] Feature splicing: ,in (Attention weight matrix) (Attention bias);

[0118] Query vector generation:

[0119] (2) Attention weight normalization: The scores are converted into normalized weights using the Softmax function to ensure that the sum of the weights is 1;

[0120]

[0121] In the formula, (Position weight) (Speed ​​weight) (Acceleration weight), and ;

[0122] Scene adaptive effect: In overtaking scenarios, Large values; in car-following scenarios, Large value;

[0123] (3) Final temporal feature fusion: weighted summation to obtain the temporal feature vector of the target vehicle.

[0124]

[0125] Similarly, regarding the surrounding vehicles Perform the same operation to obtain their respective time series characteristics. .

[0126] like Figure 3 As shown, by using LSTM feature extraction, the position, speed and acceleration data of each vehicle are aligned into the same feature space, and attention scores are calculated and weighted to be fused into the final trajectory features.

[0127] S3, interactive edge encoder;

[0128] Step 3.1, Identify the interactive vehicle;

[0129] (1) Distance calculation: Calculate the distance to the target vehicle and surrounding vehicles The Euclidean distance (reflecting physical proximity):

[0130]

[0131] In the formula, The current location of the target vehicle. For surrounding vehicles Current location.

[0132] (2) Interaction threshold setting:

[0133] Forward interaction threshold :when and ( (located in front of the target vehicle) is identified as a forward-interacting vehicle.

[0134] Backward interaction threshold :when and ( (located behind the target vehicle) is identified as a vehicle interacting in the rear direction.

[0135] Lateral interaction rules: Based on a lane width of 3.75m, when (Adjacent lanes) are all considered lateral interaction vehicles regardless of distance (such as when a vehicle cuts into an adjacent lane).

[0136] (3) Output of interactive vehicle set: Obtain the interactive vehicle set. .

[0137] Step 3.2, interactive feature encoding;

[0138] (1) Directional sector division and coding

[0139] Relative angle calculation: Calculation Compared to Azimuth angle (with the x-axis as the direction of travel, counterclockwise is positive):

[0140]

[0141] In the formula, .

[0142] 8-way sector definition: Mapped to 8 directional categories (in line with human driving perception habits)

[0143]

[0144] One-hot encoding: Converting orientation categories into 8-dimensional one-hot vectors (For example, "F" is encoded as [1,0,0,0,0,0,0,0]).

[0145] (2) Speed ​​difference coding: Calculation and The difference in velocity along the x and y axes (reflecting the trend of relative motion)

[0146]

[0147] (3) Distance encoding: directly use the Euclidean distance calculated in step 3.1.

[0148] Step 3.3, edge feature vector generation;

[0149] (1) The direction, velocity difference, and distance features are transformed into the same dimension through three independent linear layers. (Optimal value based on parameter sensitivity analysis)

[0150] Distance Feature Transformation: ,in ,

[0151] Velocity difference characteristic transformation: ,in ,

[0152] Directional feature transformation: ,in ,

[0153] (2) Edge feature fusion: Summing the features after the three transformations, we get and Interaction edge features:

[0154]

[0155] In the formula, It is a dynamic edge feature (the interaction weights in different scenarios can be learned through training, such as the distance feature of the forward vehicle has a higher weight).

[0156] like Figure 4 As shown in the diagram of the interaction distance threshold, vehicles within a certain distance around the target vehicle have varying degrees of influence on its future trajectory.

[0157] S4, contextual feature fusion inspired by the CBOW model;

[0158] Step 4.1, Context node feature projection;

[0159] (1) Linear projection and activation: Interactive vehicles Temporal characteristics (Module 2 output) Projected onto the intermediate feature space, and nonlinearity introduced through ReLU activation:

[0160]

[0161] In the formula, (Projection weight matrix) (Projection bias); ReLU activation function is (Filtering negative eigenvalues ​​enhances representational ability).

[0162] (2) Projection of target vehicle features: Temporal features of the target vehicle Perform the same operation to obtain .

[0163] Step 4.2, calculate the dot product attention weights;

[0164] (1) Attention score calculation: calculated by dot product and Feature similarity (the higher the similarity, the better) right The greater the impact):

[0165]

[0166] (2) Weight normalization: The scores are converted into normalized weights using Softmax.

[0167]

[0168] In the formula, ,and ;

[0169] Step 4.3, Contextual Feature Aggregation and Fusion;

[0170] (1) Contextual feature aggregation: The temporal features of the interacting vehicles are weighted and summed to obtain the contextual interaction features of the target vehicle:

[0171]

[0172] (2) Node-context fusion: Adding the context features to the target vehicle's own temporal features:

[0173]

[0174] Similarly, for interactive vehicles Perform the same operation to obtain its fusion features. (For subsequent GAT modeling).

[0175] like Figure 5 As shown, CBOW predicts the target word based on the context words. It uses the average context vector as input to train a neural network to maximize the target word probability and generate efficient word embeddings.

[0176] like Figure 6 As shown, vehicles around the target vehicle will have varying degrees of impact on it.

[0177] S5, GAT encoder;

[0178] Step 5.1, Construction of the traffic interaction graph;

[0179] (1) Definition of graph structure: Constructing a directed graph ,in:

[0180] Node set

[0181] Edge set

[0182] Step 5.2, linear transformation of node and edge features;

[0183] (1) Node feature transformation: Project the fused features onto the latent space (dimension). (The optimal value comes from parameter sensitivity analysis)

[0184]

[0185] In the formula, (Graph transformation weight matrix, shared by all nodes).

[0186] (2) Edge feature transformation: Project the interactive edge features onto the same latent space:

[0187]

[0188] In the formula, (The weight matrix is ​​transformed and shared by all edges).

[0189] Step 5.3, Multi-head image attention aggregation;

[0190] (1) Single-head attention calculation

[0191] Feature stitching: for target vehicles Interactive vehicles , splicing node and edge features:

[0192]

[0193] In the formula The transformed features of the target vehicle. for Transformed features (Features after edge transformation)

[0194] Attention score generation: Scores are calculated by sharing attention vectors (reflecting...) right (Spatiotemporal influence weights)

[0195]

[0196] In the formula, (Attention vector, training and learning); LeakyReLU negative slope = 0.2 (preserves negative feature information);

[0197] Weight normalization:

[0198]

[0199] in .

[0200] Neighbor feature aggregation: Weighted summation of interactive vehicle features to obtain single-head attention output:

[0201]

[0202] In the formula, Sigmoid activation function This compresses the features to [0,1] to enhance stability.

[0203] (2) Multi-head attention fusion

[0204] Number of attention heads (Balancing representation diversity and computational efficiency), four single-head attention calculations are performed in parallel to obtain... ;

[0205] Average fusion multi-head output:

[0206] Output meaning: The target vehicle's "temporal motion + spatial interaction" fusion characteristics include historical motion patterns and the dynamic influence of surrounding vehicles.

[0207] S6, multi-tasking Transformer decoder;

[0208] Step 6.1, Projection of task-specific features;

[0209] (1) Layer normalization: Perform layer normalization on the output of GAT (to stabilize training and avoid gradient explosion):

[0210]

[0211] In the formula, for The mean, For variance, (To prevent the denominator from being 0).

[0212] (2) Task projection: The normalized features are projected onto the predicted feature space of position, velocity, and acceleration using three independent weight matrices:

[0213] Location task projection: ,in ;

[0214] Speed ​​Mission Projection: ,in ;

[0215] Acceleration mission projection: ,in ;

[0216] Step 6.2, Hierarchical autoregressive decoding (coarse-grained trend + fine-grained correction);

[0217] Taking position prediction as an example (the prediction process for velocity and acceleration is the same, only the projection matrix is ​​different):

[0218] Stage 1: Coarse-grained trend prediction (overall direction control)

[0219] (1) Transformer encoder configuration: number of layers = 2, number of attention heads = 8, feedForward dimension = 512, dropout = 0.2;

[0220] (2) Input: ;

[0221] (3) Output: coarse-grained position trajectory (x / y axis coordinates) reflect the overall movement trend;

[0222] (4) Function: To avoid direction deviation caused by the accumulation of local errors in fine-grained prediction.

[0223] Stage 2: Fine-grained autoregressive correction

[0224] (1) Initial input: (Integrating predicted trends with original characteristics);

[0225] (2) Autoregressive process

[0226] Frame 1: Input (0 is the initial placeholder), output fine-grained correction values. ;

[0227] Frame t (t≥2): Input Output ;

[0228] (3) Random masking strategy (enhancing generalization):

[0229] During training, the random mask is adjusted by 30% of the historical values. (Replace with 0), forcing the model to utilize global features ( Complete the missing information;

[0230] Loss calculation: Loss is calculated only for unmasked frames to avoid masking noise affecting training.

[0231] (4) Final location prediction

[0232]

[0233] In the formula, This is a fine-grained correction sequence.

[0234] like Figure 7 As shown, the trajectory decoder architecture is illustrated, where the number of attention heads and decoder layers can be adjusted according to actual requirements.

[0235] Step 6.3, Multi-task loss function;

[0236] (1) Definition of task loss

[0237] Position loss ( ): MSE (mean squared error) between predicted and true locations:

[0238]

[0239] velocity loss ( MSE of predicted velocity versus actual velocity:

[0240]

[0241] Acceleration loss ( MSE of predicted acceleration versus actual acceleration:

[0242]

[0243] (2) Weighted total loss: weights are set based on the importance of the kinematic dimension.

[0244]

[0245] In the formula, , , For multi-tasking loss, This is the weight balancing parameter.

[0246] Consistency effect: Through joint optimization, physical constraints such as "no position shift when velocity is 0" and "velocity decreases when acceleration is negative" are ensured.

[0247] Step 6.4, output the prediction results;

[0248] Output the complete trajectory of the target vehicle over the next 5 seconds (25 frames), including:

[0249] (1) Location trajectory: (Unit: m);

[0250] (2) Velocity trajectory: (Unit: m / s);

[0251] (3) Acceleration trajectory: (Unit: m / s) 2 ).

[0252] S7, Model Training and Parameter Optimization;

[0253] Step 7.1, Training Environment and Hyperparameters;

[0254] (1) Hardware environment: Ubuntu 24.04 operating system, GeForce RTX 1070 GPU (8GB video memory);

[0255] (2) Software framework: PyTorch 2.3, CUDA 12.1;

[0256] (3) Optimizer: Adam optimizer, learning rate = 0.001, weight decay = 1e-4 (to prevent overfitting).

[0257] (4) Training rounds: 100 rounds, early stopping strategy (if the validation set ADE does not decrease for 5 consecutive rounds, training is stopped);

[0258] (5) Batch size: 32 (to balance training speed and memory usage).

[0259] Step 7.2, Key Parameter Optimization;

[0260] (1) Interaction distance threshold: optimal value (when At that time, the rate of missed detections for vehicles interacting with each other in the forward direction increased by 15%; At that time, the noise introduced by redundant vehicles caused an 8% increase in ADE;

[0261] (2) Feature dimension: Node feature dimension Edge feature dimension GATlatent dimension (when At that time, the model overfitted, and the FDE on the test set increased by 12%; When feature representation is insufficient, ADE increases by 18%;

[0262] (3) Number of attention heads: GAT attention head number = 4 (when the number of heads < 4, the interaction features are not fully covered; when the number of heads > 4, the computational load increases but the accuracy is not improved).

[0263] Evidence related to the technical effects obtained by the embodiments of the present invention.

[0264] 1. Experimental Dataset and Baseline Model

[0265] Dataset: CQSkyEyeX Highway Dataset, split as follows: 70% training set, 10% validation set, and 20% test set;

[0266] Baseline Model: Five mainstream trajectory prediction methods to ensure fair comparison (uniform input / output format: 3-second history → 5-second future)

[0267]

[0268] 2. Core performance indicators

[0269]

[0270] Performance improvements: Compared to the optimal baseline (GCN), ADE was reduced by 22.6%, FDE by 21.5%, and 5-second RMSE was reduced by 34.4%.

[0271] 3. Ablation test

[0272]

[0273] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.

[0274] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A vehicle trajectory prediction method based on multi-attention fusion and graph structure modeling, comprising the following steps: S1, Historical trajectory data acquisition and preprocessing: Step 1.1: Select a public dataset containing real driving scenarios on highways, divide the data into segments according to "3 seconds of historical observation + 5 seconds of future prediction", and obtain 15 historical time frames and 25 future time frames by downsampling with a step size of 0.2s. Collect the vehicle's position, speed, acceleration and vehicle ID information. Step 1.2: Based on physical constraints, outliers are removed, and Min-Max normalization is used to map each feature to the [0,1] interval. A set of historical trajectories consisting of 6-dimensional motion state vectors of the target vehicle and surrounding vehicles is defined. S2, LSTM - Attention Temporal Encoder: Step 2.1: Construct three parallel bidirectional LSTM sub-encoders to process position, velocity, and acceleration features respectively, and output the hidden state sequence and global temporal features of each feature. Step 2.2: Project the three types of global temporal features to the same intermediate feature space through three independent linear layers; Step 2.3: The aligned features are concatenated into a fusion vector. The normalized weights of various features are calculated through additive attention, and the weighted sum is used to obtain the temporal features of the target vehicle and surrounding vehicles. S3, Interactive Edge Encoder: Step 3.1: Calculate the Euclidean distance between the target vehicle and surrounding vehicles, and determine the set of interacting vehicles by combining the forward and backward interaction thresholds and the lateral lane width condition. Step 3.2: Calculate the relative angle and map it to 8 directional sectors for one-hot encoding; calculate the speed difference and Euclidean distance as interactive features. Step 3.3: Convert the direction, velocity difference, and distance features into the same dimension through independent linear layers, and sum them to obtain the dynamic interaction edge features; S4, CBOW model-inspired contextual feature fusion: Step 4.1: Project the interactive vehicles and temporal features to the intermediate feature space using linear projection and ReLU activation; Step 4.2: Calculate feature similarity through dot product, and obtain normalized attention weights through Softmax. Step 4.3: Weighted aggregation of the temporal features of the interactive vehicles to obtain contextual interaction features, which are then added to the temporal features of the target vehicle itself to achieve fusion; S5, GAT encoder: Step 5.1: Construct a directed graph with the target vehicle and the interacting vehicles as nodes and the interaction relationship as edges; Step 5.2: Project the node fusion features and edge features to the same latent space using a shared weight matrix; Step 5.3: Concatenate node and edge features, calculate interaction weights through multi-head graph attention, aggregate neighbor features and average the multi-head outputs to obtain the "temporal motion + spatial interaction" fused features; S6, Multi-tasking Transformer Decoder: Step 6.1: Perform layer normalization on the GAT output features and project them onto the position, velocity, and acceleration prediction feature space through three independent weight matrices; Step 6.2 adopts a hierarchical decoding strategy of "coarse-grained trend prediction + fine-grained autoregressive correction", and uses a random masking strategy to enhance generalization during training; Step 6.3: Define the MSE loss for position, velocity, and acceleration, obtain the total loss function by weighted summation, and perform joint optimization to ensure kinematic dimension consistency; Step 6.4: Output the complete trajectory of the target vehicle's position, speed, and acceleration for the next 5 seconds; S7, Model Training and Parameter Optimization: Train the model based on the preset hardware environment, software framework and hyperparameters, and optimize key parameters such as interaction distance threshold, feature dimension and attention head number.

2. The method as described in claim 1, characterized in that, The public dataset mentioned in step 1.1 is the CQSkyEyeX dataset, with a data sampling frequency of 25Hz, 15 time-series frames corresponding to the historical observation duration, 25 time-series frames corresponding to the future prediction duration, and a time resolution of Δt=0.2s. The specific conditions for outlier removal in step 1.2 are: remove |a x |>5m / s 2 Or |aᵧ|>3m / s 2 Acceleration anomalies, remove v x For speed anomalies >35m / s, location anomalies exceeding the road boundary are removed. The road boundary is determined based on a lane width of 3.75m.

3. The method as described in claim 1, characterized in that, The LSTM sub-encoder described in step 2.1 has 2 layers, a dropout probability of 0.2, an input dimension of [15,2] for the position encoder, an input dimension of [15,2] for both the velocity and accelerometer encoders, and a hidden layer dimension of D=128.

4. The method as described in claim 1, characterized in that, The normalized weights mentioned in step 2.3 are calculated using the Softmax function, satisfying α p +αᵥ+α a =1, where α p αᵥ represents the position feature weight, αᵥ represents the velocity feature weight, and αᵥ represents the velocity feature weight. a As the acceleration feature weight, α in the overtaking scenario a The value is larger, and the value of αᵥ is larger in the following vehicle scenario.

5. The method as described in claim 1, characterized in that, In step 3.1, the forward interaction threshold D_front=100m, the backward interaction threshold D_rear=60m, and the lateral interaction determination condition is |yᵢ-y0|≤3.75m, where yᵢ is the y-axis coordinate of the surrounding vehicles and y0 is the y-axis coordinate of the target vehicle. The angle ranges of the eight directional sectors mentioned in step 3.2 are as follows: front (F) [-π / 12, π / 12], front right (FR) (π / 12, 5π / 12], right (R) (5π / 12, 7π / 12], back right (RR) (7π / 12, 11π / 12], back (R) (11π / 12, π]∪[-π, -11π / 12], back left (RL) (-11π / 12, -7π / 12], left (L) (-7π / 12, -5π / 12], and front left (FL) (-5π / 12, -π / 12). Each directional sector corresponds to an 8-dimensional one-hot encoding.

6. The method as described in claim 1, characterized in that, The ReLU activation function described in step 4.1 satisfies ReLU(x)=max(0,x), and the attention weight βᵢ described in step 4.2 satisfies 0≤βᵢ≤1 and Σβᵢ=1, where i is the index of the interactive vehicle.

7. The method as described in claim 1, characterized in that, In step 5.3, the GAT has 4 attention heads (K_head=4) and a latent space dimension (F=256). The LeakyReLU activation function and the Sigmoid activation function are used in the single-head attention calculation. The multi-head outputs are averaged and fused to obtain the final node features.

8. The method as described in claim 1, characterized in that, In step 6.2, the number of Transformer encoder layers for coarse-grained prediction is 2, the number of attention heads is 8, the FeedForward dimension is 512, and dropout=0.2; the random masking strategy is to randomly mask 30% of the historical correction value during training, and only calculate the loss for unmasked frames; The total loss function mentioned in step 6.3 is: ; in For location MSE loss, For speed MSE loss, To accelerate MSE loss, , , This is the weight balancing parameter.

9. A vehicle trajectory prediction system, characterized in that, It includes a data acquisition and preprocessing module, a temporal feature encoding module, an interaction edge feature encoding module, a context fusion module, a graph attention encoding module, a trajectory prediction and decoding module, and a training optimization module; The data acquisition and preprocessing module is used to construct fifteen historical frames and twenty-five future trajectory segments and normalize the features. The temporal feature encoding module consists of a three-way bidirectional long short-term memory network and is used to extract temporal representations of position, velocity, and acceleration. The interactive edge encoding module is used to calculate the distance, direction and speed difference and generate interactive features; The context fusion module aggregates interactive vehicle information based on contextual attention; The graph attention module constructs a directed graph based on traffic relationships and aggregates multiple points to obtain spatiotemporal coupling features; The decoding module is used to output the trajectory sequence for the next five seconds; The optimization module is used to adjust the interaction threshold, the number of attention heads, and the feature dimensions, and to train the model.

10. The system according to claim 9, characterized in that, The trajectory decoding module generates continuous outputs of position, velocity, and acceleration for the next five seconds by combining interpolation trend prediction with temporal autoregressive correction and trains using joint mean square error loss.