A method, device and product for generating safety-critical scenarios leading to traffic accidents

By using CAVE scene generation models and diverse sampler processing, the problem of scarce safety-critical scenarios is solved, generating a variety of autonomous driving scenarios and improving the effectiveness and safety of autonomous driving algorithms.

CN119761206BActive Publication Date: 2025-11-14TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411951151.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-11-14
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

In existing technologies, the effectiveness of autonomous driving algorithms depends on the scale and quality of traffic scene datasets. However, safety-critical scenarios that are prone to traffic accidents are relatively rare, and data simulation and reconstruction are too costly, lacking flexibility and diversity.

Method used

The CAVE scene generation model is adopted, which uses pre-trained CAVE past encoding module and future decoding module to generate vehicle trajectories, and uses a sampler to diversify the features to generate a variety of safety-critical scenarios.

Benefits of technology

It enables the automated and low-cost generation of diverse safety-critical scenarios, improving the optimization efficiency and safety of autonomous driving algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761206B_ABST
    Figure CN119761206B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, and product for generating safety-critical scenarios leading to traffic accidents, relating to the field of scenario generation technology. The method includes: obtaining historical trajectory information of N vehicles, the historical trajectory information including state information of the N vehicles in multiple historical time slices, the state information including the vehicle's position, speed, and orientation; inputting the historical trajectory information of the N vehicles into a trained CAVE past encoding module to obtain a first latent vector; using a trained sampler to diversify the first latent vector to obtain multiple diversified first latent vectors; and processing the multiple diversified first latent vectors through a trained first CAVE future decoding module to obtain adversarial trajectory information of the N vehicles, the adversarial trajectory information satisfying the condition that at least two of the N vehicles collide.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of scene generation technology, and in particular to a method, apparatus and product for generating safety-critical scenes that lead to traffic accidents. Background Technology

[0002] The safety of autonomous driving is challenged by the high diversity and complexity of real-world scenarios, including various traffic regulations, road conditions, weather patterns, and other unforeseen circumstances. The effectiveness of end-to-end autonomous driving algorithms depends on the scale and quality of traffic scenario datasets. Therefore, acquiring a large number of safety-critical scenarios that could easily lead to traffic accidents is crucial for optimizing autonomous driving algorithms and improving autonomous driving technology.

[0003] However, in actual driving, safety-critical scenarios that are likely to lead to traffic accidents are relatively rare. Reconstructing these scenarios through data simulation requires manual intervention, which is too costly. Therefore, there is an urgent need to propose a method, device, and product for generating safety-critical scenarios that lead to traffic accidents, so as to conveniently obtain diverse safety-critical scenarios. Summary of the Invention

[0004] In view of the above problems, embodiments of this application provide a method, apparatus and product for generating safety-critical scenarios that lead to traffic accidents, so as to overcome the above problems or at least partially solve the above problems.

[0005] A first aspect of this application provides a method for generating safety-critical scenarios leading to traffic accidents, the method comprising:

[0006] Obtain the historical trajectory information of N vehicles, which includes the state information of the N vehicles in multiple historical time slices, including the vehicle's position, speed, and orientation;

[0007] Input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first potential vector;

[0008] The first latent vector is diversified using the trained sampler to obtain multiple diversified first latent vectors;

[0009] The trained first CAVE future decoding module processes multiple diverse first latent vectors to obtain adversarial trajectory information for N vehicles. The adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0010] In one possible implementation, the method further includes:

[0011] Obtain the historical trajectory information and future trajectory information of each of the N sample vehicles. The future trajectory information includes the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices.

[0012] Input the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain the first sample potential vector;

[0013] Input the future trajectory information of each of the N sample vehicles into the CAVE future encoding module to be trained to obtain the second sample potential vector;

[0014] The second sample latent vector is processed by the second CAVE future decoding module to be trained to obtain the predicted trajectory information of each of the N sample vehicles.

[0015] Based on the first sample latent vector and the second sample latent vector, the first loss function value is obtained;

[0016] The second loss function value is obtained based on the predicted trajectory information of each of the N sample vehicles and the future trajectory information of each of the N sample vehicles.

[0017] Based on the first loss function value and the second loss function value, the model parameters of the CAVE past encoding module, the CAVE future encoding module, and the second CAVE future decoding module to be trained are updated to obtain the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module.

[0018] In one possible implementation, the method further includes:

[0019] The model parameters of the first CAVE future decoding module to be trained are initialized to the model parameters of the second CAVE future decoding module that has been trained.

[0020] Based on the historical and future trajectory information of N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, trained CAVE future encoding module, and trained second CAVE future decoding module unchanged, the sampler to be trained and the first CAVE future decoding module to be trained are trained to obtain the trained sampler and the trained first CAVE future decoding module.

