Traffic scene generation system and method for self-driving test and electronic equipment
By integrating multi-source data and a multi-stage generation process, combined with semantic conditional diffusion and physical constraints, highly adversarial and diverse autonomous driving test scenarios are generated. This solves the problem of insufficient scenario generation in existing technologies and improves the safety verification and algorithm optimization capabilities of autonomous driving systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies struggle to generate highly adversarial and diverse autonomous driving test scenarios, especially extreme and rare high-risk situations, thus failing to meet the safety verification and algorithm optimization requirements of autonomous driving systems.
The system employs a multi-source traffic data fusion module, a semantic condition diffusion generation layer, a trajectory consistency optimization layer, and a physical constraint fusion layer. Through a multi-stage noise addition and denoising process, it generates scenarios that conform to traffic logic and physical laws. The generation process is then evaluated and optimized using multi-dimensional indicators.
It enables the generation of high-fidelity, controllable, and diverse traffic scenarios, covering more rare and extreme traffic events, improving the comprehensiveness and safety of autonomous driving algorithm testing, and is applicable to mainstream simulation platforms, supporting traffic simulation data enhancement and algorithm verification.
Smart Images

Figure CN121859693A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous driving testing, and more specifically to a traffic scene generation system, method, and electronic device for autonomous driving testing. Background Technology
[0002] In the rapid development of intelligent transportation and autonomous driving technologies, the enhanced safety verification and algorithm generalization capabilities of autonomous driving systems have placed stringent demands on the realism, diversity, and high challenge of traffic simulation test scenarios. Currently, the verification of autonomous driving systems mainly relies on two methods: physical road testing and virtual simulation scenario construction. Physical road testing is costly, time-consuming, and limited by factors such as natural environment and road conditions, making it difficult to cover rare high-risk scenarios such as extreme weather and sudden accidents. Virtual simulation scenario construction often adopts manual modeling or rule-based parameter generation modes, which not only requires a large investment of manpower to pre-set scenario templates, but the generated results are often limited to conventional traffic scenarios, making it difficult to reproduce dynamic scenarios such as complex multi-vehicle interactions and abnormal traffic events in real traffic environments, thus failing to meet the complexity and diversity requirements of autonomous driving systems for test scenarios.
[0003] With the development of deep learning and generative artificial intelligence technologies, traffic scene generation methods based on Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs) have been gradually applied to the field of virtual simulation. However, these methods still have significant technical defects. For example, on the one hand, GAN-type models are prone to pattern collapse and semantic drift problems, and the generated traffic scenes often have semantic conflicts such as vehicles driving in the wrong direction and traffic light logic disorder, lacking interpretability of traffic behavior. On the other hand, existing generative models generally do not incorporate traffic physics laws and spatiotemporal consistency constraints, resulting in physical distortions such as sudden speed changes, collision overlaps, and vehicle floating in the generated vehicle trajectories, leading to low credibility of simulation results.
[0004] Crucially, in meeting the core requirements of functional safety testing for autonomous driving, existing technologies struggle to generate adversarial scenarios with specific risk factors, such as multi-vehicle rear-end collisions in heavy rain, traffic congestion caused by road construction, and pedestrians suddenly crossing the road – rare, high-risk situations. Because traditional generative models primarily learn from the distribution of routine traffic data, their ability to model low-frequency, high-risk events is insufficient. This results in the testing coverage of autonomous driving systems being concentrated in conventional driving environments, failing to fully verify the system's safety performance and robustness under extreme and dangerous conditions. This severely restricts the integrity of the autonomous driving simulation verification system and creates potential safety hazards for the actual road applications of autonomous driving systems.
[0005] Therefore, there is an urgent need for an intelligent technology that can integrate multi-source traffic data, possess semantic logic control and physical constraint capabilities, and can generate highly adversarial test scenarios in a targeted manner, so as to break through the limitations of existing scenario generation methods and provide high-quality and diversified test scenario support for the safety assessment and algorithm optimization of autonomous driving systems. Summary of the Invention
[0006] To address the problems existing in the prior art, the present invention provides a traffic scene generation system, method, and electronic device for autonomous driving testing, which at least partially solves the problems existing in the prior art.
[0007] In a first aspect, embodiments of the present invention provide a traffic scene generation system for autonomous driving testing, comprising:
[0008] Multi-source traffic data fusion module, intermediate module, and traffic scenario adversarial generation, evaluation, and optimization module;
[0009] The intermediate module includes: a semantic condition diffusion generation layer, a trajectory consistency optimization layer, and a physical constraint fusion layer;
[0010] The multi-source traffic data fusion module is used to collect multi-source traffic data, standardize and semantically process the multi-source traffic data, and obtain structured semantic information that can guide the generation of scenarios.
[0011] The semantic conditional diffusion generation layer is used to generate initial scene data that conforms to basic traffic logic through a multi-stage noise addition and denoising process based on the structured semantic information and time dimension parameters.
[0012] The trajectory consistency optimization layer is used to perform temporal optimization on the movement trajectory of traffic elements in the initial data of the scenario, ensuring that the trajectory is continuous and conflict-free in the time dimension and conforms to the movement characteristics of traffic participants.
[0013] The physical constraint fusion layer is used to correct the initial data of the scenario based on the embedded physical laws and traffic rule constraints, so that the generated scenario meets the physical rationality and behavioral compliance in the real traffic environment.
[0014] The traffic scene adversarial generation evaluation and optimization module is used to evaluate the quality and adversarial nature of the generated scene through multi-dimensional indicators, obtain evaluation results, adjust the parameters of the traffic scene generation system for autonomous driving testing based on the evaluation results, and perform incremental generation of special scenes based on the evaluation results.
[0015] Furthermore, the multi-source traffic data collected by the multi-source traffic data fusion module includes at least one of the following: measured traffic operation data, high-precision map data, environmental and meteorological data, and simulation data sources;
[0016] The multi-source traffic data fusion module performs spatial registration, time synchronization, and semantic hierarchical encoding on the multi-source traffic data to obtain a traffic scene semantic map.
[0017] The semantic hierarchical encoding of the multi-source traffic data fusion module includes: constructing the fused multi-source traffic data into a traffic scene semantic graph containing an entity set, a semantic relationship set, and node attributes; representing the traffic scene semantic graph through a bidirectional graph attention mechanism; performing weighted aggregation on the relation representation to obtain context features; and obtaining a semantic graph tensor based on the context features.
[0018] Furthermore, the semantic graph of the traffic scene is as follows:
[0019] in, A collection of entities in the scene. A set of semantic relationships between entities. Node attributes;
[0020] The node vectorization representation is as follows:
[0021]
[0022] in, Let be the vector representation of the i-th node. For embedded functions, Let i be the entity type of the i-th node. Let be the state attribute of the i-th node. Let i be the spatial location of the i-th node;
[0023] The relationship is represented using a bidirectional graph attention mechanism, as detailed below:
[0024]
[0025] in, Let be the attention weight of node i to node j, and exp be the exponential function. For activation function, Let W be the transpose of the attention vector, and W be the shared linear transformation weight matrix. , Let i be the vector representation of nodes i, j, and k. This is a vector concatenation operation. Let i be the set of adjacent nodes of node i;
[0026] Contextual features are obtained through weighted aggregation, as follows:
[0027]
[0028] in, Enhance the contextual feature vector of node i. Use either the Sigmoid or ReLU activation function;
[0029] The contextual features are organized according to the topological structure of the traffic scene semantic graph to form a global tensor, ultimately obtaining a semantic graph tensor. The semantic graph tensor As input to the semantic conditional diffusion generation layer.
[0030] Furthermore, the semantic conditional diffusion generation layer generates initial scene data that conforms to basic traffic logic through a multi-stage noise addition and denoising process based on the structured semantic information and time dimension parameters. This includes: the semantic conditional diffusion generation layer transforms the original traffic state into a random noise distribution through multi-step positive noise addition.
[0031] During the reverse denoising process, the semantic conditional diffusion generation layer uses a parameterized network combined with the structured semantic information to gradually restore the original traffic state with random noise distribution, generating the initial scene data that conforms to basic traffic logic.
[0032] Furthermore, the semantic conditional diffusion generation layer transforms the original traffic state into a random noise distribution through multi-step forward noise addition, as detailed below:
[0033] in, Let be the positive conditional probability distribution from step t−1 to step t. It follows a Gaussian distribution. Let t be the traffic scene state tensor at step t. Let be the traffic scene state tensor at step t-1. Let be the noise variance scheduling parameter at step t. It is the identity matrix. The coefficients are retained for the original state;
[0034] The semantic conditional diffusion generation layer adds noise in T consecutive steps to the initial traffic state. Convert to Gaussian noise ;
[0035] The semantic conditional diffusion generation layer, through a parameterized network and combined with the structured semantic information, progressively reconstructs the original traffic state from a random noise distribution, generating initial scene data that conforms to basic traffic logic, including:
[0036] The reverse denoising process uses a parametric model to model the probability of recovering the scene state from the noise state at step t to the scene state at step t−1.
[0037] in, The inverse conditional probability distribution modeled by parameter θ. Let be the restored scene state tensor at step t-1. Let be the noise state tensor at step t. For semantic graph tensors, Let be the mean function of a Gaussian distribution. It follows a Gaussian distribution.
[0038] Furthermore, the trajectory consistency optimization layer receives the trajectory sequence output by the semantic conditional diffusion generation layer and optimizes the trajectory sequence based on the temporal attention mechanism of Transformer;
[0039] The trajectory consistency optimization layer constrains the trajectory sequence optimization through a trajectory consistency loss function, which is a weighted sum of smoothing loss, collision loss, and dynamic consistency loss. The smoothing loss constrains the trajectory change to be continuous, the collision loss avoids the overlap of traffic element trajectories, and the dynamic consistency loss ensures that the changes in speed and acceleration are reasonable.
[0040] Furthermore, the constraints of the physical constraint fusion layer include at least one of traffic participant dynamic characteristic constraints, road space boundary constraints, and traffic rule constraints. The physical constraint fusion layer corrects the initial data of the scenario through differentiable penalties or rule verification.
[0041] Among them, the dynamic characteristics constraints of traffic participants ensure that speed and acceleration are within the physically feasible range;
[0042] Road space boundary constraints ensure that the vehicle's position is within the road polygon;
[0043] Traffic rules are enforced to ensure that vehicle speeds approach zero at red lights and that the distance between vehicles meets both the desired time distance and the minimum safe distance requirements.
[0044] Furthermore, the multi-dimensional evaluation indicators of the traffic scene adversarial generation evaluation and optimization module include: scene diversity indicator, traffic rationality indicator, physical consistency indicator, safety coverage indicator and adversarial intensity indicator. When the comprehensive score of the evaluation result is lower than the preset threshold, the traffic scene generation system for self-driving test automatically triggers the updating and retraining of model parameters or the generation of special scenes.
[0045] In a second aspect, embodiments of this disclosure provide a method for generating traffic scenes for autonomous driving testing, which generates traffic scenes using a traffic scene generation system for autonomous driving testing as described in any of the first aspects, including:
[0046] Collect multi-source traffic data, standardize and semantically process the multi-source traffic data to obtain structured semantic information that can guide scenario generation;
[0047] Based on the structured semantic information and time dimension parameters, initial scene data conforming to basic traffic logic is generated through a multi-stage noise addition and denoising process.
[0048] The movement trajectories of traffic elements in the initial data of the scenario are optimized in time sequence to ensure that the trajectories are continuous and conflict-free in the time dimension and conform to the movement characteristics of traffic participants.
[0049] Based on the embedded physical laws and traffic rule constraints, the initial data of the scenario is corrected to ensure that the scenario meets the physical rationality and behavioral compliance requirements of a real traffic environment.
[0050] The quality and adversarial nature of the generated scene are evaluated using multi-dimensional indicators to obtain evaluation results. Based on the evaluation results, the parameters of the traffic scene generation system used for autonomous driving testing are adjusted, and incremental generation of special scenes is performed based on the evaluation results.
[0051] In a third aspect, embodiments of this disclosure provide an electronic device comprising:
[0052] At least one processor; and,
[0053] The memory is communicatively connected to the at least one processor; wherein,
[0054] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the traffic scene generation method for autonomous driving testing described above.
[0055] Fourthly, embodiments of this disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the aforementioned traffic scene generation method for autonomous driving testing.
[0056] Other optional features and technical effects of the embodiments of the present invention are partly described below and partly apparent from reading this document.
[0057] Compared with the prior art, the present invention has the following beneficial technical effects:
[0058] This application's embodiments break free from the constraints of traditional template-based scene generation, fully leveraging the advantages of diffusion models in high-fidelity generation and conditional control. It relies on multi-source traffic semantic information to drive automatic scene construction, requiring minimal manual intervention and significantly improving scene generation efficiency and automation. By introducing a semantic conditional diffusion mechanism, it ensures logical consistency among traffic elements. Combining trajectory consistency optimization and physical constraint fusion strategies, it strengthens the dynamic correlation between vehicle, pedestrian, and environmental elements, achieving continuous spatiotemporal generation of traffic scenes. This effectively avoids semantic conflicts and trajectory anomalies, greatly enhancing the realism and dynamic rationality of the generated scenes. It can generate test scenes with complex interactions, dynamic changes, and diverse distributions, especially covering more rare and extreme traffic events, compensating for the shortcomings of traditional methods in covering high-risk, low-frequency scenarios. This makes autonomous driving algorithm testing more comprehensive, helping to enhance the robustness and safety of algorithms on real roads. The traffic scene generation system for autonomous driving testing provided in this application's embodiments can seamlessly integrate with CARLA, SUMO, and OpenSCENARIO. It supports mainstream simulation platforms and flexibly supports various application scenarios such as traffic simulation data enhancement, algorithm verification, and system evaluation. It adapts to different autonomous driving testing and intelligent transportation research needs and has a wide range of applications. Moreover, it introduces multi-dimensional scenario indicators at the evaluation layer, which can automatically filter and incrementally optimize the generated results of intelligent adversarial traffic scenarios to continuously improve the quality of scenarios. At the same time, it provides an efficient and scalable intelligent scenario generation tool that combines diversity, realism, and high adversarialness for the safety verification and algorithm optimization of autonomous driving systems, supporting the iteration of autonomous driving technology and the development of intelligent transportation systems. Attached Figure Description
[0059] Figure 1 A schematic diagram of a traffic scene generation system for autonomous driving testing according to an embodiment of the present disclosure is shown;
[0060] Figure 2 A schematic diagram of the diffusion model framework of an embodiment of this disclosure is shown;
[0061] Figure 3 A schematic flowchart of a traffic scene generation method for autonomous driving testing according to an embodiment of this disclosure is shown;
[0062] Figure 4 A schematic diagram of a traffic scene generation electronic device for autonomous driving testing according to an embodiment of the present disclosure is shown. Detailed Implementation
[0063] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0064] The following specific examples illustrate the implementation of this disclosure. Those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0065] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0066] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0067] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0068] This disclosure aims to provide a traffic scene generation system for autonomous driving testing based on a diffusion model, achieving high-fidelity, controllable, diverse, and highly adversarial generation of traffic scenes in autonomous driving simulation testing. The overall system framework consists of five parts: a multi-source traffic data fusion module, a semantic conditional diffusion generation layer, a trajectory consistency optimization layer, a physical constraint fusion layer, and a traffic scene adversarial generation evaluation and optimization module. The system takes measured traffic data and simulated road networks as input, and through semantic encoding, conditional diffusion generation, spatiotemporal optimization, and rule constraints, finally outputs a complete traffic test scene that conforms to physical laws, traffic logic, and exhibits high adversarial characteristics.
[0069] Figure 1 A schematic diagram of a traffic scene generation system for autonomous driving testing according to an embodiment of this disclosure is shown, such as... Figure 1 As shown, the traffic scene generation system for autonomous driving testing includes: a multi-source traffic data fusion module 101, an intermediate module 102, and a traffic scene adversarial generation, evaluation, and optimization module 103. The intermediate module 102 includes: a semantic condition diffusion generation layer 1021, a trajectory consistency optimization layer 1022, and a physical constraint fusion layer 1023.
[0070] First, a detailed introduction to the multi-source traffic data fusion module 101 will be given.
[0071] Optionally, a multi-source traffic data fusion module is used to collect multi-source traffic data, standardize and semantically process the multi-source traffic data, and obtain structured semantic information that can guide the generation of scenarios.
[0072] Specifically, the multi-source traffic data collected by the multi-source traffic data fusion module includes at least one of the following: measured traffic operation data, high-precision map data, environmental and meteorological data, and simulation data sources;
[0073] The multi-source traffic data fusion module performs spatial registration, temporal synchronization, and semantic hierarchical encoding on multi-source traffic data to obtain a traffic scene semantic map.
[0074] The semantic hierarchical encoding of the multi-source traffic data fusion module includes: constructing the fused multi-source traffic data into a traffic scene semantic graph containing a set of entities, a set of semantic relationships, and node attributes; representing the traffic scene semantic graph through a bidirectional graph attention mechanism; performing weighted aggregation on the relation representation to obtain context features; and obtaining a semantic graph tensor based on the context features.
[0075] In other words, the data sources collected by the multi-source traffic data fusion module cover measured road network information, signal control data, traffic flow monitoring data, and meteorological condition data. Among them, measured road network information can include road topology, number of lanes, and lane boundary parameters; signal control data can include the phase status and timing information of traffic lights; traffic flow monitoring data includes vehicle trajectory, driving speed, and traffic density information; and meteorological condition data includes rainfall, visibility, and road surface friction coefficient information.
[0076] The multi-source traffic data fusion module eliminates the dimensional differences between data from different sources through data standardization operations, and then extracts key features such as road geometry, vehicle type, traffic signal status, and weather parameters through feature extraction algorithms. Subsequently, the extracted features are transformed into a set of semantic features of a unified dimension, and a traffic scene semantic graph is constructed based on this set of semantic features.
[0077] The traffic scene semantic graph adopts a graph structure, whose nodes include static element nodes and dynamic element nodes in the scene. Static element nodes correspond to road nodes, lane boundary nodes, and traffic light location nodes. Each static element node is associated with its own attribute parameters (e.g., road nodes are associated with road length and curvature, and traffic light location nodes are associated with traffic light signs and covered lanes). Dynamic element nodes correspond to vehicle nodes, pedestrian nodes, and non-motorized vehicle nodes. Each dynamic element node is associated with its own state parameters (e.g., vehicle nodes are associated with vehicle type and real-time location, and pedestrian nodes are associated with walking direction and movement speed). The traffic scene semantic graph is used to provide conditional input for the subsequent semantic condition diffusion generation layer.
[0078] For example, the input data for the multi-source traffic data fusion module may include: measured traffic flow data (such as vehicle trajectory, speed, acceleration, and lane change records); high-precision map data (such as road geometry, lane structure, traffic signs, and signal timing); environmental and meteorological data (such as visibility, rainfall, and road surface friction coefficient); and simulation data sources (such as scene samples from platforms such as CARLA and SUMO).
[0079] The multi-source traffic data fusion module first performs spatial registration and temporal synchronization on the data from each source. The measured dataset for the multi-source traffic data fusion module can be defined as:
[0080]
[0081] Where D represents the measured dataset, t i Let i be the timestamp corresponding to the i-th data sample. For vehicle location, For speed, For acceleration, This represents the vehicle category or status characteristic, and the number of N independent data samples.
[0082] Then, the multi-source traffic data fusion module models the high-precision map topology as a directed graph structure:
[0083]
[0084] in, For a high-precision map topological directed graph, nodes Indicates a road intersection or signal node, edge This represents the road connection relationships. Each edge contains attributes:
[0085]
[0086] in, Let be the directed edge connecting node j and node k. For edge e jk The corresponding road length, For edge e jk The corresponding number of lanes For edge e jk The corresponding speed limit value, For edge e jk The corresponding road curvature.
[0087] Meteorological and environmental parameters are time-stamped Corresponding to traffic conditions, joint features are formed. :
[0088] in, For feature fusion function, For timestamp t i The corresponding meteorological and environmental parameters, Vehicle position x i The corresponding traffic signal status.
[0089] As can be seen from the above, after collecting, integrating, calibrating, standardizing, extracting, and semantically modeling multi-source traffic data, the multi-source traffic data fusion module finally obtains a traffic scene semantic graph tensor and a structured joint feature set of associations. This not only eliminates the heterogeneity of the original multi-source traffic data, but also includes the semantic associations and spatiotemporal consistency of traffic, environment, and road network, which can be directly used as the condition input for the subsequent semantic condition diffusion generation layer.
[0090] Next, the multi-source traffic data fusion module performs semantic layer encoding on the processed multi-source traffic data to obtain a traffic scene semantic map.
[0091] Optionally, the semantic graph for the traffic scene is as follows:
[0092] in, This refers to a collection of entities in the scene (such as vehicles, pedestrians, traffic lights, etc.). It is a set of semantic relationships between entities (such as following, avoiding, collision risk, etc.). Node attributes (such as position, speed, category, size, etc.);
[0093] The node vectorization representation is as follows:
[0094]
[0095] in, Let be the vector representation of the i-th node. For embedded functions, Let i be the entity type of the i-th node. Let be the state attribute of the i-th node. Let i be the spatial location of the i-th node;
[0096] The relation representation is implemented using a bidirectional graph attention mechanism, as follows:
[0097]
[0098] in, Let be the attention weight of node i to node j, and exp be the exponential function. For activation function, Let W be the transpose of the attention vector, and W be the shared linear transformation weight matrix. , Let i be the vector representation of nodes i, j, and k. This is a vector concatenation operation. Let i be the set of adjacent nodes of node i;
[0099] Contextual features are obtained through weighted aggregation, as follows:
[0100]
[0101] in, Enhance the contextual feature vector of node i. Use either the Sigmoid or ReLU activation function;
[0102] The contextual features are organized according to the topological structure of the traffic scene semantic graph to form a global tensor, ultimately obtaining a semantic graph tensor. The semantic graph tensor This serves as the conditional input for the semantic conditional diffusion generation layer.
[0103] The semantic conditional diffusion generation layer of intermediate module 102 will be described in detail below.
[0104] Optionally, the semantic conditional diffusion generation layer transforms the original traffic state into a random noise distribution through multi-step positive noise addition;
[0105] In the reverse denoising process, the semantic conditional diffusion generation layer uses a parameterized network combined with the structured semantic information to gradually restore the original traffic state with random noise distribution, generating initial scene data that conforms to basic traffic logic.
[0106] Specifically, the semantic conditional diffusion generation layer uses a diffusion model as its core generation engine and adopts a conditional U-Net network structure. Through a diffusion mechanism of progressively adding noise and reverse denoising, it gradually recovers and generates traffic scenes that conform to traffic semantic logic and physical laws from random noise that conforms to a standard normal distribution. See details. Figure 2 ,like Figure 2 As shown, the diffusion model adopts a modular structure of variational encoder-conditional diffusion U-Net-decoder. The encoder is responsible for feature compression and embedding of the semantic graph; the diffusion model generates latent space representation through progressive denoising; and the decoder restores the latent representation to a scene state matrix or visual image. The entire model supports multi-scale feature fusion, ensuring consistency and controllability in both local details and global layout of the generated results.
[0107] In other words, during the forward diffusion process, the semantic conditional diffusion generation layer gradually applies Gaussian noise to the initial traffic scene state, transforming the initial scene into random noise. During the reverse diffusion process, based on the conditional U-Net network, the semantic conditional diffusion generation layer uses random noise as input and reconstructs the target traffic scene through multi-step denoising and inversion operations. The conditional U-Net network includes an encoder, a bottleneck layer, and a decoder. The encoder is used to extract multi-scale features of the noise state, the bottleneck layer embeds semantic constraints and time step information, and the decoder is used to recover the feature elements of the output traffic scene.
[0108] It should be noted that the input to the semantic conditional diffusion generation layer contains two types of information: first, the semantic graph tensor (Zi) output by the multi-source traffic data fusion module. s Secondly, the time step parameter (t) of the diffusion process is used to adapt the denoising intensity of different noise stages. The semantic graph tensor is used to provide semantic information such as road topology, traffic element association, and environmental constraints. The output of the semantic condition diffusion generation layer is the spatial layout and state distribution data of each element in the traffic scene, specifically including the vehicle's position coordinates, driving speed, acceleration, pedestrian movement trajectory, traffic light phase state, and road lane usage.
[0109] The U-Net network incorporates a conditional embedding unit and a multi-head attention mechanism. The conditional embedding unit transforms the traffic scene semantic graph tensor into a conditional feature vector for the adapted model, and injects it into the network after fusing it with the temporal step position encoding. The multi-head attention mechanism is used to capture high-dimensional interaction relationships in the traffic scene, specifically including the lane constraint relationship between vehicles and roads, the traffic rule relationship between vehicles and traffic lights, and the avoidance interaction relationship between vehicles and pedestrians. By modeling the above interaction relationships, it ensures that the traffic scene generated by the semantic conditional diffusion generation layer is consistent in semantic logic and conforms to the initial scene data of basic traffic logic in spatial structure.
[0110] Optionally, the semantic conditional diffusion generation layer transforms the original traffic state into a random noise distribution through multi-step forward noise addition, as follows:
[0111] in, Let be the positive conditional probability distribution from step t−1 to step t. It follows a Gaussian distribution. Let t be the traffic scene state tensor at step t. Let be the traffic scene state tensor at step t-1. Let be the noise variance scheduling parameter at step t. It is the identity matrix. The coefficients are retained for the original state;
[0112] The semantic conditional diffusion generation layer adds noise in T consecutive steps to represent the initial traffic state. Convert to Gaussian noise ;
[0113] The semantic conditional diffusion generation layer, through a parameterized network and the structured semantic information, progressively reconstructs the original traffic state from a random noise distribution, generating initial scene data that conforms to basic traffic logic, including:
[0114] The reverse denoising process uses a parametric model to model the probability of recovering the scene state from the noise state at step t to the scene state at step t−1.
[0115] in, The inverse conditional probability distribution modeled by parameter θ. Let be the restored scene state tensor at step t-1. Let be the noise state tensor at step t. For semantic graph tensors, Let be the mean function of a Gaussian distribution. It follows a Gaussian distribution.
[0116] In addition, the semantic conditional diffusion generation layer adopts a conditional U-Net architecture, including: an encoder, a bottleneck layer, and a decoder: the encoder extracts multi-scale features; the bottleneck layer introduces temporal step embeddings. With semantic conditions The decoder recovers the spatial distribution of traffic elements through residual blocks.
[0117] The core layer computation of the U-Net network is as follows:
[0118] in H represents a diffusion denoising network. l h represents the noise features extracted from the l-th layer of the encoder. l+1 To inject semantic conditions into the noise features, ensuring that the subsequent denoising process conforms to the semantic logic of the traffic scene.
[0119] The denoising network is trained by minimizing the noise prediction error:
[0120]
[0121] in, For the spread of loss, To determine the original traffic conditions Time step t, random noise The average of all possible values, The original Gaussian noise follows distributed, For the output of the denoising network, For noisy traffic scenarios, For semantic graph tensors, , As input to the denoising network, This refers to the noise variance scheduling parameter.
[0122] It should be noted that minimizing the noise prediction error allows the denoising network to accurately predict the mixed noise and subtract the noise from the noisy scene, thus reconstructing the original scene features that conform to the real traffic patterns.
[0123] Furthermore, the U-Net network embeds semantic graphs as conditional feature vectors:
[0124]
[0125] in, Let be the semantic conditional feature vector at time step t, and be the input to the denoising network. It is a multilayer perceptron. For semantic graph tensors, This represents the time step location encoding, used to maintain timing awareness of the diffusion process.
[0126] In addition, the U-Net network injects semantic conditions into the generative network through a cross-attention mechanism:
[0127]
[0128] in, For cross-attention computation functions, Multi-scale features of noisy traffic scenes extracted from the U-Net encoder. Derived from semantic graph embedding , The dimension of the key vector. This is a similarity matrix. This is the activation function.
[0129] In other words, the cross-attention mechanism ensures that the generative network can accurately invoke the corresponding semantic constraints for the local features of the current scene at each step of denoising by matching Q (scene features) and K (semantic conditions) to avoid generating semantically contradictory scenes.
[0130] It can be seen that the semantic condition diffusion generation layer can achieve semantically controllable traffic scene generation, ensuring the logical consistency of road structure, signal status, and traffic flow distribution.
[0131] The trajectory consistency optimization layer will be described in detail below.
[0132] Optionally, the trajectory consistency optimization layer receives the trajectory sequence output by the semantic conditional diffusion generation layer and optimizes the trajectory sequence based on the temporal attention mechanism of Transformer;
[0133] The trajectory consistency optimization layer constrains the trajectory sequence optimization through a trajectory consistency loss function, which is a weighted sum of smoothing loss, collision loss, and dynamic consistency loss. The smoothing loss constrains the trajectory change to be continuous, the collision loss avoids the overlap of traffic element trajectories, and the dynamic consistency loss ensures that the changes in speed and acceleration are reasonable.
[0134] In other words, the trajectory consistency optimization layer can guarantee the spatiotemporal continuity of the traffic scene. The trajectory consistency optimization layer performs time series optimization on the generated vehicle and pedestrian trajectories, introduces a trajectory consistency loss function, and can not only generate static spatial layout, but also generate dynamic traffic evolution processes that change over time, thereby realizing the natural flow and logical continuity of vehicle behavior in the simulation.
[0135] Specifically, the trajectory consistency optimization layer generates the state sequence of each vehicle at consecutive time steps:
[0136]
[0137] The goal is to achieve a smooth, collision-free trajectory that meets vehicle dynamics constraints.
[0138] Then, the trajectory consistency optimization layer introduces a trajectory consistency loss function, which is defined as:
[0139]
[0140] in, The total loss for trajectory consistency. , , For sub-loss weighting coefficients,
[0141] Smoothness loss is used to constrain the temporal continuity of the trajectory and prevent sudden changes or abrupt shifts in the trajectory.
[0142]
[0143] in, The total number of traffic participants. Index for traffic participants, Let be the position vector of the i-th participant at time step t. Let i be the position vector of the i-th participant at time step t-1. Let be the position vector of the i-th participant at time step t-2.
[0144] Collision Loss is used to ensure that the distance between vehicles is greater than a safe distance. :
[0145] in, It can iterate through all different traffic participant pairs, avoiding conflicts between any two entities. To preset a safe distance threshold, Let be the spatial location vector of the i-th participant at time step t. (0, ) only generates a positive loss when the actual spacing is less than the preset safety distance. If the spacing is compliant, the loss is 0, thus avoiding invalid optimization.
[0146] Dynamic Loss is used to ensure that acceleration and velocity changes are reasonable.
[0147] in, Let be the acceleration vector of the i-th participant at time step t. Let be the velocity vector of the i-th participant at time step t.
[0148] In addition, the trajectory consistency optimization layer uses a Transformer-based temporal attention mechanism to optimize the trajectory sequence output by the semantic conditional diffusion generation layer:
[0149] )
[0150] in, Let be the optimized trajectory feature vector of the i-th traffic participant (such as a vehicle or pedestrian) at time step t. For attention mechanism functions, Let be the trajectory feature vector of the i-th traffic participant at time step t-1. Let be the trajectory feature vector of the i-th traffic participant at time step t-2. It is a semantic graph tensor.
[0151] Then, the trajectory consistency optimization layer performs a joint optimization process:
[0152]
[0153] Achieve spatial-temporal consistency coupling optimization of the trajectory. Specifically, represents the weighting coefficient for trajectory consistency loss.
[0154] It should be noted that in existing technologies, scene generation and trajectory construction are separate steps, which can easily lead to contradictions between semantics and trajectory (e.g., the trajectory shows vehicles moving under a red light). This application's embodiment, through a joint optimization process, ensures that trajectory generation always relies on scene semantic constraints (e.g., ensuring the semantics of a red light while constraining the vehicle trajectory to stop), avoiding disconnection. The optimized scene possesses both semantic realism (e.g., roads, signals, and environment matching real traffic) and dynamic rationality (e.g., vehicle following, lane changing, and collision avoidance conforming to real driving behavior), and can be directly used for autonomous driving testing on platforms such as CARLA and SUMO, solving the problem of low credibility in existing simulation scenarios.
[0155] The following section provides a detailed introduction to the theoretical constraint fusion module.
[0156] Optionally, the constraints of the physical constraint fusion layer include at least one of traffic participant dynamic characteristic constraints, road space boundary constraints, and traffic rule constraints. The physical constraint fusion layer corrects the initial scene data through differentiable penalties or rule verification.
[0157] Among them, the dynamic characteristics constraints of traffic participants ensure that speed and acceleration are within the physically feasible range;
[0158] Road space boundary constraints ensure that the vehicle's position is within the road polygon;
[0159] Traffic rules are enforced to ensure that vehicle speeds approach zero at red lights and that the distance between vehicles meets both the desired time distance and the minimum safe distance requirements.
[0160] The physical constraint fusion layer further embeds traffic dynamics and safety rule constraints into the denoised trajectory generation stage. The model combines constraints such as vehicle dynamics equations, road curvature radius, and maximum steering angle to correct unreasonable trajectories during trajectory generation, ensuring that the motion state of each traffic participant conforms to real physical characteristics. Simultaneously, the system also introduces rule-based traffic behavior logic (such as stopping at red lights, priority passage, and yielding to pedestrians), ensuring that the generated scenarios are not only numerically reasonable but also comply with traffic regulations in terms of behavioral logic.
[0161] Specifically, constraints on the dynamic characteristics of traffic participants are imposed, such as vehicle dynamics model constraints, which can be based on a simplified longitudinal vehicle dynamics model:
[0162]
[0163] in, For engine traction; For vehicle braking force, For air resistance, Where A is the air resistance coefficient and A is the vehicle's frontal area. Let v be the air density and v be the vehicle's current speed. For rolling resistance; For vehicle quality.
[0164] It should be noted that during trajectory generation, the generated velocity sequence must satisfy the following:
[0165]
[0166] Due to noise or semantic constraint bias, the speed obtained from the vehicle's longitudinal dynamics model may exceed the physically feasible range of a real vehicle. Therefore, it's necessary to convert the degree of violation into an optimizable loss value, apply gradient penalties, and guide the system to correct the violated speed during backpropagation, ensuring the physical plausibility of the generated trajectory. Specifically:
[0167] in, This is the physical constraint loss (gradient penalty term). The penalty coefficient is... The speed of the i-th vehicle at time step t. This represents the physical feasible range limit for the vehicle.
[0168] First, the theoretical physical state (e.g., acceleration) of the i-th vehicle at time step t is calculated using a vehicle dynamics model. Then, the physical limit corresponding to that vehicle model is retrieved, and the absolute difference between the two is calculated. Retain the difference between the violation and the standard violation (which is 0 for compliance), then multiply by the penalty coefficient. The physical constraint loss of the vehicle is obtained.
[0169] In addition, road space boundary constraints, such as lane constraints, need to be applied during trajectory generation, i.e., vehicle center point constraints. Must be on the road polygon Inside;
[0170] Traffic rules constraints also need to be applied during trajectory generation, such as signal constraints. For example, if the red light signal status is 1, the corresponding vehicle speed should meet certain conditions. ;
[0171] Car-following constraint, i.e., the distance between vehicles in front and behind. satisfy
[0172]
[0173] in For the desired time interval, For a safe distance.
[0174] Optionally, the physical constraints can be transformed into differentiable penalty terms, as follows:
[0175]
[0176] in, This represents the total loss value due to physical and rule constraints. The physical constraint loss weighting coefficient, The weighting coefficients for rule-constrained loss. Losses are due to traffic rule constraints.
[0177] And the total loss value of physical and rule constraints is added to the overall loss function: ,in, The weighting coefficients for trajectory consistency loss are... This represents the weighting coefficient for the total loss due to physical and rule constraints.
[0178] Based on the backpropagation algorithm, the gradient of the total loss with respect to all learnable parameters is calculated, and the parameters are updated along the negative gradient direction, so that the degree of physical violations and traffic rule violations in the next generated scene is reduced.
[0179] The following section provides a detailed introduction to the traffic scenario confrontation assessment generation and optimization module.
[0180] Optionally, the multi-dimensional evaluation indicators of the traffic scene adversarial generation evaluation and optimization module include: scene diversity indicator, traffic rationality indicator, physical consistency indicator, safety coverage indicator and adversarial intensity indicator. When the comprehensive score of the evaluation result is lower than the preset threshold, the traffic scene generation system for self-driving test will automatically trigger the updating and retraining of model parameters or the generation of special scenes.
[0181] Specifically, the traffic scenario generation module used for self-driving tests generates and evaluates traffic adversarial scenarios. The system evaluates the traffic adversarial scenario generation results through multi-dimensional indicators, including: (1) the scenario diversity score, which measures the degree of difference between different generated samples; (2) the traffic rationality score, which reflects the consistency between vehicle and pedestrian behavior and signal control; and (3) the safety coverage score, which evaluates the coverage level of the adversarial generated scenario for high-risk situations.
[0182] (4) Resistance intensity score: to evaluate the traffic resistance intensity of the adversarial generation scenario.
[0183] The evaluation results will be fed back to the diffusion system parameter update module, and the model generation capability will be gradually improved through adaptive retraining and noise scheduling adjustment to achieve closed-loop optimization.
[0184] Furthermore, this application also introduces a rare scenario incremental generation mechanism, which automatically triggers conditional diffusion resampling for complex or extreme scenarios (such as severe weather, sudden congestion, road construction, traffic accidents, etc.) to generate more challenging and high-test-value samples. This mechanism can significantly improve the coverage and representativeness of test samples, meeting the safety verification requirements of autonomous driving systems under extreme conditions.
[0185] The traffic scene generation module used for self-driving tests can establish a comprehensive evaluation system, as detailed in Table 1, which contains scene evaluation indicators.
[0186] Table 1
[0187] Indicator Name meaning Calculation method Scene diversity index Measuring differences between samples Traffic rationality indicators Testing behavior compliance Compare the generated scene with the real semantic distribution using KL divergence. Physical consistency index Check if the dynamic constraints are satisfied. according to average default rate Safety coverage index Measuring the proportion of rare high-risk scenarios Statistical proportion of dangerous events Confrontation Intensity Index Measuring the proportion of failure scenarios of autonomous driving algorithms Statistical analysis of the percentage of failed autonomous driving algorithms
[0188] The overall evaluation score for the scenario is: .
[0189] in, To score the scenario diversity index, , Let i be the joint feature of the generated scenes in groups i and j, and N be the total number of generated scene samples participating in the evaluation. , , , These are the weighting coefficients for each dimension of the indicators.
[0190] When the overall scene evaluation score falls below a threshold, the system automatically triggers a retraining and resampling mechanism. The adaptive scheduling equation is:
[0191]
[0192] in, For the updated set of model parameters, The set of model parameters before the update. For learning rate, For model parameters gradient operator, This is the adaptive learning rate correction term. The target threshold for comprehensive scene evaluation is defined as follows. Unlike existing technologies that focus solely on loss-based optimization, the adaptive scheduling equation simultaneously reduces generation error and improves scene quality, ensuring that the generated scenes are both error-free and of high quality, meeting the high-fidelity and high-adversarial requirements of autonomous driving testing. Through the combination of gradient descent and evaluation feedback, the system can autonomously identify quality shortcomings and iterate parameters without manual intervention, solving the problems of reliance on manual parameter tuning and low optimization efficiency in existing technologies. The coordinated control of the learning rate and adaptive learning rate correction term in the adaptive scheduling equation avoids excessive parameter update magnitude or directional deviation, ensuring stable convergence of the model during iteration and ultimately generating consistently high-quality traffic scenes that meet the standards.
[0193] Furthermore, the system employs a re-diffusion sampling method based on noise perturbation for low-frequency events:
[0194]
[0195] and through control conditions (Such as extreme weather, accident markers) guide the model to generate rare scenario samples. This mechanism ensures that the generation system continuously improves the coverage and generation stability of rare adversarial scenarios during iteration.
[0196] A second embodiment of the present invention also provides a traffic scene generation method for autonomous driving testing, see details below. Figure 3 , Figure 3 The flowchart illustrates a traffic scene generation method for autonomous driving testing provided in this application embodiment. This method can be executed by an electronic device, such as one or more processors within the electronic device, to achieve the following steps:
[0197] S301 collects multi-source traffic data, standardizes and semantically processes the multi-source traffic data, and obtains structured semantic information that can guide the generation of scenarios.
[0198] Specifically, multi-source data can be obtained from traffic perception systems, simulation platforms, and public datasets, including road topology, vehicle trajectories, signal timing, weather conditions, traffic flow, and accident records. Time synchronization, coordinate registration, and format standardization of data from different sources are performed to ensure spatiotemporal consistency of all elements in the scene, providing fundamental data support for subsequent modeling.
[0199] Then, the fused traffic data undergoes semantic layering, transforming information such as roads, lanes, vehicles, pedestrians, traffic lights, and weather into structured semantic descriptions. Through graph modeling, various traffic elements are defined as nodes, and traffic interaction relationships are defined as edges, constructing a traffic scene semantic graph to provide conditional input for the diffusion layer.
[0200] S302, based on structured semantic information and time dimension parameters, generates initial scene data that conforms to basic traffic logic through a multi-stage noise addition and denoising process.
[0201] Specifically, the extracted semantic information is normalized and features are embedded, mapping different types of features (such as velocity, density, and signal state) to a unified vector space. The semantic graph is then compressed using an encoder module to generate a low-dimensional semantic vector representation, which controls the generation direction of the Diffusion layer.
[0202] In the trajectory generation stage, the target traffic scene representation is first initialized as a random noise distribution. Based on the time step parameters and the noise scheduling table, noise addition is performed step by step to form a multi-stage intermediate state, providing a sampling starting point for the subsequent reverse denoising generation process.
[0203] The Diffusion layer initiates a reverse generation process based on the input semantic embedding vector and time step information. Employing a conditional U-Net structure, it combines semantic information with historical states at each reverse denoising stage to progressively generate initial scene data that conforms to traffic logic. The output initial scene data is a spatial distribution map of traffic elements, including roads, vehicles, signals, and pedestrians, or a scene state matrix.
[0204] S303 performs temporal optimization on the movement trajectories of traffic elements in the initial scene data to ensure that the trajectories are continuous, conflict-free, and consistent with the movement characteristics of traffic participants in the time dimension.
[0205] Specifically, trajectory-level optimization is performed on the generated static traffic layout. Based on traffic rules and vehicle motion characteristics, a time-continuous motion trajectory is generated for each traffic participant. Smoothing constraints and collision avoidance strategies are employed to ensure that the generated trajectories are continuous, natural, and conflict-free, achieving dynamic consistency with real traffic flow.
[0206] S304, based on the embedded physical laws and traffic rule constraints, corrects the initial data of the scenario to ensure that the scenario meets the physical rationality and behavioral compliance requirements of a real traffic environment.
[0207] Specifically, traffic dynamics and safety rules are imposed on the generated scenario. Vehicle acceleration and speed changes must conform to dynamic ranges; passage is prohibited at red lights; and vehicle-to-vehicle distances must meet safety thresholds. An automatic adjustment module corrects unreasonable results, ensuring that the adversarial generated scenario is both physically and logically feasible.
[0208] S305 evaluates the quality and adversarial nature of the generated scene using multi-dimensional indicators, obtains evaluation results, adjusts the parameters of the traffic scene generation system for autonomous driving testing based on the evaluation results, and incrementally generates special scenes based on the evaluation results.
[0209] Specifically, the generated scenes are evaluated from multiple dimensions, including indicators such as structural integrity, behavioral rationality, scene diversity, and physical consistency. If the overall score is lower than a set threshold, the model parameters are automatically adjusted and retraining is triggered to gradually improve the generation quality, achieving adaptive learning and optimization.
[0210] To address the issue of insufficient coverage of long-tail problems in autonomous driving algorithms by conventional scenarios, a rare adversarial scenario regeneration mechanism is introduced. Based on labels such as accident type, severe weather, or abnormal traffic conditions, noise is resampled and diffused, and conditional features are injected to generate test samples under high-risk and high-adversarial scenarios, thereby improving the completeness, challenge, and adversarial nature of simulation tests.
[0211] It should be noted that the generated scene can be output in standard formats, such as OpenSCENARIO, SUMO XML, or CARLA JSON, in conjunction with the platform's integrated and optimized traffic scenes. It can be directly interfaced with autonomous driving simulation platforms for algorithm testing, policy evaluation, or simulation training. Furthermore, it supports user-defined input conditions, such as road network type, traffic density, or weather conditions, to generate specific scenes, achieving a controllable and intelligent process for generating test samples for adversarial traffic scenarios.
[0212] To verify the effectiveness of the system and method provided in the embodiments of this application, experimental verification was also conducted, as follows:
[0213] First, verification based on the CARLA simulation platform was conducted. In this embodiment, the system was deployed in the CARLA autonomous driving simulation platform environment, utilizing the basic road network provided by it, including urban roads, suburban roads, and highways, for experimental verification. The specific process is as follows:
[0214] 1. Semantic data preparation:
[0215] The system acquires multi-source data, including road structure, vehicle information, signal status, and weather conditions, through the CARLA interface. This raw data is then standardized and semantically encoded to form a traffic scene semantic graph, which serves as input to the diffusion model.
[0216] 2. Model Execution and Scene Generation:
[0217] During the model execution phase, the traffic scene adversarial generation module of the diffusion model gradually generates the spatial layout and dynamic trajectory of traffic elements based on the input semantic conditions. In the reverse denoising process, the system automatically integrates semantic embeddings and temporal features to generate a complete traffic scene including roads, vehicles, pedestrians, and signal states.
[0218] 3. Optimization and Constraint Correction:
[0219] The generated results undergo joint optimization by the trajectory consistency module and the physical constraint module. The system automatically corrects abnormal trajectories, eliminates collisions, smooths vehicle movement paths, and adjusts traffic behavior according to traffic signal logic. The generated scene exhibits stability in terms of spatiotemporal continuity, traffic rule compliance, and logical consistency.
[0220] 4. Results Analysis:
[0221] Through manual verification and platform playback, the generated scenarios demonstrate that the vehicle, signal, and pedestrian states conform to conventional traffic logic, and vehicle acceleration and deceleration behaviors are smooth and natural. Under various scenario conditions (such as intersections, roundabouts, and ramps), the system can generate diverse and reasonable traffic states, proving that the model possesses good generalization ability and traffic scenario resilience.
[0222] Next, traffic flow validation based on the SUMO platform was conducted. To verify the applicability of the model at the macro-level of traffic, the generation system was embedded into the SUMO traffic simulation platform. The specific process is as follows:
[0223] 1. Semantic Input:
[0224] Road network data (including road length, number of lanes, signal control cycle, etc.) exported from SUMO is used as input semantic conditions. The system generates an initial scene configuration based on traffic flow parameters and semantic structure information, including traffic density, signal timing, and road distribution.
[0225] 2. Scene generation and simulation execution:
[0226] The model automatically generates multiple traffic state samples based on input conditions. The generated adversarial traffic elements (vehicle type, location, speed) are imported into the SUMO platform for traffic flow evolution simulation. During the simulation, the traffic flow patterns generated by the system (such as going straight, changing lanes, stopping and waiting) remain consistent with the road structure and control logic.
[0227] 3. Effect Observation:
[0228] Simulation results show that the system can generate stable and highly adversarial traffic flow scenarios under different traffic densities. Under special conditions (such as high-density road sections or scenarios with frequent signal alternation), the system can still maintain the logical rationality and stability of vehicle operation, verifying the model's adaptability, robustness, and high adversarial capability in diverse scenarios.
[0229] In summary, this application introduces a diffusion generation model and proposes a semantically guided conditional diffusion generation mechanism. Through semantic graph conditional control, it achieves reverse generation from random noise to traffic scenes, generating diverse scenes with reasonable structure and semantic consistency while maintaining traffic rules and spatial constraints. This overcomes the difficulty in controlling traffic semantics in traditional GAN and VAE methods. Furthermore, it introduces a joint optimization mechanism of trajectory consistency and physical constraints. By leveraging trajectory smoothing, collision avoidance, and dynamic constraints in the generation process, it ensures that the movement trajectories of traffic participants are continuous and smooth in the time dimension and conform to physical and dynamic laws, solving the problems of sudden changes in vehicle behavior and discontinuous trajectories in the generated scenes, thus improving simulation credibility and traffic adversarial intensity. Additionally, it constructs an adaptive generation and evaluation system for high-adversarial scenes. Through semantic conditional resampling and diffusion regeneration mechanisms, it supports the automatic synthesis of high-adversarial traffic scenes such as accidents, severe weather, and congestion. A quality evaluation system based on multiple indicators such as rationality, diversity, consistency, safety coverage, and adversarial intensity is introduced to achieve self-learning and performance closed-loop optimization of the generation model, endowing the model with continuous evolution and adaptive improvement capabilities.
[0230] In summary, the embodiments of this application achieve a fundamental shift from template-driven to intelligent generation. Based on the Diffusion generation framework, it automatically generates complete scenes from semantic conditions, overcoming the limitations of traditional manual modeling and template-based design. The traffic semantic hierarchy is clear and highly controllable. Traffic elements are modeled in the form of semantic graphs, and the generated results can be directly controlled by modifying condition vectors (such as traffic density, signal timing, and weather type), improving scene controllability and reproducibility. The generated results are physically reasonable and logically consistent, embedding dynamic constraints and traffic rule checking mechanisms to ensure that the results conform to real traffic laws in terms of speed, acceleration, vehicle distance, and signal compliance, achieving dual consistency at both the visual and behavioral levels. It has outstanding scalability and platform compatibility, supporting standard data formats of mainstream simulation platforms such as CARLA, SUMO, and VTD. It can be used as a scene generation engine module for autonomous driving systems, and the model architecture is open, making it easy to migrate to different urban road networks or simulation engines. It has self-learning and continuous optimization capabilities, automatically identifying degradation in generation quality and triggering retraining through a scene evaluation feedback mechanism, achieving adaptive model optimization and long-term online iterative improvement.
[0231] In terms of application prospects, intelligent traffic scenario systems and methods can be widely used in autonomous driving system testing and verification (providing diverse, extreme, high-fidelity, and high-intensity adversarial traffic scenarios), intelligent traffic simulation and testing evaluation (supporting the rapid generation of city-level adversarial traffic flow scenarios for traffic control system strategy optimization and risk assessment), and the construction of digital twin cities for adversarial scenarios (serving as a virtual traffic environment verification module, providing high-fidelity adversarial traffic experimental environment support for digital urban traffic management). They are innovative in both theoretical methods and engineering implementation, effectively improving the automation and intelligence level of traffic simulation testing, and providing key technical support for future intelligent transportation systems and autonomous driving verification.
[0232] The third embodiment of the present invention also provides an electronic device, the electronic device comprising:
[0233] At least one processor; and,
[0234] The memory is communicatively connected to the at least one processor; wherein,
[0235] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the traffic scene generation method for autonomous driving testing of any of the foregoing embodiments.
[0236] The fourth embodiment of the present invention also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the traffic scene generation method for autonomous driving testing described in any of the foregoing embodiments.
[0237] The fifth embodiment of the present invention also provides a computer program product, which includes a computing program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the traffic scene generation method for autonomous driving testing of any of the foregoing embodiments.
[0238] Figure 4 The diagram illustrates a method for implementing embodiments of the present invention or an electronic device 1000 for implementing embodiments of the present invention. In some embodiments, it may include more or fewer devices than illustrated. In some embodiments, it may be implemented using a single or multiple devices. In some embodiments, it may be implemented using cloud-based or distributed devices.
[0239] like Figure 4As shown, the electronic device 1000 includes a processor 1001, which can perform various appropriate operations and processes based on programs and / or data stored in read-only memory (ROM) 1002 or programs and / or data loaded from storage portion 1008 into random access memory (RAM) 1003. The processor 1001 may be a multi-core processor or may contain multiple processors. In some embodiments, the processor 1001 may include a general-purpose main processor and one or more special coprocessors, such as a central processing unit (CPU), graphics processing unit (GPU), neural network processor (NPU), digital signal processor (DSP), etc. Various programs and data required for the operation of the electronic device 1000 are also stored in RAM 1003. The processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. An input / output (I / O) interface 1005 is also connected to bus 1004.
[0240] The processor and memory described above are used together to execute programs stored in the memory. When the program is executed by a computer, it can implement the methods, steps, or functions described in the above embodiments.
[0241] The following components are connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, touchscreen, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 1010 as needed so that computer programs read from it can be installed into storage section 1008 as needed. Figure 4 The diagram only shows a portion of the components and does not imply that the electronic device 1000 includes only these components. Figure 4 The components shown.
[0242] The systems, devices, modules, or units described in the above embodiments can be implemented by a computer or its associated components. The computer may be, for example, a mobile terminal, smartphone, personal computer, laptop computer, in-vehicle human-machine interface device, personal digital assistant, media player, navigation device, game console, tablet computer, wearable device, smart TV, Internet of Things system, smart home, industrial computer, server, or a combination thereof.
[0243] Although not shown, in this embodiment of the invention, a computer-readable storage medium is provided having a computer program / instructions stored thereon, which, when executed by a processor, implements the traffic scene generation system for autonomous driving testing described in the embodiment.
[0244] Storage media in embodiments of the present invention include articles that are permanent and non-permanent, removable and non-removable, capable of storing information by any method or technology. Examples of storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0245] Although not shown, embodiments of the present invention also provide a computer program product, including: a computer program / instructions that, when executed by a processor, implement the traffic scene generation system for autonomous driving testing described in the embodiments.
[0246] The methods, programs, systems, apparatuses, etc., in embodiments of the present invention can be executed or implemented in one or more networked computers, or practiced in a distributed computing environment. In the embodiments of this specification, in these distributed computing environments, tasks can be performed by remote processing devices connected via a communication network.
[0247] Those skilled in the art will understand that the embodiments described in this specification can be provided as methods, systems, or computer program products. Therefore, those skilled in the art will realize that the functional modules / units or controllers and related method steps described in the above embodiments can be implemented in software, hardware, or a combination of both.
[0248] Unless explicitly stated otherwise, the actions or steps of the methods and procedures described in the embodiments of the present invention do not necessarily have to be performed in a specific order and can still achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0249] This document describes several embodiments of the present invention; however, for the sake of brevity, the descriptions of the embodiments are not exhaustive, and identical or similar features or parts between the embodiments may be omitted. In this document, "one embodiment," "some embodiments," "example," "specific example," or "some examples" refers to embodiments applicable to at least one, but not all, of the present invention. The above terms do not necessarily refer to the same embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described herein, as well as the features of the different embodiments or examples.
[0250] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are merely examples of the best mode for implementing the systems and methods. Those skilled in the art will understand that various changes can be made to the embodiments of the systems and methods described herein without departing from the spirit and scope of the invention as defined in the appended claims when implementing the systems and / or methods.
Claims
1. A traffic scene generation system for autonomous driving testing, characterized in that, include: Multi-source traffic data fusion module, intermediate module, and traffic scenario adversarial generation, evaluation, and optimization module; in The multi-source traffic data fusion module is used to collect multi-source traffic data, standardize and semantically process the multi-source traffic data, and obtain structured semantic information that can guide the generation of scenarios. The intermediate module includes: a semantic condition diffusion generation layer, a trajectory consistency optimization layer, and a physical constraint fusion layer; in The semantic conditional diffusion generation layer is used to generate initial scene data that conforms to basic traffic logic through a multi-stage noise addition and denoising process based on the structured semantic information and time dimension parameters. The trajectory consistency optimization layer is used to perform temporal optimization on the movement trajectory of traffic elements in the initial data of the scenario, ensuring that the trajectory is continuous and conflict-free in the time dimension and conforms to the movement characteristics of traffic participants. The physical constraint fusion layer is used to correct the initial data of the scenario based on the embedded physical laws and traffic rule constraints, so that the generated scenario meets the physical rationality and behavioral compliance in the real traffic environment. The traffic scene adversarial generation evaluation and optimization module is used to evaluate the quality and adversarial nature of the generated scene through multi-dimensional indicators, obtain evaluation results, adjust the parameters of the traffic scene generation system for autonomous driving testing based on the evaluation results, and perform incremental generation of special scenes based on the evaluation results.
2. The traffic scene generation system for self-driving testing according to claim 1, characterized in that, The multi-source traffic data collected by the multi-source traffic data fusion module includes at least one of the following: measured traffic operation data, high-precision map data, environmental and meteorological data, and simulation data sources; The multi-source traffic data fusion module performs spatial registration, time synchronization, and semantic hierarchical encoding on the multi-source traffic data to obtain a traffic scene semantic map. The semantic hierarchical encoding of the multi-source traffic data fusion module includes: constructing the fused multi-source traffic data into a traffic scene semantic graph containing an entity set, a semantic relationship set, and node attributes; representing the traffic scene semantic graph through a bidirectional graph attention mechanism; performing weighted aggregation on the relation representation to obtain context features; and obtaining a semantic graph tensor based on the context features.
3. The traffic scene generation system for self-driving testing according to claim 2, characterized in that, The semantic graph of the traffic scene is as follows: in, A collection of entities in the scene. A set of semantic relationships between entities. Node attributes; The node vectorization representation is as follows: in, Let be the vector representation of the i-th node. For embedded functions, Let i be the entity type of the i-th node. Let be the state attribute of the i-th node. Let i be the spatial location of the i-th node; The relationship is represented using a bidirectional graph attention mechanism, as detailed below: in, Let be the attention weight of node i to node j, and exp be the exponential function. For activation function, Let W be the transpose of the attention vector, and W be the shared linear transformation weight matrix. , Let i be the vector representation of nodes i, j, and k. This is a vector concatenation operation. Let i be the set of adjacent nodes of node i; Contextual features are obtained through weighted aggregation, as follows: in, Enhance the contextual feature vector of node i. Use either the Sigmoid or ReLU activation function; The contextual features are organized according to the topological structure of the traffic scene semantic graph to form a global tensor, ultimately obtaining a semantic graph tensor. The semantic graph tensor As input to the semantic conditional diffusion generation layer.
4. The traffic scene generation system for self-driving testing according to claim 1, characterized in that, The semantic conditional diffusion generation layer generates initial scene data that conforms to basic traffic logic through a multi-stage noise addition and denoising process based on the structured semantic information and time dimension parameters. This includes: the semantic conditional diffusion generation layer transforms the original traffic state into a random noise distribution through multi-step positive noise addition. During the reverse denoising process, the semantic conditional diffusion generation layer uses a parameterized network combined with the structured semantic information to gradually restore the original traffic state with random noise distribution, generating the initial scene data that conforms to basic traffic logic.
5. The traffic scene generation system for self-driving testing according to claim 4, characterized in that, The semantic conditional diffusion generation layer transforms the original traffic state into a random noise distribution through multi-step positive noise addition, as detailed below: in, Let be the positive conditional probability distribution from step t−1 to step t. It follows a Gaussian distribution. Let t be the traffic scene state tensor at step t. Let be the traffic scene state tensor at step t-1. Let be the noise variance scheduling parameter at step t. It is the identity matrix. The coefficients are retained for the original state; The semantic conditional diffusion generation layer adds noise in T consecutive steps to the initial traffic state. Convert to Gaussian noise ; The semantic conditional diffusion generation layer, through a parameterized network and combined with the structured semantic information, progressively reconstructs the original traffic state from a random noise distribution, generating initial scene data that conforms to basic traffic logic, including: The reverse denoising process uses a parametric model to model the probability of recovering the scene state from the noise state at step t to the scene state at step t−1. in, The inverse conditional probability distribution modeled by parameter θ. Let be the restored scene state tensor at step t-1. Let be the noise state tensor at step t. For semantic graph tensors, Let be the mean function of a Gaussian distribution. It follows a Gaussian distribution.
6. The traffic scene generation system for self-driving testing according to claim 1, characterized in that, The trajectory consistency optimization layer receives the trajectory sequence output by the semantic conditional diffusion generation layer and optimizes the trajectory sequence based on the temporal attention mechanism of Transformer; The trajectory consistency optimization layer constrains the trajectory sequence optimization through a trajectory consistency loss function, which is a weighted sum of smoothing loss, collision loss, and dynamic consistency loss. The smoothing loss constrains the trajectory change to be continuous, the collision loss avoids the overlap of traffic element trajectories, and the dynamic consistency loss ensures that the changes in speed and acceleration are reasonable.
7. The traffic scene generation system for self-driving testing according to claim 1, characterized in that, The constraints of the physical constraint fusion layer include at least one of traffic participant dynamic characteristic constraints, road space boundary constraints, and traffic rule constraints. The physical constraint fusion layer corrects the initial data of the scenario through differentiable penalties or rule verification. Among them, the dynamic characteristics constraints of traffic participants ensure that speed and acceleration are within the physically feasible range; Road space boundary constraints ensure that the vehicle's position is within the road polygon; Traffic rules are enforced to ensure that vehicle speeds approach zero at red lights and that the distance between vehicles meets both the desired time distance and the minimum safe distance requirements.
8. The traffic scene generation system for self-driving testing according to claim 1, characterized in that, The multi-dimensional evaluation indicators of the traffic scene adversarial generation evaluation and optimization module include: scene diversity indicator, traffic rationality indicator, physical consistency indicator, safety coverage indicator and adversarial intensity indicator. When the comprehensive score of the evaluation result is lower than the preset threshold, the traffic scene generation system for self-driving test will automatically trigger the updating and retraining of model parameters or the generation of special scenes.
9. A method for generating traffic scenarios for autonomous driving testing, characterized in that, Generating a traffic scene using the traffic scene generation system for autonomous driving testing as described in any one of claims 1-8 includes: Collect multi-source traffic data, standardize and semantically process the multi-source traffic data to obtain structured semantic information that can guide scenario generation; Based on the structured semantic information and time dimension parameters, initial scene data conforming to basic traffic logic is generated through a multi-stage noise addition and denoising process. The movement trajectories of traffic elements in the initial data of the scenario are optimized in time sequence to ensure that the trajectories are continuous and conflict-free in the time dimension and conform to the movement characteristics of traffic participants. Based on the embedded physical laws and traffic rule constraints, the initial data of the scenario is corrected to ensure that the scenario meets the physical rationality and behavioral compliance requirements of a real traffic environment. The quality and adversarial nature of the generated scene are evaluated using multi-dimensional indicators to obtain evaluation results. Based on the evaluation results, the parameters of the traffic scene generation system used for autonomous driving testing are adjusted, and incremental generation of special scenes is performed based on the evaluation results.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and, The memory is communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the traffic scene generation method for autonomous driving testing as described in claim 9.