Method, device and product for generating safety key scene causing traffic accident

Through the CAVE scene generation model, the vehicle historical trajectory is used to generate adversarial trajectories, and the construction of safety-critical scenarios is solved, which solves the problem of obtaining a variety of safety-critical scenarios in the existing technology, and realizes the optimization of autonomous driving algorithms and the safety improvement of autonomous driving technology.

CN119761206AActive Publication Date: 2025-04-04TSINGHUA UNIVERSITY
View PDF 9 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively obtain a variety of safety-critical scenarios, especially those that are prone to traffic accidents, which limits the optimization and improvement of autonomous driving algorithms.

Method used

Through the CAVE scene generation model, the vehicle's historical trajectory information is used to generate adversarial trajectory information, causing at least two vehicles to collide, thereby building a safety-critical scenario. The model includes a CAVE past encoding module, a sampler and a first CAVE future decoding module to generate a variety of security-critical scenarios through diversified processing and decoding.

Benefits of technology

It realizes the automatic generation of various safety-critical scenarios, improves the efficiency of scenario generation, and can be effectively used to optimize autonomous driving algorithms and improves the safety of autonomous driving technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761206A_ABST
    Figure CN119761206A_ABST
Patent Text Reader

Abstract

The invention provides a method, a device and a product for generating a safety key scene causing a traffic accident, and relates to the technical field of scene generation, the method comprises the following steps: obtaining respective historical track information of N vehicles, the historical track information comprising state information of the N vehicles in a plurality of historical time slices, the state information comprises the position, the speed and the orientation of the vehicle; inputting respective historical track information of N vehicles into a trained CAVE past coding module to obtain a first potential vector; carrying out diversification processing on the first potential vector by utilizing the trained sampler to obtain a plurality of diversification first potential vectors; the multiple diversified first potential vectors are processed through a trained first CAVE future decoding module, confrontation track information of the N vehicles is obtained, and the confrontation track information meets the condition that at least two vehicles in the N vehicles collide.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of scene generation, and in particular to a method, device and product for generating safety-critical scenes leading to traffic accidents. Background Art

[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, obtaining a large number of safety-critical scenarios that are prone 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, and reconstructing safety-critical scenarios through data simulation requires manual intervention, which is too costly. Therefore, it is urgent to propose a method, device, and product for generating safety-critical scenarios that lead to traffic accidents, so as to easily obtain a variety of safety-critical scenarios. Summary of the invention

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

[0005] In a first aspect of an embodiment of the present application, a method for generating a safety-critical scenario leading to a traffic accident is provided, the method comprising: Obtaining historical trajectory information of each of N vehicles, the historical trajectory information including: status information of the N vehicles in multiple historical time slices, the status information including: position, speed and direction of the vehicle; Input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first latent vector; Using the trained sampler to perform diversification processing on the first latent vector to obtain multiple diversified first latent vectors; The multiple diversified first potential vectors are processed by the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles, and the adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0006] In a possible implementation, the method further includes: Obtaining historical trajectory information and future trajectory information of each of the N sample vehicles, wherein the future trajectory information includes: 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 a second sample potential vector; Processing the second sample potential vector by a second CAVE future decoding module to be trained to obtain predicted trajectory information of each of the N sample vehicles; Obtaining a first loss function value based on the first sample latent vector and the second sample latent vector; 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, a second loss function value is obtained; 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.

[0007] In a possible implementation, the method further includes: Initializing 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; 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, 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.

[0008] In a 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: Input the historical trajectory information of each of the N sample vehicles into the trained CAVE past encoding module to obtain the first sample potential vector; Performing diversification processing on the first sample latent vector using the sampler to be trained to obtain a plurality of diversified first sample latent vectors; Processing a plurality of diverse first sample potential vectors through a first CAVE future decoding module to be trained to obtain adversarial trajectory information of N sample vehicles; Based on the adversarial trajectory information of the N sample vehicles and the future trajectory information of the N sample vehicles, a third loss function value is obtained; Based on the third loss function value, model parameters of the sampler to be trained and the first CAVE future decoding module to be trained are updated to obtain a trained sampler and a trained first CAVE future decoding module.

[0009] In a possible implementation, the first latent vector is diversified using the trained sampler to obtain a plurality of diversified first latent vectors, including: ; in, represents the diversified first latent vector, represents a non-singular matrix, represents the bias vector, represents Gaussian noise.