[0021] In one possible implementation, based on the historical trajectory information and future trajectory information of each of the N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module unchanged, the sampler to be trained and the first CAVE future decoding module to be trained are trained, including:

[0022] Input the historical trajectory information of each of the N sample vehicles into the trained CAVE past encoding module to obtain the first sample latent vector;

[0023] The sampler to be trained is used to diversify the first sample latent vector to obtain multiple diversified first sample latent vectors.

[0024] The first CAVE future decoding module to be trained processes multiple diverse first sample latent vectors to obtain adversarial trajectory information of N sample vehicles.

[0025] Based on the adversarial trajectory information of N sample vehicles and the future trajectory information of N sample vehicles, the third loss function value is obtained;

[0026] Based on the third loss function value, the model parameters of the sampler to be trained and the first CAVE future decoding module to be trained are updated to obtain the trained sampler and the trained first CAVE future decoding module.

[0027] In one possible implementation, the first latent vector is diversified using the trained sampler to obtain multiple diversified first latent vectors, including:

[0028] ;

[0029] in, Represents the diverse first latent vectors. Represents a non-singular matrix. This represents the bias vector. This represents Gaussian noise.

[0030] In one possible implementation, both the trained CAVE past encoding module and the trained CAVE future encoding module include a feature extraction unit based on a graph attention network. The feature extraction process of the graph attention network-based feature extraction unit includes:

[0031] Using N sample vehicles as N nodes, for the i-th node, the attention weight of the i-th node relative to the j-th neighbor node of the i-th node is determined by a graph attention network;

[0032] Based on the determined attention weights, the features of each neighboring node of the i-th node are fused to obtain the features of the i-th node.

[0033] A second aspect of this application also provides a safety-critical scenario generation device for causing traffic accidents, the device comprising:

[0034] The information acquisition module is used to obtain the historical trajectory information of N vehicles. The historical trajectory information includes the status information of the N vehicles in multiple historical time slices, and the status information includes the vehicle's position, speed, and orientation.

[0035] The first latent vector generation module is used to input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first latent vector.

[0036] The diversification module is used to diversify the first latent vector using the trained sampler to obtain multiple diversified first latent vectors.

[0037] The scene generation module is used to process multiple diverse first latent vectors through the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles. The adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0038] In one possible implementation, the device further includes:

[0039] The sample information acquisition module utilizes and obtains the historical trajectory information and future trajectory information of each of the N sample vehicles. The future trajectory information includes the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices.

[0040] The first sample latent vector generation module is used to input the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain the first sample latent vector.

[0041] The second sample latent vector generation module is used to input the future trajectory information of each of the N sample vehicles into the CAVE future encoding module to be trained, and obtain the second sample latent vector.

[0042] The predicted trajectory information generation module is used to process the second sample latent vector through the second CAVE future decoding module to be trained, so as to obtain the predicted trajectory information of each of the N sample vehicles.

[0043] The first loss function calculation module is used to obtain the first loss function value based on the first sample latent vector and the second sample latent vector;

[0044] The second loss function calculation module is used to obtain the second loss function value based on the predicted trajectory information of each of the N sample vehicles and the future trajectory information of each of the N sample vehicles.

[0045] The parameter update module is used to update the model parameters of the CAVE past encoding module, the CAVE future encoding module, and the second CAVE future decoding module to be trained based on the first loss function value and the second loss function value, so as to obtain the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module.

[0046] In one possible implementation, the device further includes:

[0047] The model parameter initialization module is used to initialize the model parameters of the first CAVE future decoding module to be trained to the model parameters of the trained second CAVE future decoding module.

[0048] The training module is used to train the sampler and the first CAVE future decoding module based on the historical trajectory information and future trajectory information of N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, trained CAVE future encoding module, and trained second CAVE future decoding module unchanged, so as to obtain the trained sampler and trained first CAVE future decoding module.

[0049] A third aspect of this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in the method for generating safety-critical scenarios leading to traffic accidents as described in the first aspect of this application.

[0050] The fourth aspect of this application also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps in the method for generating safety-critical scenarios leading to traffic accidents as described in the first aspect of this application.

[0051] The fifth aspect of this application also provides a computer program product that, when run on an electronic device, causes a processor to execute the steps in the method for generating safety-critical scenarios leading to traffic accidents as described in the first aspect of this application.

