Transform-based vehicle track prediction method

By employing a Transformer-based vehicle trajectory prediction method and utilizing self-attention mechanism and feature fusion technology, the prediction accuracy and generalization issues in complex traffic scenarios are addressed, achieving more accurate vehicle trajectory prediction and supporting autonomous driving and traffic management.

CN121366492APending Publication Date: 2026-01-20TONGHUI INTELLIGENT MACHINERY (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511546016.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Existing vehicle trajectory prediction technologies suffer from insufficient prediction accuracy, limited spatiotemporal feature capture capabilities, and weak generalization performance in complex traffic scenarios.

Method used

A Transformer-based vehicle trajectory prediction method is adopted, which models vehicle behavior through a self-attention mechanism, combines historical trajectory data and environmental information to generate a probability intent matrix, and establishes an information path with the trajectory generation unit through a feature fusion layer to inject driving decision intent to improve prediction accuracy.

Benefits of technology

It achieves more accurate and robust prediction of future vehicle trajectories, supports autonomous driving decision-making and traffic flow optimization, and improves the model's generalization ability in complex traffic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121366492A_ABST
    Figure CN121366492A_ABST
Patent Text Reader

Abstract

The invention specifically discloses a Transform-based vehicle trajectory prediction method, and the method comprises the following steps: S1, determining vehicle trajectory data needing to be predicted, and carrying out the preprocessing of the data; step S2, carrying out detailed setting on parameters of the Transform network; s3, designing a vehicle behavior recognition module, performing time sequence modeling on behaviors of the vehicle through a self-attention mechanism, analyzing lane changing and following behaviors of the vehicle, and outputting a probability intention matrix; according to the method, more accurate and robust future track prediction of the vehicle with good generalization ability is realized by deeply mining the space-time correlation characteristics of the historical track of the vehicle and the surrounding environment information, and key technical support is provided for automatic driving decision making, traffic flow optimization and intelligent traffic management. In practical application, the trajectory prediction model based on Transform can identify the motion mode of the vehicle by analyzing historical trajectory data, and predict the future driving trajectory of the vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent networked vehicles, and specifically relates to a vehicle trajectory prediction method based on a Transformer. BACKGROUND

[0002] In modern urban traffic management, with the rapid development of autonomous driving technology, vehicle-to-everything (V2X), and intelligent traffic management systems, accurately and efficiently predicting future vehicle trajectories has become a key technical challenge in application scenarios such as improving road safety, optimizing traffic flow, and enhancing autonomous driving decision-making capabilities. This application focuses on using the powerful sequence modeling capabilities of the Transformer architecture, combined with spatiotemporal feature extraction and fusion technology, to propose an innovative vehicle trajectory prediction method that addresses the issues of insufficient accuracy and weak generalization ability faced by traditional methods in handling complex traffic scenarios.

[0003] In vehicle trajectory prediction, the advantages of the Transformer model mainly lie in the following aspects: 1. Self-attention mechanism: Traditional recurrent neural networks (RNNs) are prone to gradient vanishing or exploding problems when dealing with long sequences, making it difficult for the model to learn long-distance dependencies. The Transformer, through its self-attention mechanism, can directly weight all elements in the input sequence, allowing the Transformer to better understand the mutual influence between vehicles in complex traffic scenarios.

[0004] 2. Parallel processing capability: Unlike RNNs, the Transformer model can process all positions of the input sequence in parallel during training, greatly improving the training efficiency of the model. In practical applications, especially in large-scale traffic data processing scenarios, the Transformer can significantly reduce training time and improve the real-time prediction capabilities of the model.

[0005] 3. Flexibility and scalability: The structure of the Transformer model is flexible and can adjust the number of layers and hidden units according to demand, adapting to trajectory prediction tasks of different scales and complexities. In addition, the Transformer can be combined with other models (such as convolutional neural networks) to further improve prediction results.

[0006] 4. Multimodal information fusion: In traffic scenarios, in addition to historical trajectory data of vehicles, other information such as traffic signals, road conditions, weather conditions, etc. may also be involved. The Transformer model can effectively process multi-modal data, integrating information from different sources through the self-attention mechanism, thereby improving the accuracy of trajectory prediction.

[0007] 5. Excellent generalization ability: Transformer models trained on large-scale data can learn more general feature representations, which enable the model to better adapt to different traffic scenarios and have better generalization ability. This feature is particularly important for highway congestion scenarios, as different congestion situations can lead to significant changes in vehicle behavior.

[0008] Existing vehicle trajectory prediction techniques have problems such as insufficient prediction accuracy, limited spatiotemporal feature capture ability, and weak generalization performance in complex traffic scenarios. To address these issues, a vehicle trajectory prediction method based on Transformer is proposed. SUMMARY

[0009] The purpose of the present application is to provide a vehicle trajectory prediction method based on Transformer to solve the problems of insufficient prediction accuracy, limited spatiotemporal feature capture ability, and weak generalization performance of existing vehicle trajectory prediction techniques in complex traffic scenarios as mentioned in the background.

[0010] To achieve the above purpose, the present application provides the following technical solutions: A vehicle trajectory prediction method based on Transformer, comprising the following steps: Step S1: Determine the vehicle trajectory data that needs to be predicted and preprocess the data; Step S2: Detailed setting of the parameters of the Transformer network; Step S3: Design a vehicle behavior recognition module to model the behavior of the vehicle in time series through a self-attention mechanism, analyze the lane changing and following behavior of the vehicle, and output a probability intention matrix; Step S4: The probability intention matrix establishes an information channel with the trajectory generation unit through a feature fusion layer; Step S5: Inject the driving decision intention into the trajectory prediction process through an attention weight transfer mechanism, so that the prediction model can output a higher confidence spatiotemporal position distribution prediction result under a specific behavior pattern.

[0011] In an optional solution, the step S1 comprises the following steps: Step S101: Determine the data; Step S102: Extract three typical trajectory patterns from the original data set: left lane change, right lane change, and straight line maintenance, and construct a classification coding system; Step S103: In the data preprocessing link, define the spatial intersection point of the vehicle trajectory and the lane boundary line as the lane change feature point.

[0012] In an optional solution, the step S101 adopts a public data set: Aerial Dataset for China Congested Highway and Expressway (AD4CHE).

[0013] In an optional solution, the classification coding system adopts a three-dimensional vector identification method, in which [1, 0, 0] represents a left lane-changing behavior, [0, 1, 0] corresponds to a right lane-changing mode, and [0, 0, 1] represents a straight keeping state.

[0014] In an optional solution, the step S2 requires parameter setting of the Transformer network.

[0015] In an optional solution, the step S3 comprises the following steps: Step S301: The input of the vehicle behavior prediction module includes the historical trajectory data Et of the vehicle and the interaction data St, that is, I=[E t ,S t ] wherein E t represents the motion state information such as position, speed and acceleration of the vehicle at time t, and S t represents the interaction information such as relative position, speed and distance between the vehicle and other vehicles; Step S302: By combining the two, the model can fully mine the key features of the vehicle in the lane-changing and following behaviors, and the output of this module is the probability distribution of three types of driving intentions, i.e. left lane-changing, right lane-changing and straight keeping, forming a probability intention matrix: P=[w1,w2,w3] wherein w1, w2 and w3 respectively represent the probability values of the three types of vehicle behaviors, the behavior corresponding to the maximum value in the probability intention matrix is taken as the final prediction result, and the probability thereof is set to 1, and the probabilities of the remaining behaviors are set to 0; Step S303: For the vehicle behavior prediction module, the recall rate R is selected as an evaluation index to measure the recognition ability of the model to positive samples, and the calculation formula of the recall rate is as follows:

[0016] wherein, represents the number of samples in which both the actual behavior and the predicted behavior occur; represents the number of samples in which the actual behavior occurs but the predicted behavior does not occur, and the higher the recall rate, the stronger the recognition ability of the model to positive samples.

[0017] In an alternative, [1, 0, 0] represents a left lane change, [0, 1, 0] represents a right lane change, and [0, 0, 1] represents the vehicle continuing to keep straight.

[0018] In an alternative, step S4 comprises the following steps: Step S401: The vehicle trajectory prediction module combines I and P through a concatenation function to form the input of the encoder, as shown in the following formula:

[0019] where I is the historical motion information, including the position, speed, and acceleration of the vehicle, and P is the probability vector of the vehicle behavior, which is output by the vehicle behavior prediction module and represents the future driving intention of the vehicle (left lane change, right lane change, or keep straight).

[0020] Step S402: The core of the encoder is to capture the context dependence of the output sequence through self-attention mechanism, to fuse the source information through encoder-decoder attention, to enhance the non-linear expression through feedforward neural network, and to ensure the time sequence of the generation process through causal mask. The specific calculation formula is as follows:

[0021] where Q is the query matrix, K is the key matrix, and V is the value matrix, is the weight matrix that is updated during the training process, is the dimension of the key vector.

[0022] Step S403: The multi-head attention mechanism generates a global self-attention feature mapping A by concatenating and weighting the outputs of multiple attention heads:

[0023] where, is the weight matrix used to fuse the multi-head output. Through the multi-head attention mechanism, the model can capture the global dependence in the input sequence and generate a high-dimensional semantic representation combined with the driving intention information; Step S403: The input of the decoder of the model includes two parts: the attention matrix A output by the encoder, which provides context information, and the feature representation B of the vehicle motion trajectory data Et after the mask multi-head attention mechanism, the decoder combines A and B through the multi-head attention mechanism to generate a trajectory position weighting matrix Z:

[0024] where, is a weight matrix in the decoder, through the processing of the decoder, the model can combine the driving intention information and the historical trajectory data to generate the position distribution of the future trajectory; Step S404: For the vehicle trajectory prediction module, the root mean squared error RMSE (denoted as ) is used as an evaluation index to evaluate the deviation between the predicted and actual trajectories, and the calculation formula is:

[0025] wherein, is the prediction time domain; and y are the actual position and the predicted position, respectively, The smaller the value is, the closer the predicted vehicle trajectory is to the actual vehicle trajectory.

[0026] Compared with the prior art, the beneficial effects of the present application are: In the present application, by deeply mining the spatio-temporal correlation characteristics of vehicle historical trajectory and surrounding environment information, more accurate, robust and good generalization ability of vehicle future trajectory prediction is realized, which provides key technical support for automatic driving decision, traffic flow optimization and intelligent traffic management. In practical application, the trajectory prediction model based on Transformer can analyze historical trajectory data, identify the motion pattern of the vehicle, and predict its future driving trajectory. This process not only needs to consider the motion state of the vehicle itself, but also needs to consider the changes of the surrounding environment and the behaviors of other vehicles. Through efficient model training and prediction, the traffic management department can timely obtain the trend of traffic flow, formulate corresponding management measures, optimize traffic flow, and reduce congestion phenomenon. BRIEF DESCRIPTION OF DRAWINGS

[0027] Figure 1 is the flow chart of the vehicle trajectory prediction method based on Transformer of the present application.

[0028] Figure 2 is the prediction model diagram of the present application.

[0029] Figure 3 is the relationship diagram of data length D and prediction time domain Tpre.

[0030] Figure 4 is the comparison diagram of the prediction result of the present application and the prediction result before improvement. DETAILED DESCRIPTION

[0031] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work are within the scope of protection of the present application.

[0032] Please refer to Figures 1-4 In the embodiment, a vehicle trajectory prediction method based on a Transformer includes the following steps: Step S1: Determine the vehicle trajectory data to be predicted, and pre-process the data; Step S2: The parameters of the Transformer network are set in detail; Step S3: Design a vehicle behavior recognition module, model the behavior of the vehicle through a self-attention mechanism, analyze the lane changing and following behavior of the vehicle, and output a probability intention matrix; Step S4: The probability intention matrix establishes an information channel with the trajectory generation unit through a feature fusion layer; Step S5: Inject the driving decision intention into the trajectory prediction process through an attention weight transmission mechanism, so that the prediction model can output a higher confidence spatiotemporal position distribution prediction result under a specific behavior mode.

[0033] The step S1 includes the following steps: Step S101: Determine the data; adopt a public data set: Aerial Dataset for China Congested Highway and Expressway (AD4CHE); Step S102: Extract three typical trajectory modes: left lane change, right lane change and straight line keeping from the original data set, and construct a classification coding system; adopt a three-dimensional vector identification method, wherein [1, 0, 0] represents the left lane change behavior, [0, 1, 0] corresponds to the right lane change mode, and [0, 0, 1] represents the straight line keeping state; Step S103: In the data pre-processing link, the spatial intersection point of the vehicle trajectory and the lane boundary line is defined as the lane change feature point.

[0034] The Transformer network needs to be parameterized in the step S2.

[0035] The step S3 includes the following steps: Step S301: The input of the vehicle behavior prediction module includes the historical trajectory data Et of the vehicle and the interaction data St, that is, I=[Et , S t ] wherein E t represents the motion state information of the vehicle at time t, such as position, speed and acceleration, S t represents the interaction information between the vehicle and other vehicles, such as relative position, speed and distance; Step S302: By combining the two, the model can fully mine the key features of the vehicle in the lane changing and following behaviors, and the output of this module is the probability distribution of three types of driving intentions, i.e. left lane changing, right lane changing and straight driving, forming a probability intention matrix: P = [w1, w2, w3] wherein w1, w2 and w3 represent the probability values of the three types of vehicle behaviors respectively, the behavior corresponding to the maximum value in the probability intention matrix is taken as the final prediction result, and the probability thereof is set to 1, and the probabilities of the remaining behaviors are set to 0; wherein [1, 0, 0] represents left lane changing, [0, 1, 0] represents right lane changing, and [0, 0, 1] represents the vehicle continuing to keep straight driving; Step S303: For the vehicle behavior prediction module, the recall rate R is selected as the evaluation index, which is used to measure the recognition ability of the model to positive samples, and the calculation formula of the recall rate is as follows:

[0036] wherein, Table Actual behavior and predicted behavior are the number of samples that occur; represents the number of samples that actually occur but are not predicted to occur, and the higher the recall rate, the stronger the recognition ability of the model to positive samples.

[0037] Step S4 comprises the following steps: Step S401: The vehicle trajectory prediction module combines I and P through a concatenation function to form the input of the encoder, and the formula is as follows:

[0038] wherein I is the historical motion information, including the position, speed and acceleration of the vehicle and other motion state information; P is the probability vector of the vehicle behavior, which is output by the vehicle behavior prediction module and represents the future driving intention of the vehicle (left lane changing, right lane changing or straight driving).

[0039] Step S402: The core of the encoder is to capture the context dependence of the output sequence through the self-attention mechanism, to fuse the source end information by using the encoder-decoder attention, to enhance the nonlinear expression by cooperating with the feedforward neural network, and to ensure the time sequence of the generation process by using the causal mask, and the specific calculation formula is as follows:

[0040] Wherein, Q is a query matrix, K is a key matrix, V is a value matrix, is a weight matrix that is updated during the training process, is the dimension of the key vector.

[0041] Step S403: The multi-head attention mechanism generates a global self-attention feature map A by concatenating and weighting the outputs of multiple attention heads:

[0042] Wherein, is a weight matrix for fusing multi-head outputs, through the multi-head attention mechanism, the model can capture global dependencies in the input sequence and generate high-dimensional semantic representations combined with driving intent information; Step S403: The decoder of the model inputs contains two parts: the attention matrix A of the encoder output, used to provide context information, and the feature representation B of the vehicle motion trajectory data Et after the mask multi-head attention mechanism, the decoder combines A and B through the multi-head attention mechanism to generate a trajectory position weighting matrix Z:

[0043] Wherein, and are weight matrices in the decoder, through the processing of the decoder, the model can combine driving intent information and historical trajectory data to generate a position distribution of the future trajectory; Step S404: For the vehicle trajectory prediction module, to evaluate the deviation between the predicted and actual trajectories, the root mean squared error RMSE (denoted as ) is used as an evaluation index, and the calculation formula is:

[0044] Wherein, is the prediction time domain; and y are the actual position and the predicted position respectively, The smaller the value, the closer the predicted vehicle trajectory is to the actual vehicle trajectory.

[0045] To verify the effectiveness of the vehicle trajectory prediction method improved by adding vehicle behavior prediction to the improved Transformer, the present application designs a comparison between the vehicle trajectory prediction based on the Transformer and the prediction experiment after the improvement.

[0046] The highway congestion data set is selected as the data input, and the vehicle interaction on the congestion section is more complex, so the requirement for model prediction is higher.

[0047] The parameter setting of the Transformer network in step S2 is as follows:

[0048] In order to improve the accuracy of trajectory prediction, the improved trajectory prediction model Transformer (M) based on Transformer is proposed, and a vehicle behavior prediction module is introduced based on the Transformer model. The experimental prediction results are shown in the following table:

[0049] When the prediction time domain is 0s, the RMSE of the Transformer model is 0.38, and the RMSE of the Transformer (M) is 0.24, and the error is reduced by 36.8%. With the extension of the prediction time domain, the error of the Transformer model gradually increases, for example, when the prediction time domain is 2s, the RMSE reaches 2.94, and the RMSE of the Transformer (M) is 2.12, and the error is reduced by 27.9%. This shows that the vehicle behavior prediction module can significantly optimize the accuracy of trajectory prediction by capturing driving intentions (such as lane changing or following). Especially in the congestion scene of the highway, the distance between vehicles is small and the interaction is frequent, and the Transformer (M) effectively reduces the error accumulation problem in long-time domain prediction by combining driving intentions and interaction features.

[0050] The method can be applied to a loader, and trajectory data of the loader is collected for preprocessing, network parameters are configured, and multi-modal feature fusion is performed.

[0051] The traditional lane changing behavior is replaced by a loading-unloading operation cycle modeling, the symmetry feature of the V-shaped trajectory is learned through the attention mechanism, the hydraulic data of the bucket is introduced as the key feature of behavior recognition, the boundary interaction point detection is realized to achieve adaptive operation area, and the trajectory prediction of different site layouts (linear arrangement, ring arrangement) is supported, and smooth operation trajectory planning is provided for the automatic driving loader.

[0052] The above is only a preferred embodiment of the present application, and is not intended to limit the present application in other forms. Any person skilled in the art can use the disclosed technical content to make changes or modifications to equivalent embodiments applied to other fields, but any simple modification, equivalent change and modification made on the basis of the technical essence of the present application to the above embodiments shall fall within the protection scope of the present application.

Claims

1. A Transformer-based vehicle trajectory prediction method, characterized in that, The method comprises the following steps: Step S1: determine the vehicle trajectory data that needs to be predicted, and pre-process the data; Step S2: detailed setting of the parameters of the Transformer network; Step S3: design a vehicle behavior recognition module, model the behavior of the vehicle in time sequence through a self-attention mechanism, analyze the lane changing and following behaviors of the vehicle, and output a probability intention matrix; Step S4: the probability intention matrix passes through a feature fusion layer to establish an information channel with a trajectory generation unit; Step S5: the driving decision intention is injected into the trajectory prediction process through an attention weight transfer mechanism, so that the prediction model can output a higher confidence spatiotemporal position distribution prediction result under a specific behavior mode. 2.The Transformer-based vehicle trajectory prediction method of claim 1, wherein: The step S1 comprises the following steps: Step S101: determine the data; Step S102: extract three typical trajectory modes, left lane change, right lane change and straight line keeping, from the original data set, and construct a classification coding system; Step S103: in the data pre-processing link, the spatial intersection point of the vehicle trajectory and the lane boundary line is defined as the lane change feature point. 3.The Transformer-based vehicle trajectory prediction method of claim 2, wherein: In the step S101, the public data set: Aerial Dataset for China Congested Highway and Expressway (AD4CHE) is used. 4.The Transformer-based vehicle trajectory prediction method of claim 2, wherein: The classification coding system uses a three-dimensional vector identification method, in which [1, 0, 0] represents left lane change behavior, [0, 1, 0] corresponds to right lane change mode, and [0, 0, 1] represents straight line keeping state.

5. The Transformer-based vehicle trajectory prediction method of claim 1, wherein: The parameters of the Transformer network need to be set in the step S2.

6. The Transformer-based vehicle trajectory prediction method of claim 1, wherein: Step S3 comprises the following steps: Step S301: The input of the vehicle behavior prediction module includes the historical trajectory data Et of the vehicle and the interaction data St, i.e. I=[E t , S t ] Wherein, E t represents the motion state information such as the position, speed and acceleration of the vehicle at time t, and S t represents the interaction information such as the relative position, speed and distance between the vehicle and other vehicles; Step S302: by combining the two, the model can fully mine the key features of the vehicle in the lane changing and following behaviors, the output of this module is the probability distribution of three types of driving intentions, i.e. left lane change, right lane change and straight line keeping, forming a probability intention matrix: P=[w1, w2, w3] In the formula, w1, w2 and w3 represent the probability values of the three types of vehicle behaviors respectively, the behavior corresponding to the maximum value in the probability intention matrix is taken as the final prediction result, and its probability is set to 1, and the probabilities of the remaining behaviors are set to 0; Step S303: For the vehicle behavior prediction module, the present application selects the recall rate R as an evaluation index for measuring the recognition ability of the model to positive example samples, and the calculation formula of the recall rate is as follows: Wherein, represents the number of samples in which both the actual behavior and the predicted behavior occur; represents the number of samples in which the actual behavior occurs but the predicted behavior does not occur, and the higher the recall rate, the stronger the recognition ability of the model to positive example samples.

7. The Transformer-based vehicle trajectory prediction method of claim 6, wherein: [1, 0, 0] represents left lane change, [0, 1, 0] represents right lane change, and [0, 0, 1] represents that the vehicle continues to keep straight. 8.The Transformer-based vehicle trajectory prediction method of claim 1, wherein: Step S4 comprises the following steps: Step S401: The vehicle trajectory prediction module combines I and P through a concatenation function to form the input of the encoder, as shown in the following formula: wherein I is historical motion information including motion state information such as the position, speed and acceleration of the vehicle; P is a probability vector of vehicle behavior, which is output by the probability intention matrix of the vehicle behavior prediction module and represents the future driving intention (lane changing to the left, lane changing to the right or keeping straight) of the vehicle. Step S402: The core of the encoder is to capture the context dependence of the output sequence through self-attention mechanism, to integrate the source information by using encoder-decoder attention, to enhance the nonlinear expression by cooperating with feedforward neural network, and to ensure the time sequence of the generation process by using causal mask. The specific calculation formula is as follows: Wherein, Q is a query matrix, K is a key matrix, and V is a value matrix, is a weight matrix updated during the training process, is the dimension of the key vector. Step S403: the multi-head attention mechanism generates a global self-attention feature mapping A by concatenating and weighting the outputs of multiple attention heads: wherein, is a weight matrix for fusing multi-head outputs, through the multi-head attention mechanism, the model can capture global dependency in the input sequence, and generate a high-dimensional semantic representation combined with driving intention information; Step S403: the input of the decoder of the model comprises two parts: the attention matrix A of the encoder output, which is used to provide context information, and the feature representation B of the vehicle motion trajectory data Et after the mask multi-head attention mechanism, the decoder combines A and B through the multi-head attention mechanism to generate a trajectory position weighting matrix Z: wherein, and is a weight matrix in the decoder, through the processing of the decoder, the model can combine the driving intention information and the historical trajectory data to generate the position distribution of the future trajectory; Step S404: For the vehicle trajectory prediction module, to evaluate the deviation of the predicted trajectory from the actual trajectory, the root mean squared error RMSE (denoted as ) is used as an evaluation index, and the calculation formula is: Wherein, is the prediction time domain; and y are the actual position and the predicted position, respectively, The smaller the value, the closer the predicted vehicle trajectory is to the actual vehicle trajectory.