A method for generating critical edge scenes in autonomous driving based on causal multi-directional particle swarm optimization.

By generating key edge scenes for autonomous driving using a causal multi-directional particle swarm optimization algorithm and a variational autoencoder, the problem of low efficiency in generating key scenes in existing technologies is solved, and efficient and accurate scene generation and system evaluation are achieved.

CN119761196BActive Publication Date: 2025-10-31EAST CHINA NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing autonomous driving systems struggle to effectively generate critical scenarios during testing and verification, making it impossible to comprehensively evaluate system performance. In reality, critical scenarios have a low probability of occurring, making it impractical to rely on road-collected data.

Method used

A causal multi-directional particle swarm optimization algorithm is used to generate critical edge scenes for autonomous driving. The population is initialized through chaotic iteration, and critical edge scenes are generated by combining causal relationships and variational autoencoders (VAE). The fitness is calculated using a Carla simulator, and a global optimal position set and multi-directional strategy are introduced to optimize particle velocity. Importance sampling and accept-reject sampling algorithms are combined to improve generation efficiency and accuracy.

Benefits of technology

It effectively generated key edge scenarios for autonomous driving, improved the efficiency and accuracy of scenario generation, and enhanced the evaluation capability of autonomous driving systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761196B_ABST
    Figure CN119761196B_ABST
Patent Text Reader

Abstract

This invention discloses a method for generating critical edge scenes for autonomous driving based on causal multidirectional particle swarm optimization. In scene-based autonomous driving system testing, critical and edge scenes are crucial for improving testing efficiency. Critical scenes typically refer to those that pose safety challenges to the system under test, while edge scenes typically refer to those with low probability in the scene distribution. This invention aims to combine and improve optimization algorithms and variational autoencoders to generate critical edge scenes for autonomous driving safety. The method iteratively uses the FGES algorithm for causal relationship mining during the optimization process, adjusting particle speeds based on causal relationships to more efficiently optimize critical scenes. After a preliminary traversal of the scene space using the optimization algorithm, a variational autoencoder is used to fit the distribution of the sample space, and finally, edge scenes are obtained through sampling techniques.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of autonomous driving scenarios and is mainly used to address safety-critical and edge scenario generation issues in autonomous driving. Background Technology

[0002] To accelerate the testing and validation 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, only a small portion of these scenarios, known as critical scenarios, are truly crucial for testing the system. These critical scenarios typically refer to complex or extreme situations that could lead to accidents during actual driving. In reality, the probability of critical scenarios occurring is very low, making it impractical to rely solely on road-collected scenario test data. This is because it is difficult to capture enough critical scenarios in real-world driving data to comprehensively evaluate and validate the performance of autonomous driving systems. Therefore, developing effective methods to generate these critical scenarios is particularly important. Summary of the Invention

[0003] This invention discloses a method for generating critical edge scenes for autonomous driving based on a causal multi-directional particle swarm optimization algorithm. The aim is to effectively generate critical and edge scenes for autonomous driving safety.

[0004] The specific technical solution for achieving the objective of this invention is as follows:

[0005] A method for generating critical edge scenes for autonomous driving based on causal multi-directional particle swarm optimization includes the following specific steps:

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

[0007] 1.1: Define the essential elements required for autonomous driving scenarios;

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

[0009] Step 2: Generate key scenes and scene sample datasets based on the causal multi-directional particle swarm optimization algorithm.

[0010] 2.1: Initialize the population using chaotic iteration, and denote the current population as P;

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

[0012] 2.3: Update the global optimum set P o And the individual local optimum;

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

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