[0052] This application provides a method for generating safety-critical scenarios leading to traffic accidents. The method includes: obtaining historical trajectory information of N vehicles, the historical trajectory information including state information of the N vehicles in multiple historical time slices, the state information including the vehicle's position, speed, and orientation; inputting the historical trajectory information of the N vehicles into a trained CAVE past encoding module to obtain a first latent vector; using a trained sampler to diversify the first latent vector to obtain multiple diversified first latent vectors; and processing the multiple diversified first latent vectors through a trained first CAVE future decoding module to obtain adversarial trajectory information of the N vehicles, wherein the adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0053] This application proposes a method for automatically generating safety-critical scenarios that lead to traffic accidents. On the one hand, a pre-trained model (including a CAVE past encoding module and a first CAVE future decoding module) is used to generate vehicle trajectories. On the other hand, a sampler is used to diversify the extracted features, increasing the diversity of scenarios and improving the efficiency of scenario generation. Attached Figure Description

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

[0055] Figure 1 This is a flowchart illustrating the steps of a method for generating safety-critical scenarios leading to traffic accidents, as provided in an embodiment of this application.

[0056] Figure 2 This is a schematic diagram of the architecture of a CAVE scene generation model provided in an embodiment of this application;

[0057] Figure 3 This is a schematic diagram of the structure of a safety-critical scenario generation device provided in an embodiment of this application;

[0058] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0059] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0060] The safety of autonomous driving is challenged by the high diversity and complexity of real-world scenarios, including various traffic regulations, road conditions, weather patterns, and other unforeseen circumstances. The effectiveness of end-to-end autonomous driving algorithms depends on the scale and quality of traffic scenario datasets. Therefore, acquiring a large number of safety-critical scenarios that could easily lead to traffic accidents is crucial for optimizing autonomous driving algorithms and improving autonomous driving technology.

[0061] However, in actual driving, safety-critical scenarios that are likely to lead to traffic accidents are relatively rare. Reconstructing these scenarios through data simulation requires manual intervention, which is too costly. Related machine learning-based scenario generation methods still lack flexibility and diversity. In view of the above problems, this application proposes a method, apparatus, and product for generating safety-critical scenarios leading to traffic accidents, so as to conveniently obtain diverse safety-critical scenarios. The following, in conjunction with the accompanying drawings, provides a detailed description of the method for generating safety-critical scenarios leading to traffic accidents provided by this application through some embodiments and application scenarios.

[0062] The first aspect of this application provides a method for generating safety-critical scenarios leading to traffic accidents, referring to... Figure 1 , Figure 1 A flowchart illustrating the steps of a method for generating safety-critical scenarios leading to traffic accidents, as provided in this application embodiment, is shown below. Figure 1 As shown, the method includes:

[0063] Step S101: Obtain the historical trajectory information of each of the N vehicles. The historical trajectory information includes the state information of the N vehicles in multiple historical time slices, and the state information includes the vehicle's position, speed, and orientation.

[0064] Step S102: Input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first latent vector.

[0065] Step S103: Use the trained sampler to diversify the first latent vector to obtain multiple diversified first latent vectors.

[0066] Step S104: The trained first CAVE future decoding module processes multiple diverse first latent vectors to obtain adversarial trajectory information of N vehicles. The adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0067] Safety-critical scenarios refer to situations where vehicles are likely to collide within a short period (e.g., within 10 seconds), leading to traffic accidents. Specifically, this includes the driving trajectories of multiple vehicles in the same scenario, where the trajectories indicate that at least two vehicles are likely to collide. Safety-critical scenarios can be used to evaluate or train autonomous driving technology, enabling autonomous driving algorithms to learn and find optimal driving trajectories within these scenarios to avoid traffic accidents.

[0068] To acquire a large number of diverse safety-critical scenarios, this application proposes a method for generating safety-critical scenarios that could lead to traffic accidents. In this application, generating safety-critical scenarios can be viewed as generating future vehicle trajectories based on historical vehicle trajectories, specifically trajectories where a collision is likely to occur. In a given scenario (i.e., a scenario composed of the historical trajectory information of N vehicles obtained in step S101), the future trajectories of all agents (i.e., vehicles) are predicted based on their past movements. The proposed method for generating safety-critical scenarios utilizes the distribution of historical vehicle trajectories to generate potential vehicle trajectories that could lead to accidents through additional perturbations.

[0069] Specifically, this method employs a CAVE scene generation model, which can be a Variational Auto Encoder (VAE) model. This CAVE scene generation model includes at least: a CAVE past encoding module, a sampler, and a first CAVE future decoding module. The input to the CAVE model is the historical trajectory information of the vehicles (i.e., the historical trajectory information of each of the N vehicles obtained in step S101), where N represents a positive integer greater than 1. Correspondingly, the output of the CAVE model is the safety-critical scene (i.e., the adversarial trajectory information of the N vehicles obtained in step S104).