[0010] In a possible implementation, 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, and the feature extraction process of the feature extraction unit based on the graph attention network includes: Take N sample vehicles as N nodes, and for the i-th node, determine the attention weight of the i-th node relative to the j-th neighboring node of the i-th node through the 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.

[0011] A second aspect of the embodiment of the present application further provides a device for generating a safety-critical scenario leading to a traffic accident, the device comprising: An information acquisition module, used to obtain historical trajectory information of each of the N vehicles, wherein the historical trajectory information includes: status information of the N vehicles in multiple historical time slices, wherein the status information includes: position, speed and direction of the vehicle; A 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 a first latent vector; A diversification module, configured to perform diversification processing on the first latent vector using the trained sampler to obtain a plurality of diversified first latent vectors; The scenario generation module is used to process multiple diversified first potential vectors through the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles, and the adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0012] In a possible implementation, the device further includes: The sample information acquisition module uses and obtains the historical trajectory information and future trajectory information of each of the N sample vehicles, wherein the future trajectory information includes: the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices; A first sample latent vector generation module, used for inputting the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain a first sample latent vector; A second sample potential 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 to obtain a second sample potential vector; A predicted trajectory information generation module, used for processing the second sample potential vector through a second CAVE future decoding module to be trained to obtain predicted trajectory information of each of N sample vehicles; A first loss function calculation module, used for obtaining a first loss function value based on the first sample potential vector and the second sample potential vector; A second loss function calculation module, used to obtain a 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; A parameter updating module is used to 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 based on the first loss function value and the second loss function value, so as to obtain a trained CAVE past encoding module, a trained CAVE future encoding module, and a trained second CAVE future decoding module.

[0013] In a possible implementation, the device further includes: A model parameter initialization module, used for initializing 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; A training module is used to train a sampler to be trained and a first CAVE future decoding module to be trained based on the historical trajectory information and future trajectory information of each of N sample vehicles, while keeping the model parameters of a trained CAVE past encoding module, a trained CAVE future encoding module, and a trained second CAVE future decoding module unchanged, so as to obtain a trained sampler and a trained first CAVE future decoding module.

[0014] The third aspect of the embodiments of the present application also provides an electronic device, including a memory, a processor and a computer program stored on 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 described in the first aspect of the embodiments of the present application.

[0015] The fourth aspect of the embodiments of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the method for generating safety-critical scenarios that lead to traffic accidents described in the first aspect of the embodiments of the present application are implemented.

[0016] The fifth aspect of the embodiments of the present application also provides a computer program product. When the computer program product is run on an electronic device, the processor is enabled to implement the steps in the method for generating safety-critical scenarios that lead to traffic accidents as described in the first aspect of the embodiments of the present application.

[0017] An embodiment of the present application provides a method for generating a safety-critical scenario leading to a traffic accident, the method comprising: obtaining historical trajectory information of each of N vehicles, the historical trajectory information comprising: status information of the N vehicles in multiple historical time slices, the status information comprising: the position, speed and orientation of the vehicle; inputting the historical trajectory information of each of the N vehicles into a trained CAVE past encoding module to obtain a first latent vector; performing diversified processing on the first latent vector using a trained sampler to obtain multiple diversified first latent vectors; 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 a condition: at least two of the N vehicles collide.

[0018] The embodiment of the present application proposes a method for automatically generating safety-critical scenarios leading 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 perform diversified processing on the extracted features to increase the diversity of scenarios and improve the efficiency of scenario generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 is a flowchart of the steps of a method for generating a safety-critical scenario leading to a traffic accident provided by an embodiment of the present application; Figure 2 It is a schematic diagram of the architecture of a CAVE scene generation model provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of a safety-critical scenario generating device provided in an embodiment of the present application; Figure 4 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to enable the scope of the present application to be fully communicated to those skilled in the art.

[0022] 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, obtaining a large number of safety-critical scenarios that are prone to traffic accidents is crucial for optimizing autonomous driving algorithms and improving autonomous driving technology.

[0023] However, in actual driving, safety-critical scenarios that are likely to lead to traffic accidents are relatively rare, and reconstructing safety-critical scenarios through data simulation requires manual intervention, which is too costly. Related scene generation methods based on machine learning still lack flexibility and diversity. In view of the above problems, the embodiments of the present application propose a method, device and product for generating safety-critical scenarios that lead to traffic accidents, so as to achieve convenient acquisition of various safety-critical scenarios. In conjunction with the accompanying drawings, a method for generating safety-critical scenarios that lead to traffic accidents provided in the embodiments of the present application is described in detail through some embodiments and their application scenarios.

