Cross-domain adaptive autonomous driving test scenario generation method and electronic equipment
By using a cross-domain adaptive autonomous driving test scenario generation method, which utilizes scenario-level conditional diffusion backbone and spatiotemporal Transformer, the problem of feature distribution differences between the source domain and the target domain is solved, and a multi-agent joint future trajectory that conforms to the traffic characteristics of the target domain is generated, thereby improving the adaptability and stability of the generated scenario.
Patent Information
- Application Number
- CN202611627596.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-17
AI Technical Summary
Existing traffic scene generation methods struggle to overcome the differences in feature distribution between the source and target domains when source domain data is abundant but target domain data is limited. This results in generation results that are biased towards the source domain or fail to reflect traffic behavior in the target domain, and they also fail to cover the diversity of target domain scenes.
A cross-domain adaptive autonomous driving test scenario generation method is adopted. Through scenario-level conditional diffusion backbone and spatiotemporal Transformer, conditional feature encoding, forward diffusion noise addition, and conditional denoising are performed. Combined with cross-domain adaptive constraints and back diffusion sampling, a multi-agent joint future trajectory that conforms to the traffic characteristics of the target domain is generated.
It improves the model's adaptability to traffic behavior in the target domain, enhances the consistency and diversity of the generated results with the behavior distribution in the target domain, reduces the risk of road deviation and traffic conflict, and improves the continuous simulation availability and training stability of the generated scenario.
Smart Images