[0070] Specifically, the historical trajectory information input to the model includes: historical trajectory information of N vehicles x i , Historical trajectory information for each vehicle x i This includes: state information for multiple historical time slices prior to the current time. Each state information segment includes the vehicle's position, speed, and orientation within that historical time slice. Therefore, the prior information of all vehicles within the same map (same scene) can be defined as... This includes the state information of all vehicles across multiple observed historical time slices. The corresponding safety-critical scenario generated by the model is the future trajectory information of the corresponding N vehicles after the current time (i.e., the adversarial trajectory information of the N vehicles obtained in step S104), which can be represented as... Among them, the combat trajectory information y of each vehicle i This includes: state information for multiple future time slices after the current time. Each state information s i t This includes the vehicle's position, speed, and orientation within that future time slice.

[0071] Based on the above steps S101-S104, it can be seen that the embodiments of this application propose a method for automatically generating safety-critical scenarios that lead to traffic accidents. On the one hand, a pre-trained model (including a CAVE past encoding module and a first CAVE future decoding module) is used to generate vehicle trajectories; on the other hand, a sampler is used to diversify the extracted features to increase the diversity of scenarios and improve the efficiency of scenario generation.

[0072] The following examples illustrate in detail the process of diversifying the sampler.

[0073] In one possible embodiment, step S103 involves using the trained sampler to diversify the first latent vector, resulting in multiple diversified first latent vectors, including:

[0074] ;

[0075] in, Represents the diverse first latent vectors. Represents a non-singular matrix. This represents the bias vector. This represents Gaussian noise, which follows a Gaussian distribution.

[0076] Specifically, Dlow can be chosen as the sampler to diversify the final acquired trajectory. The obtained first latent vector Z can be diversified to obtain k diversified first latent vectors. Each diverse first latent vector contains feature information from all N vehicles. It can be decoded into the trajectory information of N vehicles, and then the safety-critical scenarios can be obtained. That is, the safety-critical scenarios that are prone to collisions are obtained by adding perturbations to the vehicle trajectories generated by the pre-trained model.

[0077] To improve the reliability of the safety-critical scenarios generated by the model, this application also proposes a training method for the CAVE scene generation model. In this embodiment, the model (CAVE past encoding module, sampler, and first CAVE future decoding module) is trained through two training phases. Figure 2 As shown, Figure 2 A schematic diagram of the architecture of a CAVE scene generation model is shown, such as... Figure 2 As shown, in the first stage of training, two encoders (CAVE past encoding module and CAVE future encoding module) are set up. The model encodes the input historical trajectory information and future trajectory information respectively, extracts the corresponding latent vectors, and then uses the second CAVE future decoding module to predict the vehicle's future trajectory information based on the latent vectors. Using the vehicle's actual future trajectory information as labels, the parameters of the above three modules are updated, enabling the second CAVE future decoding module to learn the ability to predict the vehicle's future trajectory information during training. Then, the second stage of training is performed. The model parameters of the trained second CAVE future decoding module are shared with the first CAVE future decoding module. The two encoders (CAVE past encoding module and CAVE future encoding module) encode the input historical trajectory information and future trajectory information respectively, extract the corresponding latent vectors, and then use a sampler to perturb the latent vectors to generate different driving trajectories from multiple random variables in the posterior latent space. The first CAVE future decoding module learns the ability to generate more diverse safety-critical scenarios.

[0078] The following embodiment describes the first stage of the training process in detail according to steps S201-S207.

[0079] In one possible implementation, the method further includes:

[0080] Step S201: Obtain the historical trajectory information and future trajectory information of each of the N sample vehicles. The future trajectory information includes the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices.

[0081] Specifically, the historical trajectory information includes: historical trajectory information of N sample vehicles x i , Historical trajectory information for each sample vehicle x i This includes: state information for multiple historical time slices prior to the current time. Each state information segment includes the position, speed, and orientation of the sample vehicle within that historical time slice. Future trajectory information includes the future trajectories of the corresponding N sample vehicles after the current time (after multiple historical time slices). ; Future trajectory information y for each sample vehicle i This includes: state information for multiple future time slices after the current time. Each state information s i t This includes the vehicle's position, speed, and orientation within that future time slice.

[0082] Step S202: Input the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain the first sample latent vector.

[0083] Step S203: Input the future trajectory information of each of the N sample vehicles into the CAVE future encoding module to be trained to obtain the second sample latent vector.

[0084] Specifically, the CAVE past encoding module takes a series of historical trajectory information of the vehicle as input, and the CAVE future encoding module takes a series of future trajectory information of the vehicle as input. The two encoding modules encode the data respectively to obtain a first sample latent vector related to the historical trajectory and a second sample latent vector related to the future trajectory. Both the first and second sample latent vectors can be expressed as their respective mean and logarithmic variance.

[0085] Step S204: The second sample latent vector is processed by the second CAVE future decoding module to be trained to obtain the predicted trajectory information of each of the N sample vehicles.

