A trajectory prediction method considering dynamic interactions between vehicles
By constructing a space-time correlation diagram between multiple vehicles in vehicle trajectory prediction and combining the LSTM encoder-decoder structure of the time attention mechanism and the multi-head attention mechanism, the problem of incomplete extraction of inter-vehicle interaction features in the prior art is solved, and the problem of incomplete extraction of inter-vehicle interaction features is realized. More accurate and flexible trajectory predictions.
Patent Information
- Application Number
- CN202410640317.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-05-22
AI Technical Summary
The existing vehicle trajectory prediction method is not adaptable in real-time, long-term prediction and complex traffic situations, and fails to fully extract the characteristics of interaction between vehicles, ignoring the differences and dynamics of the interaction between surrounding vehicles on target vehicles. .
The LSTM encoder-decoder structure is constructed using a space-time relationship diagram between multiple vehicles, combining the temporal attention mechanism and the multi-head attention mechanism, extracting more comprehensive interactive features, taking into account the dynamics of the interaction between vehicles, and improving trajectory prediction capabilities.
It improves the accuracy and accuracy of trajectory prediction, can better capture the differences and dynamics of interaction between vehicles, and improves the prediction capabilities of the model.
Smart Images

Figure CN118553108B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of autonomous driving, and in particular to a trajectory prediction method that takes dynamic interactions between vehicles into consideration. Background Art
[0002] With the continuous development of autonomous driving technology, accurate prediction of the trajectories of surrounding vehicles has become the key to achieving safe autonomous driving. Autonomous vehicles need to predict the future trajectories of other vehicles in order to make corresponding decisions and plan driving routes. Research on vehicle trajectory prediction has made great progress, and many methods and technologies have emerged. The traditional model-based method is to describe the movement of vehicles by establishing mathematical models to predict their future trajectories. This method can provide interpretability of future trajectories, but because it cannot mine potential features from the historical trajectory data of vehicles, it performs poorly in terms of real-time performance, long-term prediction, and adaptability to complex traffic conditions.
[0003] The development of machine learning and deep learning technologies has made great progress in further improving trajectory prediction based on data-driven methods. Generally, the historical trajectory information of the vehicle, such as speed and acceleration, is used as the model input, and the future trajectory is output by extracting the time series characteristics of the vehicle trajectory. However, the trajectory of the vehicle is also related to the interaction with the surrounding vehicles. The surrounding vehicles at different locations have different effects on the target vehicle at the same time. In addition, the interaction characteristics of the surrounding vehicles on the target vehicle change dynamically over time, and the impact of different historical moments on the future trajectory of the target vehicle also varies.
[0004] At present, most of the methods that consider vehicle interaction usually use the relative motion between vehicles to characterize the interaction between vehicles, ignoring the differences and dynamics of the interaction effects of surrounding vehicles on the target vehicle, and the extraction of the interaction characteristics between vehicles is incomplete. Summary of the invention
[0005] The purpose of the present invention is to overcome the limitation of incomplete interaction feature extraction in the current interaction-based prediction model, and provide a trajectory prediction method that considers the dynamic interaction between vehicles. By constructing a spatiotemporal correlation graph between multiple vehicles and using it as the input of the spatial interaction feature extraction module, the interaction between vehicles is introduced into the trajectory prediction. Taking into account the time-varying characteristics of the interaction between vehicles, the temporal attention mechanism is combined with the graph attention mechanism and embedded in the LSTM encoder-decoder to improve the trajectory prediction ability of the model.
[0006] To achieve the above object, the technical solution provided by the present invention is: a trajectory prediction method considering the dynamic interaction between vehicles, comprising the following steps:
[0007] 1) Obtain the driving trajectory data of vehicles on a certain road section, including the lateral and longitudinal position information, lateral and longitudinal speed information, lateral and longitudinal acceleration information of the vehicle at each moment, and the angle information of the vehicle's driving direction relative to the lane line, and extract the driving trajectory data of the same time length for each vehicle, and divide it into historical time domain information and future time domain information;
[0008] 2) The driving trajectory data of each vehicle at each moment is matched with the driving trajectory data of the six surrounding vehicles at that moment, namely, the vehicle in front of the vehicle in the same lane, the vehicle behind the vehicle in the same lane, the vehicle in front of the left lane, the vehicle behind the left lane, the vehicle in front of the right lane, and the vehicle behind the right lane, as the final vehicle trajectory feature data, and the feature data is divided into training set and test set;
[0009] 3) The trajectory prediction model that considers the dynamic interaction between vehicles is trained using the data from the training set; the trajectory prediction model is an improved LSTM encoder-decoder structure, and its improvement lies in: embedding a multi-head attention mechanism to capture the dynamic interaction between vehicles, fusing the spatial interaction features with the historical time domain trajectory features of the vehicles, and then weighting the vehicle information at different times through the time attention mechanism to obtain the context vector of the fused time series features, and finally predicting the future location information of the vehicle through the LSTM structure;
[0010] 4) Input the test set data into the trained trajectory prediction model to finally obtain the vehicle’s future time domain trajectory information, that is, the vehicle’s lateral and longitudinal position information at each moment in the future.
[0011] Further, in step 1), the historical time domain information of each vehicle is expressed as i=1,2,…,n, the future time domain information is expressed as Among them, t h is the length of the historical time domain, t g is the interval length between the historical time domain and the future time domain, t f is the future time domain length, in V i In the above example, the trajectory information of the vehicle at time t in the historical time domain is expressed as t=1,2,...,t h , in F i In the above example, the trajectory information of the vehicle at time t' in the future time domain is expressed as t'=t h +t g ,t h +t g +1,...,t h +t g +t f ;in is the lateral position of vehicle i at time t in the historical time domain, is the longitudinal position of vehicle i at time t in the historical time domain, is the lateral velocity of vehicle i at time t in the historical time domain, is the longitudinal velocity of vehicle i at time t in the historical time domain, is the lateral acceleration of vehicle i at time t in the historical time domain, is the longitudinal acceleration of vehicle i at time t in the historical time domain, is the heading angle of vehicle i at time t in the historical time domain.
[0012] Further, the step 2) comprises the following steps:
[0013] 2.1) Determine the target vehicle and classify the vehicles in the same lane and the left and right lanes of the target vehicle according to the lane number of the target vehicle;
[0014] 2.2) The front and rear vehicles are divided according to the headway distance between the surrounding vehicles and the target vehicle at each moment. The vehicle with the smallest positive headway distance is the front vehicle in the corresponding lane, and the vehicle with the largest negative headway distance is the rear vehicle in the corresponding lane.
[0015] 2.3) The front and rear vehicles of each vehicle at each moment are divided and matched to obtain the final vehicle trajectory feature data, including the lateral and longitudinal position information, lateral and longitudinal speed information, lateral and longitudinal acceleration information of each vehicle and its surrounding six vehicles at each moment, and the angle information of the vehicle's driving direction relative to the lane line.
[0016] Furthermore, in the step 3), the trajectory prediction model includes a spatial interaction feature extraction module, a temporal feature extraction module and a trajectory output module, which specifically performs the following operations: first, a vehicle feature matrix and a correlation matrix are constructed through the spatial interaction feature extraction module, and the spatial interaction feature matrix of the surrounding vehicles and the target vehicle at each moment is obtained by using a multi-head attention mechanism. Then, the spatial interaction features at each moment are fused with the historical time domain trajectory features of the target vehicle as the input of the temporal feature extraction module, and the weight coefficient of each moment in the historical time domain is obtained through an LSTM structure embedded with a temporal attention mechanism, and the context vector corresponding to the historical time domain is obtained by weighting. Finally, the historical information is encoded through the LSTM encoder of the trajectory output module and fused with the context vector obtained above, and finally the predicted trajectory of the target vehicle is output through the LSTM decoder.
[0017] Furthermore, the spatial interaction feature extraction module specifically performs the following operations:
[0018] Consider vehicle i at time t as a node The interaction between nodes is regarded as a weighted edge. The weight is the interaction coefficient between two nodes. The value range of the weight is [0,1]. The feature information of each node is used as a variable to construct a feature matrix. The calculation is shown in formula (1):
[0019]
[0020] Initialize the weight of each edge and construct the spatiotemporal association matrix A to express the calculation as shown in formula (2):
[0021]
[0022]
[0023] Where: is the node corresponding to car i1 at time t1; is the node corresponding to car i2 at time t2, i1,i2=0,1,...,6, t1,t2=1,2,...,t h-1 ,t h ; Representation Node and nodes The initial value of the interaction between the two nodes. If there is an interaction between the two nodes, the initial value is 1, otherwise the initial value is 0, and the edge formed by the two nodes does not participate in the operation of the graph attention network; is the longitudinal position of vehicle i1 at time t1 in the historical time domain, is the longitudinal position of vehicle i2 at time t2 in the historical time domain; d is the longitudinal spacing threshold between vehicles;
[0024] The feature matrix constructed above The spatiotemporal correlation matrix A is used as the input of the graph attention network. After calculation by the multi-head attention mechanism, the spatial interaction feature matrix between the target vehicle and the surrounding vehicles is output. The calculation is shown in formulas (4), (5), and (6):
[0025]
[0026]
[0027]
[0028] Where: H is the number of attention mechanism heads; and Represents the node and nodes The characteristic matrix of W is linearly changed. (h) is the trainable parameter matrix; c (h) is the learnable weight matrix of the h-th attention mechanism; σ is the activation function, using LeakyRelu nonlinear activation; For Node The associated node set of is the node obtained by the h-th attention mechanism For Node The interaction coefficient of The node output by the h-th attention mechanism The spatial interaction feature matrix of This is the node that is finally output by the spatial interaction feature extraction module. The spatial interaction feature matrix of is expressed as shown in formula (7):
[0029]
[0030] In the formula, represents the interaction value of the surrounding vehicles on vehicle i1 at time t1, i1 = 0, 1, 2, ..., 6, t1 = 1, 2, ..., t h-1 ,t h .
[0031] Furthermore, the time series feature extraction module specifically performs the following operations:
[0032] Extract the interactive influence of surrounding vehicles on the target vehicle at time t in the spatial interaction feature matrix t=1,2,...,t h-1 ,t h , get the spatial interaction characteristic parameters of the target vehicle It is fused with the historical time domain information V0 of the target vehicle to obtain the fusion feature is the lateral position of the target vehicle at time t in the historical time domain, is the longitudinal position of the target vehicle at time t in the historical time domain, is the lateral velocity of the target vehicle at time t in the historical time domain, is the longitudinal velocity of the target vehicle at time t in the historical time domain, is the lateral acceleration of the target vehicle at time t in the historical time domain, is the longitudinal acceleration of the target vehicle at time t in the historical time domain, is the heading angle of the target vehicle at time t in the historical time domain, and T0 is used as the input of the temporal feature extraction module. After calculation by the temporal attention mechanism, the temporal feature vector of the state of the vehicle at each moment in the historical time domain is output, as follows:
[0033] First, build an LSTM structure and input T0 into the LSTM structure to obtain all hidden layer information V h ,Right now:
[0034] V h ,h t =LSTM(T0,ht-1 ) (8)
[0035] In the formula, h t is the hidden layer output information at time t, h t-1 Output information of the hidden layer at time t-1;
[0036] Since the convolution kernel can enhance the abstract expression ability of the network layer, V h After convolution kernel calculation, multi-dimensional feature extraction at different times can be achieved, namely:
[0037]
[0038] In the formula, is the multidimensional feature extracted at time t by convolution kernel calculation, p = 1, 2, ..., s; t = 1, 2, ..., t h ; s is the size of the convolution kernel; is the hidden layer information at time t; K(p) is the pth convolution kernel; is the convolution operation;
[0039] The last hidden layer calculated by formula (8) The query vector Query, or Q, as the temporal attention mechanism, is the output of each convolutional layer at time t. At the same time, as the key vector Key (K) and the numerical vector Value (V) of the time attention mechanism, the dot product operation between Q and K is used to measure the similarity, thereby mapping the importance of each time step feature to the future trajectory prediction:
[0040]
[0041]
[0042]
[0043] Where: is the temporal attention coefficient information in the historical time domain, where δ (t) is the time attention coefficient corresponding to each moment t, t=1,2,...t h ; W t is the trainable weight matrix of the temporal attention mechanism; V T V′ is the temporal attention feature of the historical time domain obtained by weighting the temporal attention coefficient and the features at each moment; T is the historical time series feature finally obtained after the full connection layer operation; W1 and W2 are the learnable weight matrices of the network layer.
[0044] Furthermore, the trajectory output module specifically performs the following operations:
[0045] The historical time domain information of the target vehicle As the input of LSTM encoder, we obtain V′ obtained by historical time domain hidden features and time series feature extraction module T The fusion is used as the input of the LSTM decoder and the final prediction trajectory is obtained through the fully connected layer. The calculation is shown in formula (13):
[0046]
[0047] In the formula, For vehicles at t h +t g +t f The predicted position at the time, That is, the predicted horizontal position at the future time t and vertical position Through the LSTM encoder-decoder structure, The calculation of is shown in formulas (14) and (15):
[0048] H e =LSTM(V0,h e )(14)
[0049]
[0050] Where: h e 、h d are the hidden layer states of the LSTM encoder and LSTM decoder respectively; H e is the historical hidden feature output by the LSTM encoder; W3 is the learnable weight of the network layer.
[0051] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0052] 1. Interaction feature extraction considering spatiotemporal dynamics. Based on the historical temporal trajectory information of the target vehicle and its surrounding vehicles, and taking into account the time-varying characteristics of the interaction between vehicles, a spatiotemporal correlation matrix between multiple vehicles is constructed, and the dynamic interaction between vehicles is introduced into trajectory prediction. The trajectory prediction capability of the model is improved by integrating the LSTM encoder-decoder structure of the temporal attention mechanism and the multi-head attention mechanism.
[0053] 2. Consider the differential impact of surrounding vehicles on the target vehicle trajectory prediction. Since the multi-head attention mechanism constructs the interaction influence weight matrix between vehicles as input, the trajectory prediction model can learn the interaction influence weight coefficients between vehicles, thereby assigning different weights to vehicles at different positions around, incorporating the differences in the impact of surrounding vehicles into the model, extracting more comprehensive interaction features, and improving the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is the spatial position relationship diagram between the target vehicle and its surrounding vehicles.
[0055] Figure 2 Schematic diagram of the method of the present invention.
[0056] Figure 3 This is the distribution diagram of the vehicle headway distance.
[0057] Figure 4 Schematic diagram of model training results under different headway thresholds.
[0058] Figure 5 Visualization of the predicted trajectory and the actual trajectory of the vehicle under three different working conditions. DETAILED DESCRIPTION
[0059] The present invention will be further described below in conjunction with specific embodiments.
[0060] This embodiment discloses a trajectory prediction method considering dynamic interactions between vehicles, comprising the following steps:
[0061] 1) Obtain the driving trajectory data of vehicles on a certain road section, including the lateral and longitudinal position information, lateral and longitudinal speed information, lateral and longitudinal acceleration information of the vehicle at each moment, and the angle information of the vehicle's driving direction relative to the lane line, and extract the driving trajectory data of the same time length for each vehicle, and divide it into historical time domain information and future time domain information;
[0062] The historical time domain information of each vehicle is expressed as i=1,2,…,n, the future time domain information is expressed as Among them, t h is the length of the historical time domain, t g is the interval length between the historical time domain and the future time domain, t f is the future time domain length.
[0063] In V i In the above example, the trajectory information of the vehicle at time t in the historical time domain is expressed as t=1,2,...,t h , in F i In the above example, the trajectory information of the vehicle at time t' in the future time domain is expressed as t'=t h +t g ,t h +t g +1,...,t h +t g +t f ;in is the lateral position of vehicle i at time t in the historical time domain, is the longitudinal position of vehicle i at time t in the historical time domain, is the lateral velocity of vehicle i at time t in the historical time domain, is the longitudinal velocity of vehicle i at time t in the historical time domain, is the lateral acceleration of vehicle i at time t in the historical time domain, is the longitudinal acceleration of vehicle i at time t in the historical time domain, is the heading angle of vehicle i at time t in the historical time domain.
[0064] 2) Match the driving trajectory data of each vehicle at each moment with the driving trajectory data of the six surrounding vehicles at that moment, namely, the vehicle in front of the vehicle in the same lane, the vehicle behind the same lane, the vehicle in front of the left lane, the vehicle behind the left lane, the vehicle in front of the right lane, and the vehicle behind the right lane, as the final vehicle trajectory feature data, and divide the feature data into training set and test set in a ratio of 8:2; including the following steps:
[0065] 2.1) Determine the target vehicle (V0), and classify the vehicles in the same lane and the left and right lanes of the target vehicle (V0) according to the lane number of the target vehicle (V0), such as Figure 1 As shown, the front vehicle in the lane (V1), the rear vehicle in the lane (V2), the front vehicle in the left lane (V3), the rear vehicle in the left lane (V4), the front vehicle in the right lane (V5) and the rear vehicle in the right lane (V6);
[0066] 2.2) The front and rear vehicles are divided according to the headway distance between the surrounding vehicles and the target vehicle at each moment. The vehicle with the smallest positive headway distance is the front vehicle in the corresponding lane, and the vehicle with the largest negative headway distance is the rear vehicle in the corresponding lane.
[0067] 2.3) The front and rear vehicles of each vehicle at each moment are divided and matched to obtain the final vehicle trajectory feature data, including the lateral and longitudinal position information, lateral and longitudinal speed information, lateral and longitudinal acceleration information of each vehicle and its surrounding six vehicles at each moment, and the angle information of the vehicle's driving direction relative to the lane line.
[0068] 3) The trajectory prediction model that considers the dynamic interaction between vehicles is trained using the data from the training set; the trajectory prediction model is an improved LSTM encoder-decoder structure, and its improvement lies in: embedding a multi-head attention mechanism to capture the dynamic interaction between vehicles, fusing the spatial interaction features with the historical time domain trajectory features of the vehicles, and then weighting the vehicle information at different times through the time attention mechanism to obtain the context vector of the fused time series features, and finally predicting the future location information of the vehicle through the LSTM structure;
[0069] The trajectory prediction model includes a spatial interaction feature extraction module, a temporal feature extraction module and a trajectory output module. Figure 2 As shown in the figure, the following operations are performed specifically: first, the vehicle feature matrix and the correlation matrix are constructed through the spatial interaction feature extraction module, and the spatial interaction feature matrix of the surrounding vehicles and the target vehicle at each moment is obtained by using the multi-head attention mechanism. Then, the spatial interaction features at each moment are fused with the historical time domain trajectory features of the target vehicle as the input of the time series feature extraction module, and the weight coefficient of each moment in the historical time domain is obtained through the LSTM structure embedded with the time attention mechanism, and the context vector corresponding to the historical time domain is obtained by weighting. Finally, the historical information is encoded through the LSTM encoder of the trajectory output module and fused with the context vector obtained above, and finally the predicted trajectory of the target vehicle is output through the LSTM decoder.
[0070] Specifically, the spatial interaction feature extraction module specifically performs the following operations:
[0071] Consider vehicle i at time t as a node The interaction between nodes is regarded as a weighted edge. The weight is the interaction coefficient between two nodes. The value range of the weight is [0,1]. The feature information of each node is used as a variable to construct a feature matrix. The calculation is shown in formula (1):
[0072]
[0073] Initialize the weight of each edge and construct the spatiotemporal association matrix A to express the calculation as shown in formula (2):
[0074]
[0075]
[0076] Where: is the node corresponding to car i1 at time t1; is the node corresponding to car i2 at time t2, i1,i2=0,1,…,6, t1,t2=1,2,…,t h-1 ,t h ; Representation Node and nodes The initial value of the interaction between the two nodes. If there is an interaction between the two nodes, the initial value is 1, otherwise the initial value is 0, and the edge formed by the two nodes does not participate in the operation of the graph attention network; is the longitudinal position of vehicle i1 at time t1 in the historical time domain, is the longitudinal position of vehicle i2 at time t2 in the historical time domain; d is the longitudinal spacing threshold between vehicles;
[0077] The feature matrix constructed above The spatiotemporal correlation matrix A is used as the input of the graph attention network. After calculation by the multi-head attention mechanism, the spatial interaction feature matrix between the target vehicle and the surrounding vehicles is output. The calculation is shown in formulas (4), (5), and (6):
[0078]
[0079]
[0080]
[0081] Where: H is the number of attention mechanism heads; and Represents the node and nodes The characteristic matrix of W is linearly changed. (h) is the trainable parameter matrix; c (h) is the learnable weight matrix of the h-th attention mechanism; σ is the activation function, using LeakyRelu nonlinear activation; For Node The associated node set of is the node obtained by the h-th attention mechanism For Node The interaction coefficient of The node output by the h-th attention mechanism The spatial interaction feature matrix of This is the node that is finally output by the spatial interaction feature extraction module. The spatial interaction feature matrix of is expressed as shown in formula (7):
[0082]
[0083] In the formula, represents the interaction value of the surrounding vehicles on vehicle i1 at time t1, i1=0,1,2,...,6, t1=1,2,...t h-1 ,t h .
[0084] Specifically, the time series feature extraction module performs the following operations:
[0085] Extract the interactive influence of surrounding vehicles on the target vehicle at time t in the spatial interaction feature matrix t=1,2,...,t h-1 ,t h, get the spatial interaction characteristic parameters of the target vehicle It is fused with the historical time domain information V0 of the target vehicle to obtain the fusion feature is the lateral position of the target vehicle at time t in the historical time domain, is the longitudinal position of the target vehicle at time t in the historical time domain, is the lateral velocity of the target vehicle at time t in the historical time domain, is the longitudinal velocity of the target vehicle at time t in the historical time domain, is the lateral acceleration of the target vehicle at time t in the historical time domain, is the longitudinal acceleration of the target vehicle at time t in the historical time domain, is the heading angle of the target vehicle at time t in the historical time domain, and T0 is used as the input of the temporal feature extraction module. After calculation by the temporal attention mechanism, the temporal feature vector of the state of the vehicle at each moment in the historical time domain is output, as follows:
[0086] First, build an LSTM structure and input T0 into the LSTM structure to obtain all hidden layer information V h ,Right now:
[0087] V h ,h t =LSTM(T0,h t-1 ) (8) In the formula, h t is the hidden layer output information at time t, h t-1 Output information of the hidden layer at time t-1;
[0088] Since the convolution kernel can enhance the abstract expression ability of the network layer, V h After convolution kernel calculation, multi-dimensional feature extraction at different times can be achieved, namely:
[0089]
[0090] In the formula, is the multidimensional feature extracted at time t by convolution kernel calculation, p = 1, 2, ..., s; t = 1, 2, ..., t h ; s is the size of the convolution kernel; is the hidden layer information at time t; K(p) is the pth convolution kernel; is the convolution operation;
[0091] The last hidden layer calculated by formula (8) The query vector Query, or Q, as the temporal attention mechanism, is the output of each convolutional layer at time t. At the same time, as the key vector Key (K) and the numerical vector Value (V) of the time attention mechanism, the dot product operation between Q and K is used to measure the similarity, thereby mapping the importance of each time step feature to the future trajectory prediction:
[0092]
[0093]
[0094]
[0095] Where: is the temporal attention coefficient information in the historical time domain, where δ (t) is the time attention coefficient corresponding to each moment t, t=1,2,...t h ; W t is the trainable weight matrix of the temporal attention mechanism; V T V′ is the temporal attention feature of the historical time domain obtained by weighting the temporal attention coefficient and the features at each moment; T is the historical time series feature finally obtained after the full connection layer operation; W1 and W2 are the learnable weight matrices of the network layer.
[0096] Specifically, the trajectory output module performs the following operations:
[0097] The historical time domain information of the target vehicle As the input of LSTM encoder, we obtain V′ obtained by historical time domain hidden features and time series feature extraction module T The fusion is used as the input of the LSTM decoder and the final prediction trajectory is obtained through the fully connected layer. The calculation is shown in formula (13):
[0098]
[0099] In the formula, For vehicles at t h +t g +t f The predicted position at the time, That is, the predicted horizontal position at the future time t and vertical position Through the LSTM encoder-decoder structure, The calculation of is shown in formulas (14) and (15):
[0100] H e =LSTM(V0,h e ) (14)
[0101]
[0102] Where: h e 、h d are the hidden layer states of the LSTM encoder and LSTM decoder respectively; H e is the historical hidden feature output by the LSTM encoder; W3 is the learnable weight of the network layer.
[0103] In this example, 10 seconds is selected as a data sample, and 3 seconds of historical trajectory data is used to predict the trajectory data of the next 5 seconds. The model sets all hidden layer dimensions to 128, the number of heads H of the multi-head attention mechanism to 4, the dropout ratio to 0.5, the learning rate to 0.01, the training rounds to 500, and the sample batches to 256. During the training process, the mean square error (MSE) is used as the training loss function.
[0104] In addition, the construction of the spatiotemporal correlation matrix in the trajectory prediction model requires the determination of the headway distance threshold d, according to the statistical results of the headway time distribution of vehicles on the highway, such as Figure 3 As shown in the figure, the values of d are set to 50, 100, 150, and 200 respectively, and the threshold of the final model is determined according to the MSE of the validation set. The training results corresponding to different headway thresholds are shown in the figure below. Figure 4 As shown, the value of d is finally determined to be 150.
[0105] 4) Input the test set data into the trained trajectory prediction model to finally obtain the vehicle’s future time domain trajectory information, that is, the vehicle’s lateral and longitudinal position information at each moment in the future.
[0106] In order to evaluate the prediction performance of the model, the overall root mean square error (RMSE) of the prediction time domain of 5s and the absolute error (AE) of the next 1-5s are selected as indicators to characterize the prediction accuracy of the model. The calculation formula is:
[0107]
[0108]
[0109] Where: is the real horizontal and vertical position coordinates of the vehicle, is the predicted output of the vehicle's horizontal and vertical position coordinates, is the total number of predicted coordinates.
[0110] In addition, the sample mean prediction time (MPT) is used to characterize the model prediction efficiency, and the calculation formula is:
[0111]
[0112] Where: T is the total prediction time for each sample batch, B is the sample batch, which is 256 in this example.
[0113] The model prediction results are shown in Table 1.
[0114] Table 1 Comparison of prediction performance of different models
[0115] Performance parameters (unit: meter) Prediction results 1s-AE 0.17 2s-AE 0.31 3s-AE 0.27 4s-AE 0.38 5s-AE 0.42 RMSE 0.82 MPT(ms) 5.65
[0116] In order to show the prediction effect of the model under different working conditions, three vehicles under different working conditions (i.e., left lane change, lane keeping, and right lane change) are randomly selected from the test samples. The model prediction trajectory and the actual vehicle trajectory are visualized as shown below: Figure 5 As shown in the figure, it can be seen that the trajectory prediction method disclosed in the present invention can be used in an automatic driving system. By accurately predicting the vehicle trajectory, it can use the predicted information to perform safe path planning after predicting the movement or behavior of surrounding obstacles, thereby improving traffic efficiency and alleviating traffic congestion, which is worthy of promotion.
[0117] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A trajectory prediction method considering dynamic interactions between vehicles, characterized in that: The following steps are involved: 1) Obtain the driving trajectory data of vehicles on a certain road section, including the lateral and longitudinal position information, lateral and longitudinal speed information, lateral and longitudinal acceleration information of the vehicle at each moment, and the angle information of the vehicle's driving direction relative to the lane line, and extract the driving trajectory data of the same time length for each vehicle, and divide it into historical time domain information and future time domain information; 2) The driving trajectory data of each vehicle at each moment is matched with the driving trajectory data of the six surrounding vehicles at that moment, namely, the vehicle in front of the vehicle in the same lane, the vehicle behind the vehicle in the same lane, the vehicle in front of the left lane, the vehicle behind the left lane, the vehicle in front of the right lane, and the vehicle behind the right lane, as the final vehicle trajectory feature data, and the feature data is divided into training set and test set; 3) The trajectory prediction model that considers the dynamic interaction between vehicles is trained using the data from the training set; the trajectory prediction model is an improved LSTM encoder-decoder structure, and its improvement lies in: embedding a multi-head attention mechanism to capture the dynamic interaction between vehicles, fusing the spatial interaction features with the historical time domain trajectory features of the vehicles, and then weighting the vehicle information at different times through the time attention mechanism to obtain the context vector of the fused time series features, and finally predicting the future location information of the vehicle through the LSTM structure; 4) Input the test set data into the trained trajectory prediction model to finally obtain the vehicle’s future time domain trajectory information, that is, the vehicle’s lateral and longitudinal position information at each moment in the future.
2. A trajectory prediction method considering dynamic interactions between vehicles according to claim 1, characterized in that: In step 1), the historical time domain information of each vehicle is expressed as The future time domain information is expressed as Among them, t h is the length of the historical time domain, t g is the interval length between the historical time domain and the future time domain, t f is the future time domain length, in V i In the above example, the trajectory information of the vehicle at time t in the historical time domain is expressed as In F i In the example, the trajectory information of the vehicle at the future time domain t' is represented by f i (t') , t'=t h +t g ,t h +t g +1,...,t h +t g +t f ;in is the lateral position of vehicle i at time t in the historical time domain, is the longitudinal position of vehicle i at time t in the historical time domain, is the lateral velocity of vehicle i at time t in the historical time domain, is the longitudinal velocity of vehicle i at time t in the historical time domain, is the lateral acceleration of vehicle i at time t in the historical time domain, is the longitudinal acceleration of vehicle i at time t in the historical time domain, is the heading angle of vehicle i at time t in the historical time domain.
3. The trajectory prediction method considering dynamic interaction between vehicles according to claim 2, characterized in that: The step 2) comprises the following steps: 2.1) Determine the target vehicle and classify the vehicles in the same lane and the left and right lanes of the target vehicle according to the lane number of the target vehicle; 2.2) The front and rear vehicles are divided according to the headway distance between the surrounding vehicles and the target vehicle at each moment. The vehicle with the smallest positive headway distance is the front vehicle in the corresponding lane, and the vehicle with the largest negative headway distance is the rear vehicle in the corresponding lane. 2.3) The front and rear vehicles of each vehicle at each moment are divided and matched to obtain the final vehicle trajectory feature data, including the lateral and longitudinal position information, lateral and longitudinal speed information, lateral and longitudinal acceleration information of each vehicle and its surrounding six vehicles at each moment, and the angle information of the vehicle's driving direction relative to the lane line.
4. The trajectory prediction method considering dynamic interaction between vehicles according to claim 3, characterized in that: In the step 3), the trajectory prediction model includes a spatial interaction feature extraction module, a temporal feature extraction module and a trajectory output module, which specifically performs the following operations: first, a vehicle feature matrix and a correlation matrix are constructed through the spatial interaction feature extraction module, and the spatial interaction feature matrix of the surrounding vehicles and the target vehicle at each moment is obtained by using a multi-head attention mechanism. Then, the spatial interaction features at each moment are fused with the historical time domain trajectory features of the target vehicle as the input of the temporal feature extraction module, and the weight coefficient of each moment in the historical time domain is obtained through an LSTM structure embedded with a temporal attention mechanism, and the context vector corresponding to the historical time domain is obtained by weighting. Finally, the historical information is encoded through the LSTM encoder of the trajectory output module and fused with the context vector obtained above, and finally the predicted trajectory of the target vehicle is output through the LSTM decoder.
5. The trajectory prediction method considering dynamic interaction between vehicles according to claim 4, characterized in that: The spatial interaction feature extraction module specifically performs the following operations: Consider vehicle i at time t as a node V i (t) The interaction between nodes is regarded as a weighted edge. The weight is the interaction coefficient between two nodes. The value range of the weight is [0,1]. The feature information of each node is used as a variable to construct a feature matrix The calculation is shown in formula (1): Initialize the weight of each edge and construct the spatiotemporal association matrix A to express the calculation as shown in formula (2): Where: is the node corresponding to car i1 at time t1; is the node corresponding to car i2 at time t2, i1,i2=0,1,...,6, t1,t2=1,2,...,t h-1 ,t h ; Representation Node and nodes The initial value of the interaction between the two nodes. If there is an interaction between the two nodes, the initial value is 1, otherwise the initial value is 0, and the edge formed by the two nodes does not participate in the operation of the graph attention network; is the longitudinal position of vehicle i1 at time t1 in the historical time domain, is the longitudinal position of vehicle i2 at time t2 in the historical time domain; d is the longitudinal spacing threshold between vehicles; The feature matrix constructed above The spatiotemporal correlation matrix A is used as the input of the graph attention network. After calculation by the multi-head attention mechanism, the spatial interaction feature matrix between the target vehicle and the surrounding vehicles is output. The calculation is shown in formulas (4), (5), and (6): Where: H is the number of attention mechanism heads; and Represents the node and nodes The characteristic matrix of W is linearly changed. (h) is the trainable parameter matrix; c (h) is the learnable weight matrix of the h-th attention mechanism; σ is the activation function, using LeakyRelu nonlinear activation; For Node The associated node set of is the node obtained by the h-th attention mechanism For Node The interaction coefficient of The node output by the h-th attention mechanism The spatial interaction feature matrix of This is the node that is finally output by the spatial interaction feature extraction module. The spatial interaction feature matrix of is expressed as shown in formula (7): In the formula, represents the interaction value of the surrounding vehicles on vehicle i1 at time t1, i1 = 0, 1, 2, ..., 6, t1 = 1, 2, ..., t h-1 ,t h .
6. A trajectory prediction method considering dynamic interactions between vehicles according to claim 5, characterized in that: The temporal feature extraction module specifically performs the following operations: Extract the interactive influence of surrounding vehicles on the target vehicle at time t in the spatial interaction feature matrix t=1,2,…,t h-1 ,t h , get the spatial interaction characteristic parameters of the target vehicle It is fused with the historical time domain information V0 of the target vehicle to obtain the fusion feature is the lateral position of the target vehicle at time t in the historical time domain, is the longitudinal position of the target vehicle at time t in the historical time domain, is the lateral velocity of the target vehicle at time t in the historical time domain, is the longitudinal velocity of the target vehicle at time t in the historical time domain, is the lateral acceleration of the target vehicle at time t in the historical time domain, is the longitudinal acceleration of the target vehicle at time t in the historical time domain, is the heading angle of the target vehicle at time t in the historical time domain, and T0 is used as the input of the time series feature extraction module. After calculation by the time attention mechanism, the time series feature vector of the state of the vehicle at each moment in the historical time domain is output, as follows: First, build an LSTM structure and input T0 into the LSTM structure to obtain all hidden layer information V h ,Right now: V h ,h t =LSTM(T0,h t-1 ) (8) In the formula, h t is the hidden layer output information at time t, h t-1 Output information of the hidden layer at time t-1; Since the convolution kernel can enhance the abstract expression ability of the network layer, V h After convolution kernel calculation, multi-dimensional feature extraction at different times can be achieved, namely: In the formula, is the multidimensional feature extracted at time t by convolution kernel calculation, p = 1, 2, ..., s; t = 1, 2, ..., t h ; s is the size of the convolution kernel; is the hidden layer information at time t; K(p) is the pth convolution kernel; is the convolution operation; The last hidden layer calculated by formula (8) The query vector Query, or Q, as the temporal attention mechanism, is the output of each convolutional layer at time t. At the same time, as the key vector Key (K) and the numerical vector Value (V) of the time attention mechanism, the dot product operation between Q and K is used to measure the similarity, thereby mapping the importance of each time step feature to the future trajectory prediction: Where: is the temporal attention coefficient information in the historical time domain, where δ (t) is the time attention coefficient corresponding to each moment t, t=1,2,...t h ; W t is the trainable weight matrix of the temporal attention mechanism; V T The temporal attention feature of the historical time domain is obtained by weighting the temporal attention coefficient and the features at each moment; V′ T It is the historical time series feature finally obtained after the full connection layer operation; W1 and W2 are the learnable weight matrices of the network layer.
7. The trajectory prediction method considering dynamic interaction between vehicles according to claim 6, characterized in that: The trajectory output module specifically performs the following operations: The historical time domain information of the target vehicle As the input of LSTM encoder, we obtain V′ obtained by historical time domain hidden features and time series feature extraction module T The fusion is used as the input of the LSTM decoder and the final prediction trajectory is obtained through the fully connected layer. The calculation is shown in formula (13): In the formula, For vehicles at t h +t g +t f The predicted position at the time, That is, the predicted horizontal position at the future time t and vertical position Through the LSTM encoder-decoder structure, The calculation of is shown in formulas (14) and (15): H e =LSTM(V0,h e )(14) Where: h e 、h d are the hidden layer states of the LSTM encoder and LSTM decoder respectively; H e The historical hidden features output by the LSTM encoder; W3 is the learnable weight of the network layer.
