A vehicle future trajectory prediction method based on Deepwalk-LSTM coding

By using a Deepwalk-LSTM encoding method, the spatiotemporal characteristics and interaction information of vehicle trajectories are captured, improving the accuracy and stability of vehicle trajectory prediction. This solves the problem of accuracy degradation in long-term prediction using traditional methods and enhances the safety of autonomous driving.

CN117273201BActive Publication Date: 2026-06-02DALIAN UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DALIAN UNIV OF TECH
Filing Date
2023-08-31
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing vehicle trajectory prediction methods have low accuracy over long periods of time, failing to effectively capture the spatiotemporal information of vehicle trajectories and the complex interactions between vehicles, leading to a decrease in prediction accuracy.

Method used

The Deepwalk-LSTM-based encoding method is adopted. By performing graph data transformation and encoding on the historical trajectory data of vehicles, spatial information is extracted using the DeepWalk encoder, temporal information is captured by combining the LSTM network, and a self-attention mechanism is introduced to learn the interaction relationship between vehicles. Finally, the future trajectory is generated through the LSTM decoder.

Benefits of technology

It improves the accuracy and stability of vehicle trajectory prediction, enhances the driving safety of autonomous vehicles in dynamic environments, and solves the problem of declining prediction accuracy over long periods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117273201B_ABST
    Figure CN117273201B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on Deepwalk-LSTM coding vehicle future trajectory prediction method, steps include: original GPS data is preprocessed to obtain the driving trajectory of vehicle;The trajectory data after processing is regarded as continuous node and is converted into graph data;The space-time information of continuous trajectory point is encoded by DeepWalk-LSTM encoder;The interaction between the vehicles after coding is captured by self-attention mechanism, and then the future vehicle trajectory is generated using LSTM decoder;The model is trained and saved using the average displacement error ADE and final displacement error FDE loss function to update the intermediate parameters of the model.The application discloses a kind of based on Deepwalk-LSTM coding vehicle future trajectory prediction method, vehicle trajectory prediction precision is high, solve the problem of traditional method long time prediction precision decline, stability is good, safe and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of safety technology for autonomous driving systems, specifically to a method for predicting the future trajectory of a vehicle based on Deepwalk-LSTM encoding. Background Technology

[0002] In recent years, autonomous driving has become a focal point of a new round of technological revolution. The nation has also made autonomous driving a key direction for innovation and transformation in the automotive industry, and it has now entered a large-scale R&D and testing phase, with plans to gradually deploy and promote it to the public in the future. The core of an autonomous driving system mainly comprises three parts: perception, planning, and control. Vehicle trajectory prediction plays a crucial role in this process and is one of the core modules of the autonomous driving system. The vehicle trajectory module obtains information and relevant knowledge collected from the environment by the perception module; it also predicts the trajectories of surrounding dynamic and static objects by combining high-precision maps, predicting the next movement of these obstacles. This accurate and effective motion prediction result is then transmitted to the decision-making and planning layer to assist in making decisions in advance. Research on driver decision-making characteristics shows that factors such as the relative speed and distance between the car and surrounding moving vehicles greatly influence driver decisions, thus affecting driving safety. For static vehicles in the driving environment, intelligent vehicles can safely drive along a planned trajectory; however, for dynamic vehicles, human drivers can generally use past experience and intuition to predict the behavior of other drivers to avoid potential accidents. Therefore, to ensure safe driving in dynamic environments, intelligent vehicles need to improve driving safety by predicting the trajectories of surrounding moving vehicles in real time. Accurate trajectory prediction helps decision-makers make reasonable movement decisions, thereby greatly improving traffic safety.

[0003] Vehicle trajectory prediction is a task that involves modeling a vehicle's historical trajectory, its own features, and the surrounding environment to predict its future trajectory. Vehicle trajectory prediction methods can be broadly categorized into two types: 1) kinematics-based trajectory prediction models and 2) data-driven trajectory prediction models. Early research on vehicle trajectory prediction algorithms, limited by computer equipment and data scale, largely relied on kinematic trajectory prediction models. This method fails to capture the complex dynamic environment and spatiotemporal interactions between vehicles, making it only applicable to short-term trajectory prediction. In long-term trajectory prediction, the assumption that the target is solely kinematically related no longer holds, leading to large discrepancies between predicted and actual positions and insufficient prediction accuracy. In recent years, with continuous iterations of computer equipment and increasing data scale, data-driven trajectory prediction methods have developed significantly. Among these, various deep learning-based trajectory prediction methods have gained attention. These methods utilize deep learning models, such as LSTM, RNN, and CNN, to model the vehicle's historical trajectory, its own features, and the surrounding environment. However, these methods do not take into account the spatiotemporal information of vehicle trajectories, the complex interaction information between vehicles, and the spatiotemporal information of each vehicle's trajectory, resulting in low accuracy in predicting vehicle trajectories. Summary of the Invention