[0086] Specifically, the second CAVE future decoding module can be an autoregressive model that utilizes graph attention, enabling it to predict the next trajectory step (i.e., predict trajectory information) based on prior information (the second sample latent vector) at the current time point.

[0087] Step S205: Based on the first sample latent vector and the second sample latent vector, obtain the first loss function value.

[0088] Specifically, during model training, the goal is to make the first sample latent vector more similar to the second sample latent vector, and the first loss function value is calculated according to the following formula:

[0089] ;

[0090] in, The first loss function value, Let be the potential vector of the first sample. This represents the posterior probability of the second sample latent vector. This is the potential vector of the second sample. Z represents the prior probability of the first sample latent vector, X represents the input historical trajectory information, and M represents the map information. Indicates future trajectory information, This represents the KL divergence.

[0091] Step S206: Based on the predicted trajectory information of each of the N sample vehicles and the future trajectory information of each of the N sample vehicles, the second loss function value is obtained.

[0092] Specifically, during the training process, in order to make the prediction ability of the second CAVE future decoding module more accurate, and with the goal of making the predicted trajectory information output by the second CAVE future decoding module closer to the vehicle's actual future trajectory information, the second loss function value is calculated according to the following formula:

[0093] ;

[0094] in, This represents the value of the second loss function. This indicates the predicted trajectory information. This represents the future trajectory information, where N represents the number of vehicles.

[0095] Step S207: Based on the first loss function value and the second loss function value, update the model parameters of the CAVE past encoding module to be trained, the CAVE future encoding module to be trained, and the second CAVE future decoding module to be trained, to obtain the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module.

[0096] Specifically, after calculating the first loss function value and the second loss function value, the two can be combined to calculate the total loss function value according to the following formula:

[0097] ;

[0098] in, This represents the total loss function value. The first loss function value, This represents the value of the second loss function. This represents the pre-set loss weight parameters. After calculating the total loss function value, the parameters of the corresponding modules (CAVE past encoding module, CAVE future encoding module, and second CAVE future decoding module) are updated based on this total loss function value, which is considered as completing one round of training. Then, new training samples (the historical trajectory information and future trajectory information of each of the N sample vehicles) are selected and re-input into the model. Steps S201-S207 are repeated to complete multiple rounds of training until the preset number of training iterations is reached, or the loss function converges, and the training ends. The trained CAVE past encoding module, trained CAVE future encoding module, and trained second CAVE future decoding module are obtained, thus completing the first stage of training.

[0099] The following embodiment describes the training process of the second stage in detail according to steps S301 and S302.

[0100] In one possible implementation, the method further includes:

[0101] Step S301: Initialize the model parameters of the first CAVE future decoding module to be trained to the model parameters of the second CAVE future decoding module that has been trained.

[0102] Step S302: Based on the historical trajectory information and future trajectory information of each of the N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module unchanged, the sampler to be trained and the first CAVE future decoding module to be trained are trained to obtain the trained sampler and the trained first CAVE future decoding module.

[0103] After completing the first phase of training, step S301 first shares the model parameters of the second CAVE future decoding module with the first CAVE future decoding module, thus initializing the model parameters of the CAVE future decoding module. Then, the CAVE past encoding module encodes the input historical trajectory information, extracts the corresponding latent vectors, and uses a sampler to perturb the latent vectors. Finally, the first CAVE future decoding module learns to generate more diverse safety-critical scenarios.

[0104] In one possible implementation, step S302, based on the historical trajectory information and future trajectory information of each of the N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module unchanged, trains the sampler to be trained and the first CAVE future decoding module to be trained, including:

[0105] Step S3021: Input the historical trajectory information of each of the N sample vehicles into the trained CAVE past encoding module to obtain the first sample latent vector.

[0106] Specifically, the historical trajectory information includes: historical trajectory information of N sample vehicles x i , Historical trajectory information for each sample vehicle x i This includes: state information for multiple historical time slices prior to the current time. Each status information includes the sample vehicle's position, speed, and orientation within that historical time slice.

[0107] Step S3022: Use the sampler to be trained to diversify the first sample latent vector to obtain multiple diversified first sample latent vectors.

[0108] Step S3023: The first CAVE future decoding module to be trained processes multiple diverse first sample latent vectors to obtain adversarial trajectory information of N sample vehicles.

[0109] Specifically, the first CAVE future decoding module decodes the diversified first sample latent vectors obtained after diversified processing to generate corresponding trajectory information (adversarial trajectory information of N sample vehicles).

[0110] Step S3024: Based on the adversarial trajectory information of N sample vehicles and the future trajectory information of N sample vehicles, the third loss function value is obtained.

[0111] Step S3025: Based on the third loss function value, update the model parameters of the sampler to be trained and the first CAVE future decoding module to be trained to obtain the trained sampler and the trained first CAVE future decoding module.