[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: Generate key edge scenes by combining VAE and importance sampling algorithms.

[0018] 3.1: Based on the aforementioned scene sample dataset D, VAE is used to train and fit its distribution; during the training process, the Adam optimizer is used for optimization, and finally the distribution of the latent space z and the VAE decoder d are obtained;

[0019] 3.2: The latent space z is sampled using a sampling method and then mapped by a decoder to obtain the key edge scene.

[0020] Furthermore, step 1.1, which clarifies the elements of an autonomous driving scenario, specifically involves adopting a universally applicable scenario model, such as the ISO 34501 standard hierarchical model. This model categorizes all elements of a complete autonomous driving scenario into hierarchical levels:

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

[0022] Layer 2: Transportation infrastructure layer, describing structural boundaries, obstacles, traffic signs, and traffic light information;

[0023] Layer 3: Temporary Operation Layer. This layer provides temporary operations for Layers 1 and 2, describing temporary construction sites, road construction, or additional static objects that supplement the scene.

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

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

[0026] Step 1.2 describes the process of modeling the logical model of the scene using an autonomous driving scene modeling language.

[0027] This paper adopts a method for modeling autonomous driving scenarios proposed in the SML4ADS modeling language. This language has been published in relevant literature, and its meta-model includes various factors required for autonomous driving scenarios, providing comprehensive simulation capabilities. Based on SML4ADS, parameter values ​​or a numerical range for all required elements are given. If a single value is given for an element, it means that the element is fixed and does not require optimization; that is, the subsequent optimization of the parameter space dimension will not consider this element. If a parameter range is given for an element, the parameter space dimension is incremented by one in subsequent optimizations. After assigning values ​​to the SML4ADS elements, the logical model of the scenario is obtained. All scenario parameter dimensions defined as parameter ranges constitute the feature space of the logical scenario model.

[0028] Furthermore, step 2.1 specifically includes:

[0029] In order to obtain multiple key scenarios that meet the conditions in a single algorithm run, it is necessary to maintain a global optimum set P. o Two hyperparameters are needed to maintain this set: the target fitness threshold t and the number of target outcomes m; where m is the value of P. o The size of t is added to P o The threshold is defined as the degree of importance of a particle in a specific scene. A particle with a fitness greater than t is considered a sample of a key scene, and it is expected that at most m scene samples with a fitness greater than t can be obtained.

[0030] Given a population P of size n, initialize a population P of size n using chaotic iteration. Initialize P o An empty min-heap.

[0031] Furthermore, step 2.2 specifically includes:

[0032] The calculation of an individual's fitness, or criticality, relies on the Carla simulator, which is widely used in simulations related to autonomous driving research. In Carla, in addition to obtaining vehicle state information (speed, direction, and position) via API, it can also provide the collision force when a collision occurs, thus allowing for an additional dimension to be considered in the criticality calculation. The formula for calculating fitness, or scene criticality, is as follows:

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

[0034] Fitness consists of four components, where w, w2, w3, and w4 represent the weights of the four components; C v Representing speed complexity, C dRepresenting distance complexity, C a Representing acceleration complexity, C collision This indicates the degree of collision risk; collision intensity is determined based on physical quantities at the time of the collision (such as collision speed, impact angle, etc.), but in the Carla simulator, this is directly obtained through the API; if no collision occurs, this term is 0; in speed complexity, the higher the speed, the greater the driving risk, therefore 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 Let N represent the speed of the i-th traffic participant, and N represent the number of traffic participants.

[0037] When considering distance complexity, the smaller the distance, the more dangerous the scenario. Therefore, the minimum distance between all traffic participants is used to measure the complexity. To avoid the complexity approaching infinity when the distance is extremely small, an inverse proportional function is used for weighting.

[0038]

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

[0040] Finally, there's acceleration complexity. Dramatic changes in acceleration increase driving uncertainty and danger, so complexity is measured by the sum of squares of accelerations:

[0041]

[0042] Where a i Let represent the acceleration of the i-th traffic participant, and n represent the number of traffic participants.

[0043] Furthermore, step 2.3 specifically includes:

[0044] The algorithm maintains a global set of optimal points. This set is structured using a min-heap to reduce the average time complexity of the algorithm. For any position of any individual in the current population, if its fitness is greater than that of t and the fitness of a heap vertex, then that point is added to P. o In the process, the point with the lowest fitness, which is the top of the heap, is removed; for each individual in the current population, if the fitness is greater than the individual's local best position, the individual's local best position is updated to the current position.

[0045] Furthermore, step 2.4 specifically includes:

[0046] To improve the efficiency of the algorithm in finding key scenarios and alleviate the problem of local optima, causal relationships 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 in the current population and returns it as a directed acyclic graph, denoted as G. The FGES algorithm is an improvement on the GES algorithm, making the calculation of causal relationships faster.

[0047] Furthermore, step 2.5 specifically includes:

[0048] First, for all individuals in the current population, the velocity is 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 Let x represent the velocity of the i-th particle. i `i` represents the position of the i-th particle; `w` is the inertia factor, a non-negative value representing the influence of its previous velocity magnitude and direction; `c` and `c2` represent learning factors, indicating the weights of the empirical components from its own optimal and global optimal states; the `rand` function generates a random number between 0 and 1; `pbest` i This represents the best position that the i-th particle has ever reached; gbest i Represents the P closest to the i-th particle. o The position in the middle;

[0051] The difference between this method and the original algorithm is that this method does not maintain a global optimum (gbest). i It is not a set of global optima, but a set of global optima P. o Therefore, for gbest in the above formula i Use the P that is closest to the current individual and has a fitness greater than the current individual. o The points in the sample space are replaced; this makes the algorithm search not in a single optimal direction, but in all possible better directions, thus searching more of the entire sample space and preparing for the next step.

[0052] Let the individual velocity obtained above be v. Then, the velocity needs to be adjusted according to causal relationships to move in a direction more relevant to fitness. According to the directed acyclic graph G, the outgoing node of each directed edge is the cause of the incoming node, and the incoming node is the result of the outgoing node. For each dimension of the individual velocity, check whether that dimension is a direct cause of fitness in the directed acyclic graph, i.e., check whether the node of that variable dimension has an edge to the fitness node. If it is a direct cause of fitness, the velocity of that dimension remains unchanged; otherwise, the velocity of that dimension is decayed by multiplying it by a decay coefficient less than 1. Let the individual velocity after causal correction be v′. Then, using v′ to update the current individual position will yield the new individual's position.

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

[0054] Where v i It is the current velocity in the i-th dimension; ω i It is the decay 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] Furthermore, step 3.1 specifically includes:

[0058] First, we define each scene input to the VAE in the dataset D as a vector x, and the encoder and decoder as e and d, respectively; where e is to solve q(z|x), which maps the input x to the distribution of the hidden space parameters z, assuming that z follows a standard normal distribution; d is to solve p(x|z), which maps the hidden space parameters z to the distribution of the training samples x.

[0059] In practice, the VAE encoder used consists of three fully connected layers, each containing 128 to 256 neurons, using the ReLU activation function; mean and variance output layers: the last layer outputs the mean and log-variance of the latent space, respectively, for sampling from a Gaussian distribution; the decoder also consists of two to three 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; this network design ensures that the model fits the distribution well on a small sample dataset, while the dimension of the latent space can be adjusted according to the complexity of the dataset; if the data distribution has a large non-linear characteristic, consider using a deeper network structure.

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

[0061]

[0062] q(z|x) is the latent variable obtained through 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, defined as follows:

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

[0065] In the formula, p(x|z) is the probability distribution generated by the decoder, describing the probability 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, used to measure the similarity between the data generated by the decoder and the original data; E represents the log-likelihood of reconstruction calculated 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 the model parameters, and randomly initialize the parameters of the encoder and decoder;

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

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

[0070] Calculate the loss, specifically the total loss based on the aforementioned loss function;