[0004] The purpose of this invention is to provide a method for predicting the future trajectory of vehicles based on Deepwalk-LSTM encoding, so as to solve the above-mentioned defects.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A method for predicting future vehicle trajectories based on Deepwalk-LSTM encoding includes the following steps:

[0007] S1. Preprocess the raw GPS data to obtain the vehicle's driving trajectory;

[0008] S2. Treat the trajectory data processed in step S1 as continuous nodes and convert it into graph data;

[0009] S3. Encode the spatiotemporal information of the continuous trajectory points of each vehicle using a DeepWalk-LSTM encoder.

[0010] S4. Capture the coded interaction relationships between vehicles through a self-attention mechanism, and then use an LSTM decoder to generate future vehicle trajectories.

[0011] S5. The model is trained and saved using the average displacement error (ADE) and final displacement error (FDE) loss functions to update the intermediate parameters of the model. After training, the historical trajectory data of the vehicle is input into the saved model, and the output of the model is the future trajectory of the vehicle.

[0012] Preferably, step S1 specifically includes:

[0013] S1.1 Smooth the raw GPS data to remove outliers and missing values;

[0014] S1.2 Obtain trajectory point data for each vehicle ID using the time window, vehicle ID, and coordinate points in the GPS data;

[0015] S1.3 Set thresholds for the data in each frame, including: the number of trajectory points does not exceed the trajectory point number threshold node_max, the distance between trajectory points does not exceed the distance threshold distance_max, and the number of vehicles in each frame does not exceed the vehicle number threshold car_max.

[0016] S1.4. Perform sliding window sampling on the processed data, where each sample contains real-time trajectory data of the vehicle. The trajectory point data with historical time steps is selected as historical data, and the other part is used as label data. Then, divide all the data into training set, validation set and test set according to a certain ratio. The training set is used to train the model parameters, the validation set is used to adjust the parameters, and the test set is used to judge the accuracy of the model.

[0017] Preferably, step S2 specifically includes:

[0018] S2.1 Extract the historical trajectory data for each vehicle. The historical trajectory data for each vehicle can be represented as nodes in a graph. , Indicates the first a car, This represents the time step of historical trajectory data; For the first The edge set of the historical trajectories of a vehicle. Indicates historical time step The trajectory point of time and Historical time step trajectory points of time The interrelationship between them;

[0019] S2.2. Based on the node set and edge set constructed in step S2.1, the historical trajectory of the vehicle is represented as graph structure data, and the feature matrix of the node is represented as follows: Each row represents a vehicle. The feature vector of the trajectory point at the corresponding historical time step, with a feature dimension of . .

[0020] Preferably, step S3 specifically includes:

[0021] S3.1. Using the Deepwalk encoder, spatial information is obtained by performing a random walk on the graph structure data constructed according to S2.2 to acquire spatial information of historical trajectories; the graph structure data is then input into the Deepwalk encoder:

[0022] (1),

[0023] In the formula, This represents the historical trajectory feature vector after being encoded by the DeepWalk encoder. The encoded feature vector, This indicates the Deepwalk encoder. This refers to the graph structure data constructed based on S2.2;

[0024] The Deepwalk encoder, specifically, is expressed by the following formula:

[0025] (2),

[0026] (3),

[0027] In the formula, This indicates a random walk in the graph. This represents the sequence of nodes sampled by the random walk. The algorithm can efficiently represent a sequence as a feature vector, providing us with a vector representation of the nodes;

[0028] S3.2. Based on the historical trajectory feature vector obtained in step S3.1 after DeepWalk encoding, the historical trajectory information is time-encoded using an LSTM network to obtain time information; the overall formula is as follows:

[0029] (4),

[0030] In the formula, This represents the historical trajectory feature vector after LSTM encoding. The encoded feature dimension;

