A risk-controllable scene generation method based on multi-agent interaction
Patent Information
- Application Number
- CN202611230011.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本发明的目的在于提供一种基于多智能体交互预测的风险可控场景生成、物理约束筛选与导出验证方法及系统,以解决风险条件不能有效控制关键智能体轨迹、生成轨迹难以保证动力学可执行性、物理无效候选参与综合评分以及生成结果无法稳定导入仿真平台的问题
[0023]与现有技术相比,本发明能够使风险条件重点作用于历史高风险智能体对,将多模态预测结果转化为完整候选场景,并在综合排序前剔除物理无效候选;通过区分近失碰与非物理穿透以及执行标准化导出和回放验证,提高场景的风险可控性、物理有效性和工程可复现性。
Smart Images

Figure CN123013291A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent transportation and autonomous driving simulation testing technology, specifically involving a method for generating risk-controllable scenarios based on multi-agent interaction prediction, combined with historical risk proxy, differentiated injection of target risk conditions, multimodal trajectory generation, physical constraint screening, and standardized export verification. Background Technology
[0002] The training and testing of autonomous driving systems require a large number of high-risk, long-tail, reproducible, and physically reliable traffic scenarios. Existing rule-based methods have limited combinatorial space; purely generative methods are prone to dynamic discontinuities and exceeding kinematic limits; multi-agent trajectory prediction methods usually aim to predict the most likely future, making it difficult to actively control the future trajectory distribution according to the target risk level, target risk score, and target conflict type.
[0003] Existing methods still have the following shortcomings: risk conditions are difficult to effectively change the trajectory distribution of key agents; multimodal prediction results may have discontinuous starting points, kinematic indices exceeding limits, crossing boundaries, reverse driving, or vehicle penetration; physically invalid candidates may be output due to high soft scores; and the criteria for judging model training, candidate evaluation, standardized export, and simulation playback are not consistent.
[0004] Therefore, it is necessary to construct a closed-loop technical solution consisting of key risk vehicle pair identification, target risk condition injection, multimodal trajectory generation, physical repair and hard filtering, effective candidate re-ranking, and standardized export verification. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for generating risk-controllable scenarios, screening physical constraints, and deriving verification based on multi-agent interaction prediction, in order to solve the problems that risk conditions cannot effectively control the trajectories of key agents, the generated trajectories are difficult to guarantee dynamic executability, invalid physical candidates are included in the comprehensive scoring, and the generated results cannot be stably imported into the simulation platform.
[0006] The risk-controllable scenario generation method based on multi-agent interaction in this invention includes the following: acquiring historical trajectory data of multiple agents in a traffic scenario and constructing a multi-agent spatiotemporal interaction graph; calculating the historical risk proxy vector of each agent pair based on the historical trajectory data, and selecting the agent pair with the highest historical proxy risk score as the historical high-risk agent pair; encoding the target risk level, target risk score, and target conflict type into a scenario-level risk condition vector, and injecting the risk conditions into a multi-agent multimodal trajectory prediction model in a manner where the condition weight of the historical high-risk agent pair is higher than the condition weights of other agents; and then, through interactive encoding and... Conditional decoding is performed to output the multimodal future trajectories, modal probabilities, and trajectory uncertainty parameters of each agent. Candidate modality combinations are generated based on the multimodal future trajectories. Physical projection repair, scene risk assessment, physical validity determination, and target alignment calculation are performed on the candidate future trajectories corresponding to each candidate modality combination. Only in the physically valid candidate set are the candidates reordered according to risk score, feasibility score, authenticity score, target alignment, and conflict type matching results to obtain target scene candidates. The target scene candidates are exported as standardized dynamic scene files and road network files, and XML validity verification and trajectory playback kinematic verification are performed.
[0007] Furthermore, the historical risk proxy vector includes at least five-dimensional risk components obtained by normalizing the historical minimum collision time, deceleration demand rate, relative velocity, Euclidean distance, and lateral motion.
[0008] Furthermore, the historical high-risk agent pairs are obtained by weighted aggregation of the historical risk agent vectors of each agent pair to obtain historical agent risk scores, and the agent pair with the largest historical agent risk score is selected.
[0009] Furthermore, the risk condition encoding includes at least one of semantic condition encoding and proxy condition encoding; wherein the semantic condition encoding includes at least risk level embedding, conflict type embedding and target risk score projection result, and the proxy condition encoding is used to map the target risk score to a continuous risk vector consistent with the historical risk proxy space.
[0010] Furthermore, the injection of risk conditions into the multi-agent multimodal trajectory prediction model includes one or more of the following: injecting modal bias into the modality selection layer, injecting hidden state offset into the initial hidden state of the decoder, and performing FiLM modulation on the features during the decoding stage.
[0011] Furthermore, the multi-agent multimodal trajectory prediction model includes a time-varying graph interactive encoder and a conditional multimodal decoder; the time-varying graph interactive encoder is used to fuse historical time-series relationships and multi-agent interaction relationships, and the conditional multimodal decoder is used to output multiple future trajectory modes, corresponding mode probabilities, and trajectory covariance parameters.
[0012] Furthermore, it also includes constructing a scenario-level risk head, performing graph-level pooling on the encoding end features, decoding end features, and modal probabilities to predict scenario-level risk vectors and scenario-level risk scores, and using the scenario-level risk vectors and scenario-level risk scores for training supervision and candidate evaluation.
[0013] Furthermore, the multi-agent multimodal trajectory prediction model employs a multi-objective joint loss function during the training phase. The multi-objective joint loss function includes at least two or more of the following: trajectory loss, risk supervision loss, risk alignment loss, order constraint loss, trajectory separation loss, and physical effectiveness loss.
[0014] Furthermore, the generation of the candidate modality combination includes: determining the basic modality combination, expanding the top-k modality replacement combination around the high-risk agent pair, and sampling according to the temperature-reweighted modality probability to expand the exploration range of high-risk scenario candidates.
[0015] Furthermore, the physical projection repair includes: calculating the desired velocity based on the position, velocity, and acceleration of the previous moment, and limiting the desired velocity; calculating the desired acceleration based on the limited velocity, and limiting the desired acceleration; applying impact constraints based on the acceleration increments of adjacent moments; and recursively obtaining the repaired trajectory that satisfies the constraints of velocity, acceleration, and impact thresholds.
[0016] Furthermore, the physical validity determination includes at least one or more of the following constraints: boundary crossing constraint, reverse travel constraint, heading continuity constraint, speed upper limit constraint, acceleration upper limit constraint, impact upper limit constraint, starting position continuity constraint, starting speed jump constraint, and collision or dangerous gap constraint between intelligent agents.
[0017] Furthermore, the scenario risk assessment obtains a scenario risk score by normalizing and weighting one or more of the following: collision probability, near-miss risk, minimum distance, minimum collision time, deceleration demand rate, post-intrusion time, total exposure time, and total intrusion time.
[0018] Furthermore, the reordering is performed by first hard filtering and then sorting; when a candidate scene does not meet the physical validity judgment, the candidate scene is directly removed from the candidate set; when there are physically valid candidate scenes, only the candidate scene with the best score among the physically valid candidate scenes is selected as the output.
[0019] Furthermore, the standardized dynamic scene file is an OpenSCENARIO file, and the road network file is an OpenDRIVE file; the export verification includes XML structure validity verification, speed verification, acceleration verification, impact verification, and multi-vehicle spacing verification in trajectory playback.
[0020] This invention also discloses a risk-controllable scenario generation, physical constraint screening, and export verification system based on multi-agent interaction prediction, comprising: a data preprocessing and label enhancement module, a historical risk proxy extraction module, a conditional encoding module, a multi-agent interaction encoding module, a risk conditional decoding module, a risk vector and risk score prediction module, a multi-objective joint training module, a candidate modality combination generation module, a scenario risk assessment and re-ranking module, a physical projection repair and physical validity filtering module, and a standardized export and replay verification module; wherein, each module collaboratively executes the aforementioned method.
[0021] The present invention also discloses an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the aforementioned method.
[0022] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the method described in any one of claims 1 to 13.
[0023] Compared with existing technologies, this invention enables risk conditions to focus on historically high-risk agent pairs, transforms multimodal prediction results into complete candidate scenarios, and eliminates physically invalid candidates before comprehensive ranking. By distinguishing between near-collision and non-physical penetration and performing standardized derivation and replay verification, it improves the risk controllability, physical validity, and engineering reproducibility of the scenario. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating the risk-controllable scenario generation method based on multi-agent interaction in an embodiment of the present invention.
[0025] Figure 2 This is a schematic diagram of the module composition of the scene generation system in an embodiment of the present invention.
[0026] Figure 3 This is a schematic diagram illustrating the construction of scene input and local traffic scene representation in an embodiment of the present invention.
[0027] Figure 4 This is a flowchart illustrating the extraction process of historical risk agents and high-risk intelligent agents in an embodiment of the present invention. Detailed Implementation
[0028] like Figure 1 As shown, the risk controllable scenario generation method based on multi-agent interaction in this embodiment includes the following steps in the actual execution order: input data, spatiotemporal interaction graph construction, historical risk agent calculation and historical high-risk agent pair identification (1) to (4); target risk condition encoding, differential condition injection and multi-agent multimodal trajectory generation and modal probability estimation (5) to (11); candidate modal combination construction, physical projection repair and hard filtering (12) and (13); only physically valid candidates are aligned with risk, feasibility, authenticity, target risk level and target risk score and conflict type matching, and comprehensive re-sorting is performed (14); the optimal candidate is exported as OpenSCENARIO and OpenDRIVE files (15), and file structure legality and kinematic playback verification are performed (16).
[0029] The core technical concepts of this method include: identifying key interaction pairs based on historical risk proxies and implementing differentiated condition injection; constructing candidate modality combinations around key interaction pairs; performing physical projection and physical validity hard filtering before comprehensive scoring; aligning target risks and comprehensively re-ranking only valid candidates; and performing standardized export and replay verification on the final results.
[0030] During the training phase, this method can also construct scenario-level risk supervision labels using future real trajectories, and jointly train a multi-agent multimodal trajectory prediction model using two or more of the following: trajectory loss, risk supervision loss, risk alignment loss, sequence constraint loss, trajectory separation loss, and physical effectiveness loss. This allows the model to simultaneously learn trajectory authenticity, risk condition controllability, and physical executability.
[0031] This example also discloses the corresponding scene generation system, electronic device, and computer-readable storage medium. For example... Figure 2 As shown, the system includes a data preprocessing module, an interactive trajectory prediction module, and a constraint repair and post-processing module. The modules and accompanying labels are as follows: Figure 2 Maintain consistency and work collaboratively in the order described above.
[0032] The invention is described below in the order of model training, scene generation, physical screening, and standardized verification. The parameters, thresholds, network structures, and weights mentioned are all feasible examples. To improve the readability of the symbols, this example uniformly uses bold lowercase letters to represent vectors, bold uppercase letters to represent matrices, and regular italic letters to represent scalars; i, j, p, q represent agent indices, t represents time steps, m represents trajectory modality indices, and n represents training sample indices; superscript h or hist represents historical observations, superscript f represents future stage quantities, superscript gt represents supervision quantities calculated from real future trajectories, and superscripts des, rep, and replay represent expected quantities, physical repair quantities, and replay verification quantities, respectively. Specialized variables in each formula are explained upon their first appearance.
[0033] Overall process
[0034] like Figure 1 As shown, in this example, the scene generation phase after model training is completed is executed in the following order:
[0035] First, by inputting data (1), historical trajectory data and road map information of multiple agents are obtained, and spatiotemporal interaction graph construction (2), historical risk agent vector calculation (3), and historical high-risk agent pair identification (4) are executed in sequence.
[0036] Second, perform proxy coding (5) on the target risk score, form semantic labels (6) for the target risk level and target conflict type, and perform risk label coding (7) together with the target risk score. The resulting risk conditions are then input into the multi-agent interaction trajectory generation network (9) after being injected with differentiated conditions (8).
[0037] Third, multiple future trajectory modes and trajectory uncertainty parameters are output through candidate future trajectory prediction (10), and the corresponding mode probabilities are obtained through mode probability estimation (11), and a multi-agent candidate mode combination is constructed.
[0038] Fourth, perform physical projection repair (12), calculate kinematic indicators, road matching indicators and agent interaction indicators, and remove physically invalid candidates through hard filtering (13);
[0039] Fifth, calculate the scenario risk score, feasibility score, authenticity score, target risk level consistency score, target risk score alignment and conflict type matching results only for physically valid candidates, and perform comprehensive re-ranking (14).
[0040] Sixth, perform OpenSCENARIO standardization generation (15) to form the corresponding OpenDRIVE road network file, and verify the legality of the file structure and kinematic playback (16).
[0041] Model training phase
[0042] Historical trajectory data input and local traffic scene representation (spatiotemporal interaction graph) construction as follows Figure 3 As shown, a local interactive window containing the target vehicle and its neighboring traffic participants is first extracted from the raw traffic data. The input data includes at least historical location, historical speed, historical acceleration, yaw angle, vehicle size, lane markings, and road geometry information. Each traffic participant in the local window constitutes a graph node; when two agents are at time... The spatial distance is no greater than the interaction radius. At this point, an interaction edge is established between the two. An undirected interaction edge can be expanded into two directed edges in opposite directions during message passing. Thus:
[0043]
[0044] in, Representing historical moments The corresponding multi-agent spatiotemporal interaction diagram; Indicates by A set of nodes composed of intelligent agents; Indicates time The set of interactive edges; and Indexes representing different intelligent agents; and Representing intelligent agents respectively and intelligent agents At a historical moment Two-dimensional position; superscript Indicates a historical observation phase; Represents the L2 norm; This represents the distance threshold for establishing interactive edges. This threshold is preferably determined based on the "maximum effective proximity distance within the prediction time domain," i.e., it satisfies...
[0045]
[0046] in, This represents the 95th percentile of the relative velocity magnitude in the training data; Represents the time domain for future predictions; This represents the buffer distance used to cover the effects of vehicle length, positioning error, and road curvature. In one embodiment, the future prediction time domain is approximately 5 seconds. Approximately 8 m / s Take 10m, and thus obtain The reason for using 50m is that this distance can cover vehicles that may directly interact within the prediction time domain, while avoiding connecting all vehicles that are far away and will not cause conflicts in the short term, which would result in an overly dense graph structure. For low-speed intersections or longer prediction time domains, the above relationship can be recalculated, instead of being fixed at 50m.
[0047] No. The node input features of an agent can be represented as:
[0048]
[0049] in, Represents intelligent agents At a historical moment Node characteristics; and These represent historical velocity and historical acceleration, respectively. Indicates the historical yaw angle; Indicates vector concatenation; using and To avoid yaw angle at and The values in the vicinity are discontinuous.
[0050] Edge features can be represented as:
[0051]
[0052] in, Indicates that by intelligent agents Pointing to intelligent agents Edge features; and These represent the relative position vector and the relative velocity vector, respectively. Represents the Euclidean distance between two agents; This represents the relative yaw angle. The node and edge features mentioned above can be added or removed based on the available fields in the dataset.
[0053] Historical risk proxy calculation and historical high-risk intelligent agent identification, such as Figure 4 As shown, agents within a local interaction window are paired up, and the collision time proxy, deceleration required to avoid collision, approach velocity along the relative position direction, Euclidean distance, and lateral motion are calculated for each agent at the end of the historical observation. These metrics are then normalized into a five-dimensional historical risk proxy vector. For any agent pair, the relative position vector and relative velocity vector at the end of the historical observation are defined as follows:
[0054]
[0055] in, Indicates the length of historical observations. and Representing intelligent agents respectively Position and velocity at the end of historical observations; Indicates from the intelligent agent Pointing to intelligent agents The relative position vector; Represents intelligent agents Compared to intelligent agents The relative velocity vector. Both relative position and relative velocity use the same coordinate system.
[0056] The collision time proxy at the end of historical observation is defined as:
[0057]
[0058] in, Indicates the agent's... Collision time proxy at the end of historical observation, in seconds; This represents the dot product of the relative position vector and the relative velocity vector; when the relative velocity is non-zero and the two vehicles are approaching each other, it is calculated according to the above formula; otherwise, it is taken as... This indicates that there is no finite approach-collision time under the current motion trend. The smaller the value, the closer the collision approaches.
[0059] To ensure that DRAC in the historical and future phases adopts a consistent physical meaning, we first define the approach velocity along the line connecting the two agents at the last moment of the historical observation:
[0060]
[0061] in, Indicates the agent's... The approach velocity at the last moment of historical observation, in meters per second; the value is positive when two agents are approaching each other, and 0 when they are moving away from each other or when there is no effective approach trend; is the numerical stability constant.
[0062] The deceleration required to avoid a collision is defined as follows:
[0063]
[0064] in, This indicates that, given the current approach speed and remaining distance, to avoid the agent from... The magnitude of the deceleration required for a collision to occur, expressed in meters per second squared. Represents the Euclidean distance at the last moment of historical observation; This represents a safety gap reserved when calculating DRAC. It applies when the two agents are not in close proximity. .
[0065] The Euclidean distance at the last moment of historical observation is defined as:
[0066]
[0067] in, Represents intelligent agents and intelligent agents The Euclidean distance between the center points at the last moment of historical observation; This represents the number of historical observation time steps. The velocity scalar in historical risk proxy uniformly adopts the aforementioned approach velocity. This avoids misjudging motion states that are only in different directions but not approaching each other as high-risk.
[0068] Lateral motion is defined as:
[0069]
[0070] in, Indicates the agent's... The lateral movement within the historical observation period; and These represent the lateral coordinates of the two agents in the Frenet coordinate system of the road or the local coordinate system of the lane, respectively; subscript 1 and These represent the start and end times of the historical observation, respectively.
[0071] To uniformly map historical risk indicators with different dimensions and value ranges to the [0,1] interval, a positively centered Sigmoid mapping is used for indicators whose larger original values indicate higher risk:
[0072]
[0073] For indicators where smaller original values indicate higher risk, a reverse-centered Sigmoid mapping is used:
[0074]
[0075] Where 'a' represents the original risk index to be normalized, which can be a collision time proxy, the deceleration required to avoid a collision, the approach velocity along the relative position direction, the Euclidean distance, or the lateral motion; τ represents the risk center threshold corresponding to the corresponding original risk index, and its dimension is the same as 'a'. When 'a=τ', the mapping result is 0.5; κ>0 represents the slope parameter of the curve corresponding to the corresponding original risk index. The dimension of κ is the reciprocal of the dimension of the corresponding original risk index. The larger κ is, the steeper the change of the risk value near the threshold.
[0076] To ensure the interpretability of κ determination, a range width corresponding to the change in risk mapping value from 0.2 to 0.8 is set for each original risk indicator. And determine κ according to the following formula:
[0077]
[0078] in, With the same dimensions as the corresponding original risk indicators, the collision time proxy and Euclidean distance are mapped using a reverse-centered Sigmoid mapping; the deceleration, approach velocity, and lateral motion required to avoid a collision are mapped using a forward-centered Sigmoid mapping. Thus, τ is used to determine the central location of the transition from the normal state to the clearly risky state, and κ is used to determine the steepness of the risk transition.
[0079] Based on the aforementioned forward-centered Sigmoid mapping and reverse-centered Sigmoid mapping, the agent's historical collision time proxy, historical collision avoidance deceleration, historical approach velocity, historical Euclidean distance, and historical lateral motion for pairs i and j are normalized respectively, and a historical risk proxy vector is constructed:
[0080]
[0081] in, This represents the five-dimensional historical risk proxy vector of agents i and j during the historical observation phase; the subscripts i and j represent the indices of the two agents constituting the agent pair; the superscript hist indicates that the corresponding variable is calculated from the historical observation data. This indicates that the historical risk proxy vector comprises five risk components, each with a value between 0 and 1. These five components represent, in order, historical TTC risk, historical DRAC risk, historical approach velocity risk, historical distance risk, and historical lateral movement risk. In one embodiment, , , Approach speed, Euclidean spacing and The risk center thresholds for lateral movement were set at 1.5s, 3.0m / s², 4.0m / s, 12.0m, and 0.6m, with corresponding curve slope parameters of 2.5, 1.0, 0.55, 0.25, and 2.0. These values were used to establish a coordinated risk scale: an approach speed of 4.0m / s could shorten the distance by approximately 12m within 3s; the TTC center threshold of 1.5s was used to highlight situations with greater time urgency; and lateral movement was used to supplement the identification of lane changes, cut-ins, and merging trends.
[0082] For different road types, sampling frequencies or vehicle categories, the above-mentioned risk center threshold and curve slope parameters can be recalibrated according to the quantile of the training data and the discrimination result of the validation set risk.
[0083] The historical proxy risk score is defined as:
[0084]
[0085] wherein, represents the historical proxy risk score for agent pair i, j; represents the weight vector of the historical risk proxy, each component of which corresponds to historical TTC risk, historical DRAC risk, historical approach speed risk, historical spacing risk and historical lateral motion risk one by one, and all weights are non-negative numbers with a sum of 1.
[0086] The above weights comprehensively consider the risk identification effect of each indicator: TTC and DRAC characterize conflict urgency and collision avoidance intensity respectively, and Euclidean spacing, approach speed and lateral motion are used to supplement and characterize spatial margin, risk development trend and lateral behavior. Under the constraint that the weights are non-negative and sum to 1, calibration can be performed according to the risk sample discrimination degree, future risk ranking consistency and high-risk agent pair identification result, and recalibration can be carried out for different road types, traffic densities, sampling frequencies or vehicle categories.
[0087] According to the historical proxy risk score of each agent pair, a historical high-risk agent pair is determined from all distinct agent pairs in the scenario, and the historical risk proxy vector corresponding to this agent pair is taken as the basic continuous control agent in the training phase:
[0088]
[0089] wherein, represents the index of the independent variable that maximizes the objective function, represents the agent pair proxy risk score; "i<j" means that the comparison is only performed among agent pairs with two distinct indices arranged in a preset order, which is used to exclude the pairing of an agent with itself and avoid repeated calculation of agent pair (i,j) and (j,i); the historical proxy risk score represented by the subscript ij and superscript hist of s is calculated in the aforementioned manner; (i*,j*) represents the agent pair with the largest historical proxy risk score among all distinct agent pairs, which is used to determine the key action object of the risk condition.
[0090] The construction of the future real risk supervision label is only implemented in the model training phase, and the future real trajectory is used to construct the risk supervision label. For any agent pair in the future phase , the relative position vector and relative velocity vector at the future time step are respectively defined as:
[0091]
[0092] in, and Indicates the agent index; Indicates a future time step; superscript Indicates a future stage; and Representing intelligent agents respectively Two-dimensional position and two-dimensional velocity.
[0093] Future Time Step The collision time proxy is defined as:
[0094] ,
[0095] in, It represents the time required to reach the closest approach state while maintaining the current relative motion trend, in seconds; positive infinity is taken when the two agents are not in a approaching state.
[0096] The approach velocity along the relative position direction is defined as:
[0097] ,
[0098] in, This represents the approach speed of two intelligent agents along the line connecting them, expressed in meters per second; it is taken as 0 when they move away from each other.
[0099] The future vehicle envelope spacing will be defined as:
[0100] ,
[0101] in, and Two-dimensional vehicle envelopes representing the two intelligent agents respectively; This represents the shortest boundary distance between envelopes; when envelopes touch or overlap, this distance is set to 0, and the overlap state is recorded through an independent collision identifier.
[0102] The deceleration required to avoid a collision in the future is defined as:
[0103] ,
[0104] in, Indicates future time steps To avoid intelligent agents from The magnitude of the deceleration required for a collision to occur, expressed in meters per second squared. This indicates a safety clearance is being reserved; when not in a close proximity state. .
[0105] The statistical measure in the future prediction time domain is defined as:
[0106]
[0107]
[0108]
[0109] in, This represents the number of future prediction time steps; the three terms represent the future minimum TTC, the future maximum DRAC, and the future minimum vehicle envelope spacing, respectively.
[0110] Define the risk time step set:
[0111]
[0112] The average approach velocity during the risk period is defined as:
[0113] ,
[0114] in, Indicates the TTC risk exposure threshold; This represents the near-collision gap threshold; using the average value during the risk period can reduce the impact of noise at a single time step.
[0115] Total exposure time (TET) and total invasive intensity integral (TIT) are defined as follows:
[0116]
[0117]
[0118] in, Indicates characteristic functions; This indicates the sampling time interval; TET reflects the duration of the risk state, while TIT reflects both the degree and duration of intrusion below a threshold. In one embodiment, Used from earlier than the center of the emergency conflict The stage begins to accumulate risk exposure.
[0119] To ensure consistency in the risk head output dimensions, the total exposure time (TET) and the total invasiveness integral (TIT) are combined into a time-exposure risk component:
[0120] ,
[0121] in, Indicates the time exposure risk component calculated from the future actual trajectory; superscript This indicates that the variable is generated from the actual future trajectory; This represents the total duration of the future prediction time domain. The first term represents the proportion of the risk state duration to the entire future prediction time domain, and the second term represents the time integral proportion of the normalized risk intrusion intensity; both coefficients are taken as... , indicating that in this embodiment, the risk persistence and the severity of intrusion are evaluated equally.
[0122] Therefore, the intelligent agent The future real five-dimensional risk vector is defined as:
[0123]
[0124] in, Indicates the agent's... The future real five-dimensional risk vector; Indicates the minimum time for a future collision; This represents the maximum deceleration required to avoid a collision in the future. This indicates the average approach speed during the risk period; Indicates the minimum future vehicle envelope spacing; Indicates the time-exposure risk component; The inverse normalization function indicates that the smaller the original value, the higher the risk. A positive normalization function that indicates a higher risk as the original value increases; Indicates the agent's... The representative near-miss gap threshold; This represents the slope parameter of the minimum distance risk mapping. In one embodiment, the agent... The representative near-miss gap threshold is defined as:
[0125] ,
[0126] in, This indicates the near-miss clearance of the foundation under low-speed or stationary conditions; This represents the time margin that increases with approach speed. This setting causes the near-collision clearance threshold to increase with approach speed, rather than applying the same fixed distance for different road speed conditions. In one embodiment, the TTC risk mapping center is taken as... DRAC Risk Mapping Center The average approach velocity mapping center during the risk period is taken The parameters mentioned above are used to maintain a consistent risk scale across historical risk agents, future supervisory labels, and candidate risk assessments. For different road types, sampling frequencies, and vehicle categories, these parameters can be recalibrated based on training data quantiles, the discriminative power between risk samples and regular samples, and the consistency of risk ranking on the validation set.
[0127] For any intelligent agent in the future stage The agent's future real risk score is calculated based on its future real five-dimensional risk vector:
[0128]
[0129] in, Indicates the agent's... The future real risk score; This represents the future true five-dimensional risk vector of the agent pair; This represents a non-negative weight vector corresponding one-to-one with each of the five risk components; superscript This represents the vector transpose; each risk weight satisfies:
[0130] ,
[0131] in, Indicates the first The weights corresponding to each risk component.
[0132] Among all future agent pairs, the scenario-wide most dangerous agent pair is defined as:
[0133] ,
[0134] in, This represents the pair of agents that have the highest future real risk score within the future prediction time domain. Indicates the combination of indices that maximizes the objective function; subscript This indicates that the intelligent agent is obtained through a scenario-wide risk comparison and is used to compare it with historically high-risk intelligent agents determined based on historical risk proxies. Distinguish between them.
[0135] The scenario's global maximum risk vector and scenario's global maximum risk score are defined as follows:
[0136]
[0137]
[0138] in, This represents the vector of true future risks determined by the most dangerous agent in the scenario. This represents the corresponding future real-world risk score. Both are used to describe the maximum risk state that will occur in the future real-world scenario and are recorded as data diagnostic metrics.
[0139] In one embodiment, the risk weight vector is:
[0140] ,
[0141] The five weights correspond, in order, to the minimum future collision time, the maximum deceleration required to avoid a collision, the average approach speed during the risk period, the minimum future vehicle envelope distance, and the time exposure risk component. The collision time weight is... This is used to highlight the urgency of the risk; the weight of the minimum vehicle envelope spacing in the future is taken as... This reflects the actual spatial margin achieved by the future trajectory; the deceleration weight required to avoid collisions is taken as... This is used to reflect the intensity of collision avoidance maneuvers; the average approach speed weight during the risk period is taken as... Used to characterize the speed of risk development; the weight of the time-exposure risk component is taken as... This is used to supplement the description of the persistence and invasiveness of the risk status. All weights should be non-negative and their sum should be 0. It can be recalibrated based on the accuracy of risk level classification, the correlation of risk ranking, or the results of validation set identification.
[0142] To ensure that the primary target of the target risk condition is consistent with the primary supervised object during model training, the primary supervised label of the risk head is defined as the historical high-risk agent pair. Risk vector and risk score on the future real trajectory:
[0143]
[0144]
[0145] in, This refers to historically high-risk agent pairs determined based on historical risk proxies. This represents the five-dimensional risk vector of the historically high-risk agent on its future real trajectory; This represents the historically high-risk agent's true risk score for the future stage; The meaning and value range are the same as those of the aforementioned risk weight vector.
[0146] During model training, scenario-level risk heads are used. and As the primary supervisory label, it ensures that the agent object whose risk condition has a significant impact is consistent with the computational object of the risk supervisory label. The aforementioned scenario's global maximum risk vector... and the scenario's global maximum risk score It serves only as a data diagnostic metric to determine whether historically high-risk agents will continue to dominate future risk evolution; it does not directly participate in the calculation of the primary supervisory loss for the risk head. When established, it indicates that the high-risk agent pair identified in the historical stage is inconsistent with the most dangerous agent pair in the future stage, and this sample can be used as a risk-dominant object transfer sample record.
[0147] Target risk condition coding as follows Figure 1 As shown in the semantic tagging, proxy encoding, and condition injection stages, the target risk condition is represented as follows:
[0148]
[0149] in For the target risk level, For target conflict type, The target risk score is used. The target conflict type adopts a uniform set of categories, including following conflict, lane changing conflict, cutting conflict, merging conflict, intersection conflict, oncoming conflict, and other conflicts.
[0150] Semantic conditional coding is defined as:
[0151]
[0152] in and These are risk level embedding and conflict type embedding, respectively. A mapping network to project the target risk scalar onto a preset dimension.
[0153] Deterministic surrogate conditional coding is defined as:
[0154]
[0155] in, A continuous control agent representing target risk; five components are used to control TTC, DRAC, approach speed, spacing, and lateral movement trend in sequence; This represents the target risk score entered by the test taker; each This is the component adjustment coefficient. In one embodiment, it can be taken as... Critical risk Other levels are assigned a value of 0.80, under high risk or critical risk. Other levels are set to 0.65, under lane change, cut-in, or merge conflicts. Other conflicts are set to 0.35. The above values are only used to ensure that each control component changes monotonically with the target risk.
[0156] The The first component belongs to the control condition space, and its fifth component represents the lateral movement trend. The aforementioned future true risk vector belongs to the supervised risk space, and its fifth component represents the time exposure. Although the two have the same dimension, the meanings of their components are not entirely the same. Instead of directly equating them component by component, their correspondence is learned through a conditional fusion network, a trajectory generation model, and a risk head.
[0157] When semantic conditions and proxy conditions are used simultaneously, the scenario-level risk condition vector is explicitly represented as:
[0158]
[0159] in For conditional fusion networks; when using only one type of encoding, It is obtained by projecting the corresponding code through a linear layer or a multilayer perceptron.
[0160] Multi-agent interaction coding and differential condition injection, such as Figure 1 As shown in the multi-agent interactive trajectory generation network, the time-varying graph interactive encoder processes historical inputs in chronological order, as represented by:
[0161]
[0162] in, Represents intelligent agents At a historical moment The encoded hidden state; This represents an interactive encoder consisting of a loop unit and graph message passing; Represents the input features of the node; Indicates the hidden state of the previous historical moment; Indicates time With intelligent agents A set of connected neighbors; Represents the corresponding edge feature set; It can be set to a zero vector or obtained by mapping from the initial state. After encoding, the basic modality logit is:
[0163] ,
[0164] in, Represents intelligent agents The base modality logit vector prior to risk condition injection; This represents a linear or multilayer perceptron that maps the encoded features at the end of the historical time step to the modal logit. This represents the number of trajectory modes for each agent; This indicates that the vector contains Each real number component.
[0165] To ensure that risk conditions preferentially apply to historically high-risk agent pairs, the agent is defined. The original conditional weights are:
[0166]
[0167] The normalized conditional weights are defined as follows:
[0168] ,
[0169] in, This represents the number of agents in the scene; after normalization, the average conditional weight of each scene is 1, thereby reducing the impact of changes in the number of agents on the injection scale.
[0170] In one embodiment, This is used to highlight key agents while preserving the interactive responses of other agents.
[0171] Acting on intelligent agents Risk condition memory features are defined as:
[0172]
[0173] in, Represents a conditional feature mapping network; Represents a scenario-level risk condition vector; It is used for subsequent decoding input, initial hidden state offset, and FiLM modulation.
[0174] The first layer of conditional injection is modal bias. Scene-level modal bias and conditional modal logit are respectively:
[0175]
[0176] in, This represents the modal bias vector generated by scenario-level risk conditions; Represents a modal bias mapping network; Represents intelligent agents Conditionalized modal logit; Indicates modal bias gain; Represents intelligent agents Normalized conditional weights.
[0177] The corresponding modal probabilities are:
[0178] ,
[0179] in, Represents intelligent agents Select mode The probability of; express The One component; Represents the traversal modality index in the denominator of the Softmax function; the probability satisfies and .
[0180] The second-layer conditional injection is the initial hidden state offset of the decoder:
[0181]
[0182] in For hidden state mapping networks, This is the hidden state gain. For modality Learnable embeddings are used to clarify that different modalities have different initial decoding states.
[0183] The third-layer conditional injection is FiLM modulation:
[0184]
[0185] in, This represents the FiLM parameter generation network; and They represent the actions of the intelligent agent. The scaling and offset vectors generated by the conditional weights and scenario-level risk conditions have dimensions consistent with the dimensions of the decoding features to be modulated.
[0186]
[0187] in, Indicates the decoding stage Individual agent, time Modal Intermediate features; This indicates the characteristics after FiLM modulation; Represents a vector consisting entirely of 1s; The conditional modulation gain can be represented by a preset constant or a trainable parameter. Used to limit the scaling range; This represents element-wise multiplication; Representation layer normalization.
[0188] The aforementioned differential injection is used to make the target risk conditions focus on influencing the modality selection and future motion state of historically high-risk agent pairs.
[0189] In the conditional multimodal decoding, uncertainty propagation, and scenario-level risk head section, the decoder performs autoregressive updates for each agent and each trajectory mode in future time sequence. The decoder input is defined as:
[0190]
[0191] in, , and These represent the agent index, future time step index, and trajectory modality index, respectively. This represents the contextual features obtained from historical encoded memory attention; This indicates the memory characteristics of the risk conditions defined above; Indicates modal embedding; This represents the motion state characteristics of the previous future time step; the semicolon indicates vector concatenation.
[0192] The hidden state is updated according to the following formula:
[0193] ,
[0194] in, Indicates future time steps With intelligent agents A set of neighbors with interactive relationships; the decoding module first aggregates the previous hidden state and interaction features of the neighbor agents, and then updates the current hidden state through a gated loop unit.
[0195] The initial decoding hidden state is defined as follows:
[0196]
[0197] in, The encoded hidden state at the last moment of historical observation; This represents the initial state mapping network.
[0198] In the embodiment employing a single-integral kinematics model, the agent's two-dimensional motion state is defined as a two-dimensional position, and the two-dimensional kinematic input output by the decoder is interpreted as a velocity vector:
[0199]
[0200] in, Represents intelligent agents In the future time step Trajectory Mode The two-dimensional kinematic input is output by the decoder; in this embodiment, It is interpreted as a two-dimensional velocity vector; This indicates that the decoded hidden state is mapped to a linear or multilayer perceptron with two-dimensional velocity. This indicates that the velocity vector contains components in two coordinate directions.
[0201] To limit the predicted velocity from exceeding the allowable upper velocity limit, velocity limiting is applied to the kinematic input:
[0202]
[0203]
[0204] in, This represents the velocity vector after amplitude limiting; This indicates the upper limit of the permissible speed; Represents the L2 norm; This represents the numerical stability constant to prevent the denominator from becoming zero. This limiting method applies when the speed does not exceed... Maintaining the original speed, when the speed exceeds While maintaining the direction unchanged, it is scaled to the upper limit of the velocity.
[0205] The single-integral motion state and its recursive relationship are defined as follows:
[0206]
[0207]
[0208] in, Represents the two-dimensional state of a single-integral kinematic model, and is equivalent to the agent. In the future time step Trajectory Mode The two-dimensional position below ; Indicates the position of the next future time step; This represents the time interval between adjacent prediction time steps.
[0209] The initial position of the decoder recursion is defined as: ,in, Represents intelligent agents The position at the last time step of the historical observation phase; all trajectory modes use the same historical end position as the prediction starting point to ensure that the predicted trajectory is continuous with the historical trajectory in position.
[0210] To characterize the uncertainty of the kinematic input, the model outputs a two-dimensional effective velocity-noise covariance matrix for each agent, future time step, and trajectory mode:
[0211] ,
[0212] in, and These represent the standard deviations of velocity noise in the two coordinate directions, respectively. The correlation coefficient is represented; the unconstrained parameters of the model output are transformed by the following formula:
[0213]
[0214] In this context, the omitted subscripts are all related to... Consistent; This is used to prevent the standard deviation from being 0. This results in a symmetric positive semidefinite covariance matrix.
[0215] The position state covariance is recursively derived using first-order linearization:
[0216]
[0217] in, Indicates the positional state covariance; and Let represent the Jacobian matrices of the state transition function with respect to the current position and the effective velocity noise, respectively. For the aforementioned single-integral kinematic model, under the local linear approximation, we can take:
[0218]
[0219] initial covariance The settings can be adjusted based on the measurement error of the last historical position; when the last historical position is considered a fixed value, a zero matrix can be used.
[0220] To construct a scenario-level risk head, graph-level pooling (Pool) is performed on encoded features, decoded features, and modal probabilities, which is insensitive to the arrangement of agents.
[0221] Historical encoding scene features are defined as follows:
[0222] ,
[0223] For each agent, the modality-probability-weighted future decoded mean feature is used:
[0224]
[0225]
[0226] in, Represents intelligent agents Modal probabilities; using probability weighting can reduce the interference of extremely low probability modes on scene representation.
[0227] intelligent agent The highest probability modality index and scene decoding final state features are defined as follows:
[0228]
[0229]
[0230] The modal probability vector and scene modal probability features are defined as follows:
[0231]
[0232] in .
[0233] Pooling can employ mean pooling, max pooling, attention pooling, or a combination thereof; when using attention pooling, the conditional weights of historically high-risk agent pairs can be used as attention priors.
[0234] The context vector of a scenario-level risk header is defined as:
[0235]
[0236] in, This represents a scenario-level risk context vector obtained by concatenating scenario encoding features, scenario decoding mean features, scenario decoding final state features, and scenario modal probability features. This indicates vector concatenation.
[0237] The key agent for scenario-level risk head prediction defines the risk vector as follows:
[0238]
[0239] in, This represents a scenario-level risk head that predicts a five-dimensional risk vector for the current historical high-risk agent; its five components correspond to the following in order: the risk of the minimum collision time in the future, the risk of the maximum deceleration required to avoid a collision in the future, the risk of the average approach speed during the risk period, the risk of the minimum vehicle envelope distance in the future, and the risk of time exposure. Indicates the output dimension is Risk head mapping network; Used to limit each risk component to a range Inside; symbol This represents the model's prediction, used to distinguish it from the true supervision label defined above.
[0240] The key agent for scenario-level risk head prediction defines the risk score as follows:
[0241]
[0242] in, This represents the risk score of the key agent pair in scenario-level risk head prediction; This represents a non-negative weight vector corresponding one-to-one with the five risk components, and its definition and value range are consistent with those mentioned above; superscript This represents the transpose of a vector. During model training... and Each is defined as
[0029] and correspond.
[0243] The scenario-level risk head is used for risk vector supervision, risk score supervision, risk condition alignment, and risk order constraints during the model training phase. The five-dimensional risk vector output by the risk head corresponds to future TTC, DRAC, average approach speed during the risk period, minimum vehicle envelope distance, and time exposure, and is used to learn the control effect of risk conditions on the future motion of historical high-risk agents.
[0244] The candidate evaluation explicitly calculates the eight-dimensional risk component based on the complete trajectory, without replacing the candidate scenario risk score with the risk head output; the five-dimensional risk head is used for training supervision, and the eight-dimensional risk component is used for candidate evaluation.
[0245] To achieve multi-objective joint training, a multi-objective joint loss function is used during the training phase:
[0246]
[0247] in, This represents the joint loss of multiple objectives during the training phase; Indicates multimodal trajectory loss; This indicates the key intelligent agent's monitoring of risk and losses; Indicates risk condition alignment loss; Indicates risk order constraint loss; This represents the trajectory separation loss between high-risk and low-risk conditions; This represents the loss of physical effectiveness. λ traj , λ risk , λ align , λ order , λ div and λ valid These represent the non-negative weight coefficients of the corresponding loss terms, used to adjust the contribution of each loss term to the multi-objective joint loss; the weight coefficients corresponding to unenabled loss terms are set to 0. In one embodiment, λ traj Set the weight to 1, and calibrate the remaining weight coefficients based on the validation set trajectory error, risk controllability, and physical efficiency.
[0248] For training samples Middle intelligence agent The There are several trajectory modes, and the trajectory regression error is defined as...
[0249]
[0250] in, Indicates the training sample index; Indicates sample The agent index in the data; Represents the trajectory modal index; Indicates a future time step index; Indicates sample The maximum effective prediction length; Indicates sample Middle intelligence agent In the future time step Trajectory Mode The predicted location below; Indicates the corresponding future actual location; This indicates whether the agent has a valid true trajectory at this future time step; The robust regression loss applied to the two-dimensional position error can be represented as the sum of Huber losses in each coordinate direction; To prevent numerical stability constants with a denominator of 0.
[0251] make Indicates sample Middle intelligence agent The trajectory mode with the smallest regression error Given a set of modal indices, the evolutionary winner-take-all loss is defined as:
[0252] ,
[0253] in, This indicates that the agent with the smallest regression error is retained. The evolutionary winner-take-all loss is obtained by averaging the values of each modality. Indicates the number of samples in the training batch; Indicates sample The number of effective intelligent agents participating in trajectory supervision; ; This represents the number of trajectory modes for each agent; The amount can be gradually reduced during training. This approach involves first retaining multiple feasible modes and then gradually enhancing the specialization among different modes; in a simplified embodiment, a fixed value can also be selected. .
[0254] The negative log-likelihood loss of a multimodal trajectory distribution is defined as:
[0255] ,
[0256] in, This represents the negative log-likelihood loss; Indicates sample Middle intelligence agent Select trajectory mode The probability, and satisfying ; This represents the mean of the Gaussian distribution and is consistent with the predicted location of the corresponding mode; The positive definite covariance matrix of the future position probability distribution can be obtained from the position state covariance recursively. Add the lower bound of minimum covariance get; The mean is Covariance is The two-dimensional Gaussian probability density; This is used to ensure that the covariance matrix is positive definite. In actual calculations, logarithmic summation and exponential operations can be used to improve numerical stability.
[0257] The trajectory training loss employs a smooth transition between evolutionary winner-take-all loss and negative log-likelihood loss:
[0258]
[0259] in, This represents the trajectory training loss in the current training round. The negative log-likelihood loss represents the multimodal trajectory distribution; This indicates the number of preferred modes retained in the current training round, which can be fixed at 1 or gradually decreased as training progresses; This indicates the proportion of the evolutionary winner-takes-all loss in the current training round. (Using...) Instead This is used to avoid confusion with the aforementioned joint loss weighting coefficients.
[0260] The mixing ratio can be varied according to the following formula:
[0261] ,
[0262] in, Indicates the current training round; This indicates the training epoch at which the evolutionary winner-takes-all loss begins to smoothly transition to the negative log-likelihood loss, and satisfies... ; Indicates the total number of training rounds; This represents the cosine function. When... At that time, the model primarily learns to generate trajectory modes that can be distinguished from each other; thereafter Gradually reduce the model size, and at the end of training, make the model focus on fitting the probability distribution and location uncertainty of each modality.
[0263] Risk monitoring of losses simultaneously constrains the predicted risk vector and predicted risk score of key agent pairs:
[0264]
[0265] in, and These represent the predicted risk vector and predicted risk score defined in
[0044] , respectively; and These respectively represent the real supervision labels defined above; This represents the internal weights of the risk score monitoring.
[0266] The basic continuous control condition adopts the historical risk proxy defined above:
[0267]
[0268] Low-risk and high-risk conditions are defined as follows:
[0269]
[0270] in, ; This represents a five-dimensional vector of all ones; all operations are element-wise. Therefore, it satisfies... When changing the intensity of continuous risks, the target conflict type should remain unchanged to avoid confusion between changes in risk intensity and changes in conflict semantics.
[0271] make Indicates continuous control conditions The predicted risk score is output from the risk head. Since the fifth component of the control agent and the fifth component of the future supervisory risk vector have different meanings, conditional alignment is not used. Perform component-by-component equivalence, while using the scalar risk caliber of historical control agents:
[0272] ,
[0273] in, Indicates continuous control conditions The predicted risk score is output by the risk head. Represents a five-dimensional continuous control condition vector; This represents the future risk weight vector defined above; Indicates continuous control conditions The corresponding scalar control risk score; This represents the historical risk proxy weight vector defined above; superscript This represents the transpose of a vector.
[0274] Risk condition alignment loss is defined as
[0275] ,
[0276] in, Indicates risk condition alignment loss; and These represent the low-risk continuous control conditions and high-risk continuous control conditions defined in
[0050] , respectively; Indicates the use of calculation and The smoothed L1 loss function for the difference between them.
[0277] definition:
[0278]
[0279] in, , and These represent the predicted risk scores output by the risk head under low-risk continuous control conditions, basic continuous control conditions, and high-risk continuous control conditions, respectively. This represents the basic continuous control condition defined above; therefore, the risk sequence constraint loss is defined as:
[0280] ,
[0281] in, Indicates risk order constraint on loss, Indicates taking Larger values than 0 This represents the minimum interval that must be maintained between the prediction scores of adjacent risk conditions.
[0282] To avoid false trajectory differences caused solely by mode switching when high-risk and low-risk conditions switch to completely different trajectory modes, the trajectory separation loss uses a mode index that is determined under the basic conditions and remains unchanged across different risk conditions.
[0283] During the training phase, samples Middle intelligence agent The selected modal index is defined as:
[0284] ,
[0285] in, Indicates sample Middle intelligence agent The trajectory mode index with the smallest regression error under basic risk conditions; Indicates the training sample index; Indicates the agent index; Represents the trajectory modal index; This represents the number of trajectory modes for each agent; This represents the trajectory regression error defined in the entire text; This represents the mode index that minimizes the trajectory regression error. This index remains consistent across forward computations under low-risk, basic-risk, and high-risk conditions. Using the mode with the minimum regression error as the sole selection rule during the training phase avoids the uncertainty in implementation caused by simply choosing "minimum regression error or maximum probability."
[0286] make Indicates sample The historically high-risk agent pairs correspond to the key agent set, making The key agent represents the set of future time steps used to evaluate the differences in risk condition trajectories. The average separation distance between high-risk and low-risk trajectories is defined as:
[0287] ,
[0288] in, Indicates sample The key intelligent agent set in; and Indicates sample The two agent indices with the highest historical agent risk scores; Represents the selected set of future time steps; Indicates the number of selected future time steps; Indicates sample The maximum effective prediction length; and These represent the intelligent agent under high-risk and low-risk conditions, respectively. In the future time step Select mode The corresponding predicted location; Key intelligent agents Average trajectory separation distance under high-risk and low-risk conditions; Representing vectors The 2-norm. In one embodiment, Several time steps in the latter half of the prediction time domain can be selected to reduce the impact of fluctuations in a single time step on the trajectory separation.
[0289] Trajectory separation loss is defined as:
[0290] ,
[0291] in, This represents the trajectory separation loss between high-risk and low-risk conditions; Indicates the number of samples in the training batch; Indicates sample The number of key intelligent agents; This represents the required minimum average trajectory separation distance; The modified linear unit function described in
[0051] is used. This loss is applied only to agents corresponding to historically high-risk agent pairs to reduce interference with the normal trajectory distribution of other background agents.
[0292] Physical efficiency loss is applied to the predicted trajectory of the selected modality during the training phase. To ensure the position difference at the first prediction time step has a definite initial state, the agent... The definition is as follows:
[0293]
[0294] in, This indicates the position of the selected modal trajectory at the prediction starting point, which is equivalent to the position at the end of the historical observation; and These represent the final velocity and final acceleration of historical observations, respectively. When the final acceleration of historical observations is not directly provided in the dataset, it can be calculated based on several velocity differences at the final historical observations, or set as the zero vector.
[0295] for Predicted velocity, predicted acceleration, and predicted impact are defined as follows:
[0296]
[0297]
[0298]
[0299] in, Represents intelligent agents Future time step under selected mode The predicted location; , and These represent the corresponding predicted velocity, predicted acceleration, and predicted impact vector, respectively. This represents the sampling time interval between adjacent prediction time steps. The impact vector represents the first-order difference of acceleration with respect to time.
[0300] Point location continuity loss is defined as:
[0301]
[0302] Indicates the loss of continuity at the starting point; The effective agent item participating in training in the current sample represents the expected first predicted position obtained according to the historical final motion state; This indicates the permissible starting position error.
[0303] The start-speed continuity loss is defined as:
[0304] ,
[0305] in, The expression represents the loss of continuity in starting speed; the fraction represents the starting speed calculated from the historical end position and the first predicted position. This indicates the permissible starting speed error.
[0306] Acceleration over-limit loss and impact over-limit loss are defined as follows:
[0307]
[0308]
[0309] in, and These represent the over-limit loss due to acceleration and the over-limit loss due to impact, respectively. and These represent the permissible upper limits for acceleration and impact, respectively. This represents the average of the future time steps for an agent with an effective predicted trajectory.
[0310] To ensure that envelope overlap is explicitly penalized, an agent is defined. and intelligent agents In the future time step The signed vehicle envelope distance is When the envelopes of two vehicles separate, And it is equal to the shortest boundary distance; when the envelopes of two vehicles are in contact, When the envelopes of two vehicles overlap, Its absolute value represents the approximate envelope penetration depth.
[0311] The vehicle envelope overlap loss is defined as:
[0312]
[0313] in, This indicates the vehicle envelope overlap loss; This is used to avoid the same agent pair being computed repeatedly. The loss produces a positive value only when the envelopes of two vehicles overlap.
[0314] The soft safety gap loss is defined as:
[0315]
[0316] in, This indicates the loss of soft safety clearances; This refers to the soft safety gap during the training phase. The soft safety gap loss is used to continuously penalize trajectories that have not yet experienced envelope overlap but have excessively small spacing; when envelope overlap occurs, the vehicle is simultaneously penalized. and The punishment is to strengthen the suppression of non-physical penetration.
[0317] Optionally, define the road boundary exceedance. and relative lane heading deviation And respectively construct road boundary loss and heading continuity loss:
[0318]
[0319]
[0320] in, This represents the maximum distance the vehicle envelope extends beyond the drivable area; it is set to 0 when the vehicle envelope is completely within the drivable area. This indicates the maximum permissible lane relative heading deviation. These two parameters can be used to ensure consistency between the physical validity constraints during the training phase and the hard determination of road boundaries and heading during the scene generation phase.
[0321] The total loss of physical effectiveness is defined as:
[0322]
[0323] Among them, each These are non-negative internal weighting coefficients; the weights for road boundary losses or heading continuity losses that are not enabled are set to 0. By setting internal weights separately, losses of different dimensions such as position error, velocity error, acceleration, impact, and envelope distance can be avoided from being directly and equally added together.
[0324] Scene generation, physical filtering and export verification stages
[0325] Inference input, key agent pair recognition and target conditions. Note: After training, the scene generation stage inputs the historical trajectory and road map information of the traffic segment to be expanded, and constructs a multi-agent spatiotemporal interaction graph according to the aforementioned method. Calculate the historical risk proxy vector for each agent pair. And historical agent risk scores, and identify historically high-risk agents. The inference phase does not use future real trajectories, nor does it calculate future real risk labels; these future real risk labels are only used for model training supervision.
[0326] in, and Indicates agent index; superscript This indicates that the corresponding variable was calculated from historical observation data; This represents the agent pair with the highest historical agent risk score.
[0327] Tester inputs target risk level Target Conflict Types and target risk score The scenario-level risk condition vector is obtained by encoding the target risk conditions. Subsequently, following the principle that the normalized conditional weight of a historically high-risk agent is higher than the conditional weights of other agents, the risk conditions are injected at one or more locations in modal bias, decoder initial hidden state offset, and FiLM feature modulation, and the multimodal future trajectories of each agent are output. Modal probability And trajectory uncertainty parameters.
[0328] in, Represents the trajectory modal index; This represents the number of trajectory modes for each agent; Represents intelligent agents In modality The complete future trajectory is as follows; Let represent the corresponding modal probability, and satisfy:
[0329] ; .
[0330] Candidate modality combination generation: each candidate scene Represented by a multi-agent modal index vector:
[0331] ,
[0332] in, Representing candidate scenarios The corresponding multi-agent modality index vector; Indicates that the candidate scenario is an intelligent agent. Selected modal index; This indicates the number of agents in the current scene.
[0333] The basic mode combination is defined as:
[0334] ,
[0335] in, This represents the basic candidate combination formed when each agent selects the mode with the highest probability.
[0336] like Figure 1 As shown in the candidate future trajectory prediction and modal probability estimation stages, in addition to the basic combination, priority is given to historical high-risk agents. The former Construct a Cartesian combination of high-probability modes and execute them on the two key agents respectively. Modal replacement; the remaining candidates were obtained by temperature-reweighted modal probability sampling:
[0337] ,
[0338] in, Indicates the sampling temperature; Maintain the original mode probability. Increase the exploration of low-probability modes. The bias is more towards the high-probability mode. In one embodiment, the low-risk, medium-risk, high-risk, and critical-risk conditions can be respectively taken as... , , and ; The minimum integer that can be no greater than 3 and ensures that the cumulative modal probability reaches a preset proportion can be selected; the total number of candidates can be limited to no more than 256. The above parameters can be adjusted according to the number of modalities, the number of agents, and the single generation delay requirements.
[0339] Candidate trajectory physical projection repair: After candidate trajectory generation and before any comprehensive evaluation, a physical projection based on the historical final state is performed on each candidate trajectory. For example... Figure 1 As shown in the physical projection repair step, for candidate scenes Middle intelligence agent The One future time step, allowing the network to predict the target location as The position, velocity, and acceleration after the previous time step repair are as follows: , and .
[0340] The desired speed is defined as:
[0341]
[0342] in, This represents the sampling time interval between adjacent prediction time steps.
[0343] The speed limiting result is:
[0344]
[0345] in, This means projecting the velocity vector onto a plane with a L2 norm not greater than 1. A set; This indicates the upper limit of the allowed speed.
[0346] The desired acceleration and its limiting results are as follows:
[0347]
[0348] in, This indicates the upper bound of the allowed acceleration. During the initial recursion, the initial values of the corrected position, velocity, and acceleration are taken as the last position, velocity, and acceleration from the historical observation, respectively.
[0349] Apply impact constraints to the acceleration increment after amplitude limiting:
[0350]
[0351] in, Indicates the maximum permissible impact; This indicates the maximum allowable change in acceleration within a single sampling time interval.
[0352] The corrected acceleration, velocity, and position are recursively calculated as follows:
[0353]
[0354]
[0355] The upper bound of the kinematics can be determined according to the following formula:
[0356]
[0357]
[0358] in, Indicates the road speed limit; , and These represent the allowed speed, acceleration, and impact limits for the vehicle model, respectively. This represents the 99.5th percentile of the absolute value of the corresponding training data. and This indicates a margin used to cover high-risk operations; This indicates the road speed limit tolerance. In one embodiment, Pick .
[0359] Kinematics and interaction index calculation and physical validity hard filtering: such as Figure 1 As shown in the hard filtering step, after physical projection, the kinematic indicators, road matching indicators, and agent interaction indicators of each candidate scenario are calculated first, and then physical validity hard filtering is performed. Hard constraints include at least road boundaries, reverse driving, heading continuity, upper bound of speed, upper bound of acceleration, upper bound of impact, continuity of predicted starting position, continuity of starting speed, vehicle envelope collision, and physically unacceptable small gaps. When any hard constraint is triggered, the corresponding candidate scenario will no longer participate in the subsequent comprehensive scoring.
[0360] The trigger flag for road boundary constraints is defined as follows:
[0361]
[0362] in, Representing candidate scenarios Does it trigger road boundary constraints? Represents intelligent agents In the future time step The vehicle envelope area; This indicates that the lane boundaries are defined by OpenDRIVE and include a numerical tolerance band. The drivable area; This represents the indicative function. The tolerance is only used to absorb map discretization and coordinate transformation errors.
[0363] The trigger flag for reverse constraint is defined as follows:
[0364] ,
[0365] in, Indicates the vehicle's heading angle; Indicates the tangential direction of the lane centerline at the vehicle's projected location; Used to normalize the angle difference to ; This represents the threshold for determining reverse flow. In one embodiment, Pick For sharp bends, the threshold can be increased appropriately and triggering can be required for multiple consecutive time steps.
[0366] The trigger flag for heading continuity constraints is defined as follows:
[0367]
[0368]
[0369] in, Indicates the maximum permissible yaw rate of the vehicle; This indicates the tolerance for angle calculation. This constraint is used to exclude discontinuous heading jumps between adjacent time steps.
[0370] The constraints for predicting the continuity of the starting position and the continuity of the starting speed are defined as follows:
[0371]
[0372]
[0373] in, and These represent the final position and velocity in historical observations, respectively. Indicates the first predicted position in the candidate scene; and These represent the allowable starting position error and starting speed error, respectively. In one embodiment, the allowable starting position error and starting speed error can be... , Alternatively, it can be recalibrated based on the high quantile value of normal sample error.
[0374] The trigger flags for velocity, acceleration, and impact upper bound constraints are defined as follows:
[0375] ,
[0376] in, , and These represent the velocity, acceleration, and impact vector of the candidate trajectory, respectively; the corresponding upper bound remains consistent with the physical projection repair stage.
[0377] To distinguish between geometric collisions, physically unacceptable small gaps, and preserveable near-miss collision states, a signed boundary distance of the vehicle envelope is defined. The value is positive when the envelopes of the two vehicles separate, 0 when they are in contact, and negative when they overlap. The three gap thresholds satisfy:
[0378] ,
[0379] in, Indicates the collision boundary where the envelope contacts or overlaps; Indicates the minimum physically acceptable gap; This represents the near-collision threshold as it varies with approach speed and is used only for risk assessment.
[0380] The near-miss threshold can be defined as:
[0381]
[0382] in, Indicates the low-speed foundation clearance; Indicates speed-related time margin; This represents the approach velocity of the two agents along their relative positions. In one embodiment, it can be taken as... , , .
[0383] Vehicle envelope collision and physically unacceptable small gap constraints are defined as follows:
[0384]
[0385]
[0386] in, Used to avoid the same agent being computed repeatedly. Candidates within an interval can be evaluated as near-miss candidates, but are not directly deemed physically invalid simply because the interval is small.
[0387] make Representing candidate scenarios Does it trigger the first There are 1 hard constraint, and the total number of hard constraints is 1. The physical validity identifier of a candidate scenario is defined as follows:
[0388] .
[0389] The physical valid candidate set is:
[0390] ,
[0391] in, This represents the complete set of candidates to be judged after physical projection; This represents the set of candidates that pass all hard constraints. (Not belonging to...) Candidates that do not meet the criteria will no longer participate in risk assessment and comprehensive re-ranking.
[0392] Risk assessment, feasibility assessment, and authenticity assessment of valid candidates: In this example, three types of risk representations with different purposes are used. A historical five-dimensional risk proxy is used to identify historical high-risk agent pairs and form continuous control conditions; a future real five-dimensional risk vector is used to train the risk head; and candidate eight-dimensional risk components are used to evaluate the generated complete future trajectory. All three representations are normalized to... Consistent or calibrable thresholds are used for common metrics such as TTC, DRAC, and spacing.
[0393] The first four categories of indicators in the historical control agent and the future real risk vector can correspond, but the fifth component represents lateral movement risk and time exposure risk, respectively. Therefore, they are not directly equated component by component. Instead, a mapping is established through a conditional trajectory model, a risk head, and the scalar alignment loss described in the full text. The tester inputs a target risk score. The same risk score as the candidate scenario is used Scale, used for numerical alignment in candidate reordering.
[0394] like Figure 1 The comprehensive reordering process shown in the figure only applies to... The candidate computation complete risk component. For candidate scenarios. Any intelligent agent in the middle The eight-dimensional risk components are defined as follows:
[0395]
[0396] The eight components represent, in order, the probability of collision, the risk of near miss, the risk of minimum distance, the risk of minimum TTC, the risk of maximum DRAC, the risk of PET, the risk of TET, and the risk of TIT.
[0397] The collision probability components are defined as follows:
[0398] ,
[0399] in, This indicates that based on the future time steps of the two intelligent agents... The probability of envelope overlap is obtained from the position mean, position covariance, and vehicle envelope estimation. This formula estimates the probability of at least one overlap occurring in the prediction time domain under the condition that overlap events are approximately independent at each time step. When the model does not output uncertainty, it can be... Set as a 0-1 indicator of envelope overlap; for candidates that have already passed deterministic hard filtering, this is... It is usually 0.
[0400] The risk components for near-miss, minimum clearance, TTC, and DRAC are defined as follows:
[0401]
[0402]
[0403]
[0404] in, , and These represent the minimum vehicle envelope spacing, minimum TTC, and maximum DRAC in the prediction time domain, respectively. The median of the adaptive near-collision threshold within the prediction time domain can be taken; and These represent normalization functions where smaller initial values indicate higher risk and larger initial values indicate higher risk, respectively. The near-collision component uses the product of distance risk and TTC risk to reduce misjudgments of vehicles traveling side-by-side but not approaching each other.
[0405] When the vehicles of two intelligent agents sweep through the same spatial conflict area At that time, let the time intervals during which the two occupy the conflict zone be respectively and The post-intrusion time PET is defined as follows:
[0406]
[0407] If the two occupied intervals overlap, then If there is no common conflict area, then let .
[0408] PET risk components are defined as follows:
[0409]
[0410] in, This is a PET risk center in one embodiment; when there is no common conflict area, .
[0411] The risk components of TET and TIT are defined as follows:
[0412]
[0413] in, and Calculated based on the aforementioned TTC risk exposure threshold; Indicates the duration of a risky state. This represents the cumulative percentage of time over which the risk intrusion intensity is expressed. Both are retained separately to distinguish between risk states that are "long-lasting but shallowly intrusive" and "short-lasting but deeply intrusive."
[0414] The agent defines the risk score as follows:
[0415]
[0416] The sum of all weights is 1. Collision probability, near miss, minimum distance, and TTC are used to characterize the main risks, while DRAC, PET, TET, and TIT are used to supplement the characterization of collision avoidance intensity, conflict time relationship, and risk exposure; the weights can be recalibrated based on the consistency of the risk ranking on the validation set.
[0417] The scenario-level risk score for candidate scenarios is defined as follows:
[0418]
[0419] in, This represents the risk score of the agent pair with the highest risk in the candidate scenario.
[0420] To distinguish the margins of the constraint boundaries for each of the physically valid candidate distances, we define: Individual normalization soft feasibility penalty The penalties refer to the degree to which indicators such as speed, acceleration, impact, road boundary, course continuity, and starting point continuity approach the upper limit of the allowable range.
[0421] The candidate feasibility score is defined as:
[0422]
[0423] in, The farther the candidate is from the boundaries of each constraint, The higher the score, the better. Since the candidates have already passed hard filtering, the feasibility score is only used to compare physical margins and does not replace hard constraint determination.
[0424] The candidate authenticity score is determined by the raw probability of the selected modality of the candidate:
[0425]
[0426] in, This is a numerical stability constant. Using geometric averaging can prevent candidates from obtaining excessively high realism scores due to the higher probabilities of other agent modes when a candidate mode contains a mode with extremely low probability.
[0427] Target alignment, conflict type matching, and comprehensive re-ranking: The alignment degree between candidate scenarios and target risk scores is defined as follows:
[0428]
[0429] in, This indicates how close the candidate scenario risk score is to the target risk score; the closer they are, the better. The higher.
[0430] To identify the conflict types in candidate scenarios, the trajectories of each agent are first projected onto the Frenet coordinate system of the road to obtain lane markings. Vertical coordinates Horizontal coordinates and heading angle And determine the spatial conflict region of any intelligent agent pair based on the temporal sweep area of the vehicle envelope. The conflict type identification rules comprehensively utilize road topology, lane changes, relative longitudinal order, conflict area occupancy time, and relative heading.
[0431] Following collisions are considered to be caused by the following conditions: the two agents are in the same lane or on the same continuous path during the risk period; and their relative headings are not greater than the parallel direction threshold. The longitudinal order remains unchanged; and the minimum TTC of the rear vehicle relative to the front vehicle is not greater than 1. The time interval between the front of the train should not be greater than Or at least one of the following: the minimum envelope spacing is less than the near-miss threshold. In one embodiment, it may be: , , .
[0432] Lane change conflicts satisfy the following conditions: at least one agent moves from the initial lane into the adjacent target lane, and its lateral displacement is not less than the width of the target lane. of The vehicle envelope crosses the lane boundary; another agent is located in the target lane or its direct successor path; the two agents reach near-collision avoidance conditions during lane changing, but do not form a stable forward insertion relationship after the lane change is completed. In one embodiment, Pick It is used to eliminate lane sway and positioning noise.
[0433] In addition to meeting the lane-change conflict conditions, the following conditions must also be met for a lane-change conflict to occur: the lane-changing vehicle must be positioned in front of the vehicles following it after entering the target lane, and this longitudinal sequence must be maintained for at least [time value missing]. The headway after lane changing is no greater than [a certain value]. TTC not greater than Or the minimum distance is less than at least one of the near-collision thresholds. In one embodiment, it may be... , The difference between cutting in and a normal lane change is that cutting in creates a stable forward insertion relationship and compresses the longitudinal clearance of the following vehicle.
[0434] A merging conflict is considered to occur when the following conditions are met: two agents are initially located in different leading lanes, which connect to the same subsequent lane or merging region within the prediction time domain; both agents enter the subsequent lane or merging region; and the time difference between their entry into the region is no greater than [value missing]. or PET not greater than In one embodiment, it is possible to... , When the road topology clearly indicates a sink, it is prioritized for identification as a sink conflict.
[0435] Cross-collision requires the following conditions: the routes or vehicles of two agents sweeping through an area form a shared spatial conflict zone; and their relative headings before entering the conflict zone are greater than 1. And less than the opposite threshold The two conflict zones occupy overlapping time intervals, or PET is not greater than 1. In one embodiment, Pick .
[0436] Opposing conflicts satisfy the following conditions: the centerlines of the routes of the two agents or the swept areas of the vehicles overlap or intersect in the prediction time domain; the relative headings are not less than [value missing]. The approach velocity of the two agents along their relative positions is positive; and the minimum TTC is no greater than [missing value]. Or the minimum distance is less than the near-collision threshold. This category can be disabled when the applied road does not contain oncoming traffic.
[0437] For each conflict category According to the necessary conditions, the proportion is met. Conditional persistence ratio and risk indicator strength Calculate the category confidence score:
[0438]
[0439]
[0440] Among them, three All located in ,each Non-negative.
[0441] The confidence scores for matching candidate conflict types and target conflict types are defined as follows:
[0442]
[0443] in, For applications requiring strict matching, further requirements can be specified. Not less than the preset threshold.
[0444] When multiple conflict categories are simultaneously satisfied, the identification priorities are as follows: merging conflict, intersection conflict, oncoming conflict, cutting conflict, lane-changing conflict, and following conflict. The priority is first based on categories that can be clearly determined by road topology and conflict areas, followed by categories determined by relative vehicle behavior. If the confidence score of the highest category is lower than the minimum identification threshold, the candidate is classified as another conflict, and the target conflict type matching confidence score is reduced accordingly.
[0445] The target risk level consistency score is defined as follows:
[0446]
[0447] in, This represents the nominal risk center corresponding to the target risk level. In one embodiment, the nominal centers for low risk, medium risk, high risk, and critical risk are 0.20, 0.50, 0.75, and 0.90, respectively. Used to align with specific target risk scores. Used to maintain consistency with semantic risk levels.
[0448] The comprehensive re-ranking score for valid physical candidates is defined as:
[0449]
[0450]
[0451] In one embodiment, Among them, the five weights correspond to risk level consistency, feasibility, authenticity, target risk score alignment, and conflict type matching confidence, respectively. Ultimately, in The candidate with the highest comprehensive re-ranking score is selected as the target scenario candidate. If... If empty, return a generation failure flag and resample candidates or adjust target conditions, without including physically invalid candidates as output.
[0452] Standardized export and playback verification, such as Figure 1 As shown in the OpenSCENARIO standardization generation and kinematic playback verification steps, road and lane information in the optimal candidate scene is mapped to the OpenDRIVE file, and agent, initial state, trajectory vertices, timestamps, and behavioral events are mapped to the OpenSCENARIO file. The coordinate system, time reference, sampling interval, vehicle size, and lane markings are kept consistent before and after export.
[0453] The file verification process includes, in sequence: XML structure and schema validity verification; road and lane reference validity verification; single-vehicle trajectory speed, acceleration, and impact verification; starting state continuity verification; multi-vehicle envelope collision and minimum clearance verification; and time synchronization verification during simulation playback.
[0454]
[0455] in, , and These represent the agents in the playback phase. At any moment Velocity, acceleration, and impact vector.
[0456] Separately , , and This indicates whether the XML structure, road references, playback kinematics, and multi-vehicle clearance validations have passed; its value is either 0 or 1. The final exported validity flag is defined as:
[0457]
[0458] in, The value is 1 only if all four validations pass; otherwise... If a candidate fails to meet the requirements, it will not be delivered as a valid scenario. The process can return to the candidate re-ranking stage to select the next candidate, or the reason for the failure can be recorded. The export stage can save candidate risk decomposition, hard filtering reasons, comprehensive re-ranking scores, XML inspection logs, and replay verification logs, forming a traceable scenario generation record.
[0459] like Figure 2As shown, the scene generation system in this example includes a data preprocessing module, an interactive trajectory prediction module, and a constraint repair and post-processing module. The data preprocessing module includes a spatiotemporal interactive graph construction unit (201a), a key pair identification and risk calculation unit (201b), a surrogate coding unit (201c), and a risk label coding unit (201d); the interactive trajectory prediction module includes a multi-agent network encoder (202a), a condition injection unit (202b), a FiLM condition processing unit (202c), a multimodal trajectory generation decoder (202d), and a modal probability estimation unit (202e); the constraint repair and post-processing module (203) includes a physical projection repair unit (203a), a hard filtering unit (203b), a comprehensive ranking unit (203c), and a standardization derivation unit (203d). The module names, unit names, and reference numerals are as follows: Figure 2 Maintain consistency.
[0460] The spatiotemporal interaction graph construction unit (201a) is used to construct nodes, interaction edges, and time-varying adjacency relationships; the key pair identification and risk calculation unit (201b) is used to calculate historical risk agents and identify historical high-risk agent pairs; the agent encoding unit (201c) is used to map the target risk score to the continuous risk agent space; and the risk label encoding unit (201d) is used to encode the target risk level, target risk score, and target conflict type. Figure 2 The "risk label" refers to the target risk condition label entered by the test taker. The above units correspond to... Figure 1 Input data (1) to risk label code (7).
[0461] A multi-agent network encoder (202a) is used to extract historical temporal relationships and multi-agent interaction features; a conditional injection unit (202b) is used to perform modal bias and decoder initial hidden state offset according to different conditional weights; a FiLM conditional processing unit (202c) is used to modulate and decode intermediate features; a multi-modal trajectory generation decoder (202d) is used to output multiple future trajectory modes and trajectory uncertainty parameters; and a modal probability estimation unit (202e) is used to output modal probabilities. The above units correspond to... Figure 1 Conditional injection (8) into modal probability estimation (11).
[0462] The physical projection repair unit (203a) is used to repair the velocity, acceleration, and impact of candidate trajectories; the hard filtering unit (203b) is used to calculate hard constraint indices and eliminate physically invalid candidates; the comprehensive ranking unit (203c) only evaluates the risk, feasibility, authenticity, target alignment, and conflict type matching of physically valid candidates and comprehensively re-ranks them; the standardization export unit (203d) is used to generate OpenSCENARIO and OpenDRIVE files and perform XML validity and kinematic playback verification. The above units correspond to... Figure 1 Physical projection restoration (12) to kinematic playback verification (16). Figure 2 The model optimization and feedback loop in the process is optional. It is used to adjust the model parameters and thresholds based on the training loss, candidate failure reasons and replay validation results, without changing the order of the main process.
[0463] This example also provides an electronic device, including a processor and a memory; when the computer program stored in the memory is executed by the processor, it implements the above-mentioned model training and / or scene generation, physical screening and export verification steps.
[0464] This example also provides a non-transitory computer-readable storage medium on which a computer program stored is executed by a processor to implement the above method.
Claims
1. A method for generating risk-controllable scenarios based on multi-agent interaction, characterized in that, The process includes the following: acquiring historical trajectory data of multiple agents in a traffic scenario and constructing a spatiotemporal interaction graph of multiple agents; calculating the historical risk agent vector of each agent pair based on the historical trajectory data, and selecting the agent pair with the highest historical agent risk score as the historical high-risk agent pair; The target risk level, target risk score, and target conflict type are encoded into a scenario-level risk condition vector. The risk conditions are then injected into the multi-agent multimodal trajectory prediction model, prioritizing the condition weights of historically high-risk agent pairs over those of other agents. Through interactive encoding and conditional decoding, the multimodal future trajectory, modality probability, and trajectory uncertainty parameters of each agent are output. Candidate modality combinations are generated based on these multimodal future trajectories, and physical projection repair, scenario risk assessment, physical validity determination, and target alignment calculation are performed on the candidate future trajectories corresponding to each candidate modality combination. Within the physically valid candidate set, the target scene candidates are reordered based on risk score, feasibility score, authenticity score, target alignment, and conflict type matching results to obtain target scene candidates. The target scene candidates are exported as standardized dynamic scene files and road network files, and XML validity verification and trajectory playback kinematic verification are performed.
2. The method according to claim 1, characterized in that, The historical risk proxy vector includes at least five-dimensional risk components obtained by normalizing the historical minimum collision time, deceleration demand rate, relative velocity, Euclidean distance, and lateral motion. The historical high-risk agent pair obtains a historical proxy risk score by weighted aggregation of the historical risk proxy vectors of each agent pair, and selects the agent pair with the largest historical proxy risk score. The risk condition encoding includes at least one of semantic condition encoding and proxy condition encoding; wherein, the semantic condition encoding includes at least risk level embedding, conflict type embedding and target risk score projection result, and the proxy condition encoding is used to map the target risk score to a continuous risk vector consistent with the historical risk proxy space; The method of injecting risk conditions into the multi-agent multimodal trajectory prediction model includes one or more of the following: injecting modality bias into the modality selection layer, injecting hidden state offset into the initial hidden state of the decoder, and performing FiLM modulation on the features during the decoding stage. The multi-agent multimodal trajectory prediction model includes a time-varying graph interactive encoder and a conditional multimodal decoder; the time-varying graph interactive encoder is used to fuse historical time-series relationships and multi-agent interaction relationships, and the conditional multimodal decoder is used to output multiple future trajectory modes, corresponding mode probabilities, and trajectory covariance parameters.
3. The method according to claim 1, characterized in that, It also includes constructing a scenario-level risk head, performing graph-level pooling on the encoding end features, decoding end features, and modal probabilities to predict scenario-level risk vectors and scenario-level risk scores, and using the scenario-level risk vectors and scenario-level risk scores for training supervision and candidate evaluation.
4. The method according to claim 1, characterized in that, The multi-agent multimodal trajectory prediction model employs a multi-objective joint loss function during the training phase. The multi-objective joint loss function includes at least two or more of the following: trajectory loss, risk supervision loss, risk alignment loss, order constraint loss, trajectory separation loss, and physical effectiveness loss.
5. The method according to claim 1, characterized in that, The generation of the candidate modality combination includes: determining the basic modality combination, developing top-k modality replacement combinations around high-risk agent pairs, and sampling according to temperature-reweighted modality probabilities to expand the exploration range of high-risk scenario candidates; The physical projection repair includes: calculating the desired velocity based on the position, velocity, and acceleration of the previous moment, and limiting the desired velocity; calculating the desired acceleration based on the limited velocity, and limiting the desired acceleration; applying impact constraints based on the acceleration increments of adjacent moments; and recursively obtaining the repaired trajectory that satisfies the constraints of velocity, acceleration, and impact thresholds. The physical validity determination includes at least one or more of the following constraints: boundary crossing constraint, reverse travel constraint, heading continuity constraint, speed upper limit constraint, acceleration upper limit constraint, impact upper limit constraint, starting position continuity constraint, starting speed jump constraint, and inter-agent collision or dangerous gap constraint.
6. The method according to claim 1, characterized in that, The scenario risk assessment is obtained by normalizing and weighting one or more of the following factors: collision probability, near-miss risk, minimum distance, minimum collision time, deceleration demand rate, post-intrusion time, total exposure time and total intrusion time. The reordering is performed by first hard filtering and then sorting; when a candidate scene does not meet the physical validity judgment, the candidate scene is directly removed from the candidate set; when there are physically valid candidate scenes, only the candidate scene with the best score among the physically valid candidate scenes is selected as the output.
7. The method according to claim 1, characterized in that, The standardized dynamic scene file is an OpenSCENARIO file, and the road network file is an OpenDRIVE file; the export verification includes XML structure validity verification, speed verification, acceleration verification, impact verification, and multi-vehicle spacing verification in trajectory playback.
8. A system for generating risk-controllable scenarios, screening physical constraints, and deriving verification based on multi-agent interaction prediction, characterized in that, include: The system comprises a data preprocessing and label enhancement module, a historical risk agent extraction module, a conditional coding module, a multi-agent interaction coding module, a risk conditional decoding module, a risk vector and risk score prediction module, a multi-objective joint training module, a candidate modality combination generation module, a scene risk assessment and re-ranking module, a physical projection repair and physical validity filtering module, and a standardized export and playback verification module; wherein each module collaboratively executes the method described in any one of claims 1 to 7.
9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, which, when executed by the processor, implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of any one of claims 1 to 7.