[0024] The first aspect of the present application embodiment provides a method for generating a safety-critical scene leading to a traffic accident, referring to Figure 1, Figure 1 A flowchart of a method for generating a safety-critical scenario leading to a traffic accident provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes: Step S101, obtaining historical trajectory information of each of N vehicles, wherein the historical trajectory information includes: status information of the N vehicles in multiple historical time slices, wherein the status information includes: position, speed and direction of the vehicle.

[0025] Step S102, inputting the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain a first latent vector.

[0026] Step S103: Use the trained sampler to perform diversification processing on the first latent vector to obtain multiple diversified first latent vectors.

[0027] Step S104, processing the multiple diversified first potential vectors through the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles, and the adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0028] Safety-critical scenarios refer to scenarios where vehicles are prone to collision within a short period of time (e.g., within 10 seconds), leading to traffic accidents. Specifically, they include the driving trajectories of multiple vehicles in the same scenario. According to the vehicle driving trajectories, it can be found that at least two vehicles in the scenario will collide. Safety-critical scenarios can be used to evaluate or train autonomous driving technology, so that autonomous driving algorithms can learn to find the optimal driving trajectory in safety-critical scenarios to avoid traffic accidents.

[0029] In order to obtain a large number of diverse safety-critical scenarios, an embodiment of the present application proposes a method for generating safety-critical scenarios that lead to traffic accidents. In an embodiment of the present application, the task of generating safety-critical scenarios can be regarded as generating the future trajectory of the vehicle based on the historical trajectory of the vehicle, and the trajectory of the vehicle that will collide in the future. In a given scenario (i.e., the scenario composed of the historical trajectory information of the N vehicles obtained in step S101), the future trajectories of all agents (i.e., vehicles) are predicted based on their past movements. The method for generating safety-critical scenarios proposed in the present application utilizes the distribution of historical trajectories of vehicles to generate potential vehicle trajectories that may cause accidents through additional disturbances.

[0030] Specifically, the method applies a CAVE scene generation model, which can be a variational auto encoder (VAE) model, and the CAVE scene generation model at least includes: a CAVE past encoding module, a sampler, and a first CAVE future decoding module. The input of the CAVE model is the historical trajectory information of the vehicle (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 a safety-critical scene (i.e., the adversarial trajectory information of the N vehicles obtained in step S104).

[0031] Specifically, the historical trajectory information of the input model includes: historical trajectory information x of N vehicles i , ; Historical trajectory information x of each vehicle i Includes: Status information for multiple historical time slices before the current time Among them, each state information includes the position, speed and direction of the vehicle in the historical time slice. Therefore, the prior information of all vehicles in the same map (same scene) can be defined as . It contains the state information of all vehicles in multiple observed historical time slices. The safety-critical scenario generated by the corresponding 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 expressed as ; Among them, the adversarial trajectory information y of each vehicle i Includes: Status information for multiple future time slices after the current time Among them, each state information s i t Includes the vehicle's position, speed, and orientation in the future time slice.

[0032] According to the above steps S101-S104, it can be known that the embodiment of the present application proposes a method for automatically generating safety-critical scenarios leading 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 perform diversified processing on the extracted features to increase the diversity of the scenarios and improve the efficiency of scenario generation.

[0033] The following embodiments specifically illustrate the process of performing diversified processing on the sampler.

[0034] In a possible embodiment, step S103, using the trained sampler to perform diversification processing on the first latent vector to obtain multiple diversified first latent vectors, includes: ; in, represents the diversified first latent vector, represents a non-singular matrix, represents the bias vector, Represents Gaussian noise, which conforms to the Gaussian distribution.

[0035] Specifically, Dlow can be selected as a sampler to diversify the final trajectory. The first latent vector Z can be diversified to obtain k diversified first latent vectors Among them, each diversified first latent vector contains the feature information of all N vehicles , can be decoded into the trajectory information of N vehicles, and then the safety-critical scenario, that is, the safety-critical scenario prone to collision, is obtained by adding perturbations to the vehicle trajectory generated by the pre-trained model.

[0036] In order to improve the reliability of the safety-critical scenarios generated by the model, the present application embodiment also proposes a training method for the CAVE scenario generation model. In this embodiment, the model (CAVE past encoding module, sampler, first CAVE future decoding module) is trained through two training stages. Figure 2 As shown, Figure 2 A schematic diagram of the architecture of a CAVE scene generation model is shown, Figure 2 As shown, in the first stage of training, two encoders (CAVE past encoding module and CAVE future encoding module) are set up, and the model encodes the input historical trajectory information and future trajectory information respectively, extracts the corresponding latent vector, and then uses the second CAVE future decoding module to predict the future trajectory information of the vehicle according to the latent vector. The parameters of the above three modules are updated with the real future trajectory information of the vehicle as the label, so that the second CAVE future decoding module learns the ability to predict the future trajectory information of the vehicle during the training process. Then, the second stage of training is performed, and 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) are used to encode the input historical trajectory information and future trajectory information respectively. After extracting the corresponding latent vector, the sampler is used to perturb the latent vector to generate different driving trajectories from multiple random variables in the posterior latent space, and the first CAVE future decoding module is used to learn the ability to generate more diverse safety-critical scenarios.

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