Figure CN123116887A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous driving technology, and in particular to a cross-domain adaptive method and electronic device for generating autonomous driving test scenarios. Background Technology
[0002] With the rapid development of autonomous driving technology, scenario-based virtual simulation testing has become an important technical means for the research, verification, and safety assessment of autonomous driving systems. Compared with real-vehicle testing, virtual simulation testing has advantages such as repeatability, controllability, low risk, and low cost, and can play an important role in software iteration, functional verification, long-tail scenario mining, and safety regression testing. A high-quality traffic simulation scenario library is the foundation for conducting autonomous driving virtual simulation testing, and its coverage, realism, and diversity directly affect the effectiveness of autonomous driving system testing and evaluation.
[0003] When autonomous driving systems operate in different cities, countries, or regions, there may be differences in road topology, traffic rules, vehicle driving habits, vehicle speed distribution, interaction behavior patterns, and map representation between different traffic domains. If the scene generation model is trained based solely on traffic scenes collected from a single city or a single data domain, the generated results are prone to carrying source domain behavioral biases and are difficult to meet the simulation testing requirements in the target deployment domain.
[0004] Existing methods for generating traffic scenarios mainly include rule-based methods and data-driven methods. Rule-based methods rely on pre-set vehicle dynamics models, car-following models, lane-changing models, or manually generated rules. While they offer some interpretability and motion feasibility, they struggle to cover complex multi-agent interactions and have limited ability to represent the diversity of real-world traffic behavior. Data-driven methods, on the other hand, can learn vehicle motion patterns and interaction rules from real-world traffic data. Among these, diffusion models, due to their multimodal modeling capabilities and controllable sampling capabilities, are increasingly being applied to multi-agent trajectory prediction and traffic scenario generation.
[0005] However, existing data-driven scene generation methods typically assume that training and test data come from the same or similar distributions, or that the training data has sufficient coverage of the target domain. In practical applications, source domain traffic scene data is often abundant, while target domain traffic scene data may be limited due to acquisition costs, privacy requirements, annotation costs, or regulatory constraints. When training with only source domain data, the generated scene may fail to reflect traffic behavior in the target domain; when training with only a small amount of target domain data, the model is prone to overfitting and struggles to cover the diversity of target domain scenes; and when training with a simple mixture of source and target domain data, it may be affected by sample imbalance and differences in inter-domain distribution, leading to a bias in the generated result towards the source domain or a mixed distribution bias.
[0006] Therefore, given the abundance of source domain samples and the limited number of target domain samples, how to utilize prior behavioral data from the source domain and limited target domain samples to reduce the distribution differences between the source and target domains, and generate multi-agent traffic scenarios that conform to the traffic characteristics of the target domain and are applicable to both open-loop and closed-loop traffic scenarios, is a technical problem that needs to be solved in this field. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a cross-domain adaptive autonomous driving test scenario generation method and electronic device. In the generation of cross-domain autonomous driving test scenarios with abundant source domain data and limited target domain data, this invention aims to overcome the differences in feature distribution between the source and target domains and the insufficient sample size in the target domain, and generate multi-agent joint future trajectory scenarios that simultaneously satisfy the rationality of multi-traffic participant interaction, road constraints, and motion physics feasibility, and support simulation verification of open-loop full-segment trajectory and closed-loop rolling trajectory.
[0008] The objective of this invention can be achieved through the following technical solutions: One aspect of the present invention provides a method for generating cross-domain adaptive autonomous driving test scenarios, comprising the following steps: Obtain source domain traffic scene datasets and target domain traffic scene datasets, where each traffic scene includes historical observation sequences, joint future trajectories, and local map context for multiple traffic participants; Conditional feature encoding is performed on the source domain traffic scene dataset and the target domain traffic scene dataset to obtain scene conditional representations; A scenario-level conditional diffusion process is constructed. The future joint motion representation corresponding to the joint future trajectory is positively diffused and denoised according to a preset noise schedule. The denoised future joint motion representation, the scenario condition representation, and the diffusion step are then embedded and input into the scenario-level conditional diffusion backbone. The spatiotemporal Transformer in the scene-level conditional diffusion backbone is used to perform conditional denoising on the input features to obtain a denoised future joint motion representation, and traffic participant-level high-level interaction features are extracted during the conditional denoising process. Based on the high-level interaction features of the traffic participants, cross-traffic participant aggregation is performed to obtain a scene-level representation; During training, the feature distribution between the source and target domains is subjected to cross-domain adaptive constraints based on the scene-level representation, and the scene-level conditional diffusion backbone is trained in conjunction with the diffusion denoising loss. During the inference process in the target domain, the backdiffusion sampling is performed starting from the initial noise, based on the historical observation sequence of the traffic scene in the target domain, the local map context, and the interaction relationship of traffic participants. The backdiffusion sampling process is guided and corrected based on the scene constraints. The future joint motion representation obtained after back-diffusion sampling is decoded to output multiple target domain multi-agent joint future trajectory samples, which are used to generate autonomous driving test scenarios.
[0009] As a preferred technical solution, for each traffic scene in the source domain traffic scene dataset and the target domain traffic scene dataset, there are multiple traffic participants' positions, heading angles and speeds in the historical observation time domain, as well as their positions and heading angles in the future generation time domain; The local map context includes at least one of the following: road geometry information, lane centerline information, drivable area information, and road topology information corresponding to the traffic scene; The number of samples in the source domain traffic scene dataset is greater than the number of samples in the target domain traffic scene dataset.
[0010] As a preferred technical solution, the conditional feature encoding process includes the following steps: The historical observation sequences of multiple traffic participants are normalized and time-series encoded to obtain the features of the historical observation sequences; The local map context is rasterized or vectorized to obtain local map context features; Interaction relationship features are constructed based on the relative positions, relative speeds, relative heading angles, and spatial adjacency relationships among traffic participants; The historical observation sequence features, local map context features, and interaction relationship features are fused to obtain a scene condition representation; The construction process of the interaction relationship features includes the following steps: A scene interaction graph is constructed using traffic participants as nodes, and the relative states between traffic participants are used as edge features. Filter adjacent traffic participants based on a preset interaction distance threshold; The node features and edge features corresponding to the selected adjacent traffic participants are input into the edge-aware interaction coding module to obtain interaction features that characterize the mutual influence relationship between traffic participants.
[0011] As a preferred technical solution, the process of constructing a scene-level conditional diffusion process and performing positive diffusion noise addition on the future joint motion representation corresponding to the joint future trajectory according to a preset noise scheduling includes the following steps: Representing the joint future trajectory of multiple traffic participants as a future joint motion representation ; Gaussian noise is gradually added to the future joint motion representation according to a preset noise scheduling coefficient, wherein the first... The forward diffusion process of each diffusion step satisfies: in, Given the first Noisy future joint motion representation of a diffusion step Under the conditions, the first Noisy future joint motion representation of a diffusion step The conditional probability distribution, i.e., the positive diffusion transition distribution; The mean is The covariance matrix is The multivariate Gaussian distribution in The probability density at that location; Indicates the first The preset noise scheduling coefficients corresponding to each diffusion step are used to control the intensity of Gaussian noise added in that diffusion step. Represents the identity matrix that matches the dimension of the future joint motion representation; Indicates the first The noisy future joint motion representation corresponding to each diffusion step; This represents the original future joint motion representation without diffusion and noise addition; Indicates the first The single-step signal retention coefficients corresponding to each diffusion step; Indicates the distance from the first diffusion step to the second diffusion step. The cumulative signal retention coefficient for each diffusion step; This is the discrete index of the current diffusion step. ,in The preset total number of diffusion steps; Indicates and They have the same dimension and follow a standard Gaussian distribution Random noise. As a preferred technical solution, the spatiotemporal Transformer includes a time-dependent modeling module, a multi-agent interaction modeling module, and a map constraint fusion module. The time-dependent modeling module updates the motion latent representations of traffic participants along the future time domain. The multi-agent interaction modeling module updates the motion latent representations of different traffic participants based on the interaction relationships between them. The map constraint fusion module fuses road geometric constraints and road topological constraints from the local map context into the future motion latent representation. The spatiotemporal Transformer first performs time attention updates on the future motion latent representation of each traffic participant, then performs interaction attention updates based on the edge features between traffic participants, and injects local map context features into the updated future motion latent representation through map cross-attention. During the conditional denoising process, high-level interaction features at the traffic participant level are formed, and the denoised future joint motion representation is obtained from the scene-level conditional diffusion backbone.
[0012] As a preferred technical solution, the process of obtaining a scene-level representation based on the high-level interaction features at the traffic participant level extracted during the conditional denoising process includes the following steps: Extract the first... Implicit representation of a traffic participant in the future time domain And high-level interaction features at the traffic participant level are obtained through time pooling. ,in This indicates a time pooling operation to be performed along the future time domain; Cross-traffic participant aggregation is performed on high-level interaction features at multiple traffic participant levels to obtain a scene-level representation. ,in For cross-traffic participant aggregation operations, The cross-traffic participant aggregation includes at least one of average pooling, max pooling, and a combination of average pooling and max pooling, where the number of traffic participants is specified.
[0013] As a preferred technical solution, the process of performing cross-domain adaptive constraints on the feature distribution between the source and target domains based on the scene-level representation, and training the scene-level conditional diffusion backbone in conjunction with diffusion denoising loss, includes the following steps: The diffusion denoising loss is calculated based on the denoised future joint motion representation obtained from the scenario-level conditional diffusion backbone prediction and the corresponding real future joint motion representation. ; The maximum mean difference feature alignment loss is calculated based on the source domain scene-level representation and the target domain scene-level representation. : In the formula, Indicates the first Each source domain scenario-level representation Indicates the first Target domain scenario-level representation , These represent the number of scene-level representations in the source domain and the number of scene-level representations in the target domain, respectively. For kernel functions; The domain discriminant adversarial feature alignment loss is calculated based on the domain label prediction results of the scene-level representation by the domain discriminator. The domain discriminative adversarial feature alignment loss is obtained by the domain discriminator based on the scene-level representation to identify the source domain label or the target domain label, and the scene-level representation tends to be domain indistinguishable by applying the reverse gradient to the scene-level conditional diffusion backbone during the backpropagation process through the gradient inversion layer. The exponential moving average teacher-student self-distillation loss is calculated based on the high-level features output by the teacher and student branches and the results of neighbor context reconstruction. ; Regarding the diffusion denoising loss Maximum mean difference feature alignment loss Domain-discriminative adversarial feature alignment loss Exponential moving average teacher-student autodistillation loss The total training loss is obtained by weighted combination, and the scenario-level conditional diffusion backbone is trained based on the total training loss.
[0014] As a preferred technical solution, the calculation process of the exponential moving average teacher-student self-distillation loss includes the following steps: Update the teacher branch parameters based on the student branch parameters according to the following formula: in, For student branch parameters, For teacher branch parameters, The exponential moving average decay coefficient; The teacher branch receives the complete view of traffic participant interaction information, while the student branch receives a randomly degraded view of traffic participant interaction information. Feature consistency loss is then calculated based on the high-level interaction features output by the teacher and student branches. The randomly degraded traffic participant interaction information view includes at least one of the following: randomly discarding some adjacent traffic participants, randomly masking some interaction edges, or randomly perturbing the interaction features of adjacent traffic participants. The neighbor context features are reconstructed from the high-level features of the student branch, and the neighbor context reconstruction loss is calculated based on the difference between the reconstructed neighbor context features and the neighbor context features corresponding to the complete interaction information view. ; Based on the aforementioned feature consistency loss and the neighbor context reconstruction loss The weighted exponential moving average teacher-student autodistillation loss is obtained. .
[0015] As a preferred technical solution, the target domain reasoning process includes the following steps: Multiple conditional backdiffusion samplings are performed starting from different initial Gaussian noises, and the scene constraint cost is reduced during the conditional backdiffusion sampling process. The backsampling process is guided and corrected for the objective, and the scenario constraint costs include road compliance costs, collision safety costs, and motion smoothing costs. In the pre-defined guided diffusion step of the back diffusion process, the corrected back sampling mean satisfy: in, The step size is used to control the magnitude of the correction of the scene constraint gradient to the current backsampled mean. This means that, without scene constraint guidance, the scene-level conditional diffusion backbone predicts the denoised future joint motion representation based on the current noisy future joint motion representation, diffusion step, and scene conditions, and calculates the back sample mean by combining the current noisy state and preset noise scheduling parameters according to the back diffusion posterior relationship. Represents the scenario constraint cost function Regarding the backsampled mean The gradient of represents the direction of local increase of the scene constraint cost relative to the backsampling mean; Decode the future joint motion representation obtained after conditional backdiffusion sampling to obtain multiple target domain multi-agent joint future trajectory samples; In the open-loop whole trajectory simulation scenario generation, the joint future trajectory of multiple agents in the future generation time domain is output at one time; In the closed-loop rolling trajectory simulation scenario generation, the back-diffusion sampling of the current observation state during the simulation process is repeatedly executed, and the multi-agent joint future trajectory for the next time period is rolled out.
[0016] In another aspect, an electronic device is provided, including one or more processors, a memory, and one or more programs stored in the memory, said one or more programs including instructions for performing the aforementioned cross-domain adaptive autonomous driving test scenario generation method.
[0017] Compared with the prior art, the present invention has at least one of the following beneficial effects: (1) Improve the model’s adaptability to traffic behavior in the target domain: In response to the problem that the source domain has abundant data but the target domain has limited data and that the generation results are biased towards the source domain due to the difference in traffic behavior distribution between the source domain and the target domain, this invention implements maximum mean difference feature alignment, domain discriminative adversarial feature alignment and exponential moving average teacher-student consistency constraint on the high-level scene representation of the scene-level conditional diffusion backbone. While utilizing the prior of traffic behavior in the source domain, it reduces the distribution difference between the high-level scene representations of the source domain and the target domain, improves the model’s adaptability to traffic behavior in the target domain, and reduces the risk of the generation results being overly biased towards the source domain under the condition of limited target domain samples.
[0018] (2) Improve the consistency of target domain behavior distribution, the rationality of multi-agent interaction, and the diversity of generation. To address the problem of difficulty in uniformly modeling changes in vehicle motion, interaction relationships among traffic participants, road environment constraints, and uncertainties in future behavior during the generation of future trajectories for multiple traffic participants, this invention employs a scenario-level conditional diffusion backbone and a spatiotemporal Transformer to conditionally denoise the future joint motion representation. Through time-dependent modeling, multi-agent interaction modeling, and map constraint fusion, the distribution of joint future behavior of multiple traffic participants is uniformly modeled. During the target domain inference process, multiple conditional backdiffusion samplings are performed starting from different initial Gaussian noises to obtain multiple candidate joint future trajectories. This helps to improve the consistency between the generated traffic scene and the real traffic scene in the target domain in terms of motion state distribution and traffic participant interaction distribution, while maintaining the diversity of future behavior generation.
[0019] (3) Reduce the risks of road deviation, traffic conflict, and motion non-smoothness, and improve the continuous simulation usability of the generated scene. In view of the problems that may occur during the diffusion generation process, such as the trajectory leaving the drivable area, collisions between traffic participants, and non-smoothness of motion changes, this invention introduces scene constraint guidance in the back diffusion sampling process under target domain conditions, and performs gradient correction on the back sampling mean in the preset guided diffusion step according to the road compliance cost, collision safety cost, and motion smoothness cost, so as to reduce the risks of road deviation, traffic conflict, and kinematic anomalies. This helps to improve the road compliance, collision safety, and motion continuity of the generated trajectory, and enhances the stability and executability of the generated scene in open-loop evaluation and closed-loop rolling simulation.
[0020] (4) Improve the stability and robustness of cross-domain joint training under the condition of limited target domain samples. In view of the problem that cross-domain adaptive constraints may interfere with the basic generation ability of the conditional diffusion model and that the high-level representation is prone to fluctuation when the target domain samples are limited, this invention applies cross-domain adaptive constraints to the scene-level high-level representation, where the domain label is used as the supervision signal of the domain discriminator instead of being directly used as the generation condition of the scene-level conditional diffusion backbone; at the same time, an exponential moving average teacher-student consistency constraint is adopted, so that the teacher branch receives the complete traffic participant interaction information view and the student branch receives the randomly degraded traffic participant interaction information view, and performs self-distillation by combining feature consistency loss and neighbor context reconstruction loss; furthermore, in the early stage of training, the loss weight corresponding to the cross-domain adaptive constraint is set to zero or a small value, and gradually increased to a preset upper limit as training progresses, thereby reducing the interference of the auxiliary cross-domain constraint on the learning of the basic denoising ability of the diffusion backbone, and improving the training stability and robustness of the high-level representation under the condition of limited target domain samples.
[0021] (5) It is compatible with open-loop scene generation and closed-loop rolling simulation, and has good engineering reuse capability. In the target domain inference process, the present invention can generate multiple target domain multi-agent joint future trajectory samples from different initial Gaussian noises; in the open-loop whole trajectory scene generation, it can generate multi-agent joint trajectories in the future time domain at one time based on the initial traffic scene, which can be used for target domain traffic scene library construction, offline trajectory evaluation and data augmentation; in the closed-loop rolling trajectory simulation, it can repeatedly execute back-diffusion sampling based on the current observation state in the simulation process and roll to generate subsequent multi-agent joint trajectories, thereby supporting continuous interactive testing and closed-loop simulation verification of autonomous driving systems, and improving the reuse capability and engineering applicability of the generated test scenarios in different autonomous driving test processes. Attached Figure Description
[0022] Figure 1 This is a flowchart of the cross-domain adaptive autonomous driving test scenario generation method in the embodiment; Figure 2 This is a diagram illustrating the overall structure of the domain adaptive conditional diffusion model in this embodiment. Figure 3 This is a schematic diagram of the difference in traffic behavior distribution between the source domain and the target domain in the embodiment, where (a) is a schematic diagram of the difference in speed distribution and (b) is a schematic diagram of the difference in corrected collision time distribution. Figure 4 The figure shows the difference curves of the empirical cumulative distribution function between the results generated by different methods in the embodiment and the actual distribution of the target domain, where (a) is the velocity distribution difference curve and (b) is the corrected collision time distribution difference curve. Figure 5 A visual comparison chart of trajectory generation for different methods in the target domain closed-loop rolling simulation in the embodiments is provided. Figure 6 This is a schematic diagram of the electronic device in the embodiment. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0024] Example 1 To address the problems existing in the prior art, this embodiment provides a cross-domain adaptive method for generating autonomous driving test scenarios, see [link to relevant documentation]. Figure 1 This is a flowchart of the method. Figure 2 This is a diagram showing the overall structure of the domain-adaptive conditional diffusion model. (Example:) Figure 1 and Figure 2 As shown, this method takes source domain traffic scene datasets and target domain traffic scene datasets as inputs. Through scene data parsing, conditional feature encoding, scene-level conditional diffusion, spatiotemporal Transformer conditional denoising, scene-level representation aggregation, cross-domain adaptive training, and target domain conditional backsampling, it generates joint future trajectory samples for multiple agents in the target domain. It also supports open-loop complete trajectory scene generation and closed-loop rolling trajectory scene generation. The specific steps are as follows: Step S1: Obtain the source domain traffic scene dataset and the target domain traffic scene dataset.
[0025] In step S1, the source domain traffic scene dataset and the target domain traffic scene dataset are obtained. The source domain traffic scene dataset is denoted as... The target domain traffic scenario dataset is denoted as The source domain can be a city, region, or dataset with abundant historical traffic scenario data, while the target domain can be a city, region, or dataset that needs to be deployed, validated, or has a small number of samples. The number of samples in the source domain traffic scenario dataset is greater than the number of samples in the target domain traffic scenario dataset.
[0026] Every traffic scenario Represented as ,in, This represents a historical observation sequence of multiple traffic participants. This represents the combined future trajectory of multiple traffic participants. This represents the local map context. For the first... Each traffic participant, their historical observation sequence Represented as: ,in, Indicates the length of the historical observation time domain. Indicates the first Traffic participants at a historical moment The current state. Historical state. This can include position, heading angle, and velocity, specifically expressed as follows: ,in, and Represents a two-dimensional planar position. Indicates the heading angle. Indicates speed. (The first...) The future trajectory of each traffic participant is represented as: ,in, Indicates the future generation time domain length. Indicates the first Traffic participants at future moments The future state can include position and heading angle, specifically represented as: .
[0027] Local map context This includes at least one of the following: road geometry information surrounding the traffic scene, lane centerline information, drivable area information, lane topology connectivity information, intersection structure information, and traffic area boundary information. Depending on the data format, the local map context can be represented using a raster map, a vector map, or a combination of both.
[0028] In this embodiment, the source domain and target domain can correspond to different cities or different data collection areas. Due to differences in road topology, traffic rules, driving habits, and traffic participant interaction behaviors among different cities, the traffic scene distribution in the source domain and target domain is usually different.
[0029] Step S2: Parse the scene data and encode the conditional features.
[0030] In step S2, the source domain traffic scene dataset and the target domain traffic scene dataset are uniformly parsed and preprocessed to convert each traffic scene into an input format suitable for the scene-level conditional diffusion model.
[0031] First, the historical observation sequences of multiple traffic participants are processed by coordinate unification, missing value handling, time alignment, and normalization. Coordinate unification utilizes a local coordinate system referenced to the target traffic participant, the main vehicle, or the scene center, converting position, heading angle, and velocity in different traffic scenarios into a unified coordinate representation. Time alignment ensures that the historical states and future trajectories of different traffic participants have consistent sampling intervals.
[0032] Then, the historical observation sequence is encoded with temporal features to obtain historical observation sequence features. These features describe the position changes, movement trends, speed changes, and heading changes of traffic participants within the historical observation time domain. Next, the local map context is encoded with map features to obtain local map context features. Local map context can be encoded as rasterized map features or as vectorized map features such as lane centerlines, road boundaries, drivable areas, and road topological relationships. These local map context features are used to provide road geometric and topological constraints to the subsequent conditional diffusion model.
[0033] Furthermore, interaction relationship features of traffic participants are constructed based on their relative positions, relative speeds, relative heading angles, and spatial adjacency. In one implementation, a scene interaction graph is constructed using traffic participants as nodes, and the relative states between traffic participants are used as edge features. Adjacent traffic participants are filtered according to a preset interaction distance threshold. The filtered node features and edge features are input into the edge-aware interaction encoding module to obtain interaction features describing the mutual influence relationships between traffic participants.
[0034] like Figure 2 As shown, the domain-adaptive conditional diffusion model employs a shared conditional coding structure to process source and target domain traffic scene data, mapping both scenarios to a unified conditional feature space. After obtaining historical observation sequence features, local map context features, and traffic participant interaction features, these features are fused to obtain the scene conditional representation. Scene condition representation This is used to constrain the subsequent conditional diffusion generation process, ensuring that the generated future joint trajectory remains consistent with the historical motion state of traffic participants, the local road environment, and the interaction relationships between traffic participants.
[0035] Step S3: Construct a scene-level conditional diffusion forward noise addition process.
[0036] In step S3, the joint future trajectory of multiple traffic participants is represented as a future joint motion representation. The future united movement indicates It includes the two-dimensional positions, heading angles, and motion state information represented by position changes of multiple traffic participants in the future generation time domain.
[0037] According to the preset noise control coefficient, the future joint motion is represented. Gaussian noise is gradually added during the diffusion step. The forward diffusion process is represented as: in, Given the first Noisy future joint motion representation of a diffusion step Under the conditions, the first Noisy future joint motion representation of a diffusion step The conditional probability distribution; Indicates the first The preset noise scheduling coefficients corresponding to each diffusion step are used to control the intensity of Gaussian noise added in that diffusion step. Represents the identity matrix that matches the dimension of the future joint motion representation; This is the discrete index of the current diffusion step. ,in This is the preset total number of diffusion steps.
[0038] make , Then it can be represented by the future joint movement. We can directly obtain the noisy future joint motion representation corresponding to any diffusion step: , .in, This represents the original future joint motion representation without diffusion and noise addition; Indicates the first Single-step signal retention coefficients for each diffusion step; Indicates as of the date The cumulative signal retention coefficient for each diffusion step; Indicates and They have the same dimension and follow a standard Gaussian distribution Random noise.
[0039] After completing the forward diffusion noise addition, the noise-added future joint motion representation will be... Scene condition representation and diffusion step embedding Common input scenario-level conditional diffusion backbone. Diffusion step embedding. This is used to represent the current noise level, enabling the model to employ different conditional denoising strategies at different diffusion steps. For example... Figure 2 As shown, the scenario-level conditional diffusion backbone maps the complex multi-agent future behavior distribution to the noise space through a forward noise addition process, and gradually recovers the future joint motion representation through a reverse noise reduction process.
[0040] Step S4: Use a spatiotemporal Transformer for conditional denoising.
[0041] In step S4, the spatiotemporal Transformer in the scene-level conditional diffusion backbone is used to perform conditional denoising on the input features. The spatiotemporal Transformer receives the noisy future joint motion representation. Diffusion step embedding and scene condition representation During the conditional denoising process, high-level interaction features at the traffic participant level are generated, and the denoised future joint motion representation is obtained by scene-level conditional diffusion backbone prediction. .
[0042] In one implementation, the spatiotemporal Transformer includes a time-dependent modeling module, a multi-agent interaction modeling module, and a map constraint fusion module.
[0043] The time-dependent modeling module is used to update the motion latent representation of each traffic participant along the future time domain. This module can model the motion trends of traffic participants in continuous time steps through a time attention mechanism, so that the generated trajectory remains continuous in time.
[0044] The multi-agent interaction modeling module is used to perform interaction attention updates based on edge features between traffic participants. Edge features can be constructed from relative position, relative speed, relative heading angle, and adjacency. Through this module, interactions such as yielding, following, paralleling, merging, and conflict between different traffic participants are integrated into the future motion latent representation.
[0045] The map constraint fusion module is used to inject local map context features into the latent representation of future motion. Specifically, a map cross-attention mechanism can be used to make the latent representation of traffic participants pay attention to road geometry, lane centerlines, drivable areas, and topological connectivity information, thereby ensuring that the generated trajectory is consistent with the road structure.
[0046] After multi-layer time-dependent modeling, multi-agent interaction modeling, and map constraint fusion, the spatiotemporal Transformer forms a high-level interaction feature that integrates historical motion conditions, future noisy states, multi-agent interaction relationships, and local map constraints. The scene-level condition diffusion backbone obtains a denoised future joint motion representation based on the high-level interaction feature.
[0047] Step S5: Extract and aggregate scene-level representations.
[0048] In step S5, traffic participant-level high-level interaction features are extracted from the high-level interaction features formed during the conditional denoising process, and aggregated across traffic participants to obtain a scene-level representation.
[0049] Specifically, for the first For each traffic participant, the latent representation of that participant in the future time domain is extracted from the high-level interaction features formed during the conditional denoising process, and this future time-domain latent representation is then time-pooled to obtain the high-level interaction features at the traffic participant level. This feature is used to represent the first... High-level motion and interaction information of multiple traffic participants in the future time domain. The high-level interaction characteristics of multiple traffic participants are represented as follows: ,in, This refers to the number of traffic participants in a traffic scenario.
[0050] Furthermore, cross-traffic participant aggregation is performed on multiple high-level interaction features at the traffic participant level to obtain a scene-level representation. : .in, This represents a cross-traffic participant aggregation operation. Cross-traffic participant aggregation operations can include at least one of average pooling, max pooling, and a concatenation of average pooling and max pooling.
[0051] By aggregating across traffic participants, the model obtains a scene-level representation that describes the high-level interaction patterns of the entire traffic scenario, providing a feature foundation for subsequent cross-domain adaptive training.
[0052] Step S6: Cross-domain adaptive training.
[0053] In step S6, cross-domain adaptive constraints are applied to the feature distribution between the source and target domains based on the scene-level representation, and the scene-level conditional diffusion backbone is trained in conjunction with the diffusion denoising loss.
[0054] During training, mixed training batches are sampled from the source domain traffic scene dataset and the target domain traffic scene dataset. For each training batch, the noisy future joint motion representation is first obtained according to step S3. Then, in step S4, a denoised future joint motion representation is obtained and a high-level interaction feature is formed. Then, in step S5, the high-level interaction features are aggregated to obtain a scene-level representation. .
[0055] like Figure 2 As shown, the domain-adaptive conditional diffusion model sets up a domain-adaptive representation learning module in addition to the scene-level conditional diffusion backbone. This module includes maximum mean difference feature alignment, domain discriminative adversarial feature alignment, and exponential moving average teacher-student consistency constraints to mitigate high-level representation shifts between the source and target domains.
[0056] The overall training objectives in this embodiment include diffusion denoising loss, maximum mean difference feature alignment loss, domain discriminative adversarial feature alignment loss, and exponential moving average teacher-student consistency loss. The diffusion denoising loss is used to train the scenario-level conditional diffusion backbone to recover the original future joint motion representation. In one implementation, the diffusion denoising loss employs a mean squared error loss that masks and weights the effective future trajectories; its basic form can be expressed as: in, The parameter is Scenario-level conditional diffusion backbone; The scenario-level conditional diffusion backbone is based on the first... Noisy future joint motion representation of a diffusion step Diffusion step index and scene condition representation The predicted denoised future joint motion representation; Represents the original future joint motion in the training samples. Standard Gaussian noise and the diffusion steps obtained from sampling The resulting random training samples are taken as expected; Represents square distance.
[0057] The maximum mean difference feature alignment loss is used to constrain the statistical distribution difference between the source domain scene-level representation and the target domain scene-level representation. Let the source domain scene-level representation in the training batch be... The target domain is represented as a scene-level representation. Then the maximum mean difference feature alignment loss Represented as: in, Indicates the first Each source domain scenario-level representation Indicates the first Target domain scenario-level representation , These represent the number of scene-level representations in the source domain and the number of scene-level representations in the target domain, respectively. The kernel function is represented by minimizing the maximum mean difference feature alignment loss, which maps the scene-level representations of the source and target domains to a higher-level latent space with a more consistent statistical distribution.
[0058] Domain-discriminative adversarial feature alignment loss is used to suppress domain-discriminative information in scene-level representations. Specifically, a domain discriminator is set. The domain discriminator predicts the corresponding source or target domain label based on the scene-level representation. Domain discrimination loss. Represented as: in, This represents the scene-level feature representation extracted from the scene-level conditional diffusion backbone; The parameter is Domain discriminator; The domain label corresponding to the scene sample is used to indicate whether the sample comes from the source domain or the target domain; The binary cross-entropy loss function; This represents the gradient reversal operation, which preserves the input features during forward propagation and multiplies the gradients propagated to the scene-level conditional diffusion backbone during backward propagation. ; This indicates the gradient inversion strength as it changes with the training progress; This represents the training progress step index during the training process. Through the gradient reversal operation, the scene-level conditional diffusion backbone learns domain-indistinguishable representations that are difficult for the domain discriminator to differentiate.
[0059] The exponential moving average teacher-student consistency loss is used to enhance the stability of the representation under the condition of a limited sample size in the target domain. Specifically, student and teacher branches are set up, and the teacher branch parameters are updated by the exponential moving average of the student branch parameters: in, Indicates the student branch parameters. Indicates the teacher branch parameters, This represents the exponential moving average decay coefficient. The teacher branch receives the complete traffic participant interaction information view, while the student branch receives a randomly degraded traffic participant interaction information view. The randomly degraded traffic participant interaction information view can be obtained by randomly discarding some adjacent traffic participants, randomly masking some interaction edges, or randomly perturbing the interaction features of neighboring vehicles.
[0060] Extract the high-level interaction features from the teacher branch and the student branch outputs respectively, and calculate the consistency loss between them. : in, This represents the high-level interaction features extracted by the student branch from the input view after random degradation of the traffic participant neighbor interaction information; This represents the high-level interaction features extracted from the teacher branch of the exponential moving average under the complete traffic participant interaction information view; This represents the feature distance function used to measure the difference in characteristics between student branches and teacher branches, and in one implementation, it uses mean squared error. This indicates stopping the gradient operation, meaning that the input value remains unchanged during forward propagation, and the gradient is prevented from continuing to propagate through the teacher branch during backward propagation.
[0061] In one embodiment, the and They were respectively through High-level fusion features of the normalized student branch and the exponentially moving average teacher branch. Furthermore, a neighbor context reconstruction loss is set. : in, This represents the neighbor historical context features predicted by the neighbor context reconstruction module based on the high-level interaction features extracted from the student branch. This represents the target features of the neighbor historical context extracted from the original, complete view of traffic participant interaction information without neighbor information degradation; Indicates smoothness The loss function measures the difference between the student branch reconstruction result and the target features of the full-view neighbor historical context. Exponential moving average teacher-student consistency loss. Represented as: in, It is the reconstructed relative weight within the distillation term.
[0062] Total training loss It can be represented as: in, This represents the feature alignment loss based on the maximum mean difference. Representation domain discriminative adversarial feature alignment loss, This represents the exponential moving average teacher-student consistency loss. , and These represent the corresponding loss weights.
[0063] In the early stages of training, the weights corresponding to the cross-domain adaptive constraints are set to zero or a small value, so that the model learns the basic diffusion denoising capability first. As training progresses, the corresponding weights are gradually increased to the preset upper limit to reduce the interference of auxiliary constraints on the convergence process of the scene-level conditional diffusion backbone in the early stages of training.
[0064] Step S7: Perform target domain conditional backsampling.
[0065] In step S7, during the target domain reasoning process, conditional backdiffusion sampling is performed starting from the initial noise, based on the historical observation sequence of the target domain traffic scene, the local map context, and the interaction relationship of traffic participants.
[0066] Specifically, the initial noise is first sampled from a standard Gaussian distribution. Then, from the diffusion step Stepwise backsampling is performed up to diffusion step 1. In the... In each backward diffusion step, the conditional backward diffusion distribution... Represented as: in, Indicates the first The sampling variance corresponding to each reverse diffusion step; This represents the mean of the backsampling at the current backdiffusion step without scene constraints as guidance. Specifically, the scene-level conditional diffusion backbone is based on the current noisy future joint motion representation. diffusion step and scene condition representation Predicting denoising and future joint motion representation ; and further according to Current noise added to future joint motion representation And the inverse posterior distribution is determined by pre-set diffusion noise parameters. , That is, the mean of the inverse posterior distribution.
[0067] To improve the usability of target domain traffic scenarios in open-loop and closed-loop simulations, a guided correction is applied to the backsampling process based on scenario constraint costs during conditional backdiffusion sampling. Scenario constraints include at least one of road compliance constraints, collision safety constraints, and motion smoothing constraints.
[0068] Road compliance constraints are used to ensure that the trajectories of traffic participants remain within the drivable area and to limit unreasonable deviations between the trajectory and the boundary of the drivable area. Collision safety constraints are used to constrain the risk of spatial overlap between different traffic participants, ensuring that traffic participants maintain a safe distance from each other. Motion smoothness constraints are used to constrain the velocity, acceleration, steering changes, and jerk corresponding to the generated trajectory, ensuring that the generated result meets reasonable requirements for motion continuity and comfort.
[0069] Scenario Constraint Cost Function Represented as: in, Indicates loss due to road deviation. Indicates collision damage. Indicates motion smoothing loss, , and These represent the corresponding loss weights.
[0070] In one implementation, the back-sampled mean is calculated in a preset late diffusion step of the back-diffusion sampling. As an optimization variable, its gradient is adjusted according to the scenario constraint cost function: in, This represents the backsampled mean after scene constraint gradient correction; It represents the mean of the backsampling of the current back diffusion step when no scene constraints are applied. It is determined by the scene-level conditional diffusion backbone based on the current noisy future joint motion representation, the diffusion step and the scene conditions to predict the denoised future joint motion representation, and combined with the current noisy state and preset noise scheduling parameters according to the back diffusion posterior relationship. Represents the scenario constraint cost function; The scenario constraint cost function represents the backsampled mean. The gradient; This represents the effective guiding step size, used to control the correction magnitude of the scene constraint gradient to the current backsampled mean. The scene-level conditional diffusion backbone first determines the current noisy future joint motion representation based on this. diffusion step and scene condition representation Predicting denoising and future joint motion representation And then according to , And the inverse posterior distribution is determined by pre-set diffusion noise parameters. And use the mean of this inverse posterior distribution as Based on the corrected backsampled mean Complete sampling for the current diffusion step and continue with subsequent back-diffusion steps. Through guided correction, the road compliance, collision safety, and motion smoothness of the generated trajectories can be improved while preserving the original generation distribution and generation diversity of the conditional diffusion model as much as possible.
[0071] Starting from different initial Gaussian noise, multiple conditional backdiffusion samplings can be performed on the same target domain traffic scene to generate multiple candidate future joint trajectory samples.
[0072] Step S8: Output the joint future trajectory sample of the target domain multi-agent.
[0073] In step S8, the future joint motion representation obtained after completing the conditional backdiffusion sampling is decoded to obtain the joint future trajectory samples of the target domain multi-agent system. Each joint future trajectory sample includes the two-dimensional positions and heading angles of multiple traffic participants in the future generation time domain.
[0074] By sampling multiple times from different initial noises, the model can generate multiple possible future joint trajectory samples for the same target domain traffic scenario, thereby characterizing the uncertainty and diversity of traffic participants' future behavior.
[0075] In the generation of open-loop trajectory scenarios, based on the same initial traffic scenario, the joint future trajectory of multiple agents within the future generation time domain is output in one go. This approach is suitable for expanding offline scenario libraries, evaluating open-loop trajectories, and analyzing target domain behavior distribution.
[0076] In the closed-loop rolling trajectory generation scenario, conditional back-diffusion sampling is repeatedly performed based on the current observation state during simulation, and the multi-agent joint future trajectory for the next time period is output in a rolling manner. After the simulation environment executes the trajectory for the current time period, it updates the state of traffic participants, and then uses the updated current observation state as the input for the next round to continue generating subsequent trajectories. This method is suitable for closed-loop simulation verification and continuous interaction scenario generation of autonomous driving systems.
[0077] After obtaining the generated test scenarios, multiple target domain multi-agent joint future trajectory samples, along with corresponding historical observation sequences and local map context, can be imported into the autonomous driving simulation platform to construct a reusable target domain test scenario library. This library can be used for offline playback and open-loop trajectory evaluation of autonomous driving perception, prediction, planning, and control modules. It can also serve as a dynamic interactive environment in closed-loop simulations, continuously outputting the multi-agent joint future trajectory for the next time period. This allows for continuous interactive testing, regression testing, safety verification, and expansion of extreme or long-tail scenarios for the autonomous driving system. Simultaneously, the generated scenarios can also be used for data augmentation and algorithm training. In situations where real-world data in the target domain is limited, this supplements the data with samples demonstrating reasonable interactions among multiple traffic participants, road compliance, and smooth motion. Furthermore, it supports different verification stages, including software-in-the-loop, hardware-in-the-loop, and vehicle-in-the-loop, to assess collision risk, traffic compliance, ride comfort, and system robustness.
[0078] To verify the effectiveness of the method in this embodiment, the following experiments were conducted: The Boston traffic scene from the nuScenes dataset is used as the source domain, and the Singapore traffic scene is used as the target domain. The nuScenes training set includes 390 Boston traffic scenes and 310 Singapore traffic scenes, each lasting approximately 20 seconds. To verify the effectiveness of the proposed method with different data usage methods, the following training groups were set under a small sample adaptation setting for the target domain: S390 indicates that only 390 source domain traffic scenes are used to train the scene generation model; T20 indicates that only 20 target domain traffic scenes are used to train the scene generation model; S390+T20 indicates that 390 source domain traffic scenes and 20 target domain traffic scenes are directly mixed to train the scene generation model, but the cross-domain adaptive constraint proposed in this invention is not used. The proposed method means that, based on the source domain traffic scenes and a small number of target domain traffic scenes, it jointly employs maximum mean difference feature alignment, domain discriminative adversarial feature alignment, exponential moving average teacher-student consistency constraint, and guided backsampling based on scene constraint cost.
[0079] The model was uniformly evaluated on 73 Singapore traffic scenarios in the nuScenes validation set. These 73 Singapore traffic scenarios were not used in model training. Three different simulation starting points were selected for each validation scenario, resulting in a total of 219 evaluation starting points. During open-loop evaluation, a 2-second historical observation sequence and local map context were input at each evaluation starting point to generate five candidate samples of multi-agent joint future trajectories for the next 6 seconds. During closed-loop evaluation, the simulation time step was set to 0.1 seconds, and the model regenerated future trajectories at a frequency of 1 Hz and ran continuously for 6 seconds. Five closed-loop simulations were performed independently for each evaluation starting point, and the results of the five simulations at the same starting point were averaged before summing the results for all evaluation starting points.
[0080] In this embodiment, the Adam optimizer is used to train the domain adaptive conditional diffusion model. The initial learning rate is set to 0.001, the total number of training steps is set to 50,000, and the training batch size is set to 4. To avoid excessively strong cross-domain constraints in the early stages of training, which could interfere with the basic generation capability of the scene-level conditional diffusion backbone, the weights of the maximum mean difference feature alignment loss, the domain discriminative adversarial feature alignment loss, and the exponential moving average teacher-student consistency loss are set to zero in the early stages of training and are linearly increased to a preset upper limit after the warm-up phase.
[0081] Figure 3 This diagram illustrates the differences in traffic behavior distribution between the source and target domains. (a) shows the difference in speed distribution, and (b) shows the difference in modified time-to-collision (MTTC) distribution. Speed characterizes the basic motion state of traffic participants; modified time-to-collision (MTTC) characterizes the relative motion state between traffic participants and potential interaction risks. Figure 3 It is evident that there is a distributional shift between the source and target domains in terms of motion states and interactive behaviors of traffic participants, highlighting the necessity of cross-domain adaptive processing.
[0082] Figure 4 The graph shows the difference curves between the empirical cumulative distribution function (ECDF) generated by different methods in the embodiments and the true distribution of the target domain. (a) is the velocity distribution difference curve, and (b) is the corrected collision time distribution difference curve. The empirical cumulative distribution function is denoted as ECDF. For any training configuration... The difference between the empirical cumulative distribution function of the generated data and the real data in the target domain Represented as: in, Indicates the use of training configuration The empirical cumulative distribution function corresponding to the generated traffic behavior data, This represents the empirical cumulative distribution function corresponding to the real traffic behavior data in the target domain.
[0083] Figure 4 The horizontal axis represents the corrected collision time and speed, and the vertical axis represents the difference between the empirical cumulative distribution function of the generated data and the empirical cumulative distribution function of the target domain's real data. The dashed line represents the baseline where the difference is zero. The closer the overall difference curve is to the zero baseline, the more consistent the traffic behavior distribution generated by the corresponding method is with the real traffic behavior distribution in the target domain. Figure 4 It can be seen that, compared with the configurations of training only with source domain traffic scenes, training with only a small number of target domain traffic scenes, and training by directly mixing source and target domain traffic scenes, the velocity distribution difference curve and the corrected collision time distribution difference curve corresponding to the method of the present invention are closer to the zero baseline as a whole. This indicates that the traffic scene generated by the method of the present invention has a high degree of consistency with the real traffic scene in the target domain in terms of motion state distribution and traffic participant interaction distribution.
[0084] Figure 5 This is a comparison chart of the multi-agent trajectory generation results of different methods in the target domain closed-loop simulation in the embodiments of the present invention. Figure 5 Using the same initial traffic scenario in the target domain, we present the real trajectory in the target domain and the future trajectories of multi-agent vehicles generated with different training configurations. Here, GT represents the real trajectory in the target domain, S390 represents the generated result of the model trained only using the source domain traffic scenario, T20 represents the generated result of the model trained only using a small number of target domain traffic scenarios, and S390+T20 represents the generated result of the model trained by directly mixing source and target domain traffic scenarios. Figure 5 It can be seen that the multi-agent future trajectory generated by the method of the present invention can better maintain the original driving intention of traffic participants and remain consistent with the local road structure and the interaction between traffic participants.
[0085] Table 1 reports the comparison results of open-loop and closed-loop performance of the method of this invention under different training configurations in the cross-domain traffic scene generation task. The open-loop evaluation metrics in Table 1 include the minimum average displacement error (…). Minimum final displacement error ( Miss rate Jensen-Shannon divergence of velocity distribution ) and Jensen-Shannon divergence of acceleration distribution ( Closed-loop evaluation indicators include closed-loop average displacement error (); ), differences in the distribution of motion features of single agents ( ), differences in the distribution of relative motion characteristics ( ), closed-loop simulation failure rate ( ) and kinematic infeasibility rate ( ).
[0086] Table 1. Comparison of Open-Loop and Closed-Loop Performance in the Boston-Singapore Cross-Domain Transportation Scenario Generation Task in, This represents the minimum average displacement error among the five candidate future trajectories; This represents the minimum final displacement error among the five candidate future trajectories; This indicates the proportion of scenarios where none of the five candidate future trajectories meet the preset final displacement error threshold; and These represent the Jensen-Shannon divergence of the generated trajectory and the true trajectory in the target domain on the velocity and acceleration distributions, respectively. This represents the average displacement error between the generated trajectory and the true trajectory in the target domain during closed-loop simulation. The error in the single-vehicle motion distribution is determined by the mean Wasserstein distance between the generated scene and the real scene in the target domain in terms of velocity, acceleration, and jerk distribution. The smaller the value, the closer the single-vehicle motion behavior in the generated scene is to the real distribution in the target domain. The relative motion distribution error is determined by the average Wasserstein distance between the generated scene and the real scene in the target domain in terms of relative velocity, relative acceleration, and relative heading angle. The smaller the value, the closer the multi-agent interaction behavior of the generated scene is to the real distribution in the target domain. This represents the closed-loop simulation failure rate caused by collisions or leaving the drivable area. This indicates the kinematic infeasibility rate caused by the speed, acceleration, or turning state exceeding a preset kinematic threshold.
[0087] The smaller the value of the above evaluation index, the better the performance of the generated result in the corresponding aspect. The bold text in Table 1 represents the optimal result under the same data settings. As can be seen from the cross-domain results from Boston to Singapore in the nuScenes dataset in Table 1, the method of this invention... , , , and The values were 1.512, 3.687, 0.436, 0.165, and 0.078, respectively, achieving optimal results among the five listed open-loop evaluation indicators. In the closed-loop evaluation, the method of this invention... , and The values are 0.089, 0.072, and 0.047 respectively, all superior to other training configurations, indicating that the method of this invention can improve the consistency of motion feature distribution and multi-agent relative motion distribution in the generated scene during the closed-loop simulation of the target domain, and reduce failures such as collisions or leaving the drivable area. Under this data setting, the S390 configuration... and The values are 2.313 and 0.006, respectively, which are lower than the corresponding values of 2.446 and 0.014 for the method of this invention. This result shows that different evaluation indicators reflect different performance aspects of the generative model. The method of this invention mainly improves the consistency of target domain behavior distribution, relative interaction rationality, and closed-loop failure rate, while maintaining competitive closed-loop trajectory error and kinematic feasibility.
[0088] comprehensive Figures 3 to 5 As shown in Table 1, the method of this invention can utilize rich behavioral priors in the source domain traffic scene and alleviate the differences in high-level representation distribution between the source and target domains through a small number of target domain traffic scenes and cross-domain adaptive constraints. During the target domain inference process, the back-diffusion sampling process is guided by road compliance, collision safety, and motion smoothing costs, which helps improve the road consistency, interaction rationality, and motion feasibility of the generated trajectory. Therefore, the method of this invention is suitable for expanding the target domain traffic scene library, evaluating open-loop trajectory generation, and verifying closed-loop simulations of autonomous driving systems.
[0089] In summary, this method has the following characteristics: (1) Existing methods are easily affected by the differences in traffic behavior distribution between the source domain and the target domain and the insufficient sample size in the target domain when the source domain data is abundant but the target domain data is limited, resulting in the generated results being biased towards the source domain. This invention adopts maximum mean difference feature alignment, domain discriminative adversarial feature alignment and exponential moving average teacher-student consistency constraint in the high-level representation of the scene. While utilizing the prior of traffic behavior in the source domain, it reduces the difference in high-level representation between the source domain and the target domain, thereby improving the model's adaptability to traffic behavior in the target domain and reducing the risk of the generated results being overly biased towards the source domain under the condition of limited sample size in the target domain.
[0090] (2) Existing methods have difficulty simultaneously modeling changes in vehicle motion, interactions between traffic participants, road environment constraints, and uncertainties in future behavior when generating future trajectories for multiple traffic participants. This invention uses a scenario-level conditional diffusion backbone and a spatiotemporal Transformer to uniformly model the distribution of joint future behavior of multiple traffic participants through time-dependent modeling, multi-agent interaction modeling, and map constraint fusion. It also generates multiple candidate joint future trajectories starting from different initial Gaussian noise, thereby improving the consistency between the generated traffic scenario and the real traffic scenario in the target domain in terms of motion state distribution and traffic participant interaction distribution, while maintaining the diversity of future behavior generation.
[0091] (3) Existing methods may encounter problems such as trajectory deviating from the drivable area, collisions between traffic participants, and unsmooth motion changes during the diffusion generation process, which affect the executability of continuous simulation of the generated scene. This invention introduces scene constraint guidance in the back diffusion sampling process under target domain conditions, and performs gradient correction on the back sampling mean in the preset guided diffusion step based on road compliance cost, collision safety cost, and motion smoothing cost, thereby reducing the risks of road deviation, traffic conflict, and kinematic anomaly. This helps to improve the road compliance, collision safety, and motion continuity of the generated trajectory, and enhances the stability and executability of the generated scene in open-loop evaluation and closed-loop rolling simulation.
[0092] (4) Existing methods, under the condition of limited target domain samples, are prone to interference with the basic generation ability of the conditional diffusion model due to cross-domain adaptive constraints, and the high-level scene representation is also prone to fluctuations. This invention applies cross-domain adaptive constraints to the scene-level high-level representation and adopts exponential moving average teacher-student consistency constraints, so that the teacher branch receives the complete traffic participant interaction information view and the student branch receives the randomly degraded traffic participant interaction information view. At the same time, the feature consistency loss and the neighbor context reconstruction loss are combined for self-distillation. In the early stage of training, the loss weight corresponding to the cross-domain adaptive constraints is set to zero or a small value and then gradually increased to the preset upper limit, thereby reducing the interference of auxiliary cross-domain constraints on the learning of basic diffusion denoising ability and improving the training stability and high-level representation robustness under the condition of limited target domain samples.
[0093] (5) Existing methods usually focus on one-time future trajectory generation, which is difficult to apply to both offline scene construction and online interactive simulation at the same time. This invention can generate multi-agent joint trajectories in the future time domain based on the initial traffic scene, which can be used for target domain traffic scene library construction, offline trajectory evaluation and data augmentation. It can also repeatedly execute conditional back-diffusion sampling and roll generation of subsequent multi-agent joint trajectories based on the current observation state in the simulation process, thereby supporting open-loop scene generation and closed-loop rolling simulation at the same time, improving the reusability and engineering applicability of the generated test scenarios in different autonomous driving test processes.
[0094] Example 2 Based on Embodiment 1, this embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the cross-domain adaptive autonomous driving test scenario generation method as described in Embodiment 1.
[0095] like Figure 6 As shown, at the hardware level, this electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above. Figure 1 The method described herein. Of course, in addition to software implementation, this invention does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0096] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0097] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer 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, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0098] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for generating cross-domain adaptive autonomous driving test scenarios, characterized in that, Includes the following steps: Obtain source domain traffic scene datasets and target domain traffic scene datasets, where each traffic scene includes historical observation sequences, joint future trajectories, and local map context for multiple traffic participants; Conditional feature encoding is performed on the source domain traffic scene dataset and the target domain traffic scene dataset to obtain scene conditional representations; A scenario-level conditional diffusion process is constructed. The future joint motion representation corresponding to the joint future trajectory is positively diffused and denoised according to a preset noise schedule. The denoised future joint motion representation, the scenario condition representation, and the diffusion step are then embedded and input into the scenario-level conditional diffusion backbone. The spatiotemporal Transformer in the scene-level conditional diffusion backbone is used to perform conditional denoising on the input features to obtain a denoised future joint motion representation, and traffic participant-level high-level interaction features are extracted during the conditional denoising process. Based on the high-level interaction features of the traffic participants, cross-traffic participant aggregation is performed to obtain a scene-level representation; During training, the feature distribution between the source and target domains is subjected to cross-domain adaptive constraints based on the scene-level representation, and the scene-level conditional diffusion backbone is trained in conjunction with the diffusion denoising loss. During the inference process in the target domain, the backdiffusion sampling is performed starting from the initial noise, based on the historical observation sequence of the traffic scene in the target domain, the local map context, and the interaction relationship of traffic participants. The backdiffusion sampling process is guided and corrected based on the scene constraints. The future joint motion representation obtained after back-diffusion sampling is decoded to obtain multiple target domain multi-agent joint future trajectory samples, which are used to generate autonomous driving test scenarios.
2. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 1, characterized in that, For each traffic scene in the source domain traffic scene dataset and the target domain traffic scene dataset, there are multiple traffic participants' positions, heading angles and speeds in the historical observation time domain, as well as their positions and heading angles in the future generation time domain; The local map context includes at least one of the following: road geometry information, lane centerline information, drivable area information, and road topology information corresponding to the traffic scene; The number of samples in the source domain traffic scene dataset is greater than the number of samples in the target domain traffic scene dataset.
3. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 1, characterized in that, The conditional feature encoding process includes the following steps: The historical observation sequences of multiple traffic participants are normalized and time-series encoded to obtain the features of the historical observation sequences; The local map context is rasterized or vectorized to obtain local map context features; Interaction relationship features are constructed based on the relative positions, relative speeds, relative heading angles, and spatial adjacency relationships among traffic participants; The historical observation sequence features, local map context features, and interaction relationship features are fused to obtain a scene condition representation; The construction process of the interaction relationship features includes the following steps: A scene interaction graph is constructed using traffic participants as nodes, and the relative states between traffic participants are used as edge features. Filter adjacent traffic participants based on a preset interaction distance threshold; The node features and edge features corresponding to the selected adjacent traffic participants are input into the edge-aware interaction coding module to obtain interaction features that characterize the mutual influence relationship between traffic participants.
4. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 1, characterized in that, The process of constructing a scene-level conditional diffusion process and performing positive diffusion and noise addition on the future joint motion representation corresponding to the joint future trajectory according to a preset noise schedule includes the following steps: Representing the joint future trajectory of multiple traffic participants as a future joint motion representation ; Gaussian noise is gradually added to the future joint motion representation according to a preset noise scheduling coefficient, wherein the first... The forward diffusion process of each diffusion step satisfies: in, Given the first Noisy future joint motion representation of a diffusion step Under the conditions, the first Noisy future joint motion representation of a diffusion step The conditional probability distribution, i.e., the positive diffusion transition distribution; The mean is The covariance matrix is The multivariate Gaussian distribution in The probability density at that location; Indicates the first The preset noise scheduling coefficients corresponding to each diffusion step are used to control the intensity of Gaussian noise added in that diffusion step. Represents the identity matrix that matches the dimension of the future joint motion representation; Indicates the first The noisy future joint motion representation corresponding to each diffusion step; This represents the original future joint motion representation without diffusion and noise addition; Indicates the first The single-step signal retention coefficients corresponding to each diffusion step; Indicates from the first diffusion step to the second. The cumulative signal retention coefficient for each diffusion step; This is the discrete index of the current diffusion step. ,in The preset total number of diffusion steps; Indicates and They have the same dimension and follow a standard Gaussian distribution Random noise.
5. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 1, characterized in that, The spatiotemporal Transformer includes a time-dependent modeling module, a multi-agent interaction modeling module, and a map constraint fusion module. The time-dependent modeling module updates the motion latent representations of traffic participants along the future time domain. The multi-agent interaction modeling module updates the motion latent representations of different traffic participants based on their interaction relationships. The map constraint fusion module fuses road geometric constraints and road topological constraints from the local map context into the future motion latent representation. The spatiotemporal Transformer first performs temporal attention updates on the future motion latent representation of each traffic participant, then performs interaction attention updates based on the edge features between traffic participants, and injects local map context features into the updated future motion latent representation through map cross-attention. During the conditional denoising process, high-level interaction features at the traffic participant level are formed, and the denoised future joint motion representation is obtained from the scene-level conditional diffusion backbone.
6. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 1, characterized in that, The process of obtaining a scene-level representation based on the high-level interaction features at the traffic participant level extracted during the conditional denoising process includes the following steps: Extract the first... Implicit representation of a traffic participant in the future time domain And high-level interaction features at the traffic participant level are obtained through time pooling. ,in This indicates a time pooling operation to be performed along the future time domain; Cross-traffic participant aggregation is performed on high-level interaction features at multiple traffic participant levels to obtain a scene-level representation. ,in For cross-traffic participant aggregation operations, The cross-traffic participant aggregation includes at least one of average pooling, max pooling, and a combination of average pooling and max pooling, where the number of traffic participants is specified.
7. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 1, characterized in that, The process of applying cross-domain adaptive constraints to the feature distribution between the source and target domains based on the scene-level representation, and training the scene-level conditional diffusion backbone in conjunction with the diffusion denoising loss, includes the following steps: The diffusion denoising loss is calculated based on the denoised future joint motion representation obtained from the scenario-level conditional diffusion backbone prediction and the corresponding real future joint motion representation. ; The maximum mean difference feature alignment loss is calculated based on the source domain scene-level representation and the target domain scene-level representation. : In the formula, Indicates the first Each source domain scenario-level representation Indicates the first Target domain scenario-level representation , These represent the number of scene-level representations in the source domain and the number of scene-level representations in the target domain, respectively. For kernel functions; The domain discriminant adversarial feature alignment loss is calculated based on the domain label prediction results of the scene-level representation by the domain discriminator. The domain discriminative adversarial feature alignment loss is obtained by the domain discriminator based on the scene-level representation to identify the source domain label or the target domain label, and the scene-level representation tends to be domain indistinguishable by applying the reverse gradient to the scene-level conditional diffusion backbone during the backpropagation process through the gradient inversion layer. The exponential moving average teacher-student self-distillation loss is calculated based on the high-level features output by the teacher and student branches and the results of neighbor context reconstruction. ; Regarding the diffusion denoising loss Maximum mean difference feature alignment loss Domain-discriminative adversarial feature alignment loss Exponential moving average teacher-student autodistillation loss The total training loss is obtained by weighted combination, and the scenario-level conditional diffusion backbone is trained based on the total training loss.
8. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 7, characterized in that, The calculation process for the exponential moving average teacher-student autodistillation loss includes the following steps: Update the teacher branch parameters based on the student branch parameters according to the following formula: in, For student branch parameters, For teacher branch parameters, The exponential moving average decay coefficient; The teacher branch receives the complete view of traffic participant interaction information, while the student branch receives a randomly degraded view of traffic participant interaction information. Feature consistency loss is then calculated based on the high-level interaction features output by the teacher and student branches. The randomly degraded traffic participant interaction information view includes at least one of the following: randomly discarding some adjacent traffic participants, randomly masking some interaction edges, or randomly perturbing the interaction features of adjacent traffic participants. The neighbor context features are reconstructed from the high-level features of the student branch, and the neighbor context reconstruction loss is calculated based on the difference between the reconstructed neighbor context features and the neighbor context features corresponding to the complete interaction information view. ; Based on the aforementioned feature consistency loss and the neighbor context reconstruction loss The weighted exponential moving average teacher-student autodistillation loss is obtained. .
9. The method for generating cross-domain adaptive autonomous driving test scenarios according to claim 1, characterized in that, The target domain reasoning process includes the following steps: Multiple conditional backdiffusion samplings are performed starting from different initial Gaussian noises, and the scene constraint cost is reduced during the conditional backdiffusion sampling process. The backsampling process is guided and corrected for the objective, and the scenario constraint costs include road compliance costs, collision safety costs, and motion smoothing costs. In the pre-defined guided diffusion step of the back diffusion process, the corrected back sampling mean satisfy: in, The step size is used to control the magnitude of the correction of the scene constraint gradient to the current backsampled mean. This means that, without scene constraint guidance, the scene-level conditional diffusion backbone predicts the denoised future joint motion representation based on the current noisy future joint motion representation, diffusion step, and scene conditions, and calculates the back sample mean by combining the current noisy state and preset noise scheduling parameters according to the back diffusion posterior relationship. Represents the scenario constraint cost function Regarding the backsampled mean The gradient of represents the direction of local increase of the scene constraint cost relative to the backsampling mean; Decode the future joint motion representation obtained after conditional backdiffusion sampling to obtain multiple target domain multi-agent joint future trajectory samples; In the open-loop whole trajectory simulation scenario generation, the joint future trajectory of multiple agents in the future generation time domain is output at one time; In the closed-loop rolling trajectory simulation scenario generation, the back-diffusion sampling of the current observation state during the simulation process is repeatedly executed, and the multi-agent joint future trajectory for the next time period is rolled out.
10. An electronic device, characterized in that, It includes one or more processors, memory, and one or more programs stored in the memory, said one or more programs including instructions for performing the cross-domain adaptive autonomous driving test scenario generation method as described in any one of claims 1-9.
