A driving style feature extraction method based on improved LSTM variational autoencoder

CN119004073BActive Publication Date: 2026-10-13DALIAN MARITIME UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411092853.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2026-10-13
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

但是,上述方法较少地利用驾驶员风格的时间维度信息,导致无法完整的获取驾驶员的动态驾驶风格,且PCA线性降维方法容易造成提取的风格信息丢失

Benefits of technology

[0036]本发明通过采用变分自编码器作为主架构,在提供数据有效重构的同时,优化潜在空间的连续性和解释性,提高无监督学习过程中的数据表示能力;引入双向LSTM能够全面捕获驾驶数据的前向和后向依赖关系,提供更加丰富的时序信息解析;解码器端的混合特征自回归LSTM进行数据恢复,通过门控单元矫正自回归LSTM重构的累积误差,保持了信息的完整性和一致性,使得数据恢复更加准确;通过改进的LSTM变分自编码器方法,在优化算法复杂度的同时,有效提高了驾驶风格聚类的精确度和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004073B_ABST
    Figure CN119004073B_ABST
Patent Text Reader

Abstract

The application discloses a driving style feature extraction method based on a variational autoencoder of an improved LSTM, and belongs to the technical fields of vehicle engineering and data science. The method comprises the following steps: preprocessing data set information; constructing a model based on an improved encoder and decoder and training the model; inputting the preprocessed data, performing driving style feature extraction, feature clustering and driving style analysis, and outputting corresponding driving styles; and verifying the feature extraction performance of the model by using the feature clustering and feature analysis results. The application improves the accuracy and reliability of driving style clustering while optimizing the algorithm complexity through the improvement of feature extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of vehicle engineering and data science, and in particular to a method for extracting driving style features based on an improved LSTM-based variational autoencoder. Background Technology

[0002] Driving style refers to a driver's behavior and operating habits during driving. Different drivers have different subjective attitudes, experiences, and psychological states, leading to variations in operating methods and driving characteristics. Analyzing driving styles can help improve driving safety awareness, reduce traffic accidents, optimize driver training, and enhance passenger comfort and fuel economy. Traditional driving style identification mainly relies on questionnaires, but this method depends on the driver's subjective responses and lacks accuracy. With the development of vehicle-to-everything (V2X) technology and algorithms, data-driven driving style clustering analysis is gradually becoming mainstream. This method collects natural data from drivers during driving, making it more objective. Existing technologies often use K-means and hierarchical clustering for driving style analysis and to obtain the distribution of behavioral characteristics among different drivers. By constructing an ensemble semi-supervised model based on the k-Nearest Neighbor (KNN) algorithm, high recognition rates can be achieved even with small sample sizes. Alternatively, hierarchical clustering can be used to assess the safety of driver behavior based on lateral and longitudinal positional variations. However, in practical applications, it has been found that the driving data collected by the Internet of Vehicles is characterized by its variety and large scale. Therefore, in order to build an accurate clustering model and improve the recognition of driving styles, feature extraction and information compression of high-dimensional data are very important.

[0003] Existing feature extraction methods include statistical and variation-based approaches. Statistical methods describe driving style by extracting the mean and variance of data such as speed and acceleration. However, this method only reflects macroscopic data performance and lacks description of microscopic features such as rapid acceleration and deceleration. To address this issue, Principal Component Analysis (PCA) based on linear transformation can be used to improve clustering or classification results through dimensionality reduction. However, these methods make limited use of the temporal dimension of driver style, resulting in an incomplete understanding of the driver's dynamic driving style. Furthermore, the linear dimensionality reduction method of PCA is prone to losing extracted style information.

[0004] Therefore, there is a need for a feature extraction method that can provide more comprehensive temporal information parsing and improve the completeness of feature extraction information. Summary of the Invention

[0005] In view of this, the present invention provides a driving style feature extraction method based on an improved LSTM variational autoencoder to maintain the integrity and consistency of the feature extraction information, thereby improving the accuracy of driving style analysis.

[0006] Therefore, the present invention provides the following technical solution:

[0007] A method for extracting driving style features based on an improved LSTM-based variational autoencoder includes the following steps:

[0008] Preprocess the dataset information;

[0009] A driving style feature extraction model is constructed based on an improved LSTM variational autoencoder, and the driving style feature extraction model is trained. The driving style feature extraction model uses a variational autoencoder framework as its main framework, including a bidirectional LSTM encoder for feature extraction and an autoregressive LSTM decoder for feature fusion.

