Automatic driving key edge scene generation method based on causal multidirectional particle swarm

Through the combination of causal multidirectional particle swarm algorithm and VAE, key edge scenarios in the autonomous driving system are generated, which solves the problem of difficulty in generating key edge scenarios in the existing technology, and improves the performance evaluation efficiency and safety of the autonomous driving system.

CN119761196AActive Publication Date: 2025-04-04EAST CHINA NORMAL UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411886699.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-04
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

The prior art is difficult to effectively generate key edge scenarios in autonomous driving systems, resulting in insufficient performance evaluation of autonomous driving systems in extreme or complex situations.

Method used

A method based on causal multidirectional particle swarm algorithm is adopted to generate key edge scenarios of autonomous driving through logical scene model and VAE (variable autoencoder) combined with importance sampling algorithm.

Benefits of technology

The performance evaluation efficiency of the autonomous driving system in key edge scenarios is improved, and the generated scenarios are more in line with the actual distribution, enhancing the safety and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761196A_ABST
    Figure CN119761196A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic driving key edge scene generation method based on a causal multidirectional particle swarm, and in a scene-based automatic driving system test process, a key scene and an edge scene are very important for improving test efficiency. The key scene generally refers to a scene generating security challenge to a tested system, and the edge scene generally refers to a scene with very low probability in scene distribution. The invention aims to combine and improve an optimization algorithm and a variational auto-encoder to generate an automatic driving safety key edge scene. According to the method, in the optimization process, the FGES algorithm is iteratively used for causal relationship mining, the particle speed is adjusted through the causal relationship, and therefore the key scene is optimized more efficiently. After an optimization algorithm is used for carrying out preliminary traversal on a scene space, a variational auto-encoder is used for fitting distribution of a sample space, and finally an edge scene can be obtained through a sampling technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of autonomous driving scenarios, and is mainly used for autonomous driving safety-critical and edge scene generation problems. Background Art

[0002] In order to accelerate the testing and verification of autonomous driving systems, scenario-based simulation testing has become an important research direction. By utilizing high-performance computers, various simulation scenarios can be quickly generated and run to evaluate the safety and reliability of autonomous driving systems under different conditions. However, among these scenarios, only a small number of scenarios, called critical scenarios, are most important for the test system. These critical scenarios usually refer to complex or extreme situations that may cause accidents during actual driving. In reality, the probability of critical scenarios is very low, so it is not feasible to rely entirely on road-collected scenario test data. This is because it is difficult to capture enough critical scenarios in actual driving data to fully evaluate and verify the performance of autonomous driving systems. Therefore, it is particularly important to develop effective methods to generate these critical scenarios. Summary of the invention

[0003] The present invention discloses a method for generating key edge scenarios for autonomous driving based on a causal multidirectional particle swarm algorithm, with the purpose of effectively generating key safety scenarios and edge scenarios for autonomous driving.

[0004] The specific technical solution for achieving the purpose of the present invention is:

[0005] A method for generating key edge scenarios for autonomous driving based on causal multidirectional particle swarm, comprising the following specific steps:

[0006] Step 1: Based on the standard autonomous driving scenario model, give the logical model of the modeled autonomous driving scenario

[0007] 1.1: Clarify the elements of autonomous driving scenarios;

[0008] 1.2: Model the logical model of the scenario through the autonomous driving scenario modeling language;

[0009] Step 2: Generate key scenarios and scenario sample data sets based on causal multidirectional particle swarm algorithm

[0010] 2.1: Use chaotic iteration to initialize the population, and record the current population as P;

[0011] 2.2: Enter the iteration and calculate the fitness of all individuals in the population P;

[0012] 2.3: Update the global optimal point set P o , and individual local optimal points;

[0013] 2.4: Use the causal discovery algorithm to calculate the causal relationship between individual positions and fitness;

[0014] 2.5: Update the speed of all individuals, and correct the speed of the individual based on the causal relationship, and finally update the position of the individual based on the corrected speed;

[0015] 2.6: Add the positions of all individuals to the scene sample dataset D;

[0016] 2.7: If the maximum number of iterations is reached, then end, otherwise repeat step 2;

[0017] Step 3: Combine VAE and importance sampling algorithm to generate key edge scenes

[0018] 3.1: Based on the scene sample dataset D, use VAE training to fit its distribution; during the training process, the Adam optimizer is used to optimize and finally obtain the distribution of the latent space z and the VAE decoder d;

[0019] 3.2: Use the sampling method to sample the latent space z and map it through the decoder to obtain the key edge scene.