[0038] In a possible implementation, the method further includes: Step S201 : obtaining historical trajectory information and future trajectory information of each of N sample vehicles, wherein the future trajectory information includes: state information of the N sample vehicles in multiple future time slices after the multiple historical time slices.

[0039] Specifically, the historical trajectory information includes: historical trajectory information x of N sample vehicles i , ; Historical trajectory information x of each sample vehicle i Includes: Status information for multiple historical time slices before the current time Each state information includes the position, speed and direction of the sample vehicle in the historical time slice. The future trajectory information includes the future trajectory information of the corresponding N sample vehicles after the current time (after multiple historical time slices). ; Future trajectory information y of each sample vehicle i Includes: Status information for multiple future time slices after the current time Among them, each state information s i t Includes the vehicle's position, speed, and orientation in the future time slice.

[0040] 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 a first sample potential vector.

[0041] Step S203, inputting the future trajectory information of each of the N sample vehicles into the CAVE future encoding module to be trained to obtain a second sample potential vector.

[0042] 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 respectively to obtain a first sample potential vector related to the historical trajectory and a second sample potential vector related to the future trajectory. The first sample potential vector or the second sample potential vector can be expressed in the form of corresponding mean and logarithmic variance.

[0043] Step S204: Process the second sample potential vector through the second CAVE future decoding module to be trained to obtain the predicted trajectory information of each of the N sample vehicles.

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

[0045] Step S205: Obtain a first loss function value based on the first sample latent vector and the second sample latent vector.

[0046] Specifically, in the process of training the model, the first loss function value is calculated according to the following formula with the goal of making the first sample potential vector and the second sample potential vector closer together: ; in, is the first loss function value, is the first sample potential vector, represents the posterior probability of the second sample potential vector, is the second sample potential vector, represents the prior probability of the first sample potential vector, Z represents the potential vector, X represents the input historical trajectory information, M represents the map information, Represents future trajectory information, represents the KL divergence.

[0047] Step S206: obtaining a 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.

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

[0049] 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.

[0050] 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: ; in, represents the total loss function value, is the first loss function value, represents the second loss function value, Represents a pre-set loss weight parameter. After the total loss function value is calculated, the corresponding modules (CAVE past encoding module, CAVE future encoding module and second CAVE future decoding module) are updated according to the total loss function value, and one round of training is considered to be completed. Then select new training samples (historical trajectory information and future trajectory information of each of N sample vehicles), re-enter the model, and repeat steps S201-S207 to complete multiple rounds of training until the preset number of training times is reached, or the loss function converges, and the training is terminated to obtain the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module, that is, the first stage of training tasks is completed.

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

[0052] In a possible implementation, the method further includes: Step S301, initializing 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.

[0053] 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 a trained sampler and a trained first CAVE future decoding module.

[0054] After the first stage of training is completed, first, through step S301, the model parameters of the second CAVE future decoding module after the first stage of training are shared with the first CAVE future decoding module to complete the model parameter initialization of the CAVE future decoding module. Then, the CAVE past encoding module is used to encode the input historical trajectory information, and after extracting the corresponding latent vector, the sampler is used to perturb the latent vector, and the first CAVE future decoding module is used to learn the ability to generate more diverse safety-critical scenarios.

[0055] In a 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: 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 potential vector.