[0031] S3.3 The specific method of the LSTM encoder is as follows: the weight matrix is ​​fused with the trajectory point feature vector as input data, and the results of the forget gate, input gate, and output gate are output through the activation function as shown in the following formula:

[0032] (5),

[0033] (6), (7),

[0034] In the formula, the input is denoted as After being encoded by DeepWalk, it is located in the historical time step. Vehicle The feature vectors of the trajectory points, LSTM at historical time steps The output is represented as ; and The weight is represented as ; the bias is denoted as . ; in historical time steps At that time, the outputs of the input gate, forget gate, and output gate are denoted as... , , ; It is a non-linear activation function;

[0035] S3.4. Information about the unit state needs to be added through the input gate and tanh layer control to ensure the vehicle... The historical trajectory's time information is captured, and the information added to the unit state is represented as follows:

[0036] (8),

[0037] In the formula, This is a candidate vector used to update the cell state;

[0038] S3.5. Combine the information generated by the input gate and the tanh layer, and update the cell state by summing the dot product of the information added to the cell state and the information from the input gate. Then, obtain the encoding vector through the result of the output gate. The specific formula is as follows:

[0039] (9), (10)

[0040] Finally, the encoded trajectory point vector is obtained by concatenating the time data. .

[0041] Preferably, step S4 specifically includes:

[0042] S4.1 Introducing a self-attention mechanism, by calculating the association weight between each vehicle's trajectory point and other vehicle trajectory points at the same time, and then using the feature values ​​of other vehicle trajectory points and the obtained association weights to update the features of this vehicle trajectory point; in this way, heterogeneous connections can be adaptively captured during the extraction of vehicle trajectory interaction features.

[0043] S4.2. Based on the feature vector representation of the same historical event step obtained by the DeepWalk encoder in step S3, the query matrix, key matrix, and value matrix for capturing vehicle interaction information are then learned through the self-attention module. The specific formulas are as follows:

[0044] (11),

[0045] (12),

[0046] (13)

[0047] In the formula, It is a vector formed by concatenating all vehicle trajectory points at the same historical time step. , , The first The query matrix, key matrix, and value matrix in the self-attention mechanism of group attention mechanism. For activation function, As weight, Represents bias;

[0048] S4.3 Calculate the attention of each vehicle using the query matrix, key-value matrix, and value matrix, as shown in the following formula:

[0049] (14)

[0050] (15)

[0051] (16)

[0052] In the formula, The characteristic score matrix, This is the association weight matrix between different nodes. For the first The output of the group attention mechanism;

[0053] S4.4. Concatenate the results of multiple self-attention sets along the feature dimension to obtain a multi-head self-attention matrix, as shown below:

[0054] (17)

[0055] In the formula: This represents the feature vector of all trajectory points at each historical event step after the multi-head attention mechanism. For feature dimensions;

[0056] S4.5. Based on the feature vector obtained in step S4.4, the predicted trajectory is obtained through an LSTM decoder. The LSTM decoder formula is shown below:

[0057] (18)

[0058] (19)

[0059] (20)

[0060] (twenty one),

[0061] (twenty two),

[0062] (twenty three),

[0063] In the formula, Indicates a step in historical time Vehicle eigenvectors, The feature vectors after LSTM;

[0064] S4.6 The predicted trajectory is finally obtained through the fully connected layer, and its formula is as follows:

[0065] (twenty four),

[0066] In the formula, Indicates vehicle The predicted trajectory, with a prediction step size of .

[0067] Preferably, step S5 is as follows:

[0068] S5.1 Input historical data into the built model to output the future predicted trajectory. The deviation between the predicted trajectory and the actual trajectory is represented by the average displacement error (ADE) and the final displacement error (FDE). By minimizing the loss value, the parameters in the model are learned through backpropagation of the error. The formulas for calculating ADE and FDE are as follows:

[0069] (25),

[0070] (26)

[0071] S5.2 During training, when the validation set loss does not decrease after 20 iterations, we terminate training to prevent overfitting and save the model; the historical vehicle trajectories from the test set are input into the saved model, and the model outputs the future vehicle trajectories.

[0072] The beneficial effects of this invention are as follows:

[0073] This invention presents a vehicle future trajectory prediction method based on Deepwalk-LSTM encoding. It is the first to design a vehicle trajectory prediction framework based on a DeepWalk-LSTM encoder, capturing the spatiotemporal characteristics of vehicle trajectory data for effective encoding. By using a multi-head self-attention mechanism, it learns complex interaction information between vehicles and uses an LSTM decoder to perform time-series decoding to output the vehicle's future trajectory. This method achieves high vehicle trajectory prediction accuracy and solves the problem of declining prediction accuracy over long periods using traditional methods. It also exhibits good stability and can effectively improve the driving safety of autonomous vehicles in dynamic environments. Attached Figure Description

[0074] Figure 1 : Overall flowchart of the vehicle future trajectory prediction method based on Deepwalk-LSTM encoding. Detailed Implementation

[0075] The present invention will be further described below with reference to the embodiments. It should be noted that these are merely examples and descriptions of the inventive concept. Those skilled in the art can make various modifications or additions to the specific embodiments described or use similar methods to replace them, as long as they do not deviate from the inventive concept or exceed the scope defined in the claims, they should all be considered to fall within the protection scope of the present invention.

[0076] Example 1:

[0077] like Figure 1 As shown, a method for predicting the future trajectory of a vehicle based on Deepwalk-LSTM encoding includes the following steps:

[0078] S1. Preprocess the raw GPS data to obtain the vehicle's driving trajectory. The specific steps are as follows:

[0079] S1.1 Preprocess the raw GPS data to remove outliers and missing values.

[0080] The dataset used is the 2016 Beijing ride-hailing GPS dataset, spanning from November 1, 2016 to December 30, 2016. Because the original dataset contained many useless attributes, we simplified and cleaned the data. The simplified attributes are shown in Table 1 below:

[0081] Table 1: Simplified Attributes of Data Processing

[0082] VID Vehicle number LON longitude LAT Dimension TIME Recording time ROAD_ID Road number VALID Is it reliable (1 indicates reliable)?

[0083] The simplified data is smoothed, and outliers and unreliable signals are removed.

[0084] S1.2. Using the time window, vehicle ID, and coordinate points in the GPS data, obtain the trajectory point data of each vehicle ID within the time span.

[0085] S1.3 Set thresholds for the data in each frame, including: the number of trajectory points does not exceed the trajectory point number threshold node_max, the distance between trajectory points does not exceed the distance threshold distance_max, and the number of vehicles in each frame does not exceed the vehicle number threshold car_max.

[0086] After obtaining the trajectory point data in step S1.2, the data needs to be segmented according to the road and time frame, and the trajectory points are standardized using the latitude and longitude coordinates of the first trajectory point as the origin. The trajectory data attributes of each time frame after processing are shown in Table 2.

[0087] Table 2: Trajectory data attributes for each time frame

[0088] VID Vehicle number X x-axis Y ordinate TIME_ID Time frame

[0089] S1.4. Perform sliding window sampling on the data processed in step S1.3. Each sample contains 100 frames of real-time vehicle trajectory data. Select the first 50 frames of trajectory data of the historical time step as historical data, and the other 50 frames as label data. Then divide all data into training set, validation set and test set in a ratio of 7:1:2. The training set is used to train the model parameters, the validation set is used to adjust the parameters, and the test set is used to judge the accuracy of the model.

[0090] S2. Convert the trajectory data processed in step S1 into graph data, treating it as continuous nodes. The specific steps are as follows:

[0091] S2.1 Extract the historical trajectory data for each vehicle. The historical trajectory data for each vehicle can be represented as nodes in a graph. , Indicates the first a car, This represents the time step of historical trajectory data. For the first The edge set of the historical trajectories of a vehicle. Indicates historical time step The trajectory point of time and Historical time step trajectory points of time The interrelationship between them.

[0092] S2.2. Based on the node set and edge set constructed in step S2.1, the historical trajectory of the vehicle is represented as graph structure data, and the feature matrix of the node is represented as follows: Each row represents a vehicle. The feature vector of the trajectory point at the corresponding historical time step, with a feature dimension of . .

[0093] S3. Encode the spatiotemporal information of continuous trajectory points for each vehicle using a DeepWalk-LSTM encoder. The specific steps are as follows:

[0094] S3.1. Using the Deepwalk encoder, spatial information is obtained by performing a random walk on the graph structure data constructed according to S2.2 to acquire spatial information of historical trajectories; the graph structure data is then input into the Deepwalk encoder:

[0095] (1),

[0096] In the formula, This represents the historical trajectory feature vector after being encoded by the DeepWalk encoder. The encoded feature vector, This indicates the Deepwalk encoder. This refers to the graph structure data constructed based on S2.2;