[0112] Specifically, the third loss function value is calculated according to the following formula, based on the adversarial trajectory information of N sample vehicles and the future trajectory information of N sample vehicles:

[0113] ;

[0114] in, This indicates the adversarial trajectory information generated by the first CAVE future decoding module in step S3023. This represents the future trajectory information of N sample vehicles, where α represents a pre-set weighting parameter. This represents the first sample latent vector encoded by the CAVE past encoding module after training in step S3021. This represents the prior probability of the potential vector of the first sample.

[0115] In this embodiment, the third loss function This indicates that the adversarial trajectory information ultimately generated by the model... , and the future trajectory information of the sample vehicles With the goal of getting closer and closer to the target, the model (sampler, first CAVE future decoding module) is trained so that it can eventually learn to generate more reliable adversarial trajectory information (i.e., safety-critical scenarios). That is, among N sample vehicles, there exists adversarial trajectory information for sample vehicle A. The future trajectory information of sample vehicle B They are close enough that a collision is likely to occur, leading to a traffic accident.

[0116] After calculating the third loss function value, the parameters of the corresponding modules (sampler and first CAVE future decoding module) are updated, which is considered to complete one round of training. Then, new training samples (historical trajectory information and future trajectory information of N sample vehicles) are selected and re-input into the model. Steps S3021-S3025 are repeated to complete multiple rounds of training until the preset number of training times is reached, or the loss function converges. Training ends, and the trained sampler and trained first CAVE future decoding module are obtained, which means the second stage of training is completed.

[0117] The following examples illustrate the improvements made to the attention mechanism in the encoding module in this application.

[0118] Graph Convolutional Networks (GCNs) rely on pre-constructed graphs and cannot adapt to dynamic graphs because they lack the ability to adjust neighbor weights based on node feature attributes. In contrast, Graph Attention Networks (GATs) allow for flexible allocation of different weights based on neighbor features without requiring a pre-constructed graph. However, due to the lack of constraints on attention weights, GATs tend to utilize static attention, producing consistent attention weights regardless of changes in the query node. This application proposes using an improved Graph Attention Network (GAT) as the feature extraction unit in the CAVE past encoding module and the CAVE future encoding module to compute attention weights at each node i (i.e., each vehicle), and to weight and summarize the features based on the computed attention weights, thereby addressing the problems of Graph Convolutional Networks (GCNs).

[0119] In one possible implementation, both the trained CAVE past encoding module and the trained CAVE future encoding module include a feature extraction unit based on a graph attention network. The feature extraction process of the graph attention network-based feature extraction unit includes:

[0120] Using N sample vehicles as N nodes, for the i-th node, the attention weight of the i-th node relative to the j-th neighbor node of the i-th node is determined by a graph attention network;

[0121] Based on the determined attention weights, the features of each neighboring node of the i-th node are fused to obtain the features of the i-th node.

[0122] In this embodiment, both the CAVE past encoding module and the CAVE future encoding module utilize a feature extraction unit based on a graph attention network to extract corresponding feature information from the input trajectory information (historical or future trajectory information of N vehicles) to generate a first latent vector or a second latent vector. Specifically, the historical or future trajectory information of N vehicles is input into the encoding module in the form of a graph structure. Each graph corresponds to a time slice, and each node in the graph represents a vehicle. The information of each node represents the state information of that vehicle in that time slice. During the feature extraction process, the graph attention network calculates the attention weight of each node (e.g., the i-th node) relative to its neighboring nodes, where i represents any positive integer not exceeding the total number of nodes N. Then, feature fusion is performed on each neighboring node of the i-th node based on the attention weight. From the attention weights of each neighboring node, the maximum attention weight is selected as the node feature of the i-th node, thus completing the feature extraction process. This facilitates subsequent encoding based on the extracted features to obtain the first or second latent vector.

[0123] A second aspect of this application also provides a safety-critical scenario generation apparatus for causing traffic accidents, applied to the safety-critical scenario generation method described in the first aspect, with reference to... Figure 3 , Figure 3 A schematic diagram of a safety-critical scenario generation device is shown, such as... Figure 3 As shown, the device includes:

[0124] The information acquisition module is used to obtain the historical trajectory information of N vehicles. The historical trajectory information includes the status information of the N vehicles in multiple historical time slices, and the status information includes the vehicle's position, speed, and orientation.

[0125] The first latent vector generation module is used to input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first latent vector.

[0126] The diversification module is used to diversify the first latent vector using the trained sampler to obtain multiple diversified first latent vectors.

[0127] The scene generation module is used to process multiple diverse first latent vectors through the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles. The adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0128] In one possible implementation, the device further includes:

[0129] The sample information acquisition module utilizes and obtains the historical trajectory information and future trajectory information of each of the N sample vehicles. The future trajectory information includes the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices.