[0071] Backpropagation and parameter updates are performed using optimization algorithms (such as Adam) to update the model parameters and minimize the loss function. These steps are repeated until the model converges or the maximum number of training iterations is reached. The final latent space z has a distribution p(z) that follows a standard normal distribution N(0, I), and a decoder d consisting of multiple linear network layers.

[0072] Furthermore, step 3.2 specifically includes:

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

[0074] The sampling uses a general accept-reject sampling method, that is, first setting a probability threshold for a sample, denoted 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, and if the probability value of the sample is less than or equal to p... s If a sample is selected, it is retained; otherwise, it is discarded. This process is repeated until the number of retained target samples reaches the threshold or the number of iterations reaches the maximum.

[0075] This invention generates key edge scenes from a logical scene model for autonomous driving. It introduces causal theory into the particle swarm optimization (PSO) algorithm, guiding the particle velocity update process through the causal relationship between variables and fitness, thereby alleviating the drawbacks of local optima and low search efficiency, and improving the efficiency of optimizing key scenes. Simultaneously, it introduces a global optimal position set and a multi-directional strategy for updating particle velocities, improving the global search depth of the feature space and providing a solid foundation for fitting subsequent sample distributions. Finally, it combines VAE (Visual Augmentation Array) to fit the distribution of key scenes and uses accept-rejection sampling and importance sampling algorithms to sample edge scenes, effectively solving the problem of edge scene generation and improving the accuracy of the obtained edge scenes. Attached Figure Description

[0076] Figure 1 This is a flowchart illustrating the method framework of the present invention.

[0077] Figure 2 This is a diagram illustrating an overtaking scenario.

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

[0079] Figure 4-6 The images are for experimental record purposes, showing the initial scene and key scenes after the two algorithms were optimized. Detailed Implementation

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

[0081] This embodiment uses a typical autonomous driving overtaking scenario as an example to illustrate the specific implementation method. Figure 2This is a top-down view of the scene. In this example scenario, there are three vehicles: B, E, and F. All three vehicles travel in the same direction along the road. Vehicles B and F maintain a constant speed throughout the entire scene. Vehicle E accelerates with constant acceleration from its initial speed. When the distance between vehicle E and the vehicle in front of it (F) is less than or equal to dis, vehicle E will change lanes to the left while maintaining its constant acceleration. After changing lanes, it will continue moving forward at a constant speed.

[0082] First, the scenario is modeled according to the hierarchical scenario model for autonomous driving. For the road layer, the OpenDRIVE standard is used to describe the road structure of this scenario. In this scenario, there is only one road, Road0, which contains two lanes, Lane0 and Lane1, each 4.5m wide. The lanes all face the same direction, making it a two-lane road. Furthermore, this road is a straight road with no curves, and its length is 1000m, extending from left to right. The coordinates of the leftmost point of the road are s=0, and the coordinates of the rightmost point are s=1000. For the traffic facility layer, this scenario does not involve specific infrastructure such as traffic lights or signs, so this layer is empty. For the temporary operation layer, this scenario does not involve any modifications or temporary operations to the previous two layers, so this layer is also empty. For the object layer, this scenario contains three traffic participants: vehicles B, E, and F. The three vehicles are located on Road0-Lane0, Road0-Lane1, and Road0-Lane1, respectively. Vehicle B is located at s=100 and is in the center of Lane0. The distances between vehicles B and E, and between vehicles E and F, are each defined within a range, denoted as dis. BE and dis EF ,in All three cars have an initial speed, v. B ,v E and v F And each has a defined initial velocity range, where v B ∈ In addition to its initial velocity, vehicle E has an additional acceleration a. E The acceleration a of vehicle E E Also has a range The regulations. Finally, there is the environment layer. This embodiment does not specify concrete environmental requirements, but it defaults to a sunny day with good weather conditions.

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

[0084] First, identify the range parameters in the above scenario model: the initial velocities 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, totaling six parameters. For these six parameters, uniform sampling is used, while other parameters use fixed values ​​and chaotic iteration is employed to obtain the initial population P.