[0020] Furthermore, the elements of the autonomous driving scenario are clarified as described in step 1.1, specifically: a generally applicable scenario model such as ISO34501, a standard hierarchical model, is used. This model divides all the elements contained in a complete autonomous driving scenario into the following hierarchical categories:

[0021] Layer 1: Road layer, which describes the geometric topological structure of the road network and mainly describes the basic information of the lanes, including road length, lane network structure, lane curvature and road surface quality;

[0022] Layer 2: Traffic infrastructure layer, describing the structure boundaries, obstacles, traffic signs and traffic light information;

[0023] Layer 3: Temporary operations layer, which is a temporary operation of layers 1 and 2, describing temporary construction sites, road construction or additional static objects to supplement the scene elements;

[0024] Layer 4: Object layer, describing traffic participants, including motor vehicles and vulnerable road users such as pedestrians;

[0025] Layer 5: Environmental layer, including external conditions such as weather, time, and road conditions.

[0026] Step 1.2: Model the logical model of the scene using the autonomous driving scene modeling language.

[0027] The method for modeling autonomous driving scenarios proposed in the SML4ADS modeling language is adopted. Relevant literature has been published on this language. Its metamodel includes various factors required for autonomous driving scenarios and provides complete simulation functions. Based on SML4ADS, parameter values ​​or a numerical range of all required elements are given. If a numerical value is given for an element, it means that the element is determined and does not need to be optimized, that is, the subsequent optimization parameter space dimension will not consider the element. If a parameter range is given for an element, the parameter space dimension is increased by one in the subsequent optimization. The logical model of the scene can be obtained after the SML4ADS element assignment is completed, and all scene parameter dimensions specified as parameter ranges constitute the feature space of the logical scene model.

[0028] Further, the step 2.1 specifically includes:

[0029] In order to obtain multiple key scenarios that meet the conditions in one algorithm run, a global optimal point set P should be maintained. o , two hyperparameters are needed to maintain this set, the target fitness threshold t and the target number of results m; where m is P o The size of t is added to P o The fitness of a particle is defined as the criticality of the particle to a specific scene. A particle with a fitness greater than t is considered to be a sample of a critical scene, and it is expected to obtain at most m scene samples with a fitness greater than t.

[0030] Given a population P of size n, use chaotic iteration to initialize a population P of size n. Initialize P o An empty pile of roots.

[0031] Further, the step 2.2 specifically includes:

[0032] The calculation of individual fitness, i.e. criticality, relies on the Carla simulator, which has been widely used in simulations related to autonomous driving. In Carla, in addition to being able to obtain vehicle status information, i.e. speed, direction, and position, through the API, it is also possible to give the collision force when the vehicle collides, thus allowing for an additional dimension to be considered in the criticality calculation; the formula for calculating fitness, i.e. scene criticality, is as follows:

[0033] C=w1·C υ +w2·C d +w3·C a +w4·C collision

[0034] Fitness consists of four items, w, w2, w3 and w4 represent the weights of the four items; C v represents the speed complexity, C drepresents the distance complexity, C a represents the acceleration complexity, C collision Indicates the degree of collision risk; the collision intensity is determined by the physical quantities when the collision occurs (such as collision speed, impact angle, etc.), but in the Carla simulator, this is directly obtained through the API; if no collision occurs, this item is 0; in speed complexity, the higher the speed, the greater the driving risk, so the speed-related complexity is expressed as the sum of the squares of the speeds of all traffic participants (reflecting the energy brought by speed):

[0035]

[0036] where v i represents the speed of the i-th traffic participant, and N represents the number of traffic participants;

[0037] When considering distance complexity, the smaller the distance, the more dangerous the scene, so the minimum distance between all traffic participants is used to measure the complexity; in order to avoid the complexity tending to infinity when the distance is very small, an inverse proportional function weighting process is used:

[0038]

[0039] where dis ij represents the distance between the i-th traffic participant and the j-th traffic participant; ∈ is a small positive number used to avoid division by zero error when the distance is zero; N represents the number of traffic participants;

[0040] Finally, there is acceleration complexity. The drastic change in acceleration will increase driving uncertainty and danger, so the complexity is measured by the sum of the squares of acceleration:

[0041]

[0042] where a i represents the acceleration of the ith traffic participant, and n represents the number of traffic participants.

[0043] Further, the step 2.3 specifically includes:

[0044] The global optimal point set is maintained during the algorithm operation. The data structure of this point set uses a small root heap, which reduces the average time complexity of the algorithm. For all individual positions of the current population, if the fitness is greater than t and the fitness of the heap vertex, then the point is added to P o and delete the point with the smallest fitness, that is, the point at the top of the heap; for each individual position point of the current population, if the fitness is greater than the individual's local optimal position point, the individual's local optimal position point is updated to the current position.

[0045] Further, it is characterized in that the step 2.4 specifically includes:

[0046] In order to improve the efficiency of the algorithm in finding key scenes and alleviate the problem of local optimality, causality will be introduced to improve the algorithm. In this step, this method uses the FGES algorithm to calculate the causal relationship between individual positions and fitness for the current population, and returns it in the form of a directed acyclic graph, denoted as G. The FGES algorithm has been improved on the basis of the GES algorithm, making the calculation of causal relationships faster.

[0047] Further, the step 2.5 specifically includes:

[0048] First, for all individuals in the current population, the speed will be updated according to the following update formula:

[0049] v i =ω×v i +c1×rand()×(pbest i -x i )+c2×rand()×(gbest i -x i )

[0050] where v i represents the velocity of the ith particle, x i represents the position of the ith particle; w is the inertia factor, which is non-negative and represents the influence of its last velocity and direction; c and c2 represent learning factors, which represent the weights of the experience parts from its own best and global best; the rand function generates a random number between 0 and 1; pbest i represents the best position that the i-th particle has ever reached; gbest i represents the P closest to the i-th particle o Position in

[0051] The difference from the original algorithm is that this method does not maintain a global optimal point gbest i , but a global optimal point set P o ; So, for gbest in the above formula i , use the P that is closest to the current individual and has a greater fitness than the current individual o In this way, the algorithm searches not in a certain optimal direction, but in all possible better directions, thereby searching the entire sample space more and preparing for the next step.

[0052] The individual speed obtained by the above is recorded as v; afterwards, the speed needs to be adjusted according to the causal relationship so that it moves in the direction more related to fitness; according to the directed acyclic graph G, the outgoing point of each directed edge is the cause of the incoming point, and the incoming point is the result of the outgoing point; for each dimension of the individual speed, check whether the dimension is the direct cause of fitness in the directed acyclic graph, that is, check whether the variable dimension node has an edge to the fitness node; if it is the direct cause of fitness, the speed of this dimension remains unchanged, otherwise the speed of this dimension will be attenuated, which is achieved by multiplying it by a attenuation coefficient less than 1; the individual speed corrected by the causal relationship is recorded as v′, and then the current individual position is updated using v′ to obtain the position of the new individual;

[0053] υ′ i =ω i ·υ i

[0054] where v i is the current velocity in the i-th dimension; ω i is the attenuation factor of the i-th dimension; finally, v′ is obtained as follows:

[0055] υ′=(υ′1, υ′2,…, υ′ V )

[0056] Where V represents the dimension of velocity.

[0057] Further, the step 3.1 specifically includes:

[0058] First, define each scene in the dataset D that is input to the VAE as a vector x, as well as the encoder Encoder and decoder Decoder, represented by e and d respectively; e is to solve q(z|x), mapping the input x to the distribution of the latent space parameter z, assuming that z obeys the standard normal distribution; d is to solve p(x|z), mapping the latent space parameter z to the distribution of the training sample x;

[0059] In practice, the VAE encoder used consists of 3 fully connected layers, each layer contains 128 to 256 neurons, using the ReLU activation function; mean and variance output layer: the last layer outputs the mean and log-variance of the latent space respectively, which are used to sample from the Gaussian distribution; the decoder also consists of 2 to 3 fully connected layers, with the same number of neurons as the encoder; the number of neurons in the last layer is the number of variables for each scene data sample; the design of this network can ensure that the model fits the distribution well on smaller sample data sets, and the dimension of the latent space can be adjusted according to the complexity of the data set; if the distribution of the data has large nonlinear characteristics, consider using a deeper network structure.

[0060] There are two training goals for VAE, which are to make q(z|x) and q(z) as close as possible and to make the decoder output and x as close as possible; therefore, the loss function is defined by two parts, the first of which is defined by KL divergence:

[0061]

[0062] q(z|x) is the latent variable obtained by the encoder network, and the posterior distribution of z is the conditional distribution; p(z) is the prior distribution of the latent variable z, which is usually assumed to be a standard normal distribution N(0,I); μ and σ are the mean and variance of the latent variable learned from the encoder;

[0063] The second part measures the reconstruction error and is defined as follows:

[0064] ReconstructionLoss = E q(z|x) [logp(x|z)]