[0130] The first sample latent vector generation module is used to input the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain the first sample latent vector.

[0131] The second sample latent vector generation module is used to input the future trajectory information of each of the N sample vehicles into the CAVE future encoding module to be trained, and obtain the second sample latent vector.

[0132] The predicted trajectory information generation module is used to process the second sample latent vector through the second CAVE future decoding module to be trained, so as to obtain the predicted trajectory information of each of the N sample vehicles.

[0133] The first loss function calculation module is used to obtain the first loss function value based on the first sample latent vector and the second sample latent vector;

[0134] The second loss function calculation module is used to obtain the second loss function value based on the predicted trajectory information of each of the N sample vehicles and the future trajectory information of each of the N sample vehicles.

[0135] The parameter update module is used to update the model parameters of the CAVE past encoding module, the CAVE future encoding module, and the second CAVE future decoding module to be trained based on the first loss function value and the second loss function value, so as to obtain the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module.

[0136] In one possible implementation, the device further includes:

[0137] The model parameter initialization module is used to initialize the model parameters of the first CAVE future decoding module to be trained to the model parameters of the trained second CAVE future decoding module.

[0138] The training module is used to train the sampler and the first CAVE future decoding module based on the historical trajectory information and future trajectory information of N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, trained CAVE future encoding module, and trained second CAVE future decoding module unchanged, so as to obtain the trained sampler and trained first CAVE future decoding module.

[0139] In one possible implementation, the training module includes:

[0140] Input the historical trajectory information of each of the N sample vehicles into the trained CAVE past encoding module to obtain the first sample latent vector;

[0141] The sampler to be trained is used to diversify the first sample latent vector to obtain multiple diversified first sample latent vectors.

[0142] The first CAVE future decoding module to be trained processes multiple diverse first sample latent vectors to obtain adversarial trajectory information of N sample vehicles.

[0143] Based on the adversarial trajectory information of N sample vehicles and the future trajectory information of N sample vehicles, the third loss function value is obtained;

[0144] Based on the third loss function value, the model parameters of the sampler to be trained and the first CAVE future decoding module to be trained are updated to obtain the trained sampler and the trained first CAVE future decoding module.

[0145] In one possible implementation, the diversification module includes:

[0146] ;

[0147] in, Represents the diverse first latent vectors. Represents a non-singular matrix. This represents the bias vector. This represents Gaussian noise.

[0148] In one possible implementation, both the trained CAVE past encoding module and the trained CAVE future encoding module include a feature extraction unit based on a graph attention network. The feature extraction process of the graph attention network-based feature extraction unit includes:

[0149] Using N sample vehicles as N nodes, for the i-th node, the attention weight of the i-th node relative to the j-th neighbor node of the i-th node is determined by a graph attention network;

[0150] Based on the determined attention weights, the features of each neighboring node of the i-th node are fused to obtain the features of the i-th node.

[0151] This application also provides an electronic device, see embodiments thereof. Figure 4 , Figure 4 This is a schematic diagram of the electronic device proposed in an embodiment of this application. Figure 4 As shown, the electronic device 100 includes a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus. The memory 110 stores a computer program that can run on the processor 120 to implement the steps in the method for generating safety-critical scenarios leading to traffic accidents disclosed in the embodiments of this application.

[0152] This application also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps in the method for generating safety-critical scenarios leading to traffic accidents as disclosed in this application.

[0153] This application also provides a computer program product that, when run on an electronic device, enables the processor to execute the steps of the method for generating safety-critical scenarios leading to traffic accidents as disclosed in this application.

[0154] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0155] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0156] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0157] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0158] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0159] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0160] The above provides a detailed description of the method, apparatus, and product for generating safety-critical scenarios leading to traffic accidents provided by this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for generating safety-critical scenarios leading to traffic accidents, characterized in that, The method includes: Obtain the historical trajectory information of N vehicles, which includes the state information of the N vehicles in multiple historical time slices, including the vehicle's position, speed, and orientation; Input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first potential vector; The first latent vector is diversified using the trained sampler to obtain multiple diversified first latent vectors; The trained first CAVE future decoding module processes multiple diverse first latent vectors to obtain adversarial trajectory information for N vehicles. The adversarial trajectory information satisfies the condition that at least two of the N vehicles collide. The method further includes: Obtain the historical trajectory information and future trajectory information of each of the N sample vehicles. The future trajectory information includes the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices. Input the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain the first sample potential vector; Input the future trajectory information of each of the N sample vehicles into the CAVE future encoding module to be trained to obtain the second sample potential vector; The second sample latent vector is processed by the second CAVE future decoding module to be trained to obtain the predicted trajectory information of each of the N sample vehicles. Based on the first sample latent vector and the second sample latent vector, the first loss function value is obtained; The second loss function value is obtained based on the predicted trajectory information of each of the N sample vehicles and the future trajectory information of each of the N sample vehicles. Based on the first loss function value and the second loss function value, the model parameters of the CAVE past encoding module to be trained, the CAVE future encoding module to be trained, and the second CAVE future decoding module to be trained are updated to obtain the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module. The method further includes: The model parameters of the first CAVE future decoding module to be trained are initialized to the model parameters of the second CAVE future decoding module that has been trained. Based on the historical and future trajectory information of N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, trained CAVE future encoding module, and trained second CAVE future decoding module unchanged, the sampler to be trained and the first CAVE future decoding module to be trained are trained to obtain the trained sampler and the trained first CAVE future decoding module.