[0010] The preprocessed data is input into the driving style feature extraction model to extract the reconstructed driving style feature data, including: inputting the preprocessed data into a bidirectional LSTM encoder to extract features; reparameterizing the extracted features to obtain the corresponding distribution; and inputting the extracted features and the obtained distribution into a hybrid feature autoregressive LSTM decoder to reconstruct the data.

[0011] Furthermore, the preprocessing of the dataset information includes:

[0012] Filter data according to the analysis requirements;

[0013] After filtering, the data is randomly segmented to obtain continuous sequences;

[0014] Convert the data units in the dataset to SI units;

[0015] Smooth the horizontal and vertical coordinates using Savitzky-Golay filtering;

[0016] Based on the smoothed lateral and longitudinal coordinates, recalculate the velocity acceleration and the lateral and longitudinal velocity acceleration.

[0017] Furthermore, the autoregressive LSTM decoder for fusing features includes a gating unit.

[0018] Furthermore, the autoregressive LSTM decoder used for feature fusion, the feature fusion process includes:

[0019] The features extracted by the encoder are used as the initial hidden state, and the distribution obtained after reparameterization is used as the input at the initial time step.

[0020] At each time step, the features extracted by the encoder are compared with the h output at the previous time step. t-1 By combining these features, the encoder characteristics are reintroduced for each time step, where the data update formula in the gating unit is:

[0021] g t-1 =σ(W g ·[h t-1 ,h0]+b g );

[0022] h′ t-1 =g t-1 ·h0+(1-g t-1 )·h t-1 ;

[0023] Among them, h t-1 The hidden state is the previous time step, h0 is the feature extracted by the encoder, σ is the sigmoid activation function, and g is the hidden state at the previous time step. t-1 It is a gating signal, h′ t-1 It is a context vector; based on g t-1 To weighted fusion and h t-1 h0, as the new hidden state, is passed to the next moment.

[0024] Furthermore, the loss function used in the training model includes reconstruction error and KL divergence:

[0025]

[0026] The reconstruction error is calculated using the mean squared error; x i These are real data. It reconstructs the data, where N is the number of data samples, and μ j and Let Z be the mean and variance of the latent variable z, and J be the dimension of the latent space.

[0027] Furthermore, the driving style feature extraction model also includes:

[0028] K-means++ was used to cluster the reconstructed driving feature data;

[0029] The optimal number of clusters is obtained by using the silhouette coefficient, CH index, and SSE evaluation model to classify driving styles.

[0030] The driving style is output based on the optimal number of clusters.

[0031] Furthermore, the clustering of the reconstructed driving feature data using K-means++ is also used for:

[0032] K-means++ was used to cluster the reconstructed driving feature data, and models with different feature extraction methods were constructed. The performance of the model feature extraction was verified by silhouette coefficient, CH index and SSE.

[0033] Furthermore, the method of dividing the driving style according to the optimal number of clusters is also used for:

[0034] Data analysis is performed on driving characteristics for each driving style, including speed, acceleration, and headway. Further detailed analysis is conducted on each characteristic, including average speed, frequency of rapid acceleration and deceleration, average headway, and percentage of safe headway. The accuracy of driving style feature clustering is verified, and the performance of the model's feature extraction is further validated.

[0035] Advantages and positive effects of the present invention:

[0036] This invention employs a variational autoencoder as the main architecture, which provides effective data reconstruction while optimizing the continuity and interpretability of the latent space, thus improving the data representation capability in the unsupervised learning process. The introduction of a bidirectional LSTM comprehensively captures the forward and backward dependencies of driving data, providing richer temporal information parsing. A hybrid feature autoregressive LSTM at the decoder end performs data recovery, and a gating unit corrects the accumulated error of the autoregressive LSTM reconstruction, maintaining the integrity and consistency of information and making data recovery more accurate. Through the improved LSTM variational autoencoder method, the accuracy and reliability of driving style clustering are effectively improved while optimizing algorithm complexity. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a flowchart of the driving style analysis model according to an embodiment of the present invention;

[0039] Figure 2 This is a comparison diagram of the lateral and longitudinal positions, velocity and acceleration of the vehicle before and after data preprocessing in an embodiment of the present invention;

[0040] Figure 3 This is a simplified diagram of the autoregressive LSTM decoder model in an embodiment of the present invention;

[0041] Figure 4 This is a schematic diagram of a gating unit with hybrid features according to an embodiment of the present invention;

[0042] Figure 5 This is an overall block diagram of the model in an embodiment of the present invention;

[0043] Figure 6 In this embodiment of the invention, SSE determines the optimal number of clusters;

[0044] Figure 7 To determine the optimal number of clusters using the CH index in this embodiment of the invention;