[0085] Initializing the population using chaotic iteration is a common operation because the quality of the initial population affects the algorithm's performance. Experiments show that using chaotic mapping to generate random numbers significantly improves the fitness function value, and replacing the conventional uniformly distributed random number generator with chaotic mapping yields better results. Many chaotic mappings exist; this method chooses the classic Chebyshev chaotic mapping. The Chebyshev chaotic mapping is simple in principle and is one of the commonly used chaotic mappings. The expression for an a-order Chebyshev chaotic mapping is shown below, where a is typically 4, and x∈(-1,1).

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

[0087] Recall that in steps one and two, when constructing the scene model, a single value or a range of values ​​could be specified for the parameters of each dimension of the scene. This step will sample all scene parameters specified as ranges. Each individual in the population represents a possible scene.

[0088] Population P has a size of n = 100, target result set has a size of m = 3, and a fitness threshold t for individuals to satisfy the target is given. In addition, all individuals need to be added to another set D, which records all the individuals that have been visited.

[0089] Each scene model is input into the Carla simulator, where the simulation capabilities provided by the SML4ADS modeling language are used to run dynamic simulations and calculate the fitness of each individual. Figure 4 Initialize the example graph for the scene. Define fitness as the danger level of the scene; that is, the higher the fitness of an individual in the scene, the more dangerous it is. Update the global optimum set and the number of target individuals. The formula for calculating fitness, or the danger level of the scene, is as follows:

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

[0091] Fitness consists of four components, where w, w2, w3, and w4 represent the weights of the four components; C v Representing speed complexity, C d Representing distance complexity, Ca Representing acceleration complexity, C collision This indicates the degree of collision risk; collision intensity is determined based on the physical quantities at the time of the collision, but in the Carla simulator, it is obtained directly through the API; if no collision occurs, this term is 0; in speed complexity, the higher the speed, the greater the driving risk, therefore 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 Let N represent the speed of the i-th traffic participant, and N represent the number of traffic participants.

[0094] When considering distance complexity, the smaller the distance, the more dangerous the scenario. Therefore, the minimum distance between all traffic participants is used to measure the complexity. To avoid the complexity approaching infinity when the distance is extremely small, an inverse proportional function is used for weighting.

[0095]

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

[0097] Finally, there's acceleration complexity. Dramatic changes in acceleration increase driving uncertainty and danger, so complexity is measured by the sum of squares of accelerations:

[0098]

[0099] Where a i Let N represent the acceleration of the i-th traffic participant, and N represent the number of traffic participants.

[0100] Update the velocity and position of all individuals. First, run the FGES algorithm to calculate the causal relationships for all individuals in the population, and denote the resulting causal graph as G. For each individual, first update its velocity according to the original Particle Swarm Optimization algorithm's update formula. Then, based on the causal relationships, adjust the velocity of each variable to obtain the final velocity v′. Finally, update the individual's position based on the velocity v′.

[0101] After completing the previous stage of searching for safety-critical scenarios, we obtained the set of found safety-critical scenarios and the set of scenarios in all visited parameter spaces. In this stage, we use a variational autoencoder (VAE) to fit all the collected scenarios. First, we define each scenario input into the VAE from the dataset as a vector x. We also define the encoder (Encoder) and decoder (Decoder), denoted by e and d, respectively. e is used to solve q(z|x), mapping the input x to the distribution of the hidden space parameters z, assuming z follows a standard normal distribution. d is used to solve p(x|z), mapping the hidden space parameters z to the distribution of the training samples x. The VAE has two training objectives: to make q(z|x) and q(z) as close as possible, and to make the decoder output as close as possible to x. Therefore, the loss function is defined in two parts, the first part of which is defined by the KL divergence:

[0102]