[0056] Specifically, the historical trajectory information includes: historical trajectory information x of N sample vehicles i , ; Historical trajectory information x of each sample vehicle i Includes: Status information for multiple historical time slices before the current time Each state information includes the position, speed and direction of the sample vehicle in the historical time slice.

[0057] Step S3022: Perform diversification processing on the first sample latent vector using the sampler to be trained to obtain multiple diversified first sample latent vectors.

[0058] Step S3023, processing multiple diversified first sample potential vectors through the first CAVE future decoding module to be trained to obtain adversarial trajectory information of N sample vehicles.

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

[0060] Step S3024: obtaining a third loss function value based on the adversarial trajectory information of the N sample vehicles and the future trajectory information of the N sample vehicles.

[0061] Step S3025: 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 a trained sampler and a trained first CAVE future decoding module.

[0062] Specifically, the third loss function value is calculated based on the adversarial trajectory information of N sample vehicles and the future trajectory information of N sample vehicles according to the following formula: ; in, represents the adversarial trajectory information generated by the first CAVE future decoding module in step S3023, represents the future trajectory information of N sample vehicles, α represents the pre-set weight parameter, represents the first sample potential vector obtained by encoding the CAVE past encoding module trained in step S3021, represents the prior probability of the first sample potential vector.

[0063] In this embodiment, the third loss function Indicates that the adversarial trajectory information finally generated by the model , and the future trajectory information of the sample vehicle The model (sampler, first CAVE future decoding module) is trained to get closer and closer to the target, so that the model can eventually learn to generate more reliable adversarial trajectory information (i.e., safety-critical scenarios). That is, among the N sample vehicles, there is adversarial trajectory information of sample vehicle A. , and the future trajectory information of the sample vehicle B Close enough to easily collide and cause a traffic accident.

[0064] After calculating the third loss function value, update the parameters of the corresponding modules (sampler, first CAVE future decoding module), and consider one round of training as completed. Then select new training samples (historical trajectory information and future trajectory information of N sample vehicles), re-enter the model, and repeat steps S3021-S3025 to complete multiple rounds of training until the preset number of training times is reached, or the loss function converges, and the training is terminated to obtain the trained sampler and the trained first CAVE future decoding module, that is, the second stage of training task is completed.

[0065] The following examples are used to illustrate the improvement of the attention mechanism in the encoding module of the present application.

[0066] 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 different weights to be flexibly assigned based on the characteristics of neighbors without the need to pre-build graphs. However, due to the lack of constraints on attention weights, GATs tend to use static attention, which produces consistent attention weights regardless of changes in the query node. The embodiment of the present application proposes using an improved graph attention network (GAT) as a feature extraction unit in the CAVE past encoding module and the CAVE future encoding module to calculate the attention weight on each node i (i.e., each vehicle), and weight and summarize the features according to the calculated attention weights to solve the problems of graph convolutional networks (GCNs).

[0067] In a possible implementation, 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, and the feature extraction process of the feature extraction unit based on the graph attention network includes: Take N sample vehicles as N nodes, and for the i-th node, determine the attention weight of the i-th node relative to the j-th neighboring node of the i-th node through the 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.

[0068] In this embodiment, both the CAVE past encoding module and the CAVE future encoding module use a feature extraction unit based on a graph attention network to extract corresponding feature information from the input trajectory information (historical trajectory information or future trajectory information of N vehicles) to encode and generate a first latent vector or a second latent vector. Specifically, the historical trajectory information 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, each node in the graph represents a vehicle, and the information of each node represents the state information of the vehicle in the time slice. In the feature extraction process, the graph attention network calculates the attention weight of each node (for example, the i-th node) relative to the neighboring node, where i represents any positive integer that does not exceed the total number of nodes N, and then performs feature fusion on each neighboring node of the i-th node according to the attention weight, and selects the maximum attention weight from the attention weights of each neighboring node as the node feature of the i-th node, thereby completing the feature extraction process, so as to facilitate subsequent encoding based on the extracted features to obtain the first latent vector or the second latent vector.

