Automatic driving track prediction method based on driving style
Through the method of collaborative work of multiple modules, the graph model and the space-time graph Transformer model are used to process the interaction and time dependence between vehicles, and the style attention module is combined to capture the changes in trajectory characteristics under different driving styles, solving the accuracy of the existing vehicle trajectory prediction model and improving the trajectory prediction accuracy.
Patent Information
- Application Number
- CN202411653435.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The existing vehicle trajectory prediction model fails to fully consider the interaction and time dependence between vehicles, and fails to effectively integrate the influence of different driving styles, resulting in poor accuracy of prediction results.
Through the method of collaborative work of multiple modules, the graph model is used to extract driving characteristics from vehicle trajectory data and obtain different driving style characteristics in classification. The space-time graph Transformer model is used to process the interaction and time dependence between vehicles, and a style attention module is constructed to capture the changes in trajectory characteristics under different driving styles, dynamically adjust the allocation of trajectory characteristics attention, and generate the future trajectory of the vehicle.
The trajectory prediction accuracy of autonomous driving vehicles in complex traffic scenarios is improved, and the actual driving behavior can be more accurately reflected, and the prediction results are optimized in different driving environments.
Smart Images

Figure CN119577968A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of autonomous driving and relates to an autonomous driving trajectory prediction method based on driving style. Background Art
[0002] As one of the important transformative technologies of intelligent transportation systems, autonomous driving technology has the unique potential to provide new solutions to long-standing traffic problems such as solving traffic safety problems, alleviating urban traffic congestion, and improving energy efficiency. Vehicle trajectory prediction relies on the rapid development of autonomous driving technology, the continuous improvement of intelligent transportation systems, and the urgent need for traffic safety and efficiency. By accurately predicting the driving trajectory of vehicles, potential dangerous situations can be identified in a timely manner and corresponding safety measures can be taken, thereby reducing the incidence of traffic accidents. Due to the diversity and complexity of driving styles and vehicle interactions, the existing trajectory prediction models still need to be further improved. The research on vehicle trajectory prediction is of great significance to promoting the development of intelligent transportation systems and autonomous driving technology. Therefore, the research on vehicle trajectory prediction has high application value and is an important research direction for autonomous driving.
[0003] In the early research on vehicle trajectory prediction algorithms, due to the computing power limitations of the on-board computing platform, many studies generally adopted physical methods based on kinematic and dynamic models to predict the trajectories of surrounding vehicles. The traditional method of trajectory prediction takes into account only a single factor and cannot use environmental information and spatiotemporal interaction information for modeling, so that it can achieve good accuracy in short-term trajectory prediction. In the long-term trajectory prediction, it will cause a large deviation between the predicted position and the actual position, and the prediction accuracy is not high enough. Given the advantages of deep learning such as excellent ability to process big data, ability to extract complex features of targets, and capture long-term dependencies, vehicle trajectory prediction has gradually shifted from traditional methods to methods based on deep models, such as graph neural networks and attention mechanisms.
[0004] Existing vehicle trajectory prediction models have broken through the limitations of simple scenarios and can also perform well in complex scenarios with strong interactivity. However, existing methods do not fully consider the interaction and time dependency between vehicles, nor do they effectively integrate the impact of different driving styles, resulting in poor accuracy of prediction results. Different driving styles will cause vehicles to perform different driving behaviors in the same traffic scenario, which directly affects the vehicle's driving trajectory. Considering driving style in vehicle trajectory prediction can more accurately predict the vehicle's personalized trajectory. How to use the vehicle's historical motion state characteristics, the interaction characteristics between vehicles, and the driving style characteristics to accurately predict the vehicle's future trajectory has attracted much attention and has become one of the key issues that need to be urgently addressed in autonomous driving. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide an automatic driving trajectory prediction method based on driving style, which improves the trajectory prediction accuracy of automatic driving vehicles in complex traffic scenes through the collaborative work of multiple modules. The present invention uses a graphical model to extract the driving characteristics of the vehicle from the vehicle trajectory data, and classifies different driving style characteristics. In addition, the feature information of the time and space dimensions is captured in a hierarchical manner. In the spatial dimension, the spatial self-attention sublayer is used to capture the interaction between adjacent vehicles in the scene. In the temporal dimension, the temporal convolution sublayer is used to extract the temporal dependency of consecutive frames. The style attention module generates attention weights according to different driving styles, and finally guides the decoding module to generate the future trajectory of the vehicle.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A method for predicting an automatic driving trajectory based on a driving style, the method comprising the following steps:
[0008] S1: Collect historical trajectory data of the vehicle through sensors and vehicle-mounted systems, and pre-process the historical trajectory data of the vehicle;
[0009] S2, using vehicle motion information to model the driving scene as an undirected spatiotemporal traffic graph G;
[0010] S3, using a graphical model to extract the driver's driving characteristics from the vehicle trajectory data, and obtaining different driving style characteristics through Softmax classification;
[0011] S4, using the spatiotemporal graph Transformer model to process the interaction and time dependency between vehicles, and obtain trajectory features that contain the coupling relationship between time and space information;
[0012] S5. Construct a style attention module to capture the changes in trajectory features under different driving styles, dynamically adjust the distribution of trajectory feature attention, obtain the changes in trajectory features under different driving styles, and then predict the future trajectory of the vehicle.
[0013] Further, in step S1, historical trajectory data of the vehicle is collected through sensors and vehicle-mounted systems, wherein the historical trajectory data of the vehicle includes location information, speed, and acceleration of the vehicle;
[0014] The vehicle trajectory information is divided into sequence data, and according to the positioning of the vehicle in the global coordinate system and the positioning of the surrounding traffic participants in their respective coordinate systems, the coordinates of the surrounding traffic participants are mapped to the global coordinate system to generate data segments in frames;
[0015] Data preprocessing operations include: denoising, standardization and interpolation.
[0016] Furthermore, in step S2, the driving scene is modeled as an undirected spatiotemporal traffic graph using vehicle motion information:
[0017] G=(V,E)
[0018] in, represents the set of vehicle nodes, represents the i-th vehicle at time t, N and T represent the number of vehicles and the historical trajectory time period respectively; E represents the edge set connecting the nodes;
[0019] The edge set connecting the nodes includes the spatial edge set E s and the time edge set E t , which are respectively expressed as:
[0020]
[0021]
[0022] The spatial edge set represents the virtual connection relationship between different vehicles in the same frame, and the temporal edge set represents the temporal relationship between consecutive frames of the same vehicle.
[0023] Further, in step S3, the degree centrality and closeness centrality are used to measure the possibility and intensity of different driving behaviors, thereby reflecting the driver's driving style. and closeness centrality Respectively expressed as:
[0024]
[0025]
[0026] Among them, v j represents vehicle j, N i (t) represents the set of neighboring vehicles of the i-th vehicle, d ij represents the Euclidean distance path between vehicle i and vehicle j;
[0027] According to the spatiotemporal traffic diagram at time t, the selected features Divided into motion state and driving style status The state of a vehicle node is determined by the hidden states of its neighbor nodes Characteristics of surrounding vehicle nodes and the hidden state of the feature Decision, expressed as:
[0028]
[0029]
[0030]
[0031] Among them, σ represents the activation function, W s , W n and W ns are three trainable weight matrices;
[0032] The hidden state of the vehicle is obtained by expanding the recursion at a fixed time step, using Softmax to estimate the probability distribution of the driving style, and determining the style category, and the above different driving styles are processed into m by one-hot encoding. s , using (1,0) to represent an aggressive vehicle and (0,1) to represent a conservative vehicle. The calculation formula is:
[0033]
[0034] m s =P(c k |H i )=Softmax(H i )
[0035] in, Respectively represent the target vehicle at t and tt obs The hidden state of the neighbor node at the moment, j∈N(v i ) represents the set of vehicles in the neighborhood of the i-th vehicle, tanh(·) represents the hyperbolic tangent function, H i represents the feature set, P(c k |H i ) represents the probability distribution of driving style.
[0036] Further, in step S4, the following steps are included:
[0037] S41. The historical feature vector of each vehicle is embedded into a higher dimension through a fully connected layer to obtain an embedded vector Among them, the relative position information between trajectories is embedded through position encoding;
[0038] S42, using a multi-head self-attention mechanism to aggregate information from different feature subspaces, where after v aggregations, a fully connected layer is used to merge the output of each attention head to form the final multi-head attention output;
[0039] S43, construct a spatial self-attention layer to capture the interactive information in the spatial dimension;
[0040] S44. Construct a temporal convolutional layer to capture the dependencies in the time dimension, and interact with the temporal dependencies to fuse the spatiotemporal features.
[0041] Further, in step S41, first, the fully connected layer converts the input motion state of the i-th vehicle at time t into Convert to hidden vector
[0042] Secondly, the relative position information between the input trajectories is encoded by position encoding. The position encoding method is:
[0043]
[0044]
[0045] Among them, pos is the position information, ξ is the dimension, total is the total dimension of the input embedding;
[0046] A mask sublayer is used in the position encoder to ensure that the prediction at time t depends only on the known input before time t, and the final input embedding vector is
[0047] In step S42, the final multi-head attention output is expressed as:
[0048]
[0049] Among them, W S is a learnable weight matrix; For the attention of each head;
[0050] In step S43, the spatial self-attention layer captures the relationship between input features based on the multi-head scaled dot product attention mechanism, and the process is:
[0051] Characteristics of the vehicle at time t As input, first learn the feature vector at each moment:
[0052]
[0053]
[0054]
[0055] in, are the query vector, key vector, and value vector of the i-th vehicle at time t, respectively. q , W k , W v All are learnable weight matrices;
[0056] right and Perform a scaled dot product, normalize the weights of the spatial edges between vehicle i and its surrounding vehicles j, and sum them up to get the attention weight of a single attention head of node i The calculation method is:
[0057]
[0058] Among them, ξ k Represents the feature vector dimension; obtains the feature ω according to the attention weight;
[0059] In step S44, the temporal convolutional layer takes the feature ω as input and obtains an input graph of size (T, N, C) after normalization, where T is the number of historical frames, N is the number of vehicle nodes, and C is the embedding dimension. After the temporal convolutional layer, residual connection and normalization are introduced to obtain the final trajectory feature ω′:
[0060]
[0061]
[0062] Among them, M i Represents the final output of multi-head attention, W T represents the learnable weight matrix, is the attention of each head, concat(·) is the concatenation function; Q i represents the query vector matrix, represents the key vector matrix, d k represents the feature vector dimension, V i represents the value vector matrix and softmax(·) is the softmax activation function.
[0063] Further, in step S5, the following steps are included:
[0064] S51, generating dynamic attention weights according to different driving style characteristics through a style attention module;
[0065] S52. The decoding module is combined with the driving style attention mechanism to dynamically adjust the weight distribution of trajectory feature attention according to different driving styles and output accurate future trajectories.
[0066] Further, in step S51, the trajectory features, driving style features and interaction features are processed by the style attention module, and a feedforward neural network is introduced to learn the weights of the attention module, and the driving style feature m is converted into s , the hidden state vector p of the predicted trajectory at the last moment t-1 And the hidden state vector of the historical trajectory The three vectors are used as inputs of the feedforward neural network to learn the three and the attention weights The nonlinear relationship between:
[0067]
[0068] in, and are three learnable weight matrices; tanh(·) is the hyperbolic tangent function.
[0069] Further, in step S52, trajectory prediction is performed through a decoder, the decoder includes two multi-head attention sublayers and a feed-forward fully connected sublayer; the multi-head self-attention sublayer performs self-attention calculation on the input sequence through multiple attention heads to learn the local relationship of the vehicle trajectory;
[0070] Add a mask mechanism to ensure that the prediction of the trajectory at time t only depends on the output before time t;
[0071] Residual connections are introduced before normalization. The feedforward fully connected sublayer integrates the output of the previous sublayer in a fully connected manner, then inputs it into the fully connected linear layer, and obtains the predicted trajectory result through the SoftMax layer:
[0072]
[0073] Among them, γ t represents the fused features, and Linear(·) represents the linear operation.
[0074] Furthermore, the L2 loss between the predicted trajectory and the true trajectory is used as the loss function for decoder training:
[0075]
[0076] Among them, y t represents the true trajectory, represents the predicted trajectory, t = t obs +1 indicates the predicted start time.
[0077] The beneficial effects of the present invention are:
[0078] The present invention uses real driving data in real-life scenarios for training and learning to improve the accuracy of vehicle trajectory prediction. By considering driving style, actual driving behavior can be more accurately reflected. A spatial attention module and a temporal convolution module are constructed to calculate the relative importance of adjacent vehicles using the local position features of the vehicle and obtain the correlation of features in the time dimension. In addition, the introduction of the style attention module makes it possible to dynamically adjust trajectory features, thereby optimizing prediction results under different driving environments. The present invention improves the accuracy of vehicle trajectory prediction, shows broad application prospects, and provides strong support for future intelligent transportation systems.
[0079] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0081] Figure 1 is an overall flow chart of the trajectory prediction method of the present invention;
[0082] Figure 2 A schematic diagram of a vehicle prediction coding module of the present invention;
[0083] Figure 3 Schematic diagram of spatial attention and temporal attention of the present invention;
[0084] Figure 4 It is a schematic diagram of the vehicle prediction decoding module of the present invention. DETAILED DESCRIPTION
[0085] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0086] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0087] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0088] See also Figure 1 to Figure 4 , which is a driving style-based autonomous driving trajectory prediction method.
[0089] Example
[0090] This embodiment provides a specific implementation method of an automatic driving trajectory prediction method based on driving style, which includes: obtaining historical trajectory information of the vehicle and preprocessing the vehicle trajectory, extracting driving style features, spatial interaction features and time-dependent features, processing the fusion features, and obtaining the predicted trajectory result of the vehicle. The specific process is as follows Figure 1 As shown, the following steps are included:
[0091] S1: Collect historical trajectory data of the vehicle through sensors and vehicle systems, including location information, speed, acceleration and other information, and pre-process the historical trajectory information of the vehicle;
[0092] S2, using vehicle motion information to model the driving scene as an undirected spatiotemporal traffic graph G;
[0093] S3, using a graphical model to extract the driver's driving characteristics from the vehicle trajectory data, and obtaining different driving styles through Softmax classification;
[0094] S4, using the spatiotemporal graph Transformer model to process the interaction and time dependency between vehicles and obtain the coupling relationship between time and space information;
[0095] S5. Construct a style attention module to capture the changes in trajectory features under different driving styles, dynamically adjust the distribution of trajectory feature attention, and obtain the changes in trajectory features under different driving styles, so as to more accurately predict the future trajectory of the vehicle.
[0096] In step S1 of this embodiment, historical trajectory data of the vehicle, including position information, speed, acceleration, etc., is collected through sensors and vehicle systems, and the vehicle trajectory information is divided into sequence data. According to the positioning of the vehicle in the global coordinate system and the positioning of the surrounding traffic participants in their respective coordinate systems, the coordinates of the surrounding traffic participants are mapped to the global coordinate system, thereby generating data segments in frames.
[0097] At the same time, the vehicle trajectory data is preprocessed by denoising, standardization and interpolation to ensure the continuity and accuracy of the data.
[0098] In step S2 of this embodiment, the driving scene is modeled as an undirected spatiotemporal traffic graph G=(V,E) using vehicle motion information, where: represents the set of vehicle nodes, represents the i-th vehicle at time t, E represents the edge set connecting the nodes, and E consists of two parts: the spatial edge set and time edge set The spatial edge set represents the virtual connection relationship between different vehicles in the same frame, and the temporal edge set represents the temporal relationship between consecutive frames of the same vehicle.
[0099] In step S3 of this embodiment, the following process is specifically included:
[0100] Using degree centrality and closeness centrality, we measure the likelihood and intensity of driving behaviors such as speeding and overtaking, thus reflecting the driver's driving style.
[0101] Specifically, using degree centrality and closeness centrality Two measurement methods are used to measure the possibility and intensity of driving behaviors such as speeding and overtaking, thereby reflecting the driver's driving style. j represents vehicle j, N i (t) represents the set of neighboring vehicles of the i-th vehicle, d ij Represents the Euclidean distance path between node i and node j.
[0102] According to the spatiotemporal traffic diagram at time t, the selected features Divided into motion state and driving style status The state of a vehicle node is determined by the hidden states of its neighbor nodes Characteristics of surrounding vehicle nodes and the hidden state of the feature Decision, expressed as: Among them, σ represents the activation function, W s , W n and W ns are three trainable weight matrices;
[0103] The hidden state of the vehicle is obtained by expanding the recursion at a fixed time step, using Softmax to estimate the probability distribution of the driving style, and determining the style category, and the above different driving styles are processed into m by one-hot encoding. s , using (1,0) to represent an aggressive vehicle and (0,1) to represent a conservative vehicle. The calculation formula is:
[0104]
[0105] m s =P(c k |H i )=Softmax(H i )
[0106] in, Respectively represent the target vehicle at t and tt obs The hidden state of the neighbor node at the moment, j∈N(v i ) represents the set of vehicles in the neighborhood of the i-th vehicle, tanh(·) represents the hyperbolic tangent function, H i represents the feature set, P(c k |H i ) represents the probability distribution of driving style.
[0107] In step S4 of this embodiment, the historical motion information and vehicle motion state information of all vehicles in the scene are embedded and encoded through the trajectory input encoding module. In the spatial dimension, the spatial self-attention sublayer is used to capture the interaction between adjacent vehicles in the scene; in the temporal dimension, the temporal convolution sublayer is used to extract the temporal dependency of consecutive frames; the multi-head self-attention mechanism is used to aggregate information from different feature subspaces; the spatiotemporal Transformer model is used to encode the spatial interaction and temporal dependency between vehicles to obtain a hidden vector containing spatiotemporal features, and the position encoding module and the spatial self-attention layer are used to improve the encoding effect to ensure that the spatiotemporal features of the trajectory input sequence are fully captured. Figure 2 As shown, it includes the following steps:
[0108] S41. The historical feature vector of each vehicle is embedded into a higher dimension through a fully connected layer. The fully connected layer converts the input motion state of the i-th vehicle at time t into Convert to hidden vector Since the model input uses parallel input, the input information does not contain position information. In order to obtain the relative position information between the input trajectories, it is necessary to build a position encoding module and add position information to the input embedding. The encoding method is: Among them, pos is the position information, ξ is the dimension, total is the total dimension of the input embedding. In addition, a mask sublayer is used in the encoder to ensure that the prediction at time t can only depend on the known input before time t. The final input embedding vector is
[0109] S42. In order to enhance the modeling of complex interactive relationships from multiple perspectives, a multi-head self-attention mechanism is used to aggregate information from different feature subspaces. This process is performed τ times, and the output of each attention head is merged using a fully connected layer to form the final multi-head attention output:
[0110]
[0111] Among them, W S is a learnable weight matrix; For the attention of each head;
[0112] S43, construct a spatial self-attention layer to capture the interaction information in the spatial dimension, and a temporal convolution layer to capture the dependency in the temporal dimension. The two sub-layers are cross-stacked to process the interaction and temporal dependency of vehicles and fuse spatiotemporal features. The spatial self-attention layer is based on a multi-head scaling dot product attention mechanism to capture the relationship between input features. The features of the vehicle at time t As input, we obtain the spatial interactions between vehicles, such as Figure 3 As shown. First, learn the eigenvectors at each moment. right and Perform a scaled dot product, normalize the weights of the spatial edges between vehicle i and its surrounding vehicles j, and sum them up to get the attention weight of a single attention head of node i The calculation method is: The above three vectors are the query vectors of the i-th vehicle at time t Key Vector Value vector W q , W k , W v are three learnable weight matrices, ξ k Represents the feature vector dimension. The feature ω is obtained according to the attention weight.
[0113] S44. Use the temporal convolution module to extract the correlation of vehicle spatial features in the time dimension, and then obtain the spatiotemporal feature representation between vehicles. Use the temporal convolution module to expand the receptive field and capture the temporal dependency of local features. The temporal convolution layer takes the above processed features as input and obtains an input graph of size (T, N, C) after normalization, where T is the number of historical frames, N is the number of vehicle nodes, and C is the embedding dimension. After the temporal convolution layer, residual connections and normalization are introduced. Temporal self-attention uses a multi-head self-attention mechanism, which is similar to spatial self-attention, except that the temporal dimension correlation of each vehicle node is calculated independently.
[0114]
[0115]
[0116] Among them, M i Represents the final output of multi-head attention, W T represents the learnable weight matrix, is the attention of each head, concat(·) is the concatenation function; Q i represents the query vector matrix, represents the key vector matrix, d k represents the feature vector dimension, V i represents the value vector matrix and softmax(·) is the softmax activation function.
[0117] In step S5 of this embodiment, the trajectory decoding module decodes the acquired driving style feature vector and the spatiotemporal feature vector of the trajectory to predict the future trajectory of the vehicle, such as Figure 4 As shown, the specific steps include:
[0118] S51, generating dynamic attention weights according to different driving style characteristics to affect the prediction of the trajectory decoding module to adapt to the driving behavior differences caused by different driving styles;
[0119] Specifically, in order to consider the coupling relationship between features, a style attention module is established so that it can select more critical and useful information from a large number of feature vectors for trajectory prediction. When predicting the future trajectory at each moment, the prediction model can dynamically adjust the distribution of trajectory feature attention probability according to different driving styles, rather than treating the trajectory features at all moments in the same way. In this way, the model can better capture the changes in trajectory features under different driving styles, thereby more accurately predicting future trajectories. In the learning process, a feedforward neural network is introduced to learn the weights of the attention module, which takes the driving style feature m as the input. s , the hidden state vector p of the predicted trajectory at the last moment t-1And the hidden state vector of the historical trajectory The three vectors are used as inputs of the feedforward neural network to learn the three and the attention weights The nonlinear relationship between:
[0120]
[0121] in, and are three learnable weight matrices; tanh(·) is the hyperbolic tangent function.
[0122] S52, the decoding module combines the driving style attention mechanism to dynamically adjust the weight distribution of trajectory feature attention according to different driving styles and output accurate future trajectories;
[0123] Specifically, the decoder consists of three sublayers, including two multi-head attention sublayers and a feedforward fully connected sublayer. The multi-head self-attention sublayer performs self-attention calculations on the input sequence through multiple attention heads. Self-attention is used to learn the local relationship of the vehicle trajectory, thereby capturing the dependencies in the input trajectory sequence. In order to predict the trajectory at time t only based on the output before time t, a masking mechanism is added so that the prediction does not depend on the output after time t, ensuring that the predicted trajectory sequence does not expose future information at time t. In addition, residual connections are introduced before normalization, so that the network can better adapt to the characteristics of the input sequence when processing complex tasks. The feedforward fully connected sublayer integrates the output of the previous sublayer in a fully connected manner, and then inputs it into the fully connected linear layer, and obtains the predicted trajectory result through the SoftMax layer: in, represents the fused features, and Linear(·) represents the linear operation.
[0124] S53. Use the L2 loss between the predicted trajectory and the true trajectory as the loss function for network training:
[0125]
[0126] Among them, y t represents the true trajectory, represents the predicted trajectory, t = t obs +1 indicates the predicted start time.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for predicting automatic driving trajectory based on driving style, characterized in that: The prediction method comprises the following steps: S1: Collect historical trajectory data of the vehicle through sensors and vehicle-mounted systems, and pre-process the historical trajectory data of the vehicle; S2, using vehicle motion information to model the driving scene as an undirected spatiotemporal traffic graph G; S3, using a graphical model to extract the driver's driving characteristics from the vehicle trajectory data, and obtaining different driving style characteristics through Softmax classification; S4, using the spatiotemporal graph Transformer model to process the interaction and time dependency between vehicles, and obtain trajectory features that contain the coupling relationship between time and space information; S5. Construct a style attention module to capture the changes in trajectory features under different driving styles, dynamically adjust the distribution of trajectory feature attention, obtain the changes in trajectory features under different driving styles, and then predict the future trajectory of the vehicle.
2. The method for predicting automatic driving trajectory based on driving style according to claim 1, characterized in that: In step S1, historical trajectory data of the vehicle is collected through sensors and vehicle systems, wherein the historical trajectory data of the vehicle includes location information, speed, and acceleration of the vehicle; The vehicle trajectory information is divided into sequence data, and according to the positioning of the vehicle in the global coordinate system and the positioning of the surrounding traffic participants in their respective coordinate systems, the coordinates of the surrounding traffic participants are mapped to the global coordinate system to generate data segments in frames; Data preprocessing operations include: denoising, standardization and interpolation.
3. The method for predicting automatic driving trajectory based on driving style according to claim 1, characterized in that: In step S2, the driving scene is modeled as an undirected spatiotemporal traffic graph using vehicle motion information: G=(V,E) in, represents the set of vehicle nodes, represents the i-th vehicle at time t, N and T represent the number of vehicles and the historical trajectory time period respectively; E represents the edge set connecting the nodes; The edge set connecting the nodes includes the spatial edge set E s and the time edge set E t , which are respectively expressed as: The spatial edge set represents the virtual connection relationship between different vehicles in the same frame, and the temporal edge set represents the temporal relationship between consecutive frames of the same vehicle.
4. The method for predicting automatic driving trajectory based on driving style according to claim 3, characterized in that: In step S3, the degree centrality and closeness centrality are used to measure the possibility and intensity of different driving behaviors, thereby reflecting the driver's driving style. and closeness centrality Respectively expressed as: Among them, v j represents vehicle j, N i (t) represents the set of neighboring vehicles of the i-th vehicle, d ij represents the Euclidean distance path between vehicle i and vehicle j; According to the spatiotemporal traffic diagram at time t, the selected features Divided into motion state and driving style status The state of a vehicle node is determined by the hidden states of its neighbor nodes Characteristics of surrounding vehicle nodes and the hidden state of the feature Decision, expressed as: Among them, σ represents the activation function, W s , W n and W ns are three trainable weight matrices; The hidden state of the vehicle is obtained by expanding the recursion at a fixed time step, using Softmax to estimate the probability distribution of the driving style, and determining the style category, and the above different driving styles are processed into m by one-hot encoding. s , using (1,0) to represent an aggressive vehicle and (0,1) to represent a conservative vehicle. The calculation formula is: m s =P(c k |H i )=Softmax(H i ) in, They represent the target vehicle at t and tt respectively. obs The hidden state of the neighbor node at the moment, j∈N(v i ) represents the set of vehicles in the neighborhood of the i-th vehicle, tanh(·) represents the hyperbolic tangent function, H i represents the feature set, P(c k |H i ) represents the probability distribution of driving style.
5. The method for predicting automatic driving trajectory based on driving style according to claim 4, characterized in that: In step S4, the following steps are included: S41. The historical feature vector of each vehicle is embedded into a higher dimension through a fully connected layer to obtain the embedded vector h t i , where the relative position information between trajectories is embedded through position encoding; S42, using a multi-head self-attention mechanism to aggregate information from different feature subspaces, where after τ aggregations, a fully connected layer is used to merge the output of each attention head to form the final multi-head attention output; S43, construct a spatial self-attention layer to capture the interactive information in the spatial dimension; S44. Construct a temporal convolutional layer to capture the dependencies in the time dimension, and interact with the temporal dependencies to fuse the spatiotemporal features.
6. The method for predicting automatic driving trajectory based on driving style according to claim 5, characterized in that: In step S41, first, the fully connected layer converts the input motion state of the i-th vehicle at time t into Convert to hidden vector Secondly, the relative position information between the input trajectories is encoded by position encoding. The position encoding method is: Among them, pos is the position information, ξ is the dimension, total is the total dimension of the input embedding; A mask sublayer is used in the position encoder to ensure that the prediction at time t depends only on the known input before time t, and the final input embedding vector is obtained as In step S42, the final multi-head attention output is expressed as: Among them, W S is a learnable weight matrix; For the attention of each head; In step S43, the spatial self-attention layer captures the relationship between input features based on the multi-head scaled dot product attention mechanism, and the process is: Characteristics of the vehicle at time t As input, first learn the feature vector at each moment: in, are the query vector, key vector, and value vector of the i-th vehicle at time t, respectively. q , W k , W v All are learnable weight matrices; right and Perform a scaled dot product, normalize the weights of the spatial edges between vehicle i and its surrounding vehicles j, and sum them up to get the attention weight of a single attention head of node i The calculation method is: Among them, ξ k Represents the feature vector dimension; obtains the feature ω according to the attention weight; In step S44, the temporal convolutional layer takes the feature ω as input and obtains an input graph of size (T, N, C) after normalization, where T is the number of historical frames, N is the number of vehicle nodes, and C is the embedding dimension. After the temporal convolutional layer, residual connection and normalization are introduced to obtain the final trajectory feature ω′: Among them, M i Represents the final output of multi-head attention, W T represents the learnable weight matrix, is the attention of each head, concat(·) is the concatenation function; Q i represents the query vector matrix, represents the key vector matrix, d k represents the feature vector dimension, V i represents the value vector matrix and softmax(·) is the softmax activation function.
7. The method for predicting automatic driving trajectory based on driving style according to claim 5, characterized in that: In step S5, the following steps are included: S51, generating dynamic attention weights according to different driving style characteristics through a style attention module; S52. The decoding module is combined with the driving style attention mechanism to dynamically adjust the weight distribution of trajectory feature attention according to different driving styles and output accurate future trajectories.
8. The method for predicting automatic driving trajectory based on driving style according to claim 7, characterized in that: In step S51, the trajectory features, driving style features and interaction features are processed by the style attention module, and a feedforward neural network is introduced to learn the weights of the attention module. s , the hidden state vector p of the predicted trajectory at the last moment t-1 And the hidden state vector of the historical trajectory The three vectors are used as inputs of the feedforward neural network to learn the three and the attention weights The nonlinear relationship between: in, and are three learnable weight matrices; tanh(·) is the hyperbolic tangent function.
9. The method for predicting automatic driving trajectory based on driving style according to claim 8, characterized in that: In step S52, trajectory prediction is performed through a decoder, which includes two multi-head attention sublayers and a feed-forward fully connected sublayer; the multi-head self-attention sublayer performs self-attention calculation on the input sequence through multiple attention heads to learn the local relationship of the vehicle trajectory; Add a mask mechanism to ensure that the prediction of the trajectory at time t only depends on the output before time t; Residual connections are introduced before normalization. The feedforward fully connected sublayer integrates the output of the previous sublayer in a fully connected manner, then inputs it into the fully connected linear layer, and obtains the predicted trajectory result through the SoftMax layer: Among them, γ t represents the fused features, and Linear(·) represents the linear operation.
10. The method for predicting automatic driving trajectory based on driving style according to claim 9, characterized in that: The L2 loss between the predicted trajectory and the true trajectory is used as the loss function for decoder training: Among them, y t represents the true trajectory, represents the predicted trajectory, t = t obs +1 indicates the predicted start time.
Citation Information
Patent Citations
Vehicle track prediction method based on graph attention interaction mechanism
CN114692762A
Vehicle track prediction method based on driver interaction behavior characteristics in network connection environment
CN115520223A
Vehicle lane changing detection method based on time-space interaction graph attention network
CN116383685A
Vehicle lane changing intention recognition method and system based on machine learning
CN117237689A
Vehicle track prediction and behavior decision-making method and system considering driving style
CN118306403A
Cited By
End-to-end automatic driving system in strong interaction scene considering styles of other vehicles
CN121835447A