[0103] q(z|x) is the latent variable obtained through the encoder network, representing the posterior distribution (conditional distribution) of z. p(z) is the prior distribution of the latent variable z, 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 squared 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 encoder and decoder parameters.

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

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

[0110] Calculate the loss, specifically the total loss based on the aforementioned loss function.

[0111] Backpropagation and parameter updates use a gradient descent optimizer (such as Adam) to update the model parameters in order to minimize the loss function.

[0112] Repeat the above steps until the model converges or reaches the maximum number of training iterations.

[0113] After training the VAE in the previous step, we obtained the probability distribution of its hidden space z and the decoder d. In this step, we use receive-rejection sampling to obtain the edge scene. Figure 5 , 6 This is an example diagram of a key edge scene obtained through the process. Figure 5 For key rear-end collision scenarios, the acceleration of the rear vehicle is obtained through algorithm optimization. Figure 6 The key edge scenarios for overtaking were obtained through algorithm sampling.

Claims

1. A method for generating critical edge scenes for autonomous driving based on causal multi-directional particle swarm optimization, characterized by the following specific steps: Step 1: Based on the standard autonomous driving scenario model, provide the logical model of the modeled autonomous driving scenario. 1.1: Define the essential elements required for autonomous driving scenarios; 1.2: Model the logical model of the scenario using an autonomous driving scenario modeling language; Step 2: Generate key scenes and scene sample datasets based on the causal multi-directional particle swarm optimization algorithm. 2.1: Initialize the population using chaotic iteration, and denote the current population as P; 2.2: Proceed to the iteration and calculate the fitness of all individuals in population P; 2.3: Update the global optimum set P o And the individual local optimum; 2.4: Use the causal discovery algorithm to calculate the causal relationship between individual location and fitness; 2.5: Update the velocity of all individuals, correct the velocity of individuals based on causal relationships, and finally update the position of individuals based on the corrected velocity; 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: Generate key edge scenes by combining VAE and importance sampling algorithms. 3.1: Based on the aforementioned scene sample dataset D, use VAE to train and fit its distribution; During training, the Adam optimizer is used to optimize the process, ultimately obtaining the distribution of the latent space z and the VAE decoder d. 3.2: The latent space z is sampled using a sampling method and then mapped by a decoder to obtain the key edge scene; where: Step 2.4 specifically includes: The FGES algorithm is used to calculate the causal relationship between individual position and fitness in the current population and returned as a directed acyclic graph, denoted as G. Step 2.5 specifically includes: First, for all individuals in the current population, the velocity is updated according to the following update formula: V i =ω×V i +c1×rand()×(pbest i -x)+c2×rand()×(gbest i -x i ) Where v i Let x represent the velocity of the i-th particle. i `i` represents the position of the i-th particle; `w` is the inertia factor, a non-negative value representing the influence of its previous velocity magnitude and direction; `c1` and `c2` represent learning factors, representing the weights of the empirical components from its own optimal and global optimal states; the `rand` function generates a random number between 0 and 1; `pbest` i This represents the best position that the i-th particle has ever reached; gbest i Represents the P closest to the i-th particle. o The position in the middle; It does not maintain a global optimum (gbest) i It is not a set of global optima, but a set of global optima P. o Therefore, for gbest in the above formula i Use the P that is closest to the current individual and has a fitness greater than the current individual. o The points in the sample space are replaced; this makes the algorithm search in all better directions instead of searching in a single optimal direction, thus searching the entire sample space. Let v be the individual velocity obtained above. Then, adjust the velocity according to causal relationships to move it in a direction more relevant to fitness. According to the directed acyclic graph G, the outgoing node of each directed edge is the cause of the incoming node, and the incoming node is the result of the outgoing node. For each dimension of the individual velocity, check whether the dimension is a direct cause of fitness in the directed acyclic graph, i.e., check whether the variable dimension node has an edge to the fitness node. If it is a direct cause of fitness, the velocity of this dimension remains unchanged; otherwise, the velocity of this dimension is decayed by multiplying it by a decay coefficient less than 1. Let v′ be the individual velocity after causal correction. Then, use v′ to update the current individual position to obtain the new individual's position. v′ i =ω i ·v i Where v i It is the current velocity in the i-th dimension; ω i It is the decay factor of the i-th dimension; finally, v′ is obtained as follows: v′=(v′1,v′2,..,v′ V ) Where V represents the number of dimensions of velocity; Step 3.1 specifically includes: First, we define each scene input to the VAE in the dataset D as a vector x, and the encoder and decoder as e and d, respectively; where e is to solve q(z|x), which maps the input x to the distribution of the hidden space parameters z, assuming that z follows a standard normal distribution; d is to solve p(x|z), which maps the hidden space parameters z to the distribution of the training samples x. The VAE encoder used consists of three fully connected layers, each containing 128 to 256 neurons, using the ReLU activation function; mean and variance output layers: the last layer outputs the mean and log-variance of the latent space, respectively, for sampling from a Gaussian distribution; the decoder also consists of two to three 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; this network design ensures that the model fits the distribution well on small sample datasets, while the dimension of the latent space can be adjusted according to the complexity of the dataset; The training objectives of the VAE are twofold: to make q(z|x) and q(z) close, and to make the decoder output close to x. Therefore, the loss function is defined by two parts, the first of which is defined by the KL divergence: q(z|x) is a latent variable obtained through the encoder network, and the posterior distribution of z is a conditional distribution; p(z) is the prior distribution of the latent variable z, assumed to be a standard normal distribution N(0,μ); μ and σ are the mean and variance of the latent variable learned from the encoder. The second part measures the reconstruction error, defined as follows: ReconstructionLoss=E q(z|x) [logp(x|z)] In the formula, p(x|z) is the probability distribution generated by the decoder, describing the probability 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, used to measure the similarity between the data generated by the decoder and the original data; E represents the log-likelihood of reconstruction calculated under the latent variable q(z|x) through expectation calculation, that is, summing over different latent samples; The training steps are as follows: Initialize the model parameters, and randomly initialize the parameters of the encoder and decoder; Forward propagation involves inputting the input data x into the encoder to obtain the distribution parameters μ and σ of the latent variables; Sample z from the distribution of the latent variables; input z into the decoder to obtain the reconstructed data x'; Calculate the loss, specifically the total loss based on the aforementioned loss function; Backpropagation and parameter update: The model parameters are updated using an optimization algorithm to minimize the loss function; Repeat the above steps until the model converges or reaches the maximum number of training iterations; the final latent space z distribution p(z) follows a standard normal distribution N(0,I), and the decoder d consists of multiple linear network layers.