[0069] The second aspect of the embodiment of the present application further provides a device for generating a safety-critical scenario leading to a traffic accident, which is used to execute the method for generating a safety-critical scenario according to the first aspect, referring to Figure 3 , Figure 3 A schematic diagram of the structure of a safety-critical scene generation device is shown, such as Figure 3 As shown, the device comprises: An information acquisition module, used to obtain historical trajectory information of each of the N vehicles, wherein the historical trajectory information includes: status information of the N vehicles in multiple historical time slices, wherein the status information includes: position, speed and direction of the vehicle; A 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 a first latent vector; A diversification module, configured to perform diversification processing on the first latent vector using the trained sampler to obtain a plurality of diversified first latent vectors; The scenario generation module is used to process multiple diversified first potential vectors through the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles, and the adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

[0070] In a possible implementation, the device further includes: The sample information acquisition module uses and obtains the historical trajectory information and future trajectory information of each of the N sample vehicles, wherein the future trajectory information includes: the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices; A first sample latent vector generation module, used for inputting the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain a first sample latent vector; A second sample potential 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 to obtain a second sample potential vector; A predicted trajectory information generation module, used for processing the second sample potential vector through a second CAVE future decoding module to be trained to obtain predicted trajectory information of each of N sample vehicles; A first loss function calculation module, used for obtaining a first loss function value based on the first sample potential vector and the second sample potential vector; A second loss function calculation module, used to obtain a 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; A parameter updating module is used to 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 based on the first loss function value and the second loss function value, so as to obtain a trained CAVE past encoding module, a trained CAVE future encoding module, and a trained second CAVE future decoding module.

[0071] In a possible implementation, the device further includes: A model parameter initialization module, used for initializing 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; A training module is used to train a sampler to be trained and a first CAVE future decoding module to be trained based on the historical trajectory information and future trajectory information of each of N sample vehicles, while keeping the model parameters of a trained CAVE past encoding module, a trained CAVE future encoding module, and a trained second CAVE future decoding module unchanged, so as to obtain a trained sampler and a trained first CAVE future decoding module.

[0072] In a possible implementation, the training module includes: Input the historical trajectory information of each of the N sample vehicles into the trained CAVE past encoding module to obtain the first sample potential vector; Performing diversification processing on the first sample latent vector using the sampler to be trained to obtain a plurality of diversified first sample latent vectors; Processing a plurality of diverse first sample potential vectors through a first CAVE future decoding module to be trained to obtain adversarial trajectory information of N sample vehicles; Based on the adversarial trajectory information of the N sample vehicles and the future trajectory information of the N sample vehicles, a third loss function value is obtained; Based on the third loss function value, model parameters of the sampler to be trained and the first CAVE future decoding module to be trained are updated to obtain a trained sampler and a trained first CAVE future decoding module.

[0073] In a possible implementation, the diversification module includes: ; in, represents the diversified first latent vector, represents a non-singular matrix, represents the bias vector, represents Gaussian noise.

[0074] In a possible implementation, 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, and the feature extraction process of the feature extraction unit based on the graph attention network includes: Take N sample vehicles as N nodes, and for the i-th node, determine the attention weight of the i-th node relative to the j-th neighboring node of the i-th node through the 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.

[0075] The present application also provides an electronic device, referring to Figure 4 , Figure 4 Schematic diagram of an electronic device proposed in an embodiment of the present 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 communication. A computer program is stored in the memory 110. The computer program can be executed on the processor 120 to implement the steps in the method for generating safety-critical scenarios leading to traffic accidents disclosed in the embodiment of the present application.

[0076] An embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the method for generating a safety-critical scenario leading to a traffic accident as disclosed in the embodiment of the present application are implemented.

[0077] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the processor is enabled to implement the steps of the method for generating a safety-critical scenario leading to a traffic accident as disclosed in the embodiment of the present application.

[0078] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0079] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0080] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0081] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0082] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0083] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0084] The above is a detailed introduction to the method, device and product for generating safety-critical scenarios leading to traffic accidents provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for generating a safety-critical scenario leading to a traffic accident, characterized in that: The method comprises: Obtaining historical trajectory information of each of N vehicles, the historical trajectory information including: status information of the N vehicles in multiple historical time slices, the status information including: position, speed and direction of the vehicle; Input the historical trajectory information of each of the N vehicles into the trained CAVE past encoding module to obtain the first latent vector; Using the trained sampler to perform diversification processing on the first latent vector to obtain multiple diversified first latent vectors; The multiple diversified first potential vectors are processed by the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles, and the adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