[0097] The Deepwalk encoder, specifically, is expressed by the following formula:

[0098] (2),

[0099] (3),

[0100] In the formula, This indicates a random walk in the graph. This represents the sequence of nodes sampled by the random walk. The algorithm can efficiently represent a sequence as a feature vector, providing us with a vector representation of the nodes.

[0101] S3.2. Based on the historical trajectory feature vector obtained in step S3.1 after DeepWalk encoding, the historical trajectory information is time-encoded using an LSTM network to obtain time information; the overall formula is as follows:

[0102] (4),

[0103] In the formula, This represents the historical trajectory feature vector after LSTM encoding. This refers to the encoded feature dimensions.

[0104] S3.3 The specific method of the LSTM encoder is as follows: the weight matrix is ​​fused with the trajectory point feature vector as input data, and the results of the forget gate, input gate, and output gate are output through the activation function as shown in the following formula:

[0105] (5),

[0106] (6), (7),

[0107] In the formula, the input is denoted as After being encoded by DeepWalk, it is located in the historical time step. Vehicle The feature vectors of the trajectory points, LSTM at historical time steps The output is represented as ; and The weight is represented as ; the bias is denoted as . ; in historical time steps At that time, the outputs of the input gate, forget gate, and output gate are denoted as... , , ; It is a non-linear activation function.

[0108] S3.4. Information about the unit state needs to be added through the input gate and tanh layer control to ensure the vehicle... The historical trajectory's time information is captured, and the information added to the unit state is represented as follows:

[0109] (8),

[0110] In the formula, This is a candidate vector used to update the cell state.

[0111] S3.5. Combine the information generated by the input gate and the tanh layer, and update the cell state by summing the dot product of the information added to the cell state and the information from the input gate. Then, obtain the encoding vector through the result of the output gate. The specific formula is as follows:

[0112] (9), (10)

[0113] Finally, the encoded trajectory point vector is obtained by concatenating the time data. .

[0114] S4. Capture the encoded interaction relationships between vehicles through a self-attention mechanism, and then use an LSTM decoder to generate future vehicle trajectories. The specific steps are as follows:

[0115] S4.1 Introducing a self-attention mechanism, by calculating the association weights between each vehicle's trajectory point and other vehicle trajectory points at the same time, and then using the feature values ​​of other vehicle trajectory points and the obtained association weights to update the features of this vehicle trajectory point; in this way, heterogeneous connections can be adaptively captured during the extraction of vehicle trajectory interaction features.

[0116] S4.2. Based on the feature vector representation of the same historical event step obtained by the DeepWalk encoder in step S3, the query matrix, key matrix, and value matrix for capturing vehicle interaction information are then learned through the self-attention module. The specific formulas are as follows:

[0117] (11),

[0118] (12),

[0119] (13)

[0120] In the formula, It is a vector formed by concatenating all vehicle trajectory points at the same historical time step. , , The first The query matrix, key matrix, and value matrix in the self-attention mechanism of group attention mechanism. For activation function, As weight, Represents bias.

[0121] S4.3 Calculate the attention of each vehicle using the query matrix, key-value matrix, and value matrix, as shown in the following formula:

[0122] (14)

[0123] (15)

[0124] (16)

[0125] In the formula, The characteristic score matrix, This is the association weight matrix between different nodes. For the first The output results corresponding to the group attention mechanism.

[0126] S4.4 Utilizing multi-head self-attention mechanism to solve for the degree of association between different nodes can better model the interaction information. Simultaneously, due to the parallel structure of multi-head self-attention, we can appropriately increase the feature dimension for parallel computation, which can both represent more information and improve the model's computation speed. The results of multiple self-attention sets are concatenated along the feature dimension to obtain the multi-head self-attention matrix, as shown below:

[0127] (17)

[0128] In the formula: This represents the feature vector of all trajectory points at each historical event step after the multi-head attention mechanism. For feature dimensions.

[0129] S4.5. Based on the feature vector obtained in step S4.4, the predicted trajectory is obtained through an LSTM decoder. Compared with the traditional fully connected layer, the LSTM decoder captures temporal information. The LSTM decoder formula is shown below:

[0130] (18)

[0131] (19)

[0132] (20)

[0133] (twenty one),

[0134] (twenty two),

[0135] (twenty three),