[0065] Where p(x|z) is the probability distribution generated by the decoder, describing the possibility of reconstructing data x given the latent variable z; logp(x|z) is the log-likelihood measure based on the input data and the generated data; it is used to measure the similarity between the data generated by the decoder and the original data; E represents the calculation of the log-likelihood of reconstruction under the latent variable q(z|x) through expectation calculation, that is, summing over different latent samples;

[0066] The training steps are as follows:

[0067] Initialize model parameters and randomly initialize the parameters of the encoder and decoder;

[0068] Forward propagation, input the input data x into the encoder to obtain the distribution parameters μ and σ of the latent variables;

[0069] Sample z from the distribution of latent variables; input z into the decoder to obtain the reconstructed data x';

[0070] Calculate the loss and calculate the total loss according to the aforementioned loss function;

[0071] Back propagation and parameter update, use optimization algorithms (such as Adam) to update model parameters to minimize the loss function; repeat the above steps until the model converges or the maximum number of training times is reached. The distribution p(z) of the latent space z finally obtained obeys the standard normal distribution N(0,I), and the decoder d composed of multiple linear network layers.

[0072] Further, the step 3.2 specifically includes:

[0073] Sampling is performed from the fitted sample distribution to obtain scenes with sufficiently low probability and mapped by the decoder d, which are generally considered key edge scenes. Since the distribution is fitted by the algorithm, the obtained edge scenes are more consistent with the real distribution.

[0074] The sampling method uses the general acceptance-rejection sampling method, that is, first set a probability threshold of a sample, set to p s ; Each time, sample a batch of data from the distribution obtained in the previous step, assuming the number is m; calculate the corresponding probability value for each sample, if the probability value of the sample is less than or equal to p s , then keep it, otherwise discard it; this process is repeated until the retained target sample reaches the threshold or the number of cycles reaches the maximum.

[0075] The present invention is used to generate key edge specific scenes from the logical scene model of autonomous driving. Causality theory is introduced on the basis of the particle swarm algorithm, and the particle velocity update process of the particle swarm algorithm is guided by the causal relationship between variables and fitness, thereby alleviating the shortcomings of local optimality and low search efficiency and improving the efficiency of optimizing key scenes. At the same time, the introduction of the global optimal position set and the multi-directional strategy for updating the particle velocity improves the degree of global search of the feature space and provides a good foundation for the fitting of subsequent sample distributions. Finally, the distribution of key scenes is fitted in combination with VAE, and the acceptance-rejection sampling and importance sampling algorithms are used to sample the edge scenes, which effectively solves the generation problem of edge scenes and improves the accuracy of the obtained edge scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 It is a framework diagram of the method flow of the present invention;

[0077] Figure 2 This is a schematic diagram of an overtaking scenario;

[0078] Figure 3 This is a flow chart of step 2 of the present invention;

[0079] Figure 4-6 For experimental records, they are schematic diagrams of the initialization scene and the key scenes after two algorithm optimizations. DETAILED DESCRIPTION

[0080] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments. The overall process is as follows: Figure 1 This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0081] This embodiment takes a typical autonomous driving overtaking scenario as an example to illustrate the specific implementation method. Figure 2It is a schematic diagram of a scene from a bird's-eye view. There are three vehicles in the embodiment scenario, namely B, E and F. The three vehicles are driving in the same direction of the road, and vehicles B and F will maintain a constant speed throughout the scene. Vehicle E will accelerate at a constant acceleration based on the initial speed. When the distance between vehicle E and the preceding vehicle F is less than or equal to dis, vehicle E will choose to change lanes to the left while keeping the acceleration unchanged. After the lane change is completed, it will continue to move forward at a constant speed.

[0082] First, the scene is modeled according to the hierarchical scene model of autonomous driving. For the road layer, the OpenDRIVE standard is used to describe the road structure of the scene. In this scene, there is only one road Road0, which contains two lanes, Lane0 and Lane1, and the width is 4.5m. The lanes are all facing the same direction, so it is a two-way road. In addition, the road is a straight road with no curves. The length is 1000m and it extends from left to right. The coordinates of the leftmost end of the road are s=0 and the coordinates of the rightmost end are s=1000. For the traffic facility layer. This scene does not involve specific infrastructure such as traffic lights and signal boards, so the information of this layer is empty. For the temporary operation layer. This scene does not involve modifications and temporary operations to the first two layers, so the information of this layer is also empty. For the object layer. This scene contains three traffic participants, namely vehicles B, E and F. The three vehicles are located on roads Road0-Lane0, Road0-Lane1 and Road0-Lane1 respectively. Vehicle B is located at s=100 and is in the center of Lane0. The front and rear distances between vehicles B and E and between vehicles E and F are also specified by a range, respectively expressed as distance BE and dis EF ,in The three cars all have an initial speed, v B ,v E and v F , and each initial velocity has a specified range, where v B ∈ In addition to the initial velocity, vehicle E has an additional acceleration a E The acceleration of vehicle E is a E Also by a range Finally, there is the environment layer. In this embodiment, no specific requirements are made for the environment, but it is assumed to be sunny and the weather conditions are good.