2. The method for generating key edge scenes for autonomous driving according to claim 1, characterized in that, step 1.1, which clarifies the elements possessed by the autonomous driving scene, specifically involves: adopting a universally applicable scene model, namely a standard hierarchical model, which divides all elements contained in a complete autonomous driving scene into hierarchical categories: Layer 1: Road layer, which describes the geometric topology 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: Transportation infrastructure layer, describing structural boundaries, obstacles, traffic signs, and traffic light information; Layer 3: Temporary Operation Layer. This layer provides temporary operations for Layers 1 and 2, describing temporary construction sites, road construction, or additional static objects that supplement the scene. Layer 4: Object layer, describing traffic participants, including motor vehicles and vulnerable road users; Layer 5: Environment layer, including weather, time, road conditions and external conditions.

3. The method for generating key edge scenes for autonomous driving according to claim 1, characterized in that, Step 1.2 describes the creation of a logical model of the scene using an autonomous driving scenario modeling language. The method for modeling autonomous driving scenarios proposed in the SML4ADS modeling language is employed. Its meta-model contains various factors required for autonomous driving scenarios and provides comprehensive simulation capabilities. Based on SML4ADS, parameter values ​​or a numerical range for all required elements are given according to the scenario to be modeled. If a single value is given for an element, it indicates that the element is fixed and does not require optimization; that is, the subsequent optimization of the parameter space dimension will not consider this element. If a parameter range is given for an element, the parameter space dimension is incremented by one in subsequent optimizations. Once the SML4ADS element assignments are completed, the logical model of the scene is obtained. All scene parameter dimensions defined as parameter ranges constitute the feature space of the logical scene model.