[0045] Figure 8 To determine the optimal number of clusters for the contour coefficient in this embodiment of the invention;

[0046] Figure 9 These are the driving features corresponding to the three clusters in this embodiment of the invention;

[0047] Figure 10 This refers to the headway distribution of the three clusters in this embodiment of the invention;

[0048] Figure 11 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation

[0049] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0050] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0051] This invention provides a driving style feature extraction method based on an enhanced-long short-term memory (E-LSTM) variational autoencoder. The concept is as follows: A variational autoencoder is used as the main architecture, allowing the model to effectively reconstruct data while optimizing the continuity and interpretability of the latent space, thus improving data representation capabilities during unsupervised learning. The encoder employs a bidirectional LSTM, capable of simultaneously capturing forward and backward dependencies in driving data, providing more comprehensive temporal information analysis. The decoder uses a proposed hybrid feature autoregressive LSTM for data recovery. This model utilizes the characteristics of autoregressive LSTM to progressively recover data and uses a gating unit to mix the features initially extracted by the encoder, correcting the accumulated errors generated by the autoregressive LSTM reconstruction and maintaining the integrity and consistency of information. This effectively improves the accuracy and reliability of driving style clustering.

[0052] The process of this invention will be explained with reference to the flowchart of the driving style analysis model shown in Figure 1:

[0053] S1. Filter the data in the dataset; remove outliers using SG filtering; and recalculate the remaining driving feature information.

[0054] In this embodiment, the NGSIM dataset is selected, and the driving style characteristics of highway sections are taken into account, without considering ramps; driving data with a driving time of more than 30 seconds in lanes 1-5 of us-101 and i-80 in the dataset are selected, and the selected data is truncated into a continuous sequence of 30 seconds in length, and the data units in the original dataset are converted to international units.

[0055] However, while the NGSIM dataset is widely recognized as the most commonly used dataset for studying driving style and intention, recent studies have shown that the velocity and acceleration values ​​recorded in the NGSIM dataset contain a large number of inaccurate values. Therefore, SG filtering is used to smooth the lateral and longitudinal coordinates. Simultaneously, using the smoothed coordinates and time information, the velocity, acceleration, lateral velocity, lateral acceleration, longitudinal velocity, and longitudinal acceleration features are updated. An example of the filtered and recalculated features compared to the original features is shown below. Figure 2 As shown.

[0056] S2. Driving features are extracted using the proposed improved LSTM variational autoencoder;

[0057] An improved LSTM variational autoencoder model architecture was built and the model was trained.

[0058] Combination Figure 3 , Figure 4 , Figure 5 , Figure 11The feature extraction part of the model is explained below:

[0059] Specifically, the main framework is a variational autoencoder framework, with the encoder built using a bidirectional LSTM and the decoder built using an autoregressive LSTM that incorporates fused features.

[0060] The preprocessed data is input into a bidirectional LSTM encoder to extract features. The features extracted by the encoder are then reparameterized to obtain the corresponding distribution. The extracted features and the obtained distribution are then input into the initial input and initial state of a hybrid feature autoregressive LSTM decoder, respectively, for data reconstruction. The most crucial part of the hybrid feature autoregressive LSTM is that, firstly, the features extracted by the encoder are used as the initial hidden state, and the reparameterized distribution is used as the initial input. Secondly, this study adds a gating unit to the autoregressive LSTM decoder. At each time step, the features extracted by the encoder are compared with the output h from the previous time step. t-1 By combining these methods and reintroducing encoder features at each time step, the integrity and consistency of information can be maintained, errors can be corrected, and the output at each step can be made closer to the true pattern of the original data. The data update formulas in the gating unit are as follows:

[0061] g t-1 =σ(W g ·[h t-1 ,h0]+b g );

[0062] h′ t-1 =g t-1 ·h0+(1-g t-1 )·h t-1 ;

[0063] Among them, h t-1 Here, h0 is the hidden state from the previous time step, h0 is the feature extracted by the encoder, σ is the sigmoid activation function, and g is the hidden state from the previous time step. t-1 It is a gating signal, h′ t-1 It is a context vector, based on g t-1 To weighted fusion and h t-1 h0, as the new hidden state, is passed to the next moment.

[0064] Finally, the model is trained, and the best model is obtained by evaluating the model using silhouette coefficient, CH index, and SSE.

[0065] In this embodiment, a two-layer bidirectional LSTM is selected as the encoder, and a one-layer autoregressive LSTM with mixed features is selected as the decoder. The driver style representation feature output by the encoder is 10, which is obtained by averaging the finally extracted bidirectional features. During training, the learning rate is set to 0.001, the batch size is set to 32, the LeakyReLU activation function is selected, the Adam optimization algorithm is used to update the weight parameter matrix, and the loss function is:

[0066]

[0067] Where x i These are real data. It reconstructs the data, where N is the number of data samples, and μ j and Let Z be the mean and variance of the latent variable z, and J be the dimension of the latent space.

[0068] In this embodiment, the experiment is implemented using the PyTorch framework;

[0069] Using a well-trained data-driven method, the number of driver style categories is determined; and the model is evaluated using the profile coefficient and CH index, specifically:

[0070] After the model training is completed, all high-dimensional time series are input, and features are extracted by dimensionality reduction through a bidirectional LSTM encoder. In this embodiment, K-means++ is selected to determine the optimal number of clusters, and SSE, CH index and silhouette coefficient are used to determine the optimal number of clusters respectively.

[0071] S3. Perform cluster analysis on the features using K-means++; and analyze the driving behavior characteristics of drivers with different driving styles to verify the accuracy of feature extraction using the method of this invention. Specifically:

[0072] The clustering method was fixed at K-means++. Models were compared with those using different dimensionality reduction methods, including statistical methods, PCA dimensionality reduction, LSTM-AE, LSTM-DAE, Bi-LSTM-DAE, Bi-LSTM-DAE-AR, and the improved LSTM denoising variational autoencoder of this invention. The comparison of silhouette coefficients and CH exponents at the optimal number of clusters is shown in Table 1. The decoders of LSTM-AE, LSTM-DAE, and Bi-LSTM-DAE all use a method of inputting the features extracted by the encoder into each time step for reconstruction, rather than stepwise generation. Bi-LSTM-DAE-AR uses an autoregressive LSTM as the decoder. Experimental results show that the proposed model E-LSTM-DVAE has an optimal silhouette coefficient of 0.6824 and an optimal CH exponent of 26913.34, outperforming the other compared models.

[0073] Table 1

[0074]

[0075]

[0076] In studies of driving styles, they are typically categorized into 2-4 clusters. This example uses 2-9 clusters for experiments, and the results are as follows. Figure 6 , Figure 7 , Figure 8 As shown in the figure. The experimental results show that the method of the present invention achieved the best clustering effect when K=3 in all three indexes. Therefore, the driving styles of drivers are divided into three categories: aggressive, normal and cautious.

[0077] A detailed comparison of the mean velocity, mean absolute acceleration, and mean headway of the three clusters is as follows: Figure 9 As shown, aggressive drivers have the highest mean values ​​for both speed and absolute acceleration, while conservative drivers have the lowest values ​​among the three, and the number of average drivers is in the middle.

[0078] Based on the above three characteristics, we can analyze more detailed driving behavior characteristics;

[0079] In this embodiment, the frequency of rapid acceleration and deceleration and the headway (th) are selected for analysis. Specifically, aggressive drivers tend to have a higher frequency of rapid acceleration and deceleration, while cautious drivers tend to have a lower frequency. The acceleration thresholds are set to 2 m / s². 2 1.5m / s 2 1m / s 2 -2m / s2 -1.5m / s 2 -1m / s 2 The frequency of rapid acceleration and deceleration was calculated for all clustered samples, and the results are shown in Table 2. The experimental results show that, regardless of whether it is rapid acceleration or deceleration, the frequency of rapid acceleration and deceleration for aggressive drivers is the highest among the three driving styles among the six selected thresholds, while the frequency for conservative drivers is the lowest. This experimental result shows that, in terms of rapid acceleration and deceleration, aggressive drivers are more likely to engage in rapid acceleration and deceleration behavior than the other two types, while conservative drivers engage in rapid acceleration and deceleration behavior less frequently than the other two types, thus verifying the results of style clustering.

[0080] Table 2

[0081] 2 0.043 0.030 0.028 1.5 0.090 0.072 0.064 1 0.179 0.154 0.135 -2 0.043 0.030 0.029 -1.5 0.074 0.068 0.058 -1 0.140 0.137 0.112

[0082] Regarding the headway (th), previous research indicates that a th value less than 2 seconds suggests a higher probability of an accident, while a value greater than 2 seconds indicates safer driving. Therefore, this study uses 2 seconds as the threshold for headway analysis, calculating the percentage of drivers with th values ​​exceeding and falling below 2 seconds for different driving styles. Figure 10 As shown in the results, over 55% of aggressive drivers were in an unsafe driving state, while only 20% of conservative drivers were in an unsafe driving state. This reveals the characteristics of the three types of drivers in terms of headway. There are significant differences among drivers of different styles. Aggressive drivers had the lowest percentage of safe headway driving among the three, while conservative drivers had a much higher percentage of safe headway driving. Therefore, the headway characteristics also verify the effectiveness of style clustering.