[0136] In the formula, Indicates a step in historical time Vehicle eigenvectors, The feature vectors are after LSTM processing.

[0137] S4.6 The predicted trajectory is finally obtained through the fully connected layer, and its formula is as follows:

[0138] (twenty four),

[0139] In the formula, Indicates vehicle The predicted trajectory, with a prediction step size of .

[0140] S5. Train and save the model using the average displacement error (ADE) and final displacement error (FDE) loss functions to update the intermediate parameters of the model. The specific steps are as follows:

[0141] S5.1 Input historical data into the built model to output the future predicted trajectory. The deviation between the predicted trajectory and the actual trajectory is represented by the average displacement error (ADE) and the final displacement error (FDE). By minimizing the loss value, the parameters in the model are learned through backpropagation of the error. The formulas for calculating ADE and FDE are as follows:

[0142] (25),

[0143] (26)

[0144] S5.2 During training, when the validation set loss does not decrease after 20 iterations, we terminate training to prevent overfitting and save the model; the historical vehicle trajectories from the test set are input into the saved model, and the model outputs the future vehicle trajectories.

[0145] Graph embedding methods map nodes in a graph from a low-dimensional space to a high-dimensional space, capturing the spatial information of the nodes and representing it as vectors. Graph embedding algorithms can more comprehensively and accurately express the spatial information of vehicle trajectories. Considering the spatiotemporal characteristics of trajectory data and the interaction information between vehicles, this invention proposes a DeepWalk-LSTM encoder model to encode each trajectory point. This model connects trajectory points into a graph structure and uses a DeepWalk graph embedding encoder to extract spatial information, followed by an LSTM encoder to model temporal information. Compared to recurrent neural networks and graph convolutional networks, the DeepWalk-LSTM encoder can extract the spatiotemporal information of the trajectory better. Subsequently, due to the complex interaction information between vehicles, a multi-head attention mechanism is used to model the interaction information between vehicles, and finally, an LSTM decoder outputs the predicted trajectory. This invention's method not only considers the interaction information between vehicles but also the spatiotemporal information of each vehicle's trajectory, solving the problem of decreased prediction accuracy over long periods of time in traditional methods.

[0146] The working principle of this invention is as follows: Vehicle trajectory data exhibits significant spatiotemporal characteristics, and traditional deep learning models such as recurrent neural networks, LSTM, and convolutional neural networks lack sufficient capacity to model them. Two-graph embedding methods can effectively address this problem. This invention first preprocesses the data, then constructs a graph of the continuous trajectory sequence of vehicles on the road, treating each trajectory point as a node in the graph, and establishing edges between consecutive trajectory points. Through graph embedding, we can obtain the spatial information of consecutive nodes, and then use an LSTM network to model the temporal information. After encoding the trajectory data, we only capture the spatiotemporal characteristics of each vehicle itself. Since there are complex interactions between vehicles, to address this issue, this invention introduces a multi-head attention mechanism to model the interactions between vehicles. The attention mechanism learns the differences between vehicles, and then an LSTM decoder decodes the tensor to output the predicted trajectory.

[0147] This invention presents a vehicle future trajectory prediction method based on Deepwalk-LSTM encoding. It is the first to design a vehicle trajectory prediction framework based on a DeepWalk-LSTM encoder, capturing the spatiotemporal characteristics of vehicle trajectory data for effective encoding. By using a multi-head self-attention mechanism, it learns complex interaction information between vehicles and uses an LSTM decoder to perform time-series decoding to output the vehicle's future trajectory. This method achieves high vehicle trajectory prediction accuracy and solves the problem of declining prediction accuracy over long periods using traditional methods. It also exhibits good stability and can effectively improve the driving safety of autonomous vehicles in dynamic environments.

[0148] The above is an exemplary description of the invention. Obviously, the specific implementation of the invention is not limited to the above-described manner. Any non-substantial improvement made using the inventive concept and technical solution of the invention, or the direct application of the inventive concept and technical solution to other situations without modification, is within the protection scope of the invention.

Claims