2. The method for generating safety-critical scenarios according to claim 1, characterized in that, Based on the historical and future trajectory information of N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, trained CAVE future encoding module, and trained second CAVE future decoding module unchanged, the sampler to be trained and the first CAVE future decoding module to be trained are trained, including: Input the historical trajectory information of each of the N sample vehicles into the trained CAVE past encoding module to obtain the first sample latent vector; The sampler to be trained is used to diversify the first sample latent vector to obtain multiple diversified first sample latent vectors. The first CAVE future decoding module to be trained processes multiple diverse first sample latent vectors to obtain adversarial trajectory information of N sample vehicles. Based on the adversarial trajectory information of N sample vehicles and the future trajectory information of N sample vehicles, the third loss function value is obtained; Based on the third loss function value, the model parameters of the sampler to be trained and the first CAVE future decoding module to be trained are updated to obtain the trained sampler and the trained first CAVE future decoding module.

3. The method for generating safety-critical scenarios according to claim 1, characterized in that, The trained sampler is used to diversify the first latent vector, resulting in multiple diversified first latent vectors, including: ; in, Represents the diverse first latent vectors, Represents a non-singular matrix. This represents the bias vector. This represents Gaussian noise.

4. The method for generating safety-critical scenarios according to claim 1, characterized in that, The trained CAVE past encoding module and the trained CAVE future encoding module each include a feature extraction unit based on a graph attention network. The feature extraction process of the graph attention network-based feature extraction unit includes: Using N sample vehicles as N nodes, for the i-th node, the attention weight of the i-th node relative to the j-th neighbor node of the i-th node is determined by a graph attention network; Based on the determined attention weights, the features of each neighboring node of the i-th node are fused to obtain the features of the i-th node.

5. A device for generating safety-critical scenarios leading to traffic accidents, characterized in that, The device includes: The information acquisition module is used to obtain the historical trajectory information of N vehicles. The historical trajectory information includes the status information of the N vehicles in multiple historical time slices, and the status information includes the vehicle's position, speed, and orientation. The first latent vector generation module is used to input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first latent vector. The diversification module is used to diversify the first latent vector using the trained sampler to obtain multiple diversified first latent vectors. The scene generation module is used to process multiple diverse first latent vectors through the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles. The adversarial trajectory information satisfies the condition that at least two of the N vehicles collide. The device further includes: The sample information acquisition module utilizes and obtains the historical trajectory information and future trajectory information of each of the N sample vehicles. The future trajectory information includes the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices. The first sample latent vector generation module is used to input the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain the first sample latent vector. The second sample latent vector generation module is used to input the future trajectory information of each of the N sample vehicles into the CAVE future encoding module to be trained, and obtain the second sample latent vector. The predicted trajectory information generation module is used to process the second sample latent vector through the second CAVE future decoding module to be trained, so as to obtain the predicted trajectory information of each of the N sample vehicles. The first loss function calculation module is used to obtain the first loss function value based on the first sample latent vector and the second sample latent vector; The second loss function calculation module is used to obtain the second loss function value based on the predicted trajectory information of each of the N sample vehicles and the future trajectory information of each of the N sample vehicles. The parameter update module is used to update the model parameters of the CAVE past encoding module, the CAVE future encoding module, and the second CAVE future decoding module to be trained based on the first loss function value and the second loss function value, so as to obtain the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module. The device further includes: The model parameter initialization module is used to initialize the model parameters of the first CAVE future decoding module to be trained to the model parameters of the trained second CAVE future decoding module. The training module is used to train the sampler and the first CAVE future decoding module based on the historical trajectory information and future trajectory information of N sample vehicles, while keeping the model parameters of the trained CAVE past encoding module, trained CAVE future encoding module, and trained second CAVE future decoding module unchanged, so as to obtain the trained sampler and trained first CAVE future decoding module.

6. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the safety-critical scenario generation method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Space-temporal data variational coding and decoding cross-modal enhancement method

    CN113780003A

  • Pedestrian trajectory prediction method and device based on adversarial network, equipment and medium

    CN115908490A