[0083] Therefore, the advantages of this invention are as follows: the model processes driving trajectory data through a bidirectional LSTM encoder, obtains a continuous latent distribution using reparameterization technology, and then reconstructs the data through an autoregressive LSTM decoder that fuses features. K-means++ is applied to the features extracted by the encoder for cluster analysis, and the model's effectiveness is verified using US-101 and I-80 road segment data from the NGSIM dataset. This verifies that when using the features extracted by this model for cluster analysis, the CH coefficient can reach 28115.66, and the silhouette coefficient can reach 0.6752. Furthermore, when determining the number of clusters using the CH index, silhouette coefficient, and SSE methods, the optimal number of clusters is 3. It also verifies that drivers with three different driving styles show significant differences in driving behavior characteristics such as speed, acceleration, and headway. This invention can accurately identify different driving styles and reflect the driver's operating strategies.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for extracting driving style features based on an improved LSTM variational autoencoder, characterized in that, Including the following steps: Preprocess the dataset information; A driving style feature extraction model is constructed based on an improved LSTM variational autoencoder, and the driving style feature extraction model is trained. The driving style feature extraction model uses a variational autoencoder framework as its main framework, including a bidirectional LSTM encoder for feature extraction and an autoregressive LSTM decoder for feature fusion. The preprocessed data is input into the driving style feature extraction model to extract the reconstructed driving style feature data, including: inputting the preprocessed data into a bidirectional LSTM encoder to extract features; reparameterizing the extracted features to obtain the corresponding distribution; and inputting the extracted features and the obtained distribution into a hybrid feature autoregressive LSTM decoder to reconstruct the data. The autoregressive LSTM decoder for feature fusion includes a gating unit; The autoregressive LSTM decoder used for feature fusion includes the following feature fusion process: The features extracted by the encoder are used as the initial hidden state, and the distribution obtained after reparameterization is used as the input at the initial time step. At each time step, the features extracted by the encoder are compared with the output of the previous time step. By combining these features, the encoder characteristics are reintroduced for each time step, where the data update formula in the gating unit is: ; ; in, It is the hidden state from the previous moment. These are the features extracted by the encoder. It is the sigmoid activation function. It is a gating signal. It is a context vector; based on weighted fusion and This is passed into the next moment as a new hidden state; The driving style feature extraction model also includes: K-means++ was used to cluster the reconstructed driving feature data; The optimal number of clusters is obtained by using the silhouette coefficient, CH index, and SSE evaluation model to classify driving styles. The driving style is output based on the optimal number of clusters.

2. The driving style feature extraction method based on an improved LSTM variational autoencoder according to claim 1, characterized in that, The preprocessing of the dataset information includes: Filter data according to the analysis requirements; After filtering, the data is randomly segmented to obtain continuous sequences; Convert the data units in the dataset to SI units; Smooth the horizontal and vertical coordinates using Savitzky-Golay filtering; Based on the smoothed lateral and longitudinal coordinates, recalculate the velocity acceleration and the lateral and longitudinal velocity acceleration.

3. The driving style feature extraction method based on an improved LSTM variational autoencoder according to claim 1, characterized in that, The loss function used to train the driving style feature extraction model includes reconstruction error and KL divergence: The reconstruction error is calculated using the mean square error. These are real data. It's about reconstructing the data. It is the number of samples in the data. and Latent variables The mean and variance, It is the dimension of the potential space.

4. The driving style feature extraction method based on an improved LSTM variational autoencoder according to claim 1, characterized in that, The clustering of the reconstructed driving feature data using K-means++ is also used for: K-means++ was used to cluster the reconstructed driving feature data, and models with different feature extraction methods were constructed. The performance of the model feature extraction was verified by silhouette coefficient, CH index and SSE.

5. The driving style feature extraction method based on an improved LSTM variational autoencoder according to claim 1, characterized in that, The method of dividing and outputting driving styles according to the optimal number of clusters is also used for: Data analysis is performed on driving characteristics for each driving style, including speed, acceleration, and headway. Further detailed analysis is conducted on each characteristic, including average speed, frequency of rapid acceleration and deceleration, average headway, and percentage of safe headway. The accuracy of driving style feature clustering is verified, and the performance of the model's feature extraction is further validated.

Citation Information

Patent Citations

  • Variational auto-encoder for text generation

    CN111931461A

  • Industrial internet time series data anomaly detection method and device

    CN116522265A