1. A method for predicting the future trajectory of a vehicle based on Deepwalk-LSTM encoding, characterized in that, Includes the following steps: S1. Preprocess the raw GPS data to obtain the vehicle's driving trajectory; S2. Treat the trajectory data processed in step S1 as continuous nodes and convert it into graph data; S3. Encode the spatiotemporal information of the continuous trajectory points of each vehicle using a DeepWalk-LSTM encoder. S4. Capture the coded interaction relationships between vehicles through a self-attention mechanism, and then use an LSTM decoder to generate future vehicle trajectories. S5. The model is trained and saved using the average displacement error (ADE) and final displacement error (FDE) loss functions to update the intermediate parameters of the model. After training, the historical trajectory data of the vehicle is input into the saved model, and the output of the model is the future trajectory of the vehicle. Step S4 specifically includes: S4.1 Introducing a self-attention mechanism, by calculating the association weight between each vehicle's trajectory point and other vehicle trajectory points at the same time, and then using the feature values ​​of other vehicle trajectory points and the obtained association weights to update the features of this vehicle trajectory point; in this way, heterogeneous connections can be adaptively captured during the extraction of vehicle trajectory interaction features. S4.

2. Based on the feature vector representation of the same historical event step obtained by the DeepWalk encoder in step S3, the query matrix, key matrix, and value matrix for capturing vehicle interaction information are then learned through the self-attention module. The specific formulas are as follows: (11), (12), (13), In the formula, It is a vector formed by concatenating all vehicle trajectory points at the same historical time step. , , The first The query matrix, key matrix, and value matrix in the self-attention mechanism of group attention mechanism. For activation function, As weight, , , Let represent the weights of the query matrix, key matrix, and value matrix of the c-th group, respectively. Represents bias. , , These represent the bias terms of the query matrix, key matrix, and value matrix of the c-th group, respectively. S4.3 Calculate the attention of each vehicle using the query matrix, key-value matrix, and value matrix, as shown in the following formula: (14), (15), (16), In the formula, Let c be the feature score matrix of the attention group. This represents the transpose of the key matrix. Represents the square root of the feature dimension; This is the association weight matrix between different nodes. Let i represent the feature scores of vehicles i and j, and n represent the total number of vehicles in the current frame; For the first The output of the group attention mechanism Represents the correlation weight matrix; S4.

4. Concatenate the results of multiple self-attention sets along the feature dimension to obtain a multi-head self-attention matrix, as shown below: (17), In the formula: This represents the global interaction feature matrix obtained after multi-head self-attention encoding. , , , , These represent the output features of the self-attention mechanism for groups 1, 2, 3, c, and n, respectively. S4.

5. Based on the feature vector obtained in step S4.4, the predicted trajectory is obtained through an LSTM decoder. The LSTM decoder formula is shown below: (18), (19), (20), (21), (22), (23), In the formula, , , These represent steps in historical time. At that time, the outputs of the input gate, forget gate, and output gate, It is a non-linear activation function; and Represented as weights, These represent the weights of the hidden states of the decoder input gates, respectively. The weights of the hidden states of the decoder's forget gate are represented by their values. The weights represent the hidden states of the decoder's output gate. The weights of the hidden states represent the candidate state vectors of the decoder units. , , , , and , respectively, represent the weights of the decoder's input gate, forget gate, and output gate. The weights represent the candidate state vectors of the decoder unit; the biases are denoted as... , This represents the bias term of the decoder input gate. This represents the bias term of the decoder's forget gate. This represents the bias term of the decoder output gate. The bias term represents the candidate state vector of the decoder unit; This indicates that the LSTM decoder is at time step The updated unit status, This represents a candidate vector used to update the cell state. This indicates that the LSTM decoder is at time step The updated cell state is -1. Indicate decoder -1 hides the state; This represents the feature vector of all trajectory points at each historical event step after the multi-head attention mechanism. Indicates a step in historical time Vehicle eigenvectors, The feature vectors after LSTM; S4.6 The predicted trajectory is finally obtained through the fully connected layer, and its formula is as follows: (24), In the formula, Indicates vehicle The predicted trajectory, with a prediction step size of ; Indicates a step in historical time Vehicle The interactive feature vector is encoded by multi-head self-attention and then indexed / transformed.

2. The method for predicting future vehicle trajectories based on Deepwalk-LSTM encoding according to claim 1, characterized in that, Step S1 specifically includes: S1.1 Smooth the raw GPS data to remove outliers and missing values; S1.2 Obtain trajectory point data for each vehicle ID using the time window, vehicle ID, and coordinate points in the GPS data; S1.3 Set thresholds for the data in each frame, including: the number of trajectory points does not exceed the trajectory point number threshold node_max, the distance between trajectory points does not exceed the distance threshold distance_max, and the number of vehicles in each frame does not exceed the vehicle number threshold car_max. S1.