[0083] Input the modeled logical scenario model into the causal multi-directional particle swarm algorithm to search for key scenarios. The specific process is as follows: Figure 3 shown.

[0084] First, the range parameters in the above scenario model are confirmed: the initial speeds of vehicles B, E, and F, the acceleration of vehicle E, the initial x-axis distance between vehicles B and E, and the initial x-axis distance between vehicles E and F, a total of 6 parameters. For these six parameters, uniform sampling is used, and other parameters use fixed values ​​and use chaotic iteration to obtain the initial population P.

[0085] Initializing the population through chaotic iteration is a common operation, because the quality of the initial population will affect the performance of the algorithm. Experiments have shown that the fitness function value of random numbers generated by chaotic mapping is significantly improved, and better results can be obtained by replacing the conventional uniformly distributed random number generator with chaotic mapping. There are many chaotic maps available at present, and this method selects the classic Chebyshev chaotic map. The principle of Chebyshev chaotic map is simple and it is one of the commonly used chaotic maps. The expression of a-order Chebyshev chaotic map is as follows, usually a is 4, where x∈(-1,1).

[0086] x(i+1)=cos(a*cos -1 (x(i))), a=4

[0087] Recall that in the first and second steps, when building the scenario model, the parameters of each dimension of the scenario can be specified with a value or a range of values. In this step, all scenario parameters specified as a range of values ​​will be sampled. Each individual in the population is a possible scenario.

[0088] The size of population P is n=100, the number of target result sets is m=3, and the fitness threshold t for individuals to meet the target is given. In addition, all individuals need to be added to another set D, which records all visited individuals.

[0089] Each scenario model is input into the Carla simulator, and the simulation function provided by the SML4ADS modeling language runs the dynamic simulation and calculates the fitness of each individual. Figure 4 Initialize the example graph for the scene. Define fitness as the degree of danger of the scene, that is, the greater the fitness, the more dangerous the scene individual is, and update the global optimal point set and the number of target individuals. The fitness, that is, the criticality of the scene, is calculated as follows:

[0090] C=w1·C υ +w2·C d +w3·C a +w4·C collision

[0091] Fitness consists of four items, w, w2, w3 and w4 represent the weights of the four items; C v represents the speed complexity, C d represents the distance complexity, Ca represents the acceleration complexity, C collision Indicates the degree of collision risk; the collision intensity is determined by the physical quantity when the collision occurs, but in the Carla simulator, it is directly obtained through the API; if no collision occurs, this item is 0; in speed complexity, the higher the speed, the greater the driving risk, so the speed-related complexity is expressed as the sum of the squares of the speeds of all traffic participants (reflecting the energy brought by speed):

[0092]

[0093] where v i represents the speed of the i-th traffic participant, and N represents the number of traffic participants;

[0094] When considering distance complexity, the smaller the distance, the more dangerous the scene, so the minimum distance between all traffic participants is used to measure the complexity; in order to avoid the complexity tending to infinity when the distance is very small, an inverse proportional function weighting process is used:

[0095]

[0096] where dis ij represents the distance between the i-th traffic participant and the j-th traffic participant; ∈ is a small positive number used to avoid division by zero error when the distance is zero; N represents the number of traffic participants;

[0097] Finally, there is acceleration complexity. The drastic change in acceleration will increase driving uncertainty and danger, so the complexity is measured by the sum of the squares of acceleration:

[0098]

[0099] where a i represents the acceleration of the i-th traffic participant, and N represents the number of traffic participants.

[0100] Update the speed and position of all individuals. First, run the FGES algorithm to calculate the causal relationship for all individuals in the population, and record the resulting causal graph as G. For each individual, first update the speed according to the original particle swarm optimization algorithm update formula. Then, based on the causal relationship, correct the speed of each variable to obtain the final speed v′. Finally, update the position of the individual according to the speed v′.

