A Method for Generating Key Scenarios of Intelligent Vehicles Based on Personalized Interaction and Car-Following Model
By constructing a personalized interactive car-following model, using principal component analysis, K-means clustering, and Transformer networks to extract interactive characteristics, and combining support vector regression machines for real-time compensation, the problems of low coverage, poor rationality, and single type in the generation of intelligent vehicle test scenarios are solved, and efficient and diversified key scenario generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JILIN UNIVERSITY
- Filing Date
- 2023-12-05
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies lack high coverage, high rationality, and high diversity when generating intelligent vehicle test scenarios, making it difficult to realistically reflect the interaction characteristics between vehicles. Furthermore, the generator's adversarial training is unstable, resulting in low scenario coverage, poor rationality, and limited types.
A personalized interactive following model is constructed. Long-term interaction characteristics are extracted through principal component analysis, K-means clustering and Transformer network. Support vector regression is combined for real-time compensation. Rich interaction features are generated by multivariate weight allocation. Key scenarios are generated and evaluated in all aspects.
It achieves the generation of key scenarios with high coverage, high rationality and high diversity, meets the diverse needs of intelligent vehicle testing, and improves the stability and rationality of scenario generation.
Smart Images

Figure CN117648352B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent vehicle technology, specifically a method for generating key scenarios for intelligent vehicles based on a personalized interactive driving-following model. Background Technology
[0002] In the field of intelligent vehicle testing, critical test scenarios can lead to unsafe decisions and expose inherent flaws in intelligent algorithms. Due to their high challenge, they have become crucial for verifying the safety of intelligent vehicles. Generating high-coverage, highly plausible, and diverse critical test scenarios for intelligent vehicle testing is a critical problem that urgently needs to be solved. When generating scenarios based on natural driving data, existing methods lack an understanding of the actual motion state of vehicles during driving, making it difficult to realistically reflect the interaction characteristics between vehicles. The generated scenario data lacks strict inherent constraints and coupling relationships between vehicles. Furthermore, models based on generative adversarial networks are sensitive to network structure and hyperparameters, leading to unstable adversarial training. The generator tends to generate similar data that is easier to deceive the discriminator. These phenomena result in current methods for generating scenarios based on natural driving data suffering from low scenario coverage, poor scenario plausibility, and limited scenario types, which remain to be addressed. Summary of the Invention
[0003] This invention provides a method for generating key test scenarios for intelligent vehicles based on a personalized interactive car-following model. It constructs a personalized car-following model with highly realistic interactive characteristics. Based on this model, through the multi-weight allocation of the model, the interaction features between vehicles are diversified and the coverage of scene parameters is expanded. This method can reduce the difficulty of scene generation while achieving high coverage, high rationality, and high diversity of key scene generation, thus solving the above-mentioned problems of current methods when generating key scenarios based on natural driving data.
[0004] The technical solution of this invention is described below in conjunction with the accompanying drawings:
[0005] A method for generating key scenarios for intelligent vehicles based on a personalized interaction and car-following model includes the following steps:
[0006] Step 1: Select the natural driving dataset and preprocess it;
[0007] We selected the Natural Driving dataset, filtered out the small car following scenario data for driving style clustering, uniformly constructed a following scenario library based on its time series length, and randomly extracted some following scenarios as the original data for scenario generation.
[0008] Step 2: Construct a personalized interactive car-following model;
[0009] Principal component analysis and K-means clustering were used to obtain car-following data for different driving styles. A Transformer network was constructed to extract long-term interaction characteristics from natural driving data. Error data was used to establish a real-time compensator based on support vector regression machine. The real-time predicted value and real-time compensation value of vehicle speed were fused and calculated to obtain three types of personalized interactive car-following models.
[0010] Step 3: Generate key scenarios;
[0011] Based on three types of personalized interactive car-following models, the scene state in natural driving data is used as input stimulus. The car-following strategy of the following vehicle is diversified by the variable multi-weight allocation of different driving style car-following models, generating a large amount of scene data and extracting key scenes from it.
[0012] Step 4: Evaluate key scenarios;
[0013] The generated key scenario data is evaluated comprehensively and from multiple dimensions based on indicators such as key scenario coverage, key scenario rationality, and key scenario diversity.
[0014] Furthermore, the specific method for step one is as follows:
[0015] 11) Cluster the data of different driving styles using publicly available natural driving datasets;
[0016] 12) Extract following scenarios from the dataset according to rules, and filter by vehicle type to eliminate the influence of vehicle type on driving style. Based on the following data of small cars, randomly select 70% of the following scenario data as the data input for driving style clustering.
[0017] 13) Standardize the temporal length of following scenarios to build a natural driving following scenario library, and randomly select 6,000 following scenarios from it as the initial data for key scenario generation.
[0018] Furthermore, the specific method for step two is as follows:
[0019] 21) Select characteristic variables that can reflect the aggressiveness of vehicle driving, and use the magnitude of the characteristic variable values to measure the differences between different driving styles. The characteristic variables are selected as follows: mean of the absolute value of longitudinal speed X1, standard deviation of the absolute value of longitudinal speed X2, mean of the absolute value of longitudinal acceleration X3, standard deviation of the absolute value of longitudinal acceleration X4, mean of the longitudinal impact X5, standard deviation of the longitudinal impact X6. The vehicle impact J is the derivative of acceleration, as shown in equation (1).
[0020]
[0021] In the formula, J represents the vehicle impact intensity, and a represents the vehicle acceleration.
[0022] 22) Principal component analysis was used to reduce the dimensionality of the original data;
[0023] First, the characteristic variables of different dimensions are normalized to obtain the standardized sample matrix X, and the covariance matrix R of the standardized sample is calculated as shown in equation (2).
[0024]
[0025] In the formula, X is the sample matrix; R is the sample covariance matrix; r ij X is the element value in the i-th row and j-th column of the sample covariance matrix; n is the sample size; p is the number of feature variables; X ki Let be the value of the element in the k-th row and i-th column of the sample matrix; Let be the mean of the j-th column of the sample matrix; other similar symbols are analogous.
[0026] Calculate the eigenvalues λ and corresponding eigenvectors of the covariance matrix R. Calculate the principal component contribution rate and cumulative contribution rate based on the eigenvalues, as shown in Equation (3). Select principal component coefficients with a cumulative contribution rate exceeding 85%.
[0027]
[0028] In the formula, λ is the eigenvalue of the covariance matrix; p is the number of eigenvariant variables;
[0029] 23) Multiply the principal component coefficients obtained by dimensionality reduction from principal component analysis with the original feature matrix to obtain the matrix used for clustering. Select the K-means algorithm to perform clustering analysis on the following scene data. The K-means algorithm aims to minimize the Euclidean distance between the sample and the cluster center. The objective function is shown in equation (4). Three types of driving style data are obtained through continuous iterative updates:
[0030]
[0031] In the formula, x represents the sample in the cluster; μ j For the cluster center of category j, r ij This indicates whether the i-th sample belongs to the j-th cluster; if yes, the value is 1, otherwise the value is 0.
[0032] 24) The time sliding window method is used to process time series data of different lengths. The time sliding window length is set to obtain stationary time series data. 50,000 sample time series data are randomly selected from the training samples of the aggressive, general and conservative cathodic models.
[0033] Construct a Transformer model to extract realistic interaction characteristics in following vehicle scenarios, and convert the following vehicle speed v and the front vehicle speed v l The position of the vehicle in front (r) l The position r of the rear vehicle is used as the four-dimensional time series input, and the speed v of the rear vehicle is used as the one-dimensional time series output. The long-term interaction characteristics are extracted and transformed into a mapping function f from the historical sequence to the future state under the given training network G, as shown in equation (5).
[0034]
[0035] In the formula, Represents the time series from time i to time i+n: [x i ,x i+1 ,...,x i+n ]; This represents the time series from time t-(T-1) to time t: [v t-(T-1) ,v t-(T-2) ,...,v t ]; other similar symbols are treated similarly;
[0036] The Transformer model maps the input and output embeddings to the d_model dimension through linear transformation and adds positional encoding as input to the encoder and decoder. The positional encoding is used to capture the positional information of the sequence. The output of the final decoder is linearly transformed to match the desired output dimension. Finally, the mapped vector is processed through a Softmax layer to obtain the model's predicted output.
[0037] Set the position encoding of sine and cosine to be added to the time series data, as shown in equation (6);
[0038]
[0039] In the formula, pos is the position index in the time series; i is the position along the input embedding vector, from 0 to d_model / 2-1;
[0040] The time series data is divided into training and testing sets in an 8:2 ratio for network model training. The following parameters should be set during model training: learning rate, number of hidden neurons, Dropout, Batch_Size, input sequence dimension, output sequence dimension, d_model, number of attention heads, number of network layers, and number of iterations.
[0041] 25) Support vector regression machine (SVR) is used as an error compensator to compensate the baseline predictions of the model in real time.
[0042] The SVR model essentially maps samples that cannot be linearly regressed to a high-dimensional space for linear regression, and the regression function is shown in equation (7):
[0043] f(x) = w T h(x)+b (7)
[0044] In the formula, w is the size weight vector; h(x) is the feature mapping function that maps the original input space to the high-dimensional feature space; b is the bias term, representing the intercept of the hyperplane;
[0045] Support Vector Regression Machine with the addition of slack variable ξ i ξ i The optimized objective function is shown in equation (8):
[0046]
[0047] In the formula, c is the penalty factor;
[0048] The constraints are as shown in equation (9):
[0049]
[0050] In the formula, y i x is the output variable. i ε is the input variable; ε is the error coefficient;
[0051] Based on the optimization objective and constraints, the Lagrangian function is constructed as shown in equation (10):
[0052]
[0053] In the formula, α i α i , λ i , λ i ≥0 indicates a Lagrange multiplier;
[0054] Error time series data were obtained by comparing the baseline predictions and true values of the Transformer model. The data were divided into training and test sets in an 8:2 ratio. After normalizing the data, the optimal combination of the SVR model penalty factor c and the gamma parameter of the RBF function was found through iterative testing. Here, c represents the model’s tolerance for error, and gamma determines the distribution of the data in high-dimensional space.
[0055] The closer the SVR model score is to 1, the better the model fits the data and the better it generalizes to new data. We set the range of values for parameters c and gamma, and within this range, we searched for combined parameter values that make the model score close to 1. We also set the error coefficient epsilon value, the SVR model loss function as epsilon-SVR, and the radial basis function as exp(-gamma×|uv|). 2 );
[0056] 26) Based on the current scene state, the baseline prediction value of the vehicle speed in the next state is obtained using the Transformer model, and the error compensation value of the vehicle speed in the next state is obtained by combining the error compensator. The two are then fused and calculated to obtain three types of personalized interactive car-following models.
[0057] Furthermore, the specific method for step three is as follows:
[0058] 31) Based on the three types of personalized interactive car-following models, the model output results are assigned multiple weights to show richer interactive features, as shown in Equation (11).
[0059]
[0060] In the formula, λ1, λ2, and λ3 are the output results of the aggressive, general, and conservative car-following models at time t, respectively; λ1, λ2, and λ3 are the weight coefficients of the aggressive, general, and conservative car-following models, respectively. The combined weighted result of the model at time t;
[0061] 32) The following scene data after the time series length is unified is used as the original data G=N for scene generation. The scene generation steps based on the model are as follows: the initial state of the scene and the motion parameters of the preceding vehicle are used as input stimulus. Different weight coefficients are assigned to the personalized interactive following model as the following strategy of the following vehicle to follow the preceding vehicle. Each set of weight coefficients generates an equal amount of scene data based on the original scene data.
[0062] 33) The criticality of a scenario is measured by the collision time. The hazard levels of scenarios based on TTC are as follows: safe scenario is TTC<0 or TTC>5, emergency scenario is 3<TTC≤5, urgent scenario is 1<TTC≤3, and near-collision scenario is 0≤TTC≤1. Emergency scenario, urgent scenario, and near-collision scenario are uniformly defined as critical scenarios with different criticalities. Based on this, critical scenario data with different criticalities are extracted from the generated scenarios.
[0063] Furthermore, the specific method for step four is as follows:
[0064] 41) Design coverage evaluation indicators for key scenarios to reflect the coverage of key scenario parameters;
[0065] The following scenario can be described by three parameters: the speed of the vehicle in front, the distance between the two vehicles, and the speed of the vehicle behind. First, the range of values for each parameter is determined to form the scenario parameter space. Each parameter is then discretized into intervals of 1m or 1m / s, thereby determining the number of all possible scenario parameters. However, not all scenario parameters are critical. Therefore, a critical scenario parameter factor Ui is introduced for correction, which represents the proportion of critical scenario parameters in the parameter space.
[0066] The generated key scenes are time-series data with a fixed time step. However, not all scene parameters in all time frames are critical. The key scene parameters are processed into integers, and the number of scene parameters in the key frames of the key scene data is selected to measure the coverage of the key scenes. However, it should be noted that the same key scene parameters should be excluded. The method for evaluating the coverage of key scenes is shown in Equation (12):
[0067]
[0068] In the formula, S_coverage represents the coverage of the key scene; key_fps_count represents the number of keyframes in the key scene; and all_fps_count represents the number of all scene parameters in the scene space, using the key scene parameter factor U. i Make corrections;
[0069] 42) Design rationality evaluation indicators for key scenarios;
[0070] The rationality of a key scenario is evaluated by the smoothness of the trajectories of parameters such as the speed of the preceding vehicle, the distance between the two vehicles, and the speed of the following vehicle. First, different parameter trajectories are smoothed. The rationality of the key scenario is then quantitatively evaluated by calculating the distance between the smoothed parameter trajectory and the original parameter trajectory, as shown in Equation (13).
[0071]
[0072] In the formula, S_rational represents the rationality of the key scenario; NDis(·) is the distance function after normalization between parameter trajectories, where Dis(X,Y)=∑ i |X i -Y i |; s_count is the number of key scenarios; p_count is the number of parameters describing the following scenario; X is the original parameter trajectory; X* is the smoothed parameter trajectory; ξ j Weighting values for the rationality of parameter trajectories in different types of scenarios;
[0073] 43) Design diversity evaluation indicators for key scenarios;
[0074] The diversity of key scenarios should take into account both the shape similarity of the parameter trajectories and the magnitude of their relative distances. Therefore, dynamic time warping is used as the basis to measure the diversity between different parameter trajectories, as shown in Equation (14):
[0075]
[0076] In the formula, S_various represents the diversity of key scenarios; s_count represents the number of key scenarios; p_count represents the number of parameters describing the following scenario; θ j The weights are assigned to the diversity of parameter trajectories in different types of scenarios; NDTW(·) is the quantized value after dynamic time warping and normalization between two parameter trajectories, used to simultaneously evaluate the shape similarity and distance similarity between parameter trajectories; the calculation method of DTW(·) is shown in Equation (15):
[0077]
[0078] In the formula, D(·) is the Euclidean distance calculation function; i and j are the lengths of time series data X1 and X2, respectively. The DTW quantization values of the two time series data are obtained through continuous dynamic calculation.
[0079] The beneficial effects of this invention are as follows:
[0080] 1) This invention is based on a personalized car-following model with high realism and interactive characteristics. By allocating multiple weights in the personalized interactive car-following model, it diversifies the car-following strategies of the following vehicles, thereby generating a large amount of scenario data and filtering out key scenarios with different degrees of criticality according to rules. It also designs indicators such as key scenario coverage, key scenario rationality, and key scenario diversity to evaluate the key scenario data in a comprehensive and multi-dimensional way.
[0081] 2) This invention can effectively improve the problems of low scene coverage, poor scene rationality and single scene type in the current method when generating scenes based on natural driving data. While ensuring the rationality and diversity of key scenes, it can achieve efficient coverage of key driving scenes for large-scale testing of intelligent vehicles. At the same time, by further introducing the lateral driving behavior of vehicles, it can generate richer and more complex test scenarios to better meet the testing needs of intelligent vehicles. Attached Figure Description
[0082] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0083] Figure 1 This is a flowchart of the present invention;
[0084] Figure 2 Here is a diagram of the Transformer model structure;
[0085] Figure 3a This is a graph showing the velocity following results for the conservative model.
[0086] Figure 3b This is a graph showing the velocity following results for a general model.
[0087] Figure 3c This is a graph showing the velocity following results for the aggressive model;
[0088] Figure 3d The acceleration car-following results are shown in the diagram for the conservative model.
[0089] Figure 3e This is a graph showing the acceleration car-following results for a general model.
[0090] Figure 3f The acceleration car-following results for the aggressive model are shown in the figure.
[0091] Figure 4a This is a graph showing the coverage evaluation results when G=N;
[0092] Figure 4b The image shows the coverage evaluation results when G = 3N (MB).
[0093] Figure 4c The image shows the coverage evaluation results when G = 6N (MB).
[0094] Figure 4d The image shows the coverage evaluation results when G = 10N (MB).
[0095] Figure 4e The image shows the coverage evaluation results when G = 3N (GB).
[0096] Figure 4f The image shows the coverage evaluation results when G = 6N (GB).
[0097] Figure 4g The image shows the coverage evaluation results when G = 10N (GB).
[0098] Figure 5aTo generate the following vehicle speed curve results for key scenarios based on model-based methods;
[0099] Figure 5b The result of generating the rear vehicle speed curve for key scenarios based on the GAN method;
[0100] Figure 6a To generate rear vehicle interaction behavior result diagrams for key scenarios based on model-based methods;
[0101] Figure 6b To generate rear vehicle interaction behavior result diagrams for key scenarios based on the GAN method;
[0102] Figure 7 A comparison chart of quantitative evaluation results for key scenario combinations;
[0103] Figure 8 This is a chart showing the statistical results of the number of key scenarios under different weighting coefficients. Detailed Implementation
[0104] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0105] Example 1
[0106] See Figure 1 This invention provides a method for generating key scenarios for intelligent vehicles based on a personalized interactive driving-following model, comprising the following steps:
[0107] Step 1: Select the natural driving dataset and preprocess it;
[0108] We selected a natural driving dataset, filtered out small car following scenario data for driving style clustering, and constructed a following scenario library with uniform time series lengths. We then randomly selected a portion of following scenarios as the raw data for scenario generation, as follows:
[0109] 11) Cluster the data of different driving styles using publicly available natural driving datasets;
[0110] 12) Extract following scenarios from the dataset according to rules, and filter by vehicle type to eliminate the influence of vehicle type on driving style. Based on the following data of small cars, randomly select 70% of the following scenario data as the data input for driving style clustering.
[0111] 13) Standardize the temporal length of following scenarios to build a natural driving following scenario library, and randomly select 6,000 following scenarios from it as the initial data for key scenario generation.
[0112] Step 2: Construct a personalized interactive car-following model;
[0113] Car-following data for different driving styles were obtained through Principal Component Analysis (PCA) and K-means clustering. A Transformer network was constructed to extract long-term interaction characteristics from the natural driving data. A real-time compensator based on Support Vector Regression (SVR) was built using error data to fuse the real-time predicted vehicle speed value and the real-time compensated value, thereby obtaining three types of personalized interactive car-following models, as detailed below:
[0114] 21) Select feature variables that can reflect the aggressiveness of vehicle driving, and use the magnitude of the feature variable values to measure the differences between different driving styles. The feature variables are selected as follows: the mean of the absolute values of longitudinal speed X1 (m·s). -1 ), standard deviation of the absolute value of longitudinal velocity X2 (m·s) -1 ), the mean of the absolute value of longitudinal acceleration X3 (m·s) -2 ), the standard deviation of the absolute value of longitudinal acceleration X4 (m·s) -2 ), the mean longitudinal impact force X5 (m·s) -3 ), standard deviation of longitudinal impact X6 (m·s) -3 The vehicle impact J is the derivative of the acceleration, as shown in equation (1).
[0115]
[0116] In the formula, J represents the vehicle impact intensity, and a represents the vehicle acceleration.
[0117] 22) The above-mentioned feature variables have a strong correlation, which increases the redundancy of the data. In order to simplify the data and improve the clustering effect, principal component analysis is used to reduce the dimensionality of the original data.
[0118] First, the characteristic variables of different dimensions are normalized to obtain the standardized sample matrix X, and the covariance matrix R of the standardized sample is calculated as shown in equation (2).
[0119]
[0120] In the formula, X is the sample matrix; R is the sample covariance matrix; r ij X is the element value in the i-th row and j-th column of the sample covariance matrix; n is the sample size; p is the number of feature variables; X ki Let be the value of the element in the k-th row and i-th column of the sample matrix; Let be the mean of the j-th column of the sample matrix; other similar symbols are analogous.
[0121] Calculate the eigenvalues λ and corresponding eigenvectors of the covariance matrix R. Calculate the principal component contribution rate and cumulative contribution rate based on the eigenvalues, as shown in Equation (3). Select principal component coefficients with a cumulative contribution rate exceeding 85%.
[0122]
[0123] In the formula, λ is the eigenvalue of the covariance matrix; p is the number of eigenvariant variables;
[0124] 23) Multiply the principal component coefficients obtained by dimensionality reduction from principal component analysis with the original feature matrix to obtain the matrix used for clustering. Select the K-means algorithm to perform clustering analysis on the following scene data. The K-means algorithm aims to minimize the Euclidean distance between the sample and the cluster center. The objective function is shown in equation (4). Three types of driving style data are obtained through continuous iterative updates:
[0125]
[0126] In the formula, x represents the sample in the cluster; μ j For the cluster center of category j, r ij This indicates whether the i-th sample belongs to the j-th cluster; if yes, the value is 1, otherwise the value is 0.
[0127] 24) The time sliding window method is used to process time series data of different lengths. The time sliding window length is set to obtain stationary time series data. 50,000 sample time series data are randomly selected from the training samples of the aggressive, general and conservative cathodic models.
[0128] Construct a Transformer model to extract realistic interaction characteristics in following vehicle scenarios, and convert the following vehicle speed v and the front vehicle speed v l The position of the vehicle in front (r) l The position r of the rear vehicle is used as the four-dimensional time series input, and the speed v of the rear vehicle is used as the one-dimensional time series output. The long-term interaction characteristics are extracted and transformed into a mapping function f from the historical sequence to the future state under the given training network G, as shown in equation (5).
[0129]
[0130] In the formula, The time series from time i to time i+n is: [xi, xi+1, ..., xi+n]; This represents the time series from time t-(T-1) to time t: [v t -(T-1),v t-(T-2),...,v t ]; other similar symbols are treated similarly;
[0131] See Transformer model structure for reference. Figure 2 The Transformer model maps the input and output embeddings to the d_model dimension by linear transformation and adds positional encoding as input to the encoder and decoder. The positional encoding is used to capture the positional information of the sequence. The output of the final decoder is linearly transformed to match the desired output dimension. Finally, the mapping vector is processed by the Softmax layer to obtain the model's predicted output.
[0132] Set the position encoding of sine and cosine to be added to the time series data, as shown in equation (6);
[0133]
[0134] In the formula, pos is the position index in the time series; i is the position along the input embedding vector, from 0 to d_model / 2-1;
[0135] The time series data is divided into training and testing sets in an 8:2 ratio for network model training. The following parameters should be set during model training: learning rate, number of hidden neurons, Dropout, Batch_Size, input sequence dimension, output sequence dimension, d_model, number of attention heads, number of network layers, and number of iterations.
[0136] 25) Support vector regression machine (SVR) is used as an error compensator to compensate the baseline predictions of the model in real time.
[0137] The SVR model essentially maps samples that cannot be linearly regressed to a high-dimensional space for linear regression, and the regression function is shown in equation (7):
[0138] f(x) = w T h(x)+b (7)
[0139] In the formula, w is the size weight vector; h(x) is the feature mapping function that maps the original input space to the high-dimensional feature space; b is the bias term, representing the intercept of the hyperplane;
[0140] Support Vector Regression Machine with the addition of slack variable ξ i ξ i The optimized objective function is shown in equation (8):
[0141]
[0142] In the formula, c is the penalty factor;
[0143] The constraints are as shown in equation (9):
[0144]
[0145] In the formula, y i x is the output variable. i ε is the input variable; ε is the error coefficient;
[0146] Based on the optimization objective and constraints, the Lagrangian function is constructed as shown in equation (10):
[0147]
[0148] In the formula, α i α i , λ i , λ i ≥0 indicates a Lagrange multiplier;
[0149] Error time series data were obtained by comparing the baseline predictions and true values of the Transformer model. The data were divided into training and test sets in an 8:2 ratio. After normalizing the data, the optimal combination of the SVR model penalty factor c and the gamma parameter of the RBF function was found through iterative testing. Here, c represents the model’s tolerance for error, and gamma determines the distribution of the data in high-dimensional space.
[0150] The closer the SVR model score is to 1, the better the model fits the data and the better it generalizes to new data. We set the range of values for parameters c and gamma, and within this range, we searched for combined parameter values that make the model score close to 1. We also set the error coefficient epsilon value, the SVR model loss function as epsilon-SVR, and the radial basis function as exp(-gamma×|uv|). 2 );
[0151] 26) Based on the current scene state, the baseline prediction value of the vehicle speed in the next state is obtained using the Transformer model, and the error compensation value of the vehicle speed in the next state is obtained by combining the error compensator. The two are then fused (i.e. summed) to obtain three types of personalized interactive car-following models.
[0152] Step 3: Generate key scenarios;
[0153] Based on three types of personalized interactive car-following models, the scenario states in natural driving data are used as input stimuli. By using variable multi-weight allocation for different driving style car-following models, the car-following strategies of following vehicles are diversified, generating a large amount of scenario data and extracting key scenarios from it, as follows:
[0154] 31) Based on the three types of personalized interactive car-following models, the model output results are assigned multiple weights to show richer interactive features, as shown in Equation (11).
[0155]
[0156] In the formula, λ1, λ2, and λ3 are the output results of the aggressive, general, and conservative car-following models at time t, respectively; λ1, λ2, and λ3 are the weight coefficients of the aggressive, general, and conservative car-following models, respectively. The combined weighted result of the model at time t;
[0157] 32) The following scene data after the time series length is unified is used as the original data for scene generation (G=N). The scene generation steps based on the model are as follows: the initial state of the scene and the motion parameters of the preceding vehicle are used as input stimuli. Different weight coefficients are assigned to the personalized interactive following model as the following strategy of the following vehicle to follow the preceding vehicle. Each set of weight coefficients generates an equal amount of scene data based on the original scene data.
[0158] 33) The criticality of a scenario is measured by time to collision (TTC). The hazard levels of scenarios based on TTC are as follows: safe scenario (TTC < 0 or TTC > 5), emergency scenario (3 < TTC ≤ 5), urgent scenario (1 < TTC ≤ 3), and near-collision scenario (0 ≤ TTC ≤ 1). To demonstrate the criticality of different scenarios, this invention uniformly defines emergency scenario, urgent scenario, and near-collision scenario as critical scenarios with different criticalities. Based on this, critical scenario data with different criticalities are extracted from the generated scenarios.
[0159] Step 4: Evaluate key scenarios;
[0160] The generated key scenario data is evaluated comprehensively and from multiple dimensions based on indicators such as key scenario coverage, key scenario rationality, and key scenario diversity, as detailed below:
[0161] 41) Design coverage evaluation indicators for key scenarios to reflect the coverage of key scenario parameters;
[0162] The following scenario can be described by three parameters: the speed of the vehicle in front, the distance between the two vehicles, and the speed of the vehicle behind. First, the range of values for each parameter is determined to form the scenario parameter space. Each parameter is then discretized into intervals of 1m or 1m / s, thereby determining the number of all possible scenario parameters. However, not all scenario parameters are critical. Therefore, a critical scenario parameter factor Ui is introduced for correction, which represents the proportion of critical scenario parameters in the parameter space.
[0163] The generated key scenes are time-series data with a fixed time step. However, not all scene parameters in all time frames are critical. The key scene parameters are processed into integers, and the number of scene parameters in the key frames of the key scene data is selected to measure the coverage of the key scenes. However, it should be noted that the same key scene parameters should be excluded. The method for evaluating the coverage of key scenes is shown in Equation (12):
[0164]
[0165] In the formula, S_coverage represents the coverage of the key scene; key_fps_count represents the number of keyframes in the key scene; and all_fps_count represents the number of all scene parameters in the scene space, using the key scene parameter factor U. i Make corrections;
[0166] 42) A high coverage of key scenarios does not necessarily mean that the model generates key scenarios better. The generated key scenarios may not conform to actual driving behavior. Therefore, a reasonableness evaluation index for key scenarios should be designed.
[0167] Considering that the degree of change in the actual driving behavior of the vehicle should not be too drastic, the rationality of the key scenario is evaluated by the smoothness of the trajectory of parameters such as the speed of the preceding vehicle, the distance between the two vehicles, and the speed of the following vehicle. First, the different parameter trajectories are smoothed. The rationality of the key scenario is quantitatively evaluated by calculating the distance between the smoothed parameter trajectory and the original parameter trajectory, as shown in Equation (13):
[0168]
[0169] In the formula, S_rational represents the rationality of the key scenario; NDis(·) is the distance function after normalization between parameter trajectories, where Dis(X,Y)=∑ i |Xi-Y i |; s_count is the number of key scenarios; p_count is the number of parameters describing the following scenario; X is the original parameter trajectory; X* is the smoothed parameter trajectory; ξ j Weighting values for the rationality of parameter trajectories in different types of scenarios;
[0170] 43) High coverage and reasonableness of key scenarios do not necessarily mean good diversity of key scenarios. The model may generate a large number of homogeneous scenarios. Although it ensures the reasonableness of the scenarios and achieves high coverage of key scenario parameters, it does not generate diverse driving behaviors. Therefore, a diversity evaluation index for key scenarios is designed.
[0171] The diversity of key scenarios should take into account both the shape similarity of the parameter trajectories and the magnitude of their relative distances. Therefore, Dynamic Time Warping (DTW) is used as the basis to measure the diversity between different parameter trajectories, as shown in Equation (14):
[0172]
[0173] In the formula, S_various represents the diversity of key scenarios; s_count represents the number of key scenarios; p_count represents the number of parameters describing the following scenario; θ j The weights are assigned to the diversity of parameter trajectories in different types of scenarios; NDTW(·) is the quantized value after dynamic time warping and normalization between two parameter trajectories, used to simultaneously evaluate the shape similarity and distance similarity between parameter trajectories; the calculation method of DTW(·) is shown in Equation (15):
[0174]
[0175] In the formula, D(·) is the Euclidean distance calculation function; i and j are the lengths of time series data X1 and X2, respectively. The DTW quantization values of the two time series data are obtained through continuous dynamic calculation.
[0176] Example 2
[0177] We selected the HighD Natural Driving dataset and filtered out small car following scenario data for driving style clustering. We selected 50,000 data points each for conservative, general, and aggressive driving style clustering to train the Transformer network. The parameters were set as follows: input sequence dimension 4, output sequence dimension 1, d_model 128, attention mechanism heads 8, learning rate 0.0005, network layers 3, hidden neurons 64, Dropout 0.1, iterations 30, and batch size 64. At the same time, we trained the SVR with error time series data with the following parameters: c = 2.0 and gamma = 2.0. This resulted in three types of personalized interactive car following models.
[0178] The interaction effect of the car-following model was tested by comparing it with a car-following model constructed using an Intelligent Driver Model (IDM) and a Long Short-Term Memory (LSTM) network. The parameters of the IDM model were selected as follows: Aggressive mode: maximum acceleration of the vehicle 3.0 m / s². -2 Comfortable deceleration 1.0 m / s -2 Expected headway: 1.9s; Expected speed: 39.4m / s -1Minimum distance: 2.0m; Standard model: Maximum acceleration: 1.5m / s² -2 Comfortable deceleration 1.0 m / s -2 Expected headway: 1.9s; Expected speed: 28.8m / s -1 Minimum distance 2.0m, conservative type: maximum acceleration of this vehicle 1.0m·s⁻¹ -2 Comfortable deceleration 1.0 m / s -2 Expected headway: 1.9s; Expected speed: 24.0m / s -1 The minimum distance is 2.0m. The LSTM network training data is the same as the Transformer, with the following parameter settings: input sequence dimension 4, output sequence dimension 1, number of hidden neurons 128, learning rate 0.0005, number of network layers 1, Dropout 0.1, number of iterations 30, and batch size 64. For comparison results of model interaction effects, please refer to [link / reference]. Figures 3a-3f The results show that the car-following model proposed in this invention has a significantly better interaction effect than the car-following model constructed by IDM and LSTM networks. The interaction characteristics extracted by the model are more consistent with the actual driving state, and the details are more fully expressed.
[0179] Six thousand original scene data points were selected. By assigning 3, 6, and 10 different weight coefficients to the following vehicles, 18,000 (G=3N), 36,000 (G=6N), and 60,000 (G=10N) scene data points were generated using a model-based (MB) method. A GAN-based (GB) method was used for comparison. The generator G consisted of a fully connected neural network and multiple ReLU activation functions, and the discriminator D also consisted of a fully connected neural network and multiple ReLU activation functions. The model's batch size was 64. The learning rate of both generator G and discriminator D is 0.0003, the dimension of the latent vector is 64, and the number of training epochs is 200. This is used as a comparison model for model-based scene generation methods. The original data is used as input to train generator G. Generator G generates 18,000 (G=3N), 36,000 (G=6N), and 60,000 (G=10N) scene data respectively. The criticality of each scene is evaluated based on the value of TTC. From this, key scenes with different criticalities are extracted. Based on the generated key scene data, the coverage, rationality, and diversity of key scenes are evaluated.
[0180] Key scenario coverage evaluation: The range of values for the following vehicle's speed, distance between the two vehicles, and speed of the following vehicle in the following scenario is determined to be (0, 120m], (0, 60m / s], and (0, 60m / s], respectively. Therefore, all_fps_count is set to 120 × 60 × 60. The key scenario parameter factor U... i The value is 0.015. For the comparison results of key scenario coverage evaluation, please refer to [link / reference]. Figures 4a-4g As can be seen from the figure, model-based methods can efficiently cover key scene parameters in different regions and have a wider coverage, while GAN-based methods tend to cover the same parameter regions.
[0181] Key scenario rationality evaluation: p_count is 3. The weights for the rationality of the preceding vehicle's speed parameter trajectory ξ1 are 0.2, the weights for the rationality of the distance parameter trajectory between the two vehicles are 0.2, and the weights for the rationality of the following vehicle's speed parameter trajectory ξ3 are 0.6. The original parameter curves are smoothed using the moving average method, with a window size of 20. See the comparison results of the key scenario rationality evaluation. Figure 5a and Figure 5b As can be seen from the figure, the speed parameter curve of the rear vehicle in the scene generated by the GAN-based method is relatively steep, which does not conform to the actual driving behavior of the vehicle, resulting in a decrease in the rationality of the key scene.
[0182] Key scenario diversity assessment: p_count is 3. The weights for the diversity of the preceding vehicle's speed parameter trajectory (θ1) are 0.2, the weights for the diversity of the two-vehicle distance parameter trajectory (θ2) are 0.2, and the weights for the diversity of the following vehicle's speed parameter trajectory (θ3) are 0.6. See the comparison results of the key scenario diversity assessment. Figure 6a and Figure 6b It can be seen that GAN generates more homogeneous scenarios, and the speed parameters of the following vehicles are concentrated in the range of 30 to 36 m / s. The generated key scenarios have a high degree of similarity. In contrast, the model-based method can generate more diverse driving behaviors of the following vehicles through the multi-weight allocation of the personalized interactive car-following model. The speed parameters of the following vehicles are more dispersed, which improves the diversity of key scenarios.
[0183] Quantitative Evaluation of Key Scene Combinations: See the comparison results of quantitative evaluation of key scene combinations when generating different numbers of scenes. Figure 7 As can be seen from the figure, with the increase of the number of generated scenes, the model-based method proposed in this invention can achieve efficient coverage of key scene parameters and increase the diversity of key scenes while ensuring that the rationality of key scenes is not excessively reduced.
[0184] Scene data was generated and key scenes were extracted by assigning weight coefficients (λ1, λ2, λ3) of (0.1, 0.1, 0.8), (0.8, 0.1, 0.1), (0.2, 0.3, 0.5), and (0.5, 0.3, 0.2) respectively. For statistics on the number of key scenes generated under different weight coefficients, please refer to [link / reference]. Figure 8 Meanwhile, the key scene data generated under weight coefficients (0.1, 0.1, 0.8), (0.2, 0.3, 0.5), (0.5, 0.3, 0.2), and (0.8, 0.1, 0.1) is the average speed of the vehicle in front (m·s). -1 ), average speed of following vehicle (m·s) -1 The mean distances (m) between the two vehicles are (24.04, 26.52, 29.13), (23.89, 27.33, 30.44), (24.52, 30.65, 35.02), and (25.04, 32.17, 35.35), respectively. It can be seen that by giving the aggressive car-following model a larger weight coefficient, relatively aggressive driving behavior can be generated, tending to generate more key scenarios with vehicles at higher speeds and greater relative distances. Giving the conservative car-following model a larger weight coefficient has the opposite effect, indicating that the method provided by this invention can guide the generation direction of key scenarios to a certain extent.
[0185] In summary, the model-based key scene generation method proposed in this invention is significantly better than the GAN-based key scene generation method, effectively improving the aforementioned problems of current methods when generating scenes based on natural driving data, and providing strong support for the testing and evaluation of intelligent vehicles.
[0186] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for generating key scenarios for intelligent vehicles based on a personalized interactive driving-following model, characterized in that, Includes the following steps: Step 1: Select the natural driving dataset and preprocess it; We selected the Natural Driving dataset, filtered out the small car following scenario data for driving style clustering, uniformly constructed a following scenario library based on its time series length, and randomly extracted some following scenarios as the original data for scenario generation. Step 2: Construct a personalized interactive car-following model; Principal component analysis and K-means clustering were used to obtain car-following data for different driving styles. A Transformer network was constructed to extract long-term interaction characteristics from natural driving data. Error data was used to establish a real-time compensator based on support vector regression machine. The real-time predicted value and real-time compensation value of vehicle speed were fused and calculated to obtain three types of personalized interactive car-following models. Step 3: Generate key scenarios; Based on three types of personalized interactive car-following models, the scene state in natural driving data is used as input stimulus. The car-following strategy of the following vehicle is diversified by the variable multi-weight allocation of different driving style car-following models, generating a large amount of scene data and extracting key scenes from it. Step 4: Evaluate key scenarios; The generated key scenario data is evaluated in a comprehensive and multi-dimensional manner based on indicators such as key scenario coverage, key scenario rationality, and key scenario diversity. The specific method for step two is as follows: 21) Select characteristic variables that can reflect the aggressiveness of vehicle driving, and use the magnitude of the characteristic variable values to measure the differences between different driving styles. The characteristic variables are selected as follows: mean of the absolute value of longitudinal speed X1, standard deviation of the absolute value of longitudinal speed X2, mean of the absolute value of longitudinal acceleration X3, standard deviation of the absolute value of longitudinal acceleration X4, mean of the longitudinal impact X5, standard deviation of the longitudinal impact X6. The vehicle impact J is the derivative of acceleration, as shown in equation (1). (1) In the formula, J represents the vehicle impact intensity, and a represents the vehicle acceleration. 22) Principal component analysis was used to reduce the dimensionality of the original data; First, the characteristic variables of different dimensions are normalized to obtain the standardized sample matrix X, and the covariance matrix R of the standardized sample is calculated as shown in equation (2). (2) In the formula, The sample matrix; The sample covariance matrix; The first element in the sample covariance matrix Line number The element values of the column; The number of samples; The number of feature variables; For the sample matrix, the first... Line number The element values of the column; For the sample matrix, the first The mean of the column; Calculate the covariance matrix eigenvalues And the corresponding eigenvectors, and calculate the principal component contribution rate and cumulative contribution rate based on the eigenvalues, as shown in Equation (3), and select the principal component coefficients with a cumulative contribution rate of more than 85%; (3) In the formula, These are the eigenvalues of the covariance matrix; The number of feature variables; 23) Multiply the principal component coefficients obtained from dimensionality reduction by principal component analysis with the original feature matrix to obtain the matrix used for clustering. Select... The algorithm performs cluster analysis on the data from the following vehicle scenario. The algorithm aims to minimize the Euclidean distance between the sample and the cluster center. The objective function is shown in equation (4). The algorithm obtains three types of driving style data through continuous iterative updates: (4) In the formula, Samples for clustering; For category Cluster centers For the first Does the _ sample belong to the _ ... If there are clusters, the value is 1 if it is a cluster and 0 otherwise. 24) The time sliding window method is used to process time series data of different lengths. The time sliding window length is set to obtain stationary time series data. 50,000 sample time series data are randomly selected from the training samples of aggressive, general and conservative cathodic models. Build The model extracts real-world interaction characteristics in following scenarios, including the speed of the vehicle behind. Speed of the vehicle in front Position of the vehicle in front Rear vehicle position As a four-dimensional time series input, the speed of the following vehicle As a one-dimensional time series output, the extraction of long-term temporal interaction characteristics is transformed into a given training network. In the case of a mapping function from a historical sequence to a future state As shown in equation (5); (5) In the formula, Indicates from time Time The time series consists of: ; That is to represent from time Time The time series consists of: ; The model maps the input embedding and output embedding to a linear transformation. The dimension is then modified and positional encoding is added as input to the encoder and decoder. Positional encoding captures the positional information of the sequence. The output of the final decoder undergoes a linear transformation to match the desired output dimension. Finally, the mapped vector is processed... The predicted output of the model is obtained through layer calculation; Set the positional encoding of sine and cosine for time series data, as shown in equation (6); (6) In the formula, For location index in time series; For the position along the input embedding vector, from 0 to ; The time-series data is divided into training and testing sets in an 8:2 ratio for network model training. The following parameters should be set during model training: learning rate, number of hidden neurons, ... , Input sequence dimension, output sequence dimension Attention mechanism head count, network layer count, and number of iterations; 25) Using Support Vector Regression Machine As an error compensator, it compensates the model's baseline predictions in real time. The model essentially maps samples that cannot be linearly regressed to a high-dimensional space for linear regression, and the regression function is shown in equation (7): (7) In the formula, This is a size weight vector; This is a feature mapping function that maps the original input space to a high-dimensional feature space. This is the bias term, representing the intercept of the hyperplane; Support Vector Regression Machine with Slack Variables , The optimization objective function is as shown in equation (8): (8) In the formula, As a penalty factor; The constraints are as shown in equation (9): (9) In the formula, For output variables; For input variables; The error coefficient; Based on the optimization objective and constraints, the Lagrange function is constructed as shown in equation (10): (10) In the formula, , , , ≥0 indicates a Lagrange multiplier; use Error time-series data is obtained by comparing the model's baseline predictions with the true values. This data is then divided into training and testing sets in an 8:2 ratio. After normalization, the data is searched by iterating through the test cases. Model penalty factor and function The optimal combination of parameter values, where, This represents the model's tolerance for error. This determines the distribution of data in high-dimensional space; The closer the model's score is to 1, the better the model fits the data and the better it generalizes to new data. (Parameter settings are also important.) , The range of values for is determined, and within this range, a combination of parameter values is found that makes the model score close to 1, and an error coefficient is set. The value, The model loss function is set to The radial basis functions are set to ; 26) Based on the current scene state, utilize The model obtains the baseline prediction value of the vehicle speed in the next state, and combines it with the error compensation value of the vehicle speed in the next state obtained by the error compensator. The two are then fused and calculated to obtain three types of personalized interactive car-following models.
2. The method for generating key scenarios for intelligent vehicles based on a personalized interactive car-following model according to claim 1, characterized in that, The specific method for step one is as follows: 11) Cluster the data of different driving styles using publicly available natural driving datasets; 12) Extract following scenarios from the dataset according to rules, and filter by vehicle type to eliminate the influence of vehicle type on driving style. Based on the following data of small cars, randomly select 70% of the following scenario data as the data input for driving style clustering. 13) Standardize the temporal length of following scenarios to build a natural driving following scenario library, and randomly select 6,000 following scenarios from it as the initial data for key scenario generation.
3. The method for generating key scenarios for intelligent vehicles based on a personalized interactive car-following model according to claim 1, characterized in that, The specific method for step three is as follows: 31) Based on the three types of personalized interactive car-following models, the model output results are assigned multiple weights to show richer interactive features, as shown in Equation (11); (11) In the formula, , , The outputs of the aggressive, general, and conservative carousel models at time t are shown respectively. , , These are the weight coefficients for the aggressive, general, and conservative car-following models, respectively. The combined weighted result of the model at time t; 32) The following scene data after the time series length is unified is used as the original data G=N for scene generation. The scene generation steps based on the model are as follows: the initial state of the scene and the motion parameters of the preceding vehicle are used as input stimulus. Different weight coefficients are assigned to the personalized interactive following model as the following strategy of the following vehicle to follow the preceding vehicle. Each set of weight coefficients generates an equal amount of scene data based on the original scene data. 33) Measure the criticality of a scene by collision time, based on The danger levels of the scenarios are as follows: safe scenarios are... <0 or >
5. Emergency scenarios, i.e., 3< ≤5, urgent scenarios, i.e., 1< ≤3, near-collision scenario, i.e., 0≤ ≤1, emergency scenarios, urgent scenarios, and near-collision scenarios are uniformly defined as key scenarios with different levels of criticality, and based on this, key scenario data with different levels of criticality are extracted from the generated scenarios.
4. The method for generating key scenarios of intelligent vehicles based on a personalized interactive car-following model according to claim 1, characterized in that, The specific method for step four is as follows: 41) Design coverage evaluation indicators for key scenarios to reflect the coverage of key scenario parameters; The following scenario can be described by three parameters: the speed of the vehicle in front, the distance between the two vehicles, and the speed of the vehicle behind. First, the value range of each parameter is determined to form the scenario parameter space. Then, each parameter is discretized into intervals of 1m or 1m / s, thereby determining the number of all possible scenario parameters. However, not all scenario parameters are critical; therefore, a critical scenario parameter factor is introduced. The correction is made to represent the proportion of key scenario parameters in the parameter space; The generated key scenes are time-series data with a fixed time step. However, not all scene parameters in all time frames are critical. The key scene parameters are processed into integers, and the number of scene parameters in the key frames of the key scene data is selected to measure the coverage of the key scenes. However, it should be noted that the same key scene parameters should be excluded. The method for evaluating the coverage of key scenes is shown in Equation (12): (12) In the formula, For coverage of key scenarios; The number of keyframes in a critical scene; This represents the number of all scene parameters in the scene space, using a key scene parameter factor. Make corrections; 42) Design rationality evaluation indicators for key scenarios; The rationality of a key scenario is evaluated by the smoothness of the trajectories of parameters such as the speed of the preceding vehicle, the distance between the two vehicles, and the speed of the following vehicle. First, different parameter trajectories are smoothed. The rationality of the key scenario is then quantitatively evaluated by calculating the distance between the smoothed parameter trajectory and the original parameter trajectory, as shown in Equation (13): (13) In the formula, For the rationality of key scenarios; Let be the normalized distance function between the parameter trajectories, where ; The number of key scenarios; To describe the number of parameters in a following vehicle scenario; This represents the original parameter trajectory; The smoothed parameter trajectory; Weighting values for the rationality of parameter trajectories in different types of scenarios; 43) Design diversity evaluation indicators for key scenarios; The diversity of key scenarios should take into account both the shape similarity of the parameter trajectories and the magnitude of their relative distances. Therefore, dynamic time warping is used as the basis to measure the diversity between different parameter trajectories, as shown in Equation (14): (14) In the formula, For the diversity of key scenarios; The number of key scenarios; To describe the number of parameters in a following vehicle scenario; Assign weight values to accommodate the diversity of parameter trajectories in different types of scenarios; The quantized value after dynamic time warping and normalization between two parameter trajectories is used to simultaneously evaluate the shape similarity and distance similarity between parameter trajectories; The calculation method is shown in equation (15): (15) In the formula, The function for calculating Euclidean distance; , Time series data , The length of the two time-series data points is obtained through continuous dynamic calculation. Quantified value.