2. The method for generating a safety-critical scenario according to claim 1, characterized in that: The method further comprises: Obtaining historical trajectory information and future trajectory information of each of the N sample vehicles, wherein the future trajectory information includes: 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 a second sample potential vector; Processing the second sample potential vector by a second CAVE future decoding module to be trained to obtain predicted trajectory information of each of the N sample vehicles; Obtaining a first loss function value based on the first sample latent vector and the second sample latent vector; 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, a second loss function value is obtained; 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.

3. The method for generating a safety-critical scenario according to claim 2, characterized in that: The method further comprises: Initializing 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; 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, 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.

4. The method for generating a safety-critical scenario according to claim 3, characterized in that: Based on the historical trajectory information and future trajectory information of each of the N sample vehicles, the sampler to be trained and the first CAVE future decoding module to be trained are trained under the condition that the model parameters of the trained CAVE past encoding module, the trained CAVE future encoding module, and the trained second CAVE future decoding module remain unchanged, 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 potential vector; Performing diversification processing on the first sample latent vector using the sampler to be trained to obtain a plurality of diversified first sample latent vectors; Processing a plurality of diverse first sample potential vectors through a first CAVE future decoding module to be trained to obtain adversarial trajectory information of N sample vehicles; Based on the adversarial trajectory information of the N sample vehicles and the future trajectory information of the N sample vehicles, a third loss function value is obtained; Based on the third loss function value, model parameters of the sampler to be trained and the first CAVE future decoding module to be trained are updated to obtain a trained sampler and a trained first CAVE future decoding module.

5. The method for generating a safety-critical scenario according to claim 1, characterized in that: The first latent vector is diversified using the trained sampler to obtain multiple diversified first latent vectors, including: ; in, represents the diversified first latent vector, represents a non-singular matrix, represents the bias vector, represents Gaussian noise.

6. The method for generating a safety-critical scenario according to claim 2, 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, and the feature extraction process of the feature extraction unit based on the graph attention network includes: Take N sample vehicles as N nodes, and for the i-th node, determine the attention weight of the i-th node relative to the j-th neighboring node of the i-th node through the 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.

7. A device for generating a safety-critical scenario leading to a traffic accident, characterized in that: The device comprises: An information acquisition module, used to obtain historical trajectory information of each of the N vehicles, wherein the historical trajectory information includes: status information of the N vehicles in multiple historical time slices, wherein the status information includes: position, speed and direction of the vehicle; A 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 a first latent vector; A diversification module, configured to perform diversification processing on the first latent vector using the trained sampler to obtain a plurality of diversified first latent vectors; The scenario generation module is used to process multiple diversified first potential vectors through the trained first CAVE future decoding module to obtain adversarial trajectory information of N vehicles, and the adversarial trajectory information satisfies the condition that at least two of the N vehicles collide.

8. The safety-critical scenario generating device according to claim 7, characterized in that: The device also includes: The sample information acquisition module uses and obtains the historical trajectory information and future trajectory information of each of the N sample vehicles, wherein the future trajectory information includes: the state information of the N sample vehicles in multiple future time slices after the multiple historical time slices; A first sample latent vector generation module, used for inputting the historical trajectory information of each of the N sample vehicles into the CAVE past encoding module to be trained to obtain a first sample latent vector; A second sample potential 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 to obtain a second sample potential vector; A predicted trajectory information generation module, used for processing the second sample potential vector through a second CAVE future decoding module to be trained to obtain predicted trajectory information of each of N sample vehicles; A first loss function calculation module, used to obtain a first loss function value based on the first sample potential vector and the second sample potential vector; A second loss function calculation module, used to obtain a 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; A parameter updating module is used to 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 based on the first loss function value and the second loss function value, so as to obtain a trained CAVE past encoding module, a trained CAVE future encoding module, and a trained second CAVE future decoding module.

9. The safety-critical scenario generating device according to claim 8, characterized in that: The device also includes: A model parameter initialization module, used for initializing 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; A training module is used to train a sampler to be trained and a first CAVE future decoding module to be trained based on the historical trajectory information and future trajectory information of each of N sample vehicles, while keeping the model parameters of a trained CAVE past encoding module, a trained CAVE future encoding module, and a trained second CAVE future decoding module unchanged, so as to obtain a trained sampler and a trained first CAVE future decoding module.

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

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

  • Two-stage fault sample enhancement method and device, electronic equipment and storage medium

    CN116662797A

  • Image diversification description method based on conditional variation self-encoding and contrast learning

    CN116912599A

  • Anti-collision trajectory prediction model training method and device

    CN117521712A