Automatic driving intention recognition system and method, electronic equipment and readable storage medium
By adopting a deep learning model that integrates Transformer and BiLSTM in the autonomous driving system, the problems of uncertainty in human driving intentions and diversity in driving styles in hybrid traffic environments are solved, and more accurate driving intention recognition and prediction are achieved, improving traffic safety and efficiency.
Patent Information
- Application Number
- CN202411707186.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
AI Technical Summary
In a hybrid traffic environment, due to the uncertainty of human driving intentions and the diversity of driving styles, information acquisition and processing delays and driving behaviors are high, and the autonomous driving intentions conflict with the driver, resulting in insufficient safety and efficiency.
A deep learning model integrating Transformer and BiLSTM is adopted to construct a driving intention sample set by screening and preprocessing the vehicle trajectory data, and to use the multi-head attention mechanism and BiLSTM module of the Transformer model to classify and predict driving intentions online.
Effectively capture key time characteristics, distinguish the correlation between driving style and driving intention, improve the accuracy of identification and prediction of driving intentions of human drivers, help autonomous vehicles understand weekly vehicle intentions, improve road traffic efficiency, and reduce traffic risks.
Smart Images

Figure CN119622515A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of V2X (vehicle to everything), wireless sensor network (Wireless Sensor Network, WSN), positioning technology, driving intention recognition, and traffic safety technology, and in particular to a Transformer-BiLSTM automatic driving intention recognition system, method, electronic device, and readable storage medium based on multi-level time series weighting. Background Art
[0002] With the iteration and upgrade of autonomous driving technology (AV), vehicles with autonomous driving functions have begun to appear in real traffic environments. However, due to price, policies, regulations and other reasons, it will take a long time for autonomous driving vehicles to be fully popularized. Therefore, in the future, there will be a state of mixed traffic between autonomous driving vehicles and manually driven vehicles, and road traffic flow will also present a heterogeneous (different types of vehicles) and hetero-intelligence (different levels of intelligence). In this traffic environment, intelligent vehicles can share information through intelligent network technology and V2X technology, and information sharing can provide important prior knowledge for the safe decision-making of intelligent driving vehicles. However, due to the uncertainty of human driving intentions and the diversity of driving styles, human driving vehicles have brought great challenges to the safety and efficiency of mixed traffic flows. Therefore, identifying and predicting the changes in human driving vehicle intentions and behaviors is the key to ensuring the safety and efficiency of mixed traffic flows.
[0003] Human driving intention is usually characterized from two perspectives: one is to directly use advanced equipment to collect the driver's physiological characteristics (such as head features, eye features, body posture, electroencephalogram, etc.) to identify intention. This method is in-depth, but it is costly, has limited samples and poor generalization ability. The other is to indirectly use vehicle driving indicators (such as speed, acceleration, steering wheel angle, etc.) to reflect driving intention. This method is low-cost and easy to deploy on a large scale, but it is limited by data quality and individual differences of drivers. The existing driving intention recognition models include physical models based on vehicle dynamic information, statistical models (such as Bayesian networks, Markov models) and machine learning models (such as SVM, decision trees, LSTM). Among them, LSTM performs well in processing time series data and can capture the time dependency of driving intention. However, previous studies often modeled driving style and driving intention independently and failed to effectively combine the two. In order to improve recognition accuracy, it is crucial to develop an intention recognition model that integrates driving style pre-classification. Summary of the invention
[0004] In order to solve the problems of high delay in information acquisition and processing, high risk of driver's driving behavior uncertainty, conflict between automatic driving intention and driver in mixed traffic flow scenarios due to the uncertainty of driving intention and diversity of driving styles, such as insufficient safety and efficiency, an automatic driving intention recognition method is proposed to effectively improve the accuracy of predicting driving intention, and provide strong technical support for improving road traffic safety.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] An automatic driving intention recognition method comprises the following steps:
[0007] S1, screening and preprocessing the vehicle trajectory HighD dataset, determining the key points of lane change by calculating the intersection of the vehicle trajectory and the lane line in the vehicle trajectory HighD dataset, and using the sliding window method to extract the trajectory sequence of the specified time length to construct the driving intention sample set;
[0008] S2, constructing a deep learning model integrating Transformer and BiLSTM, and training the deep learning model integrating Transformer and BiLSTM by using the constructed driving intention sample set to obtain a trained deep learning model;
[0009] S3 collects the motion information of the vehicle and surrounding vehicles, and inputs the collected motion information of the vehicle and surrounding vehicles as input data to the constructed deep learning model that integrates Transformer and BiLSTM to obtain the most likely driving intention.
[0010] Furthermore, step S1 includes the following steps:
[0011] S11, calculating the intersection point between the vehicle trajectory and the lane line, and defining the intersection point as the lane change midpoint;
[0012] S12, starting from the midpoint of the lane change, traverse the trajectory data points upward along the time axis under each vehicle ID to determine whether there is a trajectory data point with a lateral velocity v y Satisfy|v y |≤v y s , v y s is the threshold of the lateral speed. If there is one, the first trajectory data point that meets the requirement is marked as the starting point of the lane change. Similarly, starting from the midpoint of the lane change, the trajectory data points are traversed downward along the time axis under each vehicle ID to determine whether there is a trajectory data point with v y Satisfy|v y |≤v ys , if there is, then the first trajectory data point that meets the requirements is marked as the lane-changing end point, and all points between the lane-changing start point and the lane-changing end point are defined as lane-changing process points;
[0013] S13, using the sliding window method to extract a trajectory sequence of a specified time length from the trajectory data, the time window length is set to 75, corresponding to 3s, and the time step is set to 1, that is, moving forward 1 frame each time, using the action of the sampling node in the last 1s of the trajectory sequence as the label basis, if the 25 sampling nodes in the last 1s of the extracted trajectory sequence have a lane change process point, then the sequence is marked as a lane change sequence, otherwise it is marked as a straight sequence;
[0014] S14, repeat the above operation until the time series of the motion trajectories of all vehicle IDs are marked, and randomly sample from the marked straight-ahead sequences and lane-changing sequences to construct a driving intention sample set.
[0015] Furthermore, the deep learning model integrating Transformer and BiLSTM includes a driving style online classification module and a driving intention prediction module, and step S3 includes the following steps:
[0016] S31, the driving style online classification module uses the multi-head attention mechanism and feedforward neural network of the encoder of the Transformer model to extract features from the track time series of the input data to classify the driving style online, and assign different driving style weights to the time series of the track at different times;
[0017] S32, the driving style online classification module uses the encoder of the Transformer model to combine the driving style weight with the trajectory in the original input data of step S3 in the form of tensor expansion to output weighted input data;
[0018] S33, the driving intention prediction module uses the BiLSTM module to process the weighted input data, obtains the connection between the previous and next features to retain the timing information and capture the previous and next dependency relationship of the driving intention, and finally outputs the prediction result of the driving intention through the Softmax function.
[0019] Furthermore, it is characterized in that the encoder of the Transformer model is composed of a multi-head attention mechanism and a feedforward neural network. The Transformer model extracts multi-dimensional features of the time series of driving behavior through the multi-head attention mechanism, captures the key features of driving behavior, and integrates them into the feedforward neural network for processing to obtain online classification of driving style.
[0020] Furthermore, the attention mechanism adopts dot product attention, involving three main inputs of query vector, key vector and value vector. The encoder of the Transformer model calculates the weight score of each value vector through the query vector and key vector, and then combines these weights with the value vector to calculate the weighted sum, that is, the driving style weight is combined with the trajectory in the original input data of step S3 in the form of tensor expansion as the output;
[0021] The calculation formula of attention is shown in formula (1):
[0022]
[0023] Where Q, K, and V represent the query vector matrix, key vector matrix, and value vector matrix, respectively, and their dimensions are d Q d K d V And the three dimensions are equal;
[0024] The multi-head attention mechanism is to concatenate the projections of Q, K, and V obtained through h different linear transformations. The calculation formula is shown in equations (2)-(4):
[0025] Q i =QW i Q ,K i =KW i K ,V i =VW i V (2)
[0026] h headi =Attention(Q i ,K i ,V i ) (3)
[0027]
[0028] Where: i = 1, 2, ..., n, n is the number of attention heads; W i Q , W i K , W i V are the transformation matrices of the query, key, and value of the i-th attention head; W O is the output transformation matrix, which is a learnable parameter. Its function is to linearly transform the result of splicing n attention heads; h headirepresents the output of the i-th attention head AttentionHead; MultiHead represents the multi-head attention mechanism. The function of MultiHead is to splice the attention outputs of h different heads together and pass a linear transformation W 0 Concat represents the concatenation operation of vectors. Specifically, the output h of all attention heads is headi It will be concatenated into a large matrix along the last dimension, and then transformed linearly W 0 Projection.
[0029] Furthermore, the BiLSTM module is a driving intention recognition network structure based on BiLSTM built on the LSTM network structure. The network structure of LSTM is shown in equations (5)-(10):
[0030] f t =σ(W f ·[x t ,h t-1 ]+b f ) (5)
[0031] i t =σ(W i ·[x t ,h t-1 ]+b i ) (6)
[0032] o t =σ(W o ·[x t ,h t-1 ]+b o ) (7)
[0033]
[0034] where f t 、i t and O t Corresponding to the forget gate, input gate and output gate respectively; W f , W i , W o They are the weight parameters of the forget gate, input gate, and output gate respectively; is the new input vector generated after the input gate is updated; represents the hadamard product operation; tanh() represents the hyperbolic tangent function; x t represents the input at time t, h t and h t-1 Respectively represent the output at time t and t-1; c t and c t-1Respectively represent the state information stored in the cell at time t and t-1; W c is the connection weight between time (t-1) and time t; b f 、b i 、b o 、b c All are bias parameters; σ represents the sigmoid activation function;
[0035] BiLSTM consists of two independent LSTM networks. The parameters of the BiLSTM module are input into the two LSTM networks in the forward and reverse directions respectively. Then the feature vectors extracted by the two networks are combined to form the final feature vector, as shown in equations (11)-(13):
[0036]
[0037] In the formula, represents the hidden state vector of the forward LSTM, represents the hidden state vector of the reverse LSTM, h t ,h t-1 ,h t-tv ,h t-tp+1 At time steps t, t-1, tt respectively v and c t-tv+1 The hidden state vector at time ; represents the cell state of the forward LSTM at time step t, Represents the reverse LSTM at time step tt v The cell state at c t ,c t-1 ,c t-tv ,c t-tv+1 Respectively represent the time steps t, t-1, tt v and c t-tv+1 The cell state at the time of e t and e t-tv Respectively represent the time steps t and tt v The input feature vector when H t Represents the forward hidden state and the reverse hidden state The final feature vector obtained is the output of BiLSTM.
[0038] The present invention also provides an automatic driving intention recognition system, comprising:
[0039] A motion information collection module is used to collect the motion information of the vehicle and surrounding vehicles as input data;
[0040] A driving style online classification module, which uses the multi-head attention mechanism of the encoder of the Transformer model and the feedforward neural network to extract features from the trajectory sequence of the input data to classify the driving style online, assigns different driving style weights to the time series of the trajectory at different times, and combines the driving style weights with the trajectory in the original input data of step S3 in the form of tensor expansion to output weighted input data;
[0041] The driving intention prediction module uses the BiLSTM module to process the weighted input data, obtains the connection between the previous and next features to retain the temporal information and capture the previous and next dependency relationship of the driving intention, and finally outputs the prediction result of the driving intention through the Softmax function.
[0042] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.
[0043] The present invention further provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method are executed.
[0044] Due to the adoption of the above technical solution, the present invention has the following beneficial effects:
[0045] The present invention provides an automatic driving intention recognition method and system, and proposes a deep learning model that integrates Transformer and BiLSTM, which can effectively capture key time features and distinguish the correlation between driving style and driving intention, and then accurately identify and predict the driving intention of human drivers, so as to help automatic driving cars understand the intentions of surrounding vehicles and make auxiliary decisions, thereby improving road traffic efficiency and reducing traffic risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a flowchart of a method for identifying an automatic driving intention according to a preferred embodiment of the present invention;
[0047] Figure 2 A schematic diagram of a process for constructing a driving intention sample set in a preferred embodiment of the present invention;
[0048] Figure 3 A schematic diagram of the working process of the driving style online classification module in a preferred embodiment of the present invention;
[0049] Figure 4 A schematic diagram of the working process of the driving intention prediction module in a preferred embodiment of the present invention;
[0050] Figure 5Schematic diagram of the principle of an autonomous driving intention recognition system and method according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0053] Please also see Figures 1 to 5 A preferred embodiment of the present invention provides a method for identifying an automatic driving intention, comprising the following steps:
[0054] S1, screening and preprocessing the vehicle trajectory HighD dataset, determining the key points of lane change by calculating the intersection of the vehicle trajectory and the lane line in the vehicle trajectory HighD dataset, and extracting the trajectory sequence of the specified time length by using the sliding window method to construct a driving intention sample set. In this embodiment, step S1 includes the following steps:
[0055] S11, calculating the intersection of the vehicle trajectory and the lane line, defining the intersection as a lane change midpoint, and the lane change midpoint is a key point for lane change;
[0056] S12, starting from the midpoint of the lane change, traverse the trajectory data points upward along the time axis under each vehicle ID to determine whether there is a trajectory data point with a lateral velocity v y Satisfy|v y |≤v y s , v y s is the threshold of the lateral speed. If there is one, the first trajectory data point that meets the requirement is marked as the starting point of the lane change. Similarly, starting from the midpoint of the lane change, the trajectory data points are traversed downward along the time axis under each vehicle ID to determine whether there is a trajectory data point with v y Satisfy|v y |≤v y s, if there is, then the first trajectory data point that meets the requirements is marked as the lane-changing end point, and all points between the lane-changing start point and the lane-changing end point are defined as lane-changing process points;
[0057] S13, using the sliding window method to extract a trajectory sequence of a specified time length from the trajectory data, setting the time window length to 75 (corresponding to 3s), and the time step to 1, that is, moving forward 1 frame each time, so as to make more full use of the data, using the actions of the sampling nodes in the last 1s of the trajectory sequence as the label basis, if the 25 sampling nodes in the last 1s of the extracted trajectory sequence have a lane change process point, then the sequence is marked as a lane change sequence, otherwise it is marked as a straight sequence;
[0058] S14, repeat the above operation until the time series of the motion trajectories of all vehicle IDs are marked, and randomly sample from the marked straight-ahead sequences and lane-changing sequences to construct a driving intention sample set.
[0059] This embodiment defines the midpoint of lane change by the intersection of the vehicle trajectory and the lane line, and further locates the start and end points of lane change in combination with the lateral speed threshold, which can improve the accuracy of lane change process recognition. At the same time, in mixed traffic scenarios, the sliding window method is used to extract the trajectory sequence, and frame-by-frame traversal through the time step helps to capture more detailed time series changes, so that the data set can cover different time and position states, and can more flexibly capture the dynamic changes of driving intentions, which helps to enhance the interactive ability and adaptability of the autonomous driving system in complex environments.
[0060] S2, constructing a deep learning model integrating Transformer and BiLSTM, and using the constructed driving intention sample set to train the deep learning model integrating Transformer and BiLSTM to obtain a trained deep learning model.
[0061] In this embodiment, the deep learning model integrating Transformer and BiLSTM includes a driving style online classification module and a driving intention prediction module. The driving style online classification module uses the multi-head attention mechanism and feedforward neural network of the encoder of the Transformer model to extract features from the track time series of the input data to classify the driving style online, assign different driving style weights to the time series of the track at different times, and combine the driving style weights with the track in the original input data of step S3 in the form of tensor expansion to output weighted input data.
[0062] The Transformer model consists of two parts: an encoder and a decoder. Due to the particularity of the driving intention recognition task and the characteristics of the fixed window length of the time series, the embodiment of the present invention mainly uses the encoder part. The encoder is mainly composed of a multi-head attention mechanism and a feedforward neural network. The attention mechanism uses dot product attention, involving three main inputs: query vector, key vector and value vector. The encoder of the Transformer model calculates the weight score of each value vector, that is, the trajectory time series, through the query vector and key vector, and then combines these weights with the value vector to calculate the weighted sum, that is, the driving style weight is combined with the trajectory in the original input data in the form of tensor expansion as the output;
[0063] The calculation formula of attention is shown in formula (1):
[0064]
[0065] Where Q, K, and V represent the query vector matrix, key vector matrix, and value vector matrix, respectively, and their dimensions are d Q ,d K ,d V And the three dimensions are equal;
[0066] The multi-head attention mechanism is to concatenate the projections of Q, K, and V obtained through h different linear transformations. The calculation formula is shown in equations (2)-(4):
[0067] Q i =QW i Q ,K i =KW i K ,V i =VW i V (2)
[0068] h headi =Attention(Q i ,K i ,V i ) (3)
[0069]
[0070] Where: i = 1, 2, ..., n, n is the number of attention heads; W i Q , W i K , W i V are the transformation matrices of the query, key, and value of the i-th head respectively; W Ois the output transformation matrix, which is a learnable parameter. Its function is to linearly transform the result of splicing n attention heads; h headi represents the output of the i-th attention head (AttentionHead); MultiHead represents the multi-head attention mechanism (Multi-HeadAttention). The function of MultiHead is to splice the attention outputs of h different heads together and pass a linear transformation W 0 Concat represents the concatenation operation of vectors. Specifically, the output h of all attention heads is headi It will be concatenated into a large matrix along the last dimension, and then transformed linearly W 0 Projection.
[0071] The Transformer model extracts multi-dimensional features from the time series of driving behavior through a multi-head attention mechanism, captures the key features of driving behavior, and integrates them into a feedforward neural network for processing to obtain online classification of driving style.
[0072] The encoder part of the Transformer model can reduce model complexity and computational cost. Through the dot product attention mechanism of the query vector and the key vector, the model can dynamically adjust the weight of each time series input, thereby improving the ability to distinguish different driving styles. At the same time, the multi-head attention mechanism enables the model to quickly process data in different time windows in parallel, giving the model efficient online processing capabilities and realizing real-time recognition and classification of driving styles.
[0073] The driving intention prediction module uses the BiLSTM module to process the weighted input data, obtains the connection between the front and back features to retain the temporal information and capture the front and back dependency relationship of the driving intention, and finally outputs the prediction result of the driving intention through the Softmax function.
[0074] The BiLSTM module is a driving intention recognition network structure based on BiLSTM (bidirectional long short-term memory network) built on the LSTM network structure. The network structure of LSTM is shown in equations (5)-(10):
[0075] f t =σ(W f ·[x t ,h t-1 ]+b f ) (5)
[0076] i t =σ(W i ·[x t ,h t-1 ]+b i ) (6)
[0077] o t =σ(W o ·[x t ,h t-1 ]+b o ) (7)
[0078]
[0079] where f t 、i t and O t Corresponding to the forget gate, input gate and output gate respectively; W f , W i , W o They are the weight parameters of the forget gate, input gate, and output gate respectively; is the new input vector generated after the input gate is updated; represents the hadamard product operation; tanh() represents the hyperbolic tangent function; x t represents the input at time t, h t and h t-1 Respectively represent the output at time t and t-1; c t and c t-1 Respectively represent the state information stored in the cell at time t and t-1; W c is the connection weight between time (t-1) and time t; b f 、b i 、b o 、b c are bias parameters; σ represents the sigmoid activation function.
[0080] Although LSTM improves the problem of RNN, it can only process past information and cannot utilize future information. Based on this, the present invention incorporates BiLSTM (bidirectional long short-term memory network) on the basis of LSTM. BiLSTM consists of two independent LSTM networks. The parameters input into the BiLSTM module are respectively input into the two LSTM networks in the forward and reverse directions. Then, the feature vectors extracted by the two networks are combined to form the final feature vector, as shown in equations (11)-(13):
[0081]
[0082] In the formula, represents the hidden state vector of the forward LSTM, represents the hidden state vector of the reverse LSTM, h t ,h t-1 ,h t-tv ,h t-tp+1At time steps t, t-1, tt respectively v and c t-tv+1 The hidden state vector at time ; represents the cell state of the forward LSTM at time step t, Represents the reverse LSTM at time step tt v The cell state at c t ,c t-1 ,c t-tv ,c t-tv+1 Respectively represent the time steps t, t-1, tt v and c t-tv+1 The cell state at the time of e t and e t-tv Respectively represent the time steps t and tt v The input feature vector when H t Represents the forward hidden state and the reverse hidden state The final feature vector obtained is the output of BiLSTM.
[0083] Since the BiLSTM module performs forward and reverse feature extraction at the same time, the final synthesized vector contains past and future information. By combining the information of forward and reverse sequences, BiLSTM can capture more complex and richer data features, making it more efficient to understand the overall sequence structure. to shows the process of forward operation, and to The reverse operation process is shown.
[0084] S3 collects the motion information of the vehicle and surrounding vehicles, and uses the collected motion information of the vehicle and surrounding vehicles as input data to the constructed deep learning model that integrates Transformer and BiLSTM to obtain the most likely driving intention.
[0085] In this embodiment, the motion information may include: vehicle position information, lane information (the lane the vehicle is currently in, and possible lane change intentions), speed, acceleration, steering angle, etc. The motion information of the vehicle and surrounding vehicles can be collected by the sensors on the vehicle, and after the information is collected, it is transmitted through the V2X system interconnection. Step S3 specifically includes the following steps:
[0086] S31, uses the multi-head attention mechanism and feedforward neural network of the encoder of the Transformer model to extract features from the track time series of the input data to classify the driving style online and assign different driving style weights to the time series of the track at different times;
[0087] S32, using the encoder of the Transformer model to combine the driving style weight with the trajectory in the original input data of step S3 in the form of tensor expansion to output weighted input data;
[0088] S33, using the BiLSTM module to process the weighted input data, obtain the connection between the previous and next features to retain the temporal information and capture the previous and next dependency relationship of driving intention, and finally output the prediction result of driving intention through the Softmax function.
[0089] The Transformer model can capture the multi-dimensional features of motion information, while BiLSTM further explores the dependency relationship between previous and subsequent features in time series data. The combined structure of Transformer and BiLSTM can more effectively process the multi-level features of time series data, improve the model's ability to capture long- and short-term dependency characteristics, and help accurately predict complex driving intentions.
[0090] An embodiment of the present invention further provides an automatic driving intention recognition system, comprising:
[0091] A motion information collection module is used to collect the motion information of the vehicle and surrounding vehicles as input data;
[0092] A driving style online classification module, which uses the multi-head attention mechanism of the encoder of the Transformer model and the feedforward neural network to extract features from the trajectory sequence of the input data to classify the driving style online, assigns different driving style weights to the time series of the trajectory at different times, and combines the driving style weights with the trajectory in the original input data of step S3 in the form of tensor expansion to output weighted input data;
[0093] The driving intention prediction module uses the BiLSTM module to process the weighted input data, obtains the connection between the previous and next features to retain the temporal information and capture the previous and next dependency relationship of the driving intention, and finally outputs the prediction result of the driving intention through the Softmax function.
[0094] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.
[0095] An embodiment of the present invention further provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method are executed.
[0096] The inability of traditional recognition methods to accurately identify driving intentions will directly affect the stability and reliability of the system, making it difficult to better predict the vehicle's next move, which in turn affects driving safety.
[0097] In order to improve the accuracy of the recognition method so as to accurately mark driving behaviors such as lane changing and straight driving, the present invention accurately distinguishes lane changing and straight driving behaviors, determines the lane change midpoint by calculating the intersection of the vehicle trajectory and the lane line, and then uses the lateral speed feature to accurately mark the lane change start and end point, thereby constructing an accurate "lane change sequence" and "straight driving sequence" sample set, improving the marking accuracy, and further improving the training effect of the model.
[0098] Traditional classification methods have difficulty capturing the complex multi-dimensional features of driving style and the front-to-back dependencies in time series data, and are unable to accurately and in real time identify the driver's driving style and predict the behavior of the autonomous driving system. This is because some manual vehicles may have large lateral position deviations during actual driving. This situation would be defined as lane changing in previous models, but this situation is often the driver's driving style, not his driving intention.
[0099] In order to accurately and in real time identify the driver's driving style and the behavior prediction of the automatic driving system and make further decisions, the present invention uses the encoder part of Transformer and introduces a multi-head attention mechanism to extract multi-dimensional features from the time series of driving behavior, capture the key features in driving behavior, and integrate it into the feedforward neural network for processing, thereby improving the classification accuracy of driving style and assigning different driving style weights at different times, which can better distinguish the correlation between driving style and driving intention. At the same time, the multi-head attention mechanism allows the model to focus on different information at different time steps, which can better identify complex driving styles.
[0100] Traditional methods have difficulty in handling multi-dimensional features and long time series dependencies, and cannot accurately predict the vehicle's driving intention in order to make reasonable decisions.
[0101] The present invention extracts the motion information of the vehicle and surrounding vehicles through the Transformer's multi-head attention mechanism, and assigns weights to different trajectories, thereby enhancing the understanding of different driving styles. Then, the BiLSTM module is used to retain the timing information and capture the front-end dependency of driving intentions. Finally, the Softmax function is used to output the driving intention with the highest probability, thereby improving the safety and stability of the autonomous driving system.
[0102] The above description is a detailed description of the preferred feasible embodiments of the present invention, but the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modified changes completed under the technical spirit suggested by the present invention should fall within the patent scope covered by the present invention.
Claims
1. A method for identifying an automatic driving intention, characterized in that: The following steps are involved: S1, screening and preprocessing the vehicle trajectory HighD dataset, determining the key points of lane change by calculating the intersection of the vehicle trajectory and the lane line in the vehicle trajectory HighD dataset, and using the sliding window method to extract the trajectory sequence of the specified time length to construct the driving intention sample set; S2, constructing a deep learning model integrating Transformer and BiLSTM, and training the deep learning model integrating Transformer and BiLSTM by using the constructed driving intention sample set to obtain a trained deep learning model; S3 collects the motion information of the vehicle and surrounding vehicles, and inputs the collected motion information of the vehicle and surrounding vehicles as input data to the constructed deep learning model that integrates Transformer and BiLSTM to obtain the most likely driving intention.
2. The method for identifying the intention of autonomous driving according to claim 1, wherein: Step S1 includes the following steps: S11, calculating the intersection point between the vehicle trajectory and the lane line, and defining the intersection point as the lane change midpoint; S12, starting from the midpoint of the lane change, traverse the trajectory data points upward along the time axis under each vehicle ID to determine whether there is a trajectory data point with a lateral velocity v y Satisfy|v y |≤v y s , v y s is the threshold of the lateral speed. If there is one, the first trajectory data point that meets the requirement is marked as the starting point of the lane change. Similarly, starting from the midpoint of the lane change, the trajectory data points are traversed downward along the time axis under each vehicle ID to determine whether there is a trajectory data point with v y Satisfy|v y |≤v y s , if there is, then the first trajectory data point that meets the requirements is marked as the lane-changing end point, and all points between the lane-changing start point and the lane-changing end point are defined as lane-changing process points; S13, using the sliding window method to extract a trajectory sequence of a specified time length from the trajectory data, the time window length is set to 75, corresponding to 3s, and the time step is set to 1, that is, moving forward 1 frame each time, using the action of the sampling node in the last 1s of the trajectory sequence as the label basis, if the 25 sampling nodes in the last 1s of the extracted trajectory sequence have a lane change process point, then the sequence is marked as a lane change sequence, otherwise it is marked as a straight sequence; S14, repeat the above operation until the time series of the motion trajectories of all vehicle IDs are marked, and randomly sample from the marked straight-ahead sequences and lane-changing sequences to construct a driving intention sample set.
3. The method for identifying the intention of autonomous driving according to claim 1, wherein: The deep learning model integrating Transformer and BiLSTM includes a driving style online classification module and a driving intention prediction module, and step S3 includes the following steps: S31, the driving style online classification module uses the multi-head attention mechanism and feedforward neural network of the encoder of the Transformer model to extract features from the track time series of the input data to classify the driving style online, and assign different driving style weights to the time series of the track at different times; S32, the driving style online classification module uses the encoder of the Transformer model to combine the driving style weight with the trajectory in the original input data of step S3 in the form of tensor expansion to output weighted input data; S33, the driving intention prediction module uses the BiLSTM module to process the weighted input data, obtains the connection between the previous and next features to retain the timing information and capture the previous and next dependency relationship of the driving intention, and finally outputs the prediction result of the driving intention through the Softmax function.
4. The method for identifying the intention of autonomous driving according to claim 3, wherein: The encoder of the Transformer model consists of a multi-head attention mechanism and a feedforward neural network. The Transformer model uses the multi-head attention mechanism to extract multi-dimensional features from the time series of driving behavior, capture the key features of driving behavior, and integrate them into the feedforward neural network for processing to obtain online classification of driving style.
5. The method for identifying the intention of automatic driving according to claim 4, characterized in that: The attention mechanism adopts dot product attention, involving three main inputs: query vector, key vector and value vector. The encoder of the Transformer model calculates the weight score of each value vector through the query vector and key vector, and then combines these weights with the value vector to calculate the weighted sum, that is, the driving style weight is combined with the trajectory in the original input data of step S3 in the form of tensor expansion as the output; The calculation formula of attention is shown in formula (1): Where Q, K, and V represent the query vector matrix, key vector matrix, and value vector matrix, respectively, and their dimensions are d Q ,d K ,d V And the three dimensions are equal; The multi-head attention mechanism is to concatenate the projections of Q, K, and V obtained through h different linear transformations. The calculation formula is shown in equations (2)-(4): Q i =QW i Q ,K i =KW i K ,V i =VW i V (2) h headi =Attention(Q i ,K i ,V i ) (3) Where: i = 1, 2, ..., n, n is the number of attention heads; W i Q , W i K , W i V are the transformation matrices of the query, key, and value of the i-th attention head; W O is the output transformation matrix, which is a learnable parameter. Its function is to linearly transform the result of splicing n attention heads; h headi represents the output of the i-th attention head; MultiHead represents the multi-head attention mechanism. The function of MultiHead is to splice the attention outputs of h different heads together and pass a linear transformation W 0 Concat represents the concatenation operation of vectors. Specifically, the output h of all attention heads is headi It will be concatenated into a large matrix along the last dimension, and then transformed linearly W 0 Projection.
6. The method for identifying the intention of autonomous driving according to claim 3, wherein: The BiLSTM module is a driving intention recognition network structure based on the BiLSTM network structure. The network structure of LSTM is shown in equations (5)-(10): f t =σ(W f ·[x t ,h t-1 ]+b f ) (5) i t =σ(W i ·[x t ,h t-1 ]+b i ) (6) the t =σ(W o ·[x t ,h t-1 ]+b o ) (7) where f t 、i t and O t Corresponding to the forget gate, input gate and output gate respectively; W f , W i , W o They are the weight parameters of the forget gate, input gate, and output gate respectively; is the new input vector generated after the input gate is updated; represents the hadamard product operation; tanh() represents the hyperbolic tangent function; x t represents the input at time t, h t and h t-1 Respectively represent the output at time t and t-1; c t and c t-1 Respectively represent the state information stored in the cell at time t and t-1; W c is the connection weight between time (t-1) and time t; b f , b i , b o , b c All are bias parameters; σ represents the sigmoid activation function; BiLSTM consists of two independent LSTM networks. The parameters of the BiLSTM module are input into the two LSTM networks in the forward and reverse directions respectively. Then the feature vectors extracted by the two networks are combined to form the final feature vector, as shown in equations (11)-(13): In the formula, represents the hidden state vector of the forward LSTM, represents the hidden state vector of the reverse LSTM, h t ,h t-1 ,h t-tv ,h t-tp+1 At time steps t, t-1, tt respectively v and c t-tv+1 The hidden state vector at time ; represents the cell state of the forward LSTM at time step t, Represents the reverse LSTM at time step tt v The cell state at c t ,c t-1 ,c t-tv ,c t-tv+1 Respectively represent the time steps t, t-1, tt v and c t-tv+1 The cell state at the time of e t and e t-tv Respectively represent the time steps t and tt v The input feature vector when H t represents the forward hidden state h t and the reverse hidden state h t The final feature vector obtained is the output of BiLSTM.
7. An automatic driving intention recognition system, characterized in that: include: A motion information collection module is used to collect the motion information of the vehicle and surrounding vehicles as input data; A driving style online classification module, which uses the multi-head attention mechanism of the encoder of the Transformer model and the feedforward neural network to extract features from the trajectory sequence of the input data to classify the driving style online, assigns different driving style weights to the time series of the trajectory at different times, and combines the driving style weights with the trajectory in the original input data of step S3 in the form of tensor expansion to output weighted input data; The driving intention prediction module uses the BiLSTM module to process the weighted input data, obtains the connection between the previous and next features to retain the temporal information and capture the previous and next dependency relationship of the driving intention, and finally outputs the prediction result of the driving intention through the Softmax function.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are executed.
Citation Information
Cited By
New energy automobile automatic driving collaborative decision-making method and system in man-machine mixed driving environment
CN121777954A