[0101] After completing the search for safety-critical scenarios in the previous stage, we obtained the set of safety-critical scenarios found and the set of scenarios in all visited parameter spaces. In this stage, the variational autoencoder VAE is used to fit all the collected scenarios. First, define each scene in the dataset that is input to the VAE as a vector x. As well as the encoder Encoder and the decoder Decoder, represented by e and d respectively. Among them, e is to solve q(z|x), mapping the input x to the distribution of the latent space parameter z, assuming that z obeys the standard normal distribution. D is to solve p(x|z), mapping the latent space parameter z to the distribution of the training sample x. VAE has two training goals, namely to make q(z|x) and q(z) as close as possible and to make the decoder output as close to x as possible. Therefore, the loss function is defined by two parts, the first part of which is defined by the KL divergence:

[0102]

[0103] q(z|x) is the posterior distribution (conditional distribution) of the latent variable z obtained through the encoder network. p(z) is the prior distribution of the latent variable z, which is usually assumed to be a standard normal distribution N(0,I). μ and σ are the mean and variance of the latent variable learned from the encoder.

[0104] The second part measures the reconstruction error, defined by the mean square error:

[0105] ReconstructionLoss = E q(z|x) [logp(x|z)]

[0106] The training steps are as follows.

[0107] Initialize the model parameters and randomly initialize the parameters of the encoder and decoder.

[0108] Forward propagation, input the input data x into the encoder to obtain the distribution parameters μ and σ of the latent variables.

[0109] Sample z from the distribution of latent variables. Input z into the decoder to obtain the reconstructed data x'.

[0110] Calculate the loss and calculate the total loss according to the aforementioned loss function.

[0111] Backpropagation and parameter update: The model parameters are updated using a gradient descent optimizer (such as Adam) to minimize the loss function.

[0112] Repeat the above steps until the model converges or the maximum number of training times is reached.

[0113] After training the VAE in the previous step, the probability distribution of its latent space z and the decoder d are obtained. In this step, acceptance-rejection sampling is used to obtain edge scenes. Figure 5 , 6 This is an example diagram of the key edge scene obtained through the process. Figure 5 For the key scenario of rear-end collision, the acceleration of the rear vehicle is optimized by algorithm. Figure 6 For overtaking key edge scenarios, it is obtained through algorithm sampling.

Claims

1. A method for generating key edge scenarios for autonomous driving based on causal multidirectional particle swarm, characterized by comprising the following specific steps: Step 1: Based on the standard autonomous driving scenario model, give the logical model of the modeled autonomous driving scenario 1.1: Clarify the elements of autonomous driving scenarios; 1.2: Model the logical model of the scenario through the autonomous driving scenario modeling language; Step 2: Generate key scenarios and scenario sample data sets based on causal multidirectional particle swarm algorithm 2.1: Use chaotic iteration to initialize the population, and record the current population as P; 2.2: Enter the iteration and calculate the fitness of all individuals in the population P; 2.3: Update the global optimal point set P o , and individual local optimal points; 2.4: Use the causal discovery algorithm to calculate the causal relationship between individual positions and fitness; 2.5: Update the speed of all individuals, and correct the speed of the individual based on the causal relationship, and finally update the position of the individual based on the corrected speed; 2.6: Add the positions of all individuals to the scene sample dataset D; 2.7: If the maximum number of iterations is reached, then end, otherwise repeat step 2; Step 3: Combine VAE and importance sampling algorithm to generate key edge scenes 3.1: Based on the scene sample dataset D, use VAE training to fit its distribution; The Adam optimizer is used during the training process to finally obtain the distribution of the latent space z and the VAE decoder d; 3.2: Use the sampling method to sample the latent space z and map it through the decoder to obtain the key edge scene.

2. The method for generating key edge scenarios for autonomous driving according to claim 1 is characterized in that the elements of the autonomous driving scenario described in step 1.1 are specifically: a generally applicable scenario model, i.e., a standard hierarchical model, is adopted, which divides all elements contained in a complete autonomous driving scenario into the following hierarchical categories: Layer 1: Road layer, which describes the geometric topological structure of the road network and the basic information of the lanes, including road length, lane network structure, lane curvature, and road surface quality; Layer 2: Traffic infrastructure layer, describing the structure boundaries, obstacles, traffic signs and traffic light information; Layer 3: Temporary operations layer, which is a temporary operation of layers 1 and 2, describing temporary construction sites, road construction or additional static objects to supplement the scene elements; Layer 4: Object layer, describing traffic participants, including motor vehicles and vulnerable road users; Layer 5: Environmental layer, including external conditions such as weather, time, and road conditions.

3. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: As described in step 1.2, the logical model of the scene is modeled through the autonomous driving scene modeling language, and the method for modeling autonomous driving scenes proposed in the SML4ADS modeling language is adopted. Its metamodel includes various factors required for autonomous driving scenes and provides complete simulation functions; based on SML4ADS, according to the scene to be modeled, the parameter values ​​of all required elements or a numerical range are given; if a numerical value is given for an element, it means that the element is determined and does not need to be optimized, that is, the subsequent optimization parameter space dimension will not consider the element; if a parameter range is given for an element, the parameter space dimension is increased by one in the subsequent optimization; the logical model of the scene can be obtained after the SML4ADS element assignment is completed, and all scene parameter dimensions specified as parameter ranges constitute the feature space of the logical scene model.

4. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: The step 2.1 specifically includes: In order to obtain multiple key scenarios that meet the conditions in one algorithm run, a global optimal point set P should be maintained. o , two hyperparameters are needed to maintain this set, the target fitness threshold t and the target number of results m; where m is P o The size of t is added to P o The fitness of a particle is defined as the criticality of the particle to a specific scene. A particle with a fitness greater than t is considered to be a sample of a critical scene, and it is expected to obtain at most m scene samples with a fitness greater than t. Given a population P of size n, use chaotic iteration to initialize a population P of size n, initialize P o An empty pile of roots.

5. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: The step 2.2 specifically includes: The calculation of individual fitness, i.e. criticality, relies on the Carla simulator. In Carla, in addition to being able to obtain vehicle status information, i.e. speed, direction and position, through the API, it is also possible to give the collision force when the vehicle collides, thus allowing for an additional dimension to be considered in the criticality calculation. The formula for calculating fitness, i.e. scene criticality, is as follows: C=w1·C v +w2·C d +w3·C a +w4·C collision Fitness consists of four items, w1, w2, w3 and w4 represent the weights of the four items; C v represents the speed complexity, C d represents the distance complexity, C a represents the acceleration complexity, C collision Indicates the degree of collision risk; the collision intensity is determined by the physical quantity when the collision occurs, but in the Carla simulator, it is directly obtained through the API; if no collision occurs, this item is 0; in speed complexity, the higher the speed, the greater the driving risk, so the speed-related complexity is expressed as the sum of the squares of the speeds of all traffic participants: where v i represents the speed of the i-th traffic participant, and N represents the number of traffic participants; When considering distance complexity, the smaller the distance, the more dangerous the scene, so the minimum distance between all traffic participants is used to measure the complexity; in order to avoid the complexity tending to infinity when the distance is very small, an inverse proportional function weighting process is used: where dis ij represents the distance between the i-th traffic participant and the j-th traffic participant; ∈ is a small positive number used to avoid division by zero error when the distance is zero; N represents the number of traffic participants; Finally, there is acceleration complexity. The drastic change in acceleration will increase driving uncertainty and danger, so the complexity is measured by the sum of the squares of acceleration: where a i represents the acceleration of the i-th traffic participant, and N represents the number of traffic participants.

6. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: The step 2.3 specifically includes: For all individual positions in the current population, if the fitness is greater than the fitness of t and the vertex of the heap, then the point is added to P o and delete the point with the smallest fitness, that is, the point at the top of the heap; for each individual position point of the current population, if the fitness is greater than the individual's local optimal position point, the individual's local optimal position point is updated to the current position.

7. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: The step 2.4 specifically includes: The FGES algorithm is used to calculate the causal relationship between individual positions and fitness of the current population and return it in the form of a directed acyclic graph, denoted as G.

8. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: The step 2.5 specifically includes: First, for all individuals in the current population, the speed will be updated according to the following update formula: v i =ω×v i +c1×rand()×(pbest i -x i )+c2×rand()×(gbest i -x i ) where v i represents the velocity of the ith particle, x i represents the position of the i-th particle; w is the inertia factor, which is non-negative and represents the influence of its last velocity and direction; c1 and c2 represent learning factors, which represent the weights of the experience parts from its own optimal and global optimal; the rand function generates a random number between 0 and 1; pbest i represents the best position that the i-th particle has ever reached; gbest i represents the P closest to the i-th particle o Position in What is maintained is not a global optimal point gbest i , but a global optimal point set P o ; So, for gbest in the above formula i , use the P that is closest to the current individual and has a greater fitness than the current individual o In this way, the algorithm searches not in a certain optimal direction, but in all possible better directions, thereby searching the entire sample space more. The individual speed obtained by the above is recorded as v; then, the speed is adjusted according to the causal relationship so that it moves in the direction more related to fitness; according to the directed acyclic graph G, the outgoing point of each directed edge is the cause of the incoming point, and the incoming point is the result of the outgoing point; for each dimension of the individual speed, check whether the dimension is the direct cause of fitness in the directed acyclic graph, that is, check whether the variable dimension node has an edge to the fitness node; if it is the direct cause of fitness, the speed of this dimension remains unchanged, otherwise the speed of this dimension will be attenuated, which is achieved by multiplying it by a attenuation coefficient less than 1; the individual speed corrected by the causal relationship is recorded as v′, and then the current individual position is updated using v′ to obtain the position of the new individual; v′ i =ω i ·v i where v i is the current velocity in the i-th dimension; ω i is the attenuation factor of the i-th dimension; finally, v′ is obtained as follows: v′=(v′1,v′2,...,v′ V ) Where V represents the dimension of velocity.

9. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: The step 3.1 specifically includes: First, define each scene in the dataset D that is input to the VAE as a vector x, as well as the encoder Encoder and decoder Decoder, represented by e and d respectively; e is to solve q(z|x), mapping the input x to the distribution of the latent space parameter z, assuming that z obeys the standard normal distribution; d is to solve p(x|z), mapping the latent space parameter z to the distribution of the training sample x; The VAE encoder used consists of 3 fully connected layers, each containing 128 to 256 neurons, using the ReLU activation function; mean and variance output layer: the last layer outputs the mean and log-variance of the latent space respectively, which are used to sample from the Gaussian distribution; the decoder also consists of 2 to 3 fully connected layers, with the same number of neurons as the encoder; the number of neurons in the last layer is the number of variables for each scene data sample; the design of this network can ensure that the model fits the distribution well on smaller sample data sets, and the dimension of the latent space can be adjusted according to the complexity of the data set; There are two training goals for VAE, which are to make q(z|x) and q(z) as close as possible and to make the decoder output and x as close as possible; therefore, the loss function is defined by two parts, the first of which is defined by KL divergence: q(z|x) is the latent variable obtained by the encoder network, and the posterior distribution of z is the conditional distribution; p(z) is the prior distribution of the latent variable z, which is assumed to be a standard normal distribution N(0,I); μ and σ are the mean and variance of the latent variable learned from the encoder; the second part measures the reconstruction error and is defined as follows: ReconstructionLoss=E q(z|x) [logp(x|z)] Where p(x|z) is the probability distribution generated by the decoder, describing the possibility of reconstructing data x given the latent variable z; logp(x|z) is the log-likelihood measure based on the input data and the generated data; it is used to measure the similarity between the data generated by the decoder and the original data; E represents the calculation of the log-likelihood of reconstruction under the latent variable q(z|x) through expectation calculation, that is, summing over different latent samples; The training steps are as follows: Initialize model parameters and randomly initialize the parameters of the encoder and decoder; Forward propagation, input the input data x into the encoder to obtain the distribution parameters μ and σ of the latent variables; Sample z from the distribution of latent variables; input z into the decoder to obtain the reconstructed data x'; Calculate the loss and calculate the total loss according to the aforementioned loss function; Back propagation and parameter update, using optimization algorithms to update model parameters to minimize the loss function; Repeat the above steps until the model converges or the maximum number of training times is reached; the final distribution p(z) of the latent space z obeys the standard normal distribution N(0,I), and the decoder d consists of multiple linear network layers.

10. The method for generating key edge scenarios for autonomous driving according to claim 1, characterized in that: The step 3.2 specifically includes: Sampling from the fitted sample distribution, obtaining scenes with sufficiently low probability and mapping them through the decoder d, is considered a key edge scene; The sampling method uses the acceptance-rejection sampling method, that is, a probability threshold of a sample is first set, set as p s ; Each time, sample a batch of data from the distribution obtained in the previous step, assuming the number is m; calculate the corresponding probability value for each sample, if the probability value of the sample is less than or equal to p s , then keep it, otherwise discard it; this process is repeated until the retained target sample reaches the threshold or the number of cycles reaches the maximum.

Citation Information

Patent Citations

  • Automatic driving safety scene meta-modeling method driven by spatio-temporal trajectory data

    CN112732671A

  • Key edge test scene online generation method for automatic driving acceleration test

    CN116258058A

  • Automatic driving visual perception system-oriented confrontation scene generation method

    CN116740274A

  • Man-machine cooperation-based causal knowledge generator and discriminator feedback tuning method

    CN118313461A

  • OpenX standard scene generalization generation method based on iterative test

    CN118897803A