A controllable generation method for real traffic scenarios based on control space residual diffusion networks
Patent Information
- Application Number
- CN202610763613.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-09-11
AI Technical Summary
真实道路测试成本高、风险大,而单纯回放已有场景又难以覆盖连续变化的危险程度
首先,本发明以真实交通场景库为上下文来源,保留真实地图、真实当前状态和真实交互几何,使目标难度控制建立在真实数据支持范围内,并提升高难度交互生成的上下文兼容性。其次,本发明在加速度和横摆角速度组成的控制空间中执行残差扩散,而不是直接扰动笛卡尔轨迹点,生成结果通过统一运动学积分得到,因而具有更清晰的物理含义和更强的动力学可控性。最后,本发明将目标引导、逐级约束优先选择和交通语义验证结合起来,使碰撞、地图、动力学和真实交通特征范围等不可补偿约束优先于目标难度误差,从而提高生成场景用于自动驾驶规划控制测试时的安全性、真实性和可解释性。
Smart Images

Figure CN122732227A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation and autonomous driving simulation testing technology, specifically a method for controllable generation of real traffic scenarios based on control space residual diffusion networks. Background Technology
[0002] With the rapid development of autonomous driving and intelligent transportation simulation technologies, traffic scenario generation for planning and control algorithms has become a crucial technology for ensuring the safety verification of autonomous vehicles. In real-world road traffic environments, autonomous vehicles need to simultaneously encounter traffic participants of varying numbers, speeds, and intentions. These participants are influenced by road topology, lane constraints, and mutual avoidance relationships, resulting in interactions of varying difficulty. Real-world road testing is costly and risky, while simply replaying existing scenarios struggles to cover continuously changing levels of danger. Traditional traffic scenario generation methods are mostly based on manual rules or existing log fragments, making it difficult to simultaneously achieve adjustable target difficulty and maintain traffic realism. This limits the coverage and credibility of generated scenarios in autonomous driving simulation testing.
[0003] Existing methods for generating traffic scenarios face the following challenges: First, while rule-based methods facilitate setting vehicle positions, speeds, and routes, rule setting relies on human experience, making it difficult to reproduce the complex interactions between real traffic participants. Second, log playback-based methods can preserve the features of real maps and trajectories, but can only reproduce existing fragments, making it difficult to generate new scenarios according to a given target difficulty. Furthermore, methods based on trajectory prediction or generation models typically directly generate future vehicle trajectories, lacking consideration of target difficulty, road conditions, and other factors. Figure 1 The unified constraints of consistency, dynamic effectiveness, realistic traffic characteristics, and realistic control distribution may lead to issues such as off-road driving, unreasonable motion, or artificially increased difficulty by abnormally approaching vehicles. These limitations make it difficult for existing technologies to simultaneously meet the requirements of scenario realism, controllable difficulty, and safety effectiveness when facing the complex, dynamic, and controllable difficulty of autonomous driving simulation testing. Summary of the Invention
[0004] To address the aforementioned technical issues, this invention establishes a real traffic scene library using real road driving data, converts the target difficulty coefficient input by the tester into the meaning of real traffic difficulty quantiles using scene difficulty calibration, determines the current state that can bear the target difficulty using context retrieval matching of target difficulty, generates future motion through a controllable spatial residual diffusion network, and ensures the authenticity of the generated results through hierarchical constraint priority selection and traffic semantic verification. This provides a controllable method for generating real traffic scenes based on a controllable spatial residual diffusion network.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for controllable generation of real traffic scenes based on a controllable spatial residual diffusion network, specifically including the following steps: S1. Extract local semantic maps, current states of traffic participants, and real future trajectories from real road driving data to construct a real traffic scenario library. Organize each traffic scenario into three parts: semantic map, current traffic state, and future trajectory. Establish masks for the existence of traffic participants, future validity, and map validity. S2. Based on traffic semantic features in real traffic data, such as minimum distance, collision time, number of conflicts, interaction density, required deceleration, relative speed, speed change, acceleration, rate of change of acceleration, yaw rate, curvature and number of traffic participants, a scene difficulty calibration method is established to convert the original traffic semantic features into continuous difficulty coefficients. S3. Based on the input target difficulty coefficient and optional scenario constraints, retrieve the current context with real data support from the real traffic scenario library, so that the retrieval results can support the target difficulty in terms of map topology, traffic density, spacing relationship and interaction geometry. S4. Construct a control space residual diffusion network. First, the encoder extracts map, current state and interaction context features. Then, the nominal control network predicts the acceleration and yaw rate control nodes. Subsequently, the residual diffusion network generates control residuals and obtains the future trajectory through kinematic integration. S5. During the inference phase, multiple generation candidates are sampled, and the target difficulty is guided for the candidates. A hierarchical constraint priority selection mechanism is adopted to prioritize collision, map, dynamics, real traffic feature range and real control distribution constraints over target difficulty error. S6. Perform traffic semantic controllable authenticity verification on the final candidates, calculate hard validity, pass rate of real traffic feature range, distribution sufficiency and target response score, and output the generated traffic scene set and its verification index.
[0006] As a preferred embodiment of the present invention, step S1 includes: S1.1. Read map polylines, road boundaries, traffic participant positions, speeds, headings, dimensions, and presence markers from real road driving data to form a unified traffic scene representation. ; S1.2, Using the current state of traffic participants Indicate, and based on the presence of markers Blocking invalid traffic participants; S1.3, Preserve the true future trajectory Used for training, difficulty statistics, and construction of real traffic feature range, the generation stage forms a new future interaction process based on the real current context.
[0007] As a preferred embodiment of the present invention, step S2 includes: S2.1. Perform directional consistency and standardization based on median and interquartile range on traffic semantic features of different dimensions and directions. The standardization method is as follows: The target difficulty coefficient The values are between zero and one. The directional coefficients corresponding to the minimum spacing and collision time are negative, while the directional coefficients corresponding to the number of conflicts and interaction density are positive.
[0008] S2.2 Integrate standardized features into the original difficulty value And based on a set of real reference scenarios experience sorting This makes the input target difficulty level higher. It has the meaning of the quantile of actual traffic difficulty.
[0009] As a preferred technical solution of the present invention, step S3 is used to determine the real current context capable of supporting the target difficulty before generation, avoiding the forced generation of high-difficulty interactions under maps or traffic density lacking real data support. The steps include: S3.1. The real traffic scene library constructed in S1 is indexed and organized, and each scene fragment in the scene library includes a semantic map. Current traffic conditions The true trajectory of the future Retrieving Embedded Vectors Difficulty level of key participants and overall difficulty level This is used for subsequent support calculation and context retrieval; S3.2, Based on the target difficulty coefficient Calculate local data support This ensures that search results fall primarily within the current context, where they are well supported by real data. S3.3, Based on search scoring Candidate current contexts are selected, and diversity sampling is used to avoid the search results being concentrated in the same scene fragment.
[0010] As a preferred embodiment of the present invention, step S4 includes: S4.1 Use a map encoder to process semantic map polylines, use a current state encoder to process the current state of traffic participants, and use an interaction graph encoder to aggregate the relative position and relative speed information between traffic participants to obtain the scene context features corresponding to each traffic participant. S4.2. Using scene context features as input, the output of the nominal control prediction network is... And obtained by reverse calculation of the real future trajectory Training residual diffusion networks to learn Distribution; S4.3 During inference, the residual control nodes are sampled first, then the residual control nodes are superimposed on the nominal control nodes, and the future trajectory is generated through kinematic integration.
[0011] As a preferred embodiment of the present invention, step S5 includes: S5.1 Calculate the target guiding energy for each of the multiple generated candidates. The guidance content includes target difficulty error, collision penalty, map boundary violation penalty, dynamics penalty and real control distribution deviation penalty. The real control distribution deviation penalty is used to limit the generated control nodes from the control node distribution calculated from the real future trajectory. S5.2 The candidate selection adopts a hierarchical constraint priority rule, first comparing collision violations, then comparing map violations, dynamic violations, violations of the actual traffic feature range, and deviations from the actual control distribution, and finally comparing the target ranking values. ; S5.3 When there are multiple candidates that satisfy the preceding constraints, the calibration difficulty coefficient is then used as the basis for further determination. Difficulty level of the target The final generated scene is determined by the errors between them, the deviation of the real control distribution, and the deviation of the local real support.
[0012] As a preferred embodiment of the present invention, step S6 includes: S6.1 Calculate collision validity, map validity, and dynamics validity. If any one of the three fails, the final candidate cannot be compensated by the hard validity score. S6.2 Calculate the control space calibration authenticity score at each target difficulty level. Based on comprehensive real traffic characteristics, including throughput, displacement distribution sufficiency, kinematic distribution sufficiency, and ground conditions... Figure 1 Sufficiency of uniformity distribution and sufficiency of interaction distribution; S6.3 Calculate the traffic semantic controllability authenticity score This approach ensures that the target response, target accuracy, and authenticity jointly determine the final evaluation result, allowing the evaluation result to simultaneously reflect both the difficulty response and the effectiveness of the scenario.
[0013] Compared with existing technologies, this invention provides a controllable generation method for real traffic scenes based on control space residual diffusion networks, which has the following beneficial effects: First, this invention uses a real traffic scenario library as its contextual source, preserving real maps, real current states, and real interaction geometry. This ensures that target difficulty control is within the range supported by real data and improves the contextual compatibility of generating high-difficulty interactions. Second, this invention performs residual diffusion in the control space composed of acceleration and yaw rate, rather than directly perturbing Cartesian trajectory points. The generated results are obtained through unified kinematic integration, thus possessing clearer physical meaning and stronger dynamic controllability. Finally, this invention combines target guidance, hierarchical constraint priority selection, and traffic semantic verification, prioritizing non-compensable constraints such as collision, map, dynamics, and the range of real traffic features over target difficulty errors. This improves the safety, realism, and interpretability of the generated scenarios when used for autonomous driving planning and control testing. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the process of the present invention; Figure 2 This is a schematic diagram of the control space residual diffusion network structure of the present invention; Figure 3 This is a schematic diagram illustrating the step-by-step constraint priority candidate selection and verification index calculation of the present invention.
[0015] Figure 4 The image shows the results of generating traffic scenarios under different target difficulty coefficients according to the present invention. Detailed Implementation
[0016] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0017] Please see Figure 1 This invention proposes a controllable generation method for real traffic scenarios based on a controllable space residual diffusion network, with a target difficulty coefficient. Taking scene constraints as input, this method first retrieves the current context with real data support from a real traffic scene database. Then, it uses a control spatial residual diffusion network to generate the future trajectories of multiple traffic participants. Finally, it outputs the final generated scene through hierarchical constraint priority selection and traffic semantic verification. This method uses a real map and the real current state as the generation context, and forms a new future interaction process by controlling spatial residual diffusion, so that the generated result maintains both real traffic semantic constraints and target difficulty response.
[0018] Through the above method, this invention can provide generated scenarios with continuously adjustable difficulty, verifiable hard effectiveness, and quantifiable traffic semantic authenticity in autonomous driving planning and control algorithm testing, specifically including the following steps: S1. Construct a database of real-world traffic scenarios, including: S1.1 Read semantic maps of each local scene from real road driving data. Current traffic conditions and the true future trajectory Each traffic scenario is defined as: In the formula, For traffic scenarios; For local semantic maps; This is the current traffic status set; For future trajectory set Local semantic map This includes road boundaries, lane centerlines, or map polylines; current traffic conditions. Includes the status of all valid traffic participants; future trajectories. This includes the real-world future states visible during the training phase; S1.2, for the first For each traffic participant, extract their local coordinates, velocity, acceleration, heading angle, yaw rate, vehicle dimensions, and presence markers to obtain: In the formula, The current state of traffic participants. Assign a positive integer number to each traffic participant. and The first The horizontal and vertical coordinates of each traffic participant in the local coordinate system; For speed, take a non-negative real number; It is longitudinal acceleration; For heading angle; This refers to the yaw rate; The vehicle length is a positive number. The width of the vehicle body is a positive number. This is a presence flag, with a value of either zero or one. A value of one indicates that the traffic participant exists, and a value of zero indicates that the traffic participant does not exist. When the value is zero, the traffic participant is masked in subsequent coding, loss, and evaluation; when... For a time, the traffic participant was involved in coding, loss assessment, and evaluation.
[0019] S1.3. Establish a future effective mask for future trajectories, establish a map point effective mask for map polylines, and establish an existence mask for traffic participants, so that the training and generation process can handle situations such as changes in the number of vehicles, insufficient trajectory length, and missing map points.
[0020] S2. Establish a scene difficulty calibration method, including: S2.1 The present invention selects traffic semantic features that can reflect traffic interaction pressure, including minimum future pairwise distance, minimum distance to key vehicles, approximate collision time, number of conflicts, interaction density, approximate required deceleration, maximum relative speed, average speed, maximum speed, average absolute acceleration, high quantile of absolute acceleration, rate of change of average absolute acceleration, average absolute yaw rate, curvature, number of traffic participants, and density of neighboring map polylines. S2.2 Perform direction unification and standardization based on median and interquartile range for each traffic semantic feature: In the formula, For the first A standardized difficulty feature; The traffic semantic feature is numbered, and its value ranges from one to... positive integers, The total number of traffic semantic features, rounded to a positive integer; For the first Traffic semantic features; This is the difficulty direction coefficient, with a value of either negative one or one. For the real reference scenario, the first The median of the directional uniformity features; For the real reference scenario, the first The interquartile range of the directional uniformity features is taken as a non-negative real number. To prevent positive numbers with a denominator of zero; if the smaller the characteristic value, the higher the difficulty, then... Take the negative one; if the larger the feature value, the higher the difficulty, then... Choose one.
[0021] S2.3, Integrating standardized features to obtain the original difficulty value: In the formula, For the scene The original difficulty value; The total number of traffic semantic features, rounded to a positive integer; For the first The fusion weights of the traffic semantic features are non-negative real numbers. To truncate the upper limit of the standardized features, take a positive number; This is a cutoff function with upper and lower bounds, limiting the output to negative values. to between.
[0022] S2.4, Based on a set of real-world reference scenarios Sort the original difficulty values and calculate the calibration difficulty coefficient: In the formula, For the scene The calibration difficulty coefficient ranges from zero to one. A collection of real-world reference scenarios; The number of real-world reference scenarios is a positive integer. This is a real-world reference scene number, with values ranging from one to... Positive integers; For the scene The original difficulty value; For the first A real-world reference scenario; This is an indicator function, meaning it takes the value one when the original difficulty value of the corresponding real-world reference scenario is not greater than the original difficulty value of the scenario to be evaluated, and zero when the original difficulty value of the corresponding real-world reference scenario is greater than the original difficulty value of the scenario to be evaluated; thus, we obtain... It is between zero and one, and the larger the value, the more difficult the scenario.
[0023] S3. Perform contextual retrieval matching the target difficulty, including: S3.1 To avoid applying the target difficulty independently of the current real context, this invention organizes the real traffic scene library constructed in S1 into... ,in, The number of scene segments, rounded to a positive integer; Number the scene segments; the true future trajectory It is used to calculate the retrieval labels, training targets, real traffic feature range, and real control distribution. The output is determined by the retrieval context and control space residual diffusion. S3.2, Regarding the target difficulty coefficient Calculate the local data support of the scene fragment to determine whether there are enough real samples in the vicinity of the current context to support the corresponding difficulty: In the formula, The target difficulty level is input, and its value is between zero and one. For the first The difficulty level of each scene segment is... The local data support is taken as a non-negative real number; The number of nearest neighbors, taken as a positive integer; Number the neighboring scene segments; For the first The nearest neighbor set of each scene fragment; For the first Retrieval embedding vectors of neighboring scene segments; For the first The overall difficulty level of each neighboring scene segment; The embedding distance bandwidth is a positive number; The distance bandwidth is a positive number; It is an exponential kernel function, where the output value is larger as the input value is closer to zero. It is used to convert embedding distance and difficulty distance into similarity weights. Take a non-negative real number when a scene fragment contains a real scene of similar difficulty to the target in the vicinity of the embedding space. Relatively large.
[0024] S3.3 Calculate the retrieval score: In the formula, For the first The search score for each scene segment; , , , and These are the key participant difficulty error weight, the overall scenario difficulty error weight, the local data support weight, the coverage weight, and the initial invalidity penalty weight, all of which are non-negative real numbers. For the first The coverage coefficient of each scene segment, with a value between zero and one; For the first The initial invalidity penalty value for each scene fragment is a non-negative real number; during retrieval, priority is given to selecting the real current context that has similar difficulty, high support, high coverage and valid initial state.
[0025] S4. Construct a control space residual diffusion network, such as Figure 2 As shown, it includes: S4.1 The retrieved semantic map and current traffic conditions Input the map encoder, current state encoder, and interaction graph encoder to obtain the contextual features of each traffic participant; S4.2 Compress the future control trajectory into sparse control nodes: In the formula, To control node numbering, use positive integers; For the first The traffic participants in the first Control vectors at each control node; For the first The traffic participants in the Longitudinal acceleration at each control node; For the first The traffic participants in the Yaw angular velocity at each control node; Traffic participants are numbered; control nodes are converted into control quantities for each future time step using linear interpolation; S4.3 Decode the control variable into a future state using kinematic integrals: In the formula, Use non-negative integers to number discrete-time events. The time interval between adjacent moments is a positive number. For the first Traffic participants Position vector at any given time; and The first Traffic participants Time and The velocity at each moment is taken as a non-negative real number; For the first Traffic participants The heading angle at any given moment; For the first Traffic participants Longitudinal acceleration at time t; For the first Traffic participants The yaw rate at any given moment; For the first Traffic participants Position vector at any given time; For the first Traffic participants The heading angle at any given moment; It is a function for maximizing the value; and These are cosine and sine functions, respectively; this integration process allows the generated trajectory to be controlled by acceleration and yaw rate, avoiding physical discontinuities caused by direct trajectory point disturbances. S4.4, Nominal control prediction network outputs the nominal control node: The meanings of the symbols in the formula are the same as in claim 6; the nominal control node is used to express a stable low-frequency future motion trend; S4.5 Construct residual control node training objectives based on the actual control nodes and nominal control nodes: In the formula, For the true residual control node tensor; To effectively control the mask, the mask elements are set to either zero or one. This is element-wise multiplication; The tensor of the real control node is obtained by back-calculation from the real future trajectory; the residual control node is used to represent the random changes and subtle differences in the real interaction. S4.6 The residual diffusion noise addition and denoising processes are as follows: In the formula, For the true residual control node tensor; To effectively control the mask, the mask elements are set to either zero or one. This is element-wise multiplication; The tensor of the real control node is obtained by inverse calculation from the real future trajectory; The noise tensor predicted by the denoising network; For parameters A residual diffusion denoising network is used; the denoising network learns the residual control distribution under the retrieval context and effective mask constraints.
[0026] S4.7 The following total training loss is used to train the control space residual diffusion network: The total training loss is: In the formula, Total training loss; To monitor losses for nominal control nodes; For kinematic decoding trajectory supervision loss; This is the loss for residual diffusion denoising. To control the loss from changes; , , and These are the weights for the four losses mentioned above, all taken as non-negative real numbers; where... The nominal control node is constrained to approximate the actual control node. Constrained kinematic decoding trajectories approximate real future trajectories. Constrained denoising networks predict residual noise. Constraints control the smoothness of changes; The residual diffusion denoising loss is: In the formula, To prevent positive numbers with a mask count of zero from being effectively controlled; It is a 2-norm; Norm 1; effective mask This ensures that non-traffic participants and invalid future nodes do not participate in the training.
[0027] S5. Prioritizing the selection of execution goals and hierarchical constraints, including: S5.1, In the inference phase, multiple generated candidates are sampled based on the retrieval context, and the first... One candidate target guided energy: In the formula, To generate candidate numbers, use positive integers; For the first One target guiding energy is generated for each candidate; For the first The differentiable approximation difficulty of generating candidate units, with values between zero and one; Penalty for collision; Penalties for exceeding map boundaries; As a dynamic penalty, all the above penalties are taken as non-negative real numbers; For the first A tensor for generating candidate control nodes; a deviation penalty from the real control distribution is used to measure the degree of deviation of the generated control nodes from the distribution of control nodes inversely calculated from the real scene; , , , and These are the weights for target error, collision penalty, map penalty, dynamics penalty, and deviation penalty from the actual control distribution, respectively, all of which are non-negative real numbers; The target difficulty level; For the nominal control node tensor; It is a L2 norm; this guiding energy brings candidates closer to the target difficulty while avoiding the trade-off of collisions, map out-of-bounds errors, or drastic dynamic changes for a smaller difficulty error; S5.2, such as Figure 3 As shown, the candidate selection adopts a hierarchical constraint priority rule: In the formula, The final candidate number; The amount of violation within the actual traffic characteristic range is taken as a non-negative real number. For the first The target ranking value of each generated candidate after satisfying the preceding constraints; This is a candidate selection operator for lexicographically minimizing based on the order of the violation quantities and sort values within the parentheses; For the first The calibration difficulty coefficient for each candidate is generated, with a value between zero and one; To represent the deviation from the local true support, a non-negative real number is used; , and The ranking weights for difficulty error, deviation from real control distribution, and deviation from local real support are all non-negative real numbers. The hierarchical constraint priority rule ensures that non-compensable constraints such as collision, map, dynamics, real traffic feature range, and real control distribution take precedence over the target difficulty error. Among candidates where all preceding constraints are satisfied or violated by the same amount, the target difficulty error and the deviation from real data support are then compared.
[0028] S6. Perform traffic semantic verification and output, including: S6.1, For the final generated traffic scene Calculate hard validity: In the formula, To ultimately generate a traffic scene; To ensure the hard validity of the final generated traffic scenario; , and These are collision validity, map validity, and dynamics validity, respectively. All of these validity variables take values of zero or one. When any hard validity component is zero, the final generated traffic scene cannot be rated as hard valid. S6.2 For each target difficulty level, calculate the control space calibration authenticity score: In the formula, Number the target difficulty level, and round it to a positive integer; For the first The control space calibration authenticity score for each target difficulty level ranges from zero to one. For the first The hard pass rate for each target difficulty level; The pass rate is the actual traffic characteristic range. For the sufficiency of displacement distribution; For the sufficiency of kinematic distribution; For the land Figure 1 Adequacy of uniform distribution; To ensure the sufficiency of the interactive distribution, the pass rate and sufficiency variables mentioned above all take values between zero and one; , , , and These are the fusion weights for the five scores mentioned above, all of which are non-negative real numbers; this score requires that the generated scenario maintains real data support in terms of hard validity, real traffic feature range, and distribution sufficiency under target conditions; S6.3 Calculate the traffic semantic controllability authenticity score: In the formula, The semantic controllability of traffic is scored, with values ranging from zero to one. Rate the response to the target difficulty; Accurately score the difficulty of the target; The minimum value of the control space calibration authenticity score for all target difficulty levels; The value is between zero and one. The larger the value, the better the generation method can simultaneously satisfy the target difficulty response, target difficulty accuracy, and traffic semantic authenticity.
[0029] S6.4 Output the final generated scenario as a data file containing a semantic map, current traffic status, generated future trajectory, control nodes, target difficulty coefficient, retrieval support, hard validity markers, and traffic semantic controllability realism score, for use in testing, stress assessment, and safety verification of autonomous driving planning and control algorithms.
[0030] Please see Figure 4 The four sub-graphs show the generated results when the target difficulty coefficients are 0.2, 0.4, 0.6, and 0.8, respectively. Figure 4 As can be seen, the difficulty coefficients corresponding to the generated results are 0.181, 0.401, 0.596 and 0.804, respectively, which are basically consistent with the target values. The minimum vehicle spacing gradually decreases from 19.60 meters to 3.65 meters, the number of vehicles and the overall interaction density increase, and closer traffic flow interaction appears in high-difficulty scenarios. The generated trajectory still maintains consistency with the road topology, indicating that the present invention can generate traffic scenarios from low interaction to high interaction according to the target difficulty.
[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controllable generation of realistic traffic scenes based on a control space residual diffusion network, characterized in that, Includes the following steps: S1. Extract semantic maps, current states of traffic participants, and real future trajectories from real road driving data to build a real traffic scenario library; S2. Extract traffic semantic features based on a real traffic scenario database, establish a scenario difficulty calibration method based on the traffic semantic features, and convert each real traffic scenario into a difficulty coefficient between zero and one. S3. Receive the target difficulty coefficient and scene constraints, and retrieve the real current context that matches the target difficulty based on difficulty proximity, local data support, scene coverage, and initial state validity. The difficulty proximity specifically refers to the error between the difficulty coefficients of key participants and the overall difficulty coefficient of the retrieved real current context and the target difficulty coefficient. S4. Construct a control space residual diffusion network, encode the retrieved semantic map and current traffic state into scene context, predict nominal control nodes, diffuse to generate residual control nodes, and generate future trajectories through kinematic integral decoding. S5. Prioritize the selection of candidate scenarios by guiding the target difficulty and imposing progressive constraints, so that the candidate scenarios first meet the constraints of collision, map, dynamics, real traffic feature range and real control distribution, and then determine the final candidates based on the target difficulty error. The generated candidates include future trajectories, control nodes, and differentiable approximation difficulty; S6. Perform traffic semantic controllability verification on the final candidate and output the generated scenario, control trajectory, validity label and controllability authenticity score.
2. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 1, characterized in that, The steps in S1 include: S1.1, Each traffic scenario is represented as: In the formula, For traffic scenarios; For local semantic maps; This is the current traffic status set; For the set of future trajectories; among them, and All are organized according to the effective traffic participant group; S1.2, regarding the first The current state of each traffic participant is represented uniformly as follows: In the formula, The current state of traffic participants. Number traffic participants; and The first The horizontal and vertical coordinates of each traffic participant in the local coordinate system; For speed; It is longitudinal acceleration; For heading angle; This refers to the yaw rate; This refers to the length of the vehicle body; This refers to the width of the vehicle body; Mark as present; S1.3 Generate masks for missing trajectories, invalid map points, and unavailable traffic participants, and incorporate real future trajectories into the training and difficulty calibration.
3. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 1, characterized in that, Step S2 includes: S2.1, Let the first... The traffic semantic features are The direction is made consistent and standardized based on the median and interquartile range, as shown in the following expression: In the formula, For the first A standardized difficulty feature; Number the traffic semantic features; This represents the total number of traffic semantic features; For the first Traffic semantic features; This represents the difficulty level coefficient. For the real reference scenario, the first The median of the directional uniformity features; For the real reference scenario, the first Interquartile spacing of directional uniformity features; To prevent positive numbers with a denominator of zero; S2.
2. Merge the standardized difficulty features into the original difficulty value, as shown in the following expression: In the formula, For the scene The original difficulty value; This represents the total number of traffic semantic features; For the first The fusion weights of traffic semantic features; Truncate the upper limit for standardized features; The function is used to truncate the upper and lower bounds. S2.3 Calculate the calibration difficulty coefficient based on the empirical distribution of real reference scenarios, as shown in the following expression: In the formula, For the scene The calibration difficulty coefficient; A collection of real-world reference scenarios; The number of actual reference scenarios; Number the actual reference scene; For the scene The original difficulty value; For the first A real-world reference scenario; This is an indicator function. It takes the value of 1 when the original difficulty value of the corresponding real reference scene is not greater than the original difficulty value of the scene to be evaluated, and takes the value of 0 when the original difficulty value of the corresponding real reference scene is greater than the original difficulty value of the scene to be evaluated.
4. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 1, characterized in that, The steps in S3 include: S3.1 To ensure that the target difficulty retrieval is based on the real current context and supported by real data, the real traffic scenario database constructed in S1 is indexed and organized, resulting in: In the formula, A database of real-world traffic scenarios; The number of scene segments; Number the scene segments; For the first Semantic maps of scene fragments; For the first The current traffic status of each scene segment; For the first The true future trajectory of each scene fragment; For the first Retrieval embedding vectors for each scene fragment; For the first The difficulty level of key participants in each scene segment; For the first The overall difficulty level of each scene segment; S3.2, Based on the target difficulty coefficient Calculate the first The local data support of a scene fragment is expressed as follows: In the formula, The input is the target difficulty level; For the first The difficulty level of each scene segment is... Local data support; Number of nearest neighbors; Number the neighboring scene segments; For the first The nearest neighbor set of each scene fragment; For the first Retrieval embedding vectors of neighboring scene segments; For the first The overall difficulty level of each neighboring scene segment; For embedding distance bandwidth; Difficulty distance bandwidth; It is an exponential kernel function, where the output value is larger as the input value is closer to zero. It is used to convert embedding distance and difficulty distance into similarity weights. S3.3 Calculate the retrieval score and select the highest-scoring true current context, as shown in the following expression: In the formula, For the first The search score for each scene segment; , , , and These are the key participant difficulty error weight, the overall scenario difficulty error weight, the local data support weight, the coverage weight, and the initial invalidity penalty weight; For the first Coverage coefficient of each scene segment; For the first The initial invalidation penalty value for each scene segment.
5. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 1, characterized in that, The steps in S4 include: S4.
1. Represent the future control trajectory as sparse control nodes, as follows: In the formula, To control node numbering; For the first The traffic participants in the first Control vectors at each control node; For the first The traffic participants in the first Longitudinal acceleration at each control node; For the first The traffic participants in the first Yaw angular velocity at each control node; Number traffic participants; S4.2 Obtain the time-by-time control quantity through time interpolation, and decode the future trajectory according to the following kinematic integral, the expression of which is as follows: In the formula, Numbering for discrete time; The time interval between adjacent moments; For the first Traffic participants Position vector at any given time; and The first Traffic participants Time and The speed of time; For the first Traffic participants The heading angle at any given moment; For the first Traffic participants Longitudinal acceleration at time t; For the first Traffic participants The yaw rate at any given moment; For the first Traffic participants Position vector at any given time; For the first Traffic participants The heading angle at any given moment; It is a function for maximizing the value; and These are the cosine and sine functions, respectively.
6. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 5, characterized in that, The control space residual diffusion network comprises three parts: nominal control node prediction, residual control node diffusion, and kinematic decoding. The nominal control node is predicted in the following way: In the formula, For the nominal control node tensor; For parameters The nominal control prediction network; The semantic map obtained from the retrieval; The current traffic status obtained from the retrieval; The training objective of the residual control node is: In the formula, For the true residual control node tensor; To effectively control the mask, the mask elements are set to either zero or one. This is element-wise multiplication; The tensor of the real control node is obtained by inverse calculation from the real future trajectory; In the At each diffusion level, the noise addition process at the residual control node is as follows: In the formula, Numbering of diffusion levels; For the first Noisy residual control node tensors at each diffusion level; For the first The cumulative retention coefficient of each diffusion level is greater than zero and not greater than one. For standard random noise tensors; The noise predicted by the denoising network is: In the formula, The noise tensor predicted by the denoising network; For parameters The residual diffusion denoising network.
7. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 6, characterized in that, The expression for the training loss of the control space residual diffusion network is: In the formula, Total training loss; To monitor losses for nominal control nodes; For kinematic decoding trajectory supervision loss; This is the loss for residual diffusion denoising. To control the loss from changes; , , and These are the weights of four losses: nominal control node supervision loss, kinematic decoding trajectory supervision loss, residual diffusion denoising loss, and control change smoothing loss. The residual diffusion denoising loss is: In the formula, To prevent positive numbers with a mask count of zero from being effectively controlled; It is a 2-norm; It is a norm.
8. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 1, characterized in that, The steps in S5 include: S5.1, regarding the first One candidate generation establishes the target guiding energy: In the formula, To generate candidate numbers; For the first One target guiding energy is generated for each candidate; For the first The difficulty of generating differentiable approximations of each candidate; Penalty for collision; Penalties for exceeding map boundaries; As a dynamic penalty; For the first A tensor for generating candidate control nodes; a deviation penalty from the real control distribution is used to measure the degree of deviation of the generated control nodes from the distribution of control nodes inversely calculated from the real scene; , , , and These are the weights for target error, collision penalty, map penalty, dynamics penalty, and deviation penalty from the actual control distribution, respectively. The target difficulty level; For the nominal control node tensor; It is a 2-norm; S5.2 Select the final candidate according to the hierarchical constraint priority rule: In the formula, The final candidate number; The amount of violation is within the range of actual traffic characteristics; For the first The target ranking value of each generated candidate after satisfying the preceding constraints; This is a candidate selection operator for lexicographically minimizing based on the order of the violation quantities and sort values within the parentheses; The target sort value is: In the formula, For the first The calibration difficulty coefficient for each candidate is generated, with a value between zero and one; This represents the deviation from the local true support level. , and The ranking weights are the difficulty error, the deviation of the true control distribution, and the deviation of the local true support, respectively, and are all non-negative real numbers.
9. The method for controllable generation of real traffic scenes based on control space residual diffusion networks according to claim 1, characterized in that, Step S6 includes: S6.1 Calculate the hard validity of the final candidates, as shown in the following expression: In the formula, To ultimately generate a traffic scene; To ensure the hard validity of the final generated traffic scenario; , and These are collision effectiveness, map effectiveness, and dynamics effectiveness, respectively. S6.2, in the The control space calibration authenticity score is calculated at each target difficulty level, as shown in the following expression: In the formula, Number the target difficulty level; For the first The control space calibration authenticity score for each target difficulty level; For the first The hard pass rate for each target difficulty level; The pass rate is based on the actual traffic characteristics. For the sufficiency of displacement distribution; For the sufficiency of kinematic distribution; For map consistency and distribution sufficiency; For the sufficiency of interactive distribution; , , , and The weights are the combined scores of five factors: pass rate of real traffic feature range, sufficiency of displacement distribution, sufficiency of kinematic distribution, sufficiency of map consistency distribution, and sufficiency of interaction distribution. S6.3 Calculate the traffic semantic controllability authenticity score, as shown in the following expression: In the formula, Scoring the controllability and authenticity of traffic semantics; Rate the response to the target difficulty; Accurately score the difficulty of the target; The minimum value of the control space calibration authenticity score across all target difficulty levels.