4. Perform sliding window sampling on the processed data, where each sample contains real-time trajectory data of the vehicle. The trajectory point data with historical time steps is selected as historical data, and the other part is used as label data. Then, divide all the data into training set, validation set and test set according to a certain ratio. The training set is used to train the model parameters, the validation set is used to adjust the parameters, and the test set is used to judge the accuracy of the model.

3. The method for predicting future vehicle trajectories based on Deepwalk-LSTM encoding according to claim 1, characterized in that, Step S2 specifically includes: S2.1 Extract the historical trajectory data for each vehicle. The historical trajectory data for each vehicle can be represented as nodes in a graph. , Indicates the first a car, This represents the time step of historical trajectory data; For the first The edge set of the historical trajectories of a vehicle. Indicates historical time step The trajectory point of time and Historical time step trajectory points of time The interrelationship between them; S2.

2. Based on the node set and edge set constructed in step S2.1, the historical trajectory of the vehicle is represented as graph structure data, and the feature matrix of the node is represented as follows: Each row represents a vehicle. The feature vector of the trajectory point at the corresponding historical time step, with a feature dimension of . .

4. The method for predicting future vehicle trajectories based on Deepwalk-LSTM encoding according to claim 3, characterized in that, Step S3 specifically includes: S3.

1. Using the Deepwalk encoder, spatial information is obtained by performing a random walk on the graph structure data constructed according to S2.2 to acquire spatial information of historical trajectories; the graph structure data is then input into the Deepwalk encoder: (1), In the formula, This represents the historical trajectory feature vector after being encoded by the DeepWalk encoder. The encoded feature vector, This indicates the Deepwalk encoder. This refers to the graph structure data constructed based on S2.2; The Deepwalk encoder, specifically, is expressed by the following formula: (2), (3), In the formula, This indicates a random walk in the graph. This represents the sequence of nodes sampled by the random walk. The algorithm can effectively represent a sequence as a feature vector, providing us with a vector representation of the nodes; S3.

2. Based on the historical trajectory feature vector obtained in step S3.1 after DeepWalk encoding, the historical trajectory information is time-encoded using an LSTM network to obtain time information; the overall formula is as follows: (4), In the formula, This represents the historical trajectory feature vector after LSTM encoding. The encoded feature dimension; S3.3 The specific method of the LSTM encoder is as follows: the weight matrix is ​​used as input data and fused with the feature vector of the trajectory points, and the results of the forget gate, input gate, and output gate are output through the activation function as shown in the following formula: (5), (6), (7), In the formula, the input is denoted as After being encoded by DeepWalk, it is located in the historical time step. Vehicle The feature vectors of the trajectory points, LSTM at historical time steps The output is represented as ; and The weight is represented as ; the bias is denoted as . ; in historical time steps At that time, the outputs of the input gate, forget gate, and output gate are denoted as... , , ; It is a non-linear activation function; S3.

4. Information about the unit state needs to be added through the input gate and tanh layer control to ensure the vehicle... The historical trajectory's time information is captured, and the information added to the unit state is represented as follows: (8), In the formula, This is a candidate vector used to update the cell state; S3.

5. Combine the information generated by the input gate and the tanh layer, and update the cell state by summing the dot product of the information added to the cell state and the information from the input gate. Then, obtain the encoding vector through the result of the output gate. The specific formula is as follows: (9), (10), Finally, the encoded trajectory vector is obtained by concatenating the time data. .

5. The method for predicting future vehicle trajectories based on Deepwalk-LSTM encoding according to claim 4, characterized in that, Step S5 is as follows: S5.1 Input historical data into the built model to output the future predicted trajectory. The deviation between the predicted trajectory and the actual trajectory is represented by the average displacement error (ADE) and the final displacement error (FDE). By minimizing the loss value, the parameters in the model are learned through backpropagation of the error. The formulas for calculating ADE and FDE are as follows: (25), (26), In the formula, This represents the predicted trajectory coordinates of the i-th vehicle at time step t. This represents the actual trajectory coordinates of the i-th vehicle at time step t; S5.2 During training, when the validation set loss does not decrease after 20 iterations, we terminate training to prevent overfitting and save the model; the historical vehicle trajectories from the test set are input into the saved model, and the model outputs the future vehicle trajectories.