4. The method for generating key edge scenes for autonomous driving according to claim 1, characterized in that, Step 2.1 specifically includes: In order to obtain multiple key scenarios that meet the conditions in a single algorithm run, it is necessary to maintain a global optimum set P. o Two hyperparameters are needed to maintain this set: the target fitness threshold t and the number of target outcomes m; where m is the value of P. o The size, t is added to P o The threshold is defined as the degree of importance of a particle in a specific scene. A particle with a fitness greater than t is considered a sample of a key scene, and it is expected that at most m scene samples with a fitness greater than t can be obtained. Given a population P of size n, initialize a population P of size n using chaotic iteration. o An empty min-heap.

5. The method for generating key edge scenes for autonomous driving according to claim 1, characterized in that, Step 2.2 specifically includes: The calculation of an individual's fitness, or criticality, relies on the Carla simulator. In Carla, in addition to obtaining vehicle state information (speed, direction, and position) via API, it can also provide the collision force when a collision occurs, allowing for an additional dimension to be considered in the criticality calculation. The formula for calculating fitness, or scene criticality, is as follows: C=u1·C v +w2·C d +w3·C a +w4·C collision Fitness consists of four components: w1, w2, w3, and w ( Indicates the weights of the four components; C v Representing speed complexity, C + Representing distance complexity, C a Representing acceleration complexity, C collision This indicates the degree of collision risk; collision intensity is determined based on the physical quantities at the time of the collision, but in the Carla simulator, it is obtained directly through the API; if no collision occurs, this term is 0; in speed complexity, the higher the speed, the greater the driving risk, therefore speed-related complexity is expressed as the sum of the squares of the speeds of all traffic participants: Where v i Let N represent the speed of the i-th traffic participant, and N represent the number of traffic participants. When considering distance complexity, the smaller the distance, the more dangerous the scenario. Therefore, the minimum distance between all traffic participants is used to measure the complexity. To avoid the complexity approaching infinity when the distance is extremely small, an inverse proportional function is used for weighting. where dis ij This represents the distance between the i-th and j-th traffic participants; ∈ is a small positive number used to avoid division by zero when the distance is zero; N represents the number of traffic participants. Finally, there's acceleration complexity. Dramatic changes in acceleration increase driving uncertainty and danger, so complexity is measured by the sum of squares of accelerations: Where a i Let N represent the acceleration of the i-th traffic participant, and N represent the number of traffic participants.

6. The method for generating key edge scenes for autonomous driving according to claim 1, characterized in that, Step 2.3 specifically includes: For any position of any individual in the current population, if its fitness is greater than that of t and the fitness of the heap vertex, then that point is added to P. o In the process, the point with the lowest fitness, which is the top of the heap, is removed; for each individual in the current population, if the fitness is greater than the individual's local best position, the individual's local best position is updated to the current position.

7. The method for generating key edge scenes for autonomous driving according to claim 1, characterized in that, Step 3.2 specifically includes: Sampling is performed from the fitted sample distribution to obtain low-probability scenes, which are then mapped by the decoder d and identified as key edge scenes. The sampling uses a receive-reject sampling method, that is, a probability threshold for a sample is first set, denoted as p. / 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, and if the probability value of the sample is less than or equal to p... / If a sample is selected, it is retained; otherwise, it is discarded. This process is repeated until the number of retained target samples reaches the threshold or the number of iterations 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