An automatic driving scene library construction method based on causal modeling

CN122947568APending Publication Date: 2026-10-20JIANGSU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611136921.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0006]发明目的:针对现有技术中存在的不足,本发明提供了一种基于因果建模的自动驾驶场景库构建方法,本发明通过势能场-动能场耦合风险建模、因果驱动场景生成与主动学习采样,解决多算法规模化测试与高效安全评估的问题

Benefits of technology

[0082]有益效果:本发明通过融合车道几何约束与背景车相对运动构建势能场-动能场耦合风险模型,实现对环形交叉口多车持续交互场景风险的精确量化;通过随机森林回归模型建立风险度与运动特征之间的因果关联,驱动背景车轨迹协同优化生成覆盖全风险度区间的场景库,有效弥补自然驾驶数据中高风险场景稀疏的缺陷;同时通过高斯过程回归模型结合期望提升策略的主动学习采样机制,构建以场景为核心的统一测试框架,支持多算法规模化测试,显著提高测试效率,改善现有技术中风险建模精度不足、场景库覆盖不充分、测试流程与特定算法高度绑定的问题,有效降低测试成本,能够满足多算法通用化场景库构建与高效安全评估的要求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a method for constructing an autonomous driving scenario library based on causal modeling, comprising: S1, risk field modeling and scenario unit risk degree calculation: constructing a potential energy field based on lane geometric boundary constraints and a kinetic energy field based on the relative motion state of the background vehicle to obtain the total risk potential field of a single frame; S2, construction of a full-risk scenario library: constructing a causal relationship between the scenario unit risk degree and the motion characteristics of the background vehicle based on a random forest regression model, co-optimizing the motion characteristics of the background vehicle state to generate variant scenarios, and constructing a scenario library covering the full risk degree range after trajectory smoothing; S3, sampling and testing; S4, safety assessment. This invention solves the problems of large-scale testing of multiple algorithms and efficient safety assessment by coupling potential energy field and kinetic energy field risk modeling, causal-driven scenario generation, and active learning sampling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for constructing an autonomous driving scenario library based on causal modeling, belonging to the field of autonomous driving testing technology. The classification number is G06F 17 / 18 or B60W30 / 095. Background Technology

[0002] As autonomous driving technology gradually moves towards large-scale application, safety testing for complex road scenarios has become a core technical aspect of the industry. Roundabouts, due to continuous vehicle convergence, continuous movement trajectories, and a dense spatiotemporal distribution of conflict points, are typical complex scenarios that autonomous driving systems must traverse. Their continuous spatiotemporal interaction characteristics place higher demands on risk assessment, scenario construction, and testing evaluation systems. Currently, autonomous driving testing is evolving from modular functional testing focused on single vehicle models to large-scale testing centered on scenarios and supporting multiple algorithms and platforms. How to achieve efficient verification and safety evaluation within a unified scenario framework has become a key research direction for the industry.

[0003] Patent CN117400930B discloses a risk field-based method for assessing the hazard level of intelligent connected vehicles in roundabout scenarios. This method couples a road potential field with a vehicle kinetic energy risk field, converts Cartesian coordinates to polar coordinates to adapt to the geometric characteristics of roundabouts, and introduces offset potential energy to describe the impact of vehicle steering actions on the risk field distribution, thus achieving a quantitative assessment of single-vehicle driving risk in roundabout scenarios. However, this method has the following shortcomings: it only evaluates the instantaneous risk of a single vehicle and fails to extend the risk quantification results to the scenario unit level to support subsequent scenario library construction; the risk field construction is centered on a single master vehicle, lacking a characterization of the spatiotemporal evolution of risk under continuous multi-vehicle interaction; furthermore, this method only stays at the hazard level and does not address how to generate scenarios, conduct test sampling, and evaluate the safety of autonomous driving algorithms based on the risk quantification results, thus failing to directly serve the complete process of test scenario library construction and algorithm verification.

[0004] Patent CN114818381A discloses a method for constructing a test scenario library for autonomous vehicles. It parameterizes test scenarios into two key variables: distance and speed. A Gibbs sampling method is used to sample natural driving data to generate the original scenario library, and a risk function and auxiliary objective function are designed to guide the search for key scenarios. However, this method has the following shortcomings: the scenario parameterization is overly simplified, describing scenarios only in two dimensions: distance and speed. This fails to characterize the distribution characteristics of risk that continuously changes spatially in multi-vehicle interaction scenarios such as roundabouts; scenario generation relies on sampling the probability distribution of natural driving data, lacking a controllable generation mechanism based on risk evolution laws, making it difficult to systematically cover low-probability, high-risk areas; the proxy model uses a single intelligent driving model to replace the algorithm under test, failing to reflect the differentiated safety performance of different autonomous driving algorithms. Furthermore, the test process and parameters are highly bound to specific test objects, lacking a unified test framework centered on scenarios. Changing algorithms requires re-adaptation, making it difficult to achieve multi-algorithm reuse and large-scale testing.

[0005] In summary, existing technologies generally suffer from insufficient accuracy in risk modeling for spatiotemporally continuous scenarios such as roundabouts, making it difficult to effectively depict the risk evolution patterns under continuous multi-vehicle interaction. Scenario generation largely relies on natural driving data sampling or simple parameter perturbations, lacking a controllable generation mechanism based on causal relationships, and the scenario library does not adequately cover the entire risk range. The testing process and parameters are highly tied to specific algorithms under test, lacking a unified testing framework centered on scenarios. Changing algorithms requires re-adaptation, making it difficult to achieve multi-algorithm reuse and large-scale testing. Furthermore, the lack of efficient iterative sampling strategies based on active learning to guide subsequent testing results in high testing costs and low evaluation efficiency. Summary of the Invention

[0006] Purpose of the invention: To address the shortcomings of existing technologies, this invention provides a method for constructing an autonomous driving scenario library based on causal modeling. This invention solves the problems of large-scale testing of multiple algorithms and efficient safety assessment by using potential energy field-kinetic energy field coupled risk modeling, causal-driven scenario generation, and active learning sampling.

[0007] Technical solution: A method for constructing an autonomous driving scenario library based on causal modeling, comprising the following steps:

[0008] S1. Risk field modeling and scene unit risk degree calculation: Extract continuous frame sequences centered on the main vehicle from the natural driving dataset to form scene units. Filter the set of background vehicles that have potential conflicts with the main vehicle, record their positions and motion states, and construct a potential energy field based on lane geometric boundary constraints and a kinetic energy field based on the relative motion state of the background vehicles. Couple the potential energy field and the kinetic energy field to obtain the total risk potential field of a single frame. Extract the risk value of a single frame from it, and then use the maximum value of all frames within the scene unit as the risk degree of that scene unit.

[0009] S2. Construction of a full-risk scenario library: Based on the risk levels of all scenario units obtained in S1, normalize the risk levels and fit their distribution using kernel density estimation. Enhance the sampling density of low-probability, high-risk areas through importance sampling to obtain a target distribution covering the entire risk level range. Construct a causal relationship between scenario unit risk levels and background vehicle motion characteristics based on a random forest regression model. Perform collaborative optimization on the background vehicle state motion characteristics to generate variant scenarios. After trajectory smoothing, construct a scenario library covering the entire risk level range.

[0010] S3. Sampling Test: For each scene in the scene library of S2, the single-frame risk value is recalculated and a reference path for the test vehicle is constructed. In the initial sampling phase, a sampling method based on coverage combined with scene feature clustering is used to select test scenes. In the directional iterative sampling phase, a Gaussian process regression model is constructed, with scene unit risk level and scene feature index as input and the shortest relative distance between the test vehicle and the background vehicle as output. According to the expected improvement strategy, untested scenes are iteratively selected for testing and the Gaussian process regression model is updated until the convergence condition is met.

[0011] S4. Safety Assessment: Based on the converged Gaussian process regression model, determine the minimum number of test scenarios required to assess the safety of autonomous driving algorithms, and identify the types of scenario features that are prone to collisions.

[0012] This invention constructs a potential-kinetic field coupled risk model that integrates lane geometric constraints and the relative motion of background vehicles, enabling the extraction of scene units from natural driving data and quantification of their risk levels. Then, a random forest regression model is used to establish a causal relationship between risk levels and motion characteristics, driving collaborative optimization of background vehicle trajectories to generate a scene library covering the entire risk range. Finally, a Gaussian process regression model combined with an active learning sampling mechanism based on an expectation enhancement strategy is used to achieve a unified testing framework centered on scenes. This framework supports large-scale testing of multiple algorithms within the same scene library, addressing the technical problems of insufficient accuracy in risk modeling for spatiotemporally continuous scenes such as roundabouts, inadequate coverage of the entire risk range in scene libraries, and the high degree of binding between testing processes and specific algorithms, requiring re-adaptation when changing algorithms. This significantly improves the efficiency of large-scale testing.

[0013] In order to achieve accurate quantification of risks in the spatiotemporally continuous scenario of roundabouts and to address the problem that the risk field in the existing technology only targets the instantaneous risk of a single vehicle and lacks characterization of the spatiotemporal evolution of risks under continuous interaction of multiple vehicles, the Cartesian coordinate system is transformed into a polar coordinate system to adapt to the geometric characteristics of the roundabout. A one-dimensional Gaussian kernel density potential energy field based on the inner and outer ring lane line constraints and a two-dimensional Gaussian kernel density kinetic energy field based on the relative motion of background vehicles are constructed respectively. The two are coupled and normalized to obtain the total risk potential field of a single frame. The maximum value of all frames within the scene unit is used as the risk degree of the scene unit, thereby achieving the technical effect of extending from the instantaneous risk assessment of a single vehicle to the overall risk degree assessment of the scene unit under continuous interaction of multiple vehicles.

[0014] S1 specifically includes:

[0015] S101. Scene Unit Construction and Feature Extraction: Extract continuous frame sequences centered on the main vehicle from the natural driving dataset to form scene units, and filter the set of background vehicles that have potential conflicts with the main vehicle. Where l is the number of dynamic filters and satisfies , Set a preset upper limit for the number of background vehicles; record the motion feature vectors of each background vehicle. To ensure that the risk diffusion pattern aligns with the driving direction at the roundabout, the Cartesian coordinate system is transformed into a polar coordinate system, where, Let be the spatial polar coordinates of the i-th background car at time t. and Let be the velocity and acceleration of the i-th background vehicle at time t, respectively.

[0016] S102. Let the geometric constraints of the inner and outer ring road lines in the extreme radius direction be the reference extreme radius of the inner ring road line, respectively. Reference extreme diameter of outer ring road line Construct a one-dimensional Gaussian kernel density potential energy field:

[0017]

[0018] in, For potential energy field, The polar radius coordinates of the background vehicle. The reference polar radius coordinates for lane line l. The lane line constraint strength coefficient, The bandwidth of the potential energy field;

[0019] S103. Based on the relative motion of the background vehicle, a two-dimensional Gaussian kernel density kinetic energy field is constructed by combining the two dimensions of polar radius and polar angle:

[0020]

[0021] in, Let be the kinetic energy field of the i-th background car in frame t. For frame number, The polar coordinates of the background car. The bandwidth of the kinetic energy field's polar radius. The polar bandwidth of the kinetic energy field. and The weighting coefficients for the background vehicle's speed and acceleration;

[0022] S104. Couple and normalize the potential energy field and kinetic energy field to obtain the total risk potential field of a single frame. :

[0023]

[0024] Where N is the number of background vehicles;

[0025] Pick The maximum value is used as the risk value for a single frame. :

[0026]

[0027] in, The effective spatial sampling domain of the roundabout; thus, the scene element risk level SRL is obtained:

[0028]

[0029] Where T is the number of frames in a scene unit.

[0030] The preferred option, in order to construct a scenario library covering the entire risk range and address the problems in existing technologies where scenario generation relies on probabilistic sampling or simple random perturbation of natural driving data, lacks a controllable generation mechanism based on risk evolution laws, and is difficult to systematically cover low-probability, high-risk areas, reconstructs a target distribution covering the entire risk range by estimating the kernel density of the risk level of scenario units and sampling their importance. It then uses a random forest regression model to extract the risk contribution weights and risk-feature local response gradients of each motion feature, driving the collaborative iterative optimization of the background vehicle trajectory. Combined with multiple sets of initial trajectories and random perturbations, it generates diverse variant scenarios, achieving a shift from data-driven passive sampling to causal-driven active generation. This constructs a scenario library covering the entire risk range, effectively compensating for the sparsity of high-risk scenarios in natural driving data.

[0031] S2 specifically includes:

[0032] S201. Risk Normalization and Target Distribution Reconstruction: The risk levels of all scenario units calculated in S1 are normalized; kernel density estimation is used to fit the normalized risk distribution; to compensate for the sparseness of high-risk scenarios in natural driving data, importance sampling is used to enhance the sampling density of low-probability high-risk areas, reconstruct the risk distribution, and obtain a target distribution covering the entire risk range, ensuring that the scenario library generated subsequently can cover the entire risk range.

[0033] S202. Random Forest Regression Model Construction and Training: The motion feature vectors of all background vehicles in all scene units and their corresponding single-frame risk values ​​constitute a global training set; the random forest regression algorithm is used to learn the nonlinear mapping relationship between motion features and single-frame risk values, and a causal relationship model is established.

[0034] S203. Extraction of risk contribution weights for motion features: Extract the risk contribution weights of each motion feature from the trained random forest regression model; traverse all decision trees in the forest, accumulate the error reduction brought by each motion feature when splitting at each decision tree node, take the average value of all decision trees, and obtain the risk contribution weights of each dimension of motion features to form a risk contribution vector.

[0035] S204. Risk-Feature Local Response Gradient Calculation: On the trained random forest regression model, calculate the partial derivative of the risk value of a single frame with respect to each motion feature to obtain the local response gradient vector of the risk value with respect to the motion feature.

[0036] S205. Initial background vehicle trajectory generation and risk assessment: Given the risk level of the target scene, a set of initial background vehicle trajectories are randomly generated based on the traffic rules of the roundabout and the vehicle kinematic constraints. The initial background vehicle trajectories are input into the causal relationship model constructed in S202 to obtain the risk value of each frame, and the peak value of the instantaneous risk in the time series is taken as the risk level of the current scene.

[0037] S206. Trajectory Cooperative Iterative Optimization and Scene Generation: Calculate the deviation between the current scene risk level and the target risk level; combine the risk contribution weight obtained in S203 and the local response gradient obtained in S204 to construct a cooperative feature update rule, use the risk contribution weight to determine the adjustment intensity of each motion feature, use the positive or negative sign of the response gradient to determine the adjustment direction, and update the trajectory according to the set iteration step size.

[0038] S207. Iterative Execution and Diverse Scene Generation: After updating the trajectory, recalculate the frame-by-frame risk value and peak risk level, repeat the iteration until the target risk level is approached, determine the number of generated scenes for each risk level interval according to the target distribution, use multiple sets of initial trajectories and random perturbations for the same target risk level to generate variant scenes with diverse behaviors, and build a scene library covering the entire risk level interval after trajectory smoothing.

[0039] A preferred option, in order to achieve efficient evaluation of the safety of autonomous driving algorithms and address the problems of high testing costs and low evaluation efficiency caused by the lack of a unified testing framework for multi-algorithm reuse and the lack of an adaptive iterative sampling mechanism based on active learning in existing technologies, adopts Latin hypercube sampling combined with K-means clustering in the initial sampling stage to ensure that the scene covers different risk levels and changing characteristics. In the directional iteration stage, a Gaussian process regression model is constructed and an expectation enhancement strategy is introduced to iteratively select high-risk and high-uncertainty area scenes for testing. The shortest relative distance between the test vehicle and the background vehicle is used as the collision safety evaluation index, thereby achieving the technical effect of reducing testing costs. Specifically, S3 includes:

[0040] S301. Hierarchical initial sampling: The Latin hypercube sampling method is used to select initial test scenarios from the scenario library to ensure that the test scenarios cover the risk level range of the entire scenario unit. Within each risk level range, the K-means clustering algorithm is used to divide multiple scenario categories according to scenario feature indicators, so that the initial test scenarios simultaneously cover different risk levels and different risk evolution modes, providing diversified training data for the subsequent Gaussian process regression model.

[0041] S302. Construction of Gaussian process regression model: Based on the initial test results, a Gaussian process regression model is constructed, with the scenario risk level and scenario characteristic indicators as inputs and the shortest relative distance between the test vehicle and the background vehicle as output, to establish a quantitative mapping relationship.

[0042] S303, Expected Improvement Strategy Targeted Sampling: Targeted sampling is performed using the expected improvement strategy as the scenario selection criterion; the expected improvement of each untested scenario relative to the optimal collision risk in the current tested samples is calculated, and the top few scenarios with the highest expected improvement values ​​are selected for testing;

[0043] S304, Iterative Update and Dual Convergence Criteria: In each round, the test results of the scenario selected in S303 are included in the training set to update the Gaussian process regression model. The iterative process adopts a dual convergence criterion. When the global average prediction error and the average prediction standard deviation simultaneously meet the convergence condition, the iteration stops. Otherwise, it returns to S303 to continue the next round of sampling until the Gaussian process regression model has fully learned the scenario risk characteristics.

[0044] In a preferred embodiment, to construct a causal relationship model between scene unit risk level and background vehicle motion features, and to provide an interpretable quantitative basis for subsequent causal-driven scene generation, a global training set is constructed by using the motion feature vectors of the background vehicle in four dimensions (radius radius, polar angle, velocity, and acceleration) and the corresponding single-frame risk values. A random forest regression algorithm is then used to learn the nonlinear mapping relationship between motion features and risk values, achieving accurate estimation from motion features to risk values. Specifically, S202 involves:

[0045] Motion characteristics include the extreme diameter of the background vehicle. Polar angle ,speed acceleration The random forest regression model takes four dimensions as input, with background vehicle motion feature vectors as input and outputs the corresponding single-frame risk value estimate; it integrates the motion feature vectors of all scenes and all background vehicles in the natural driving data. Corresponding Constructing a global training set A random forest regression model is used to learn the nonlinear mapping between motion characteristics and risk values.

[0046]

[0047] in, The risk value for a single frame estimated by the random forest. The ensemble function for random forest ensembles. These are the structure parameters of the integration function.

[0048] In a preferred embodiment, to achieve quantitative decision-making on the adjustment intensity and direction of each motion feature during scene generation, and to provide an interpretable causal driving basis for trajectory iterative optimization, a random forest regression model is used to extract the risk contribution weight of each motion feature, quantify the causal driving strength of each motion feature on risk evolution, and simultaneously calculate the partial derivative of the risk value with respect to each motion feature to obtain the local response gradient. The positive or negative gradient indicates the instantaneous impact direction of feature changes on risk, thus realizing the transformation from blind parameter search to causally driven interpretable trajectory optimization. Specifically, S203 and S204 are as follows:

[0049] S203: The random forest regression model quantifies causal contribution through the importance of motion features, with the risk contribution weight of the k-th dimension motion feature. for:

[0050]

[0051] in, For the number of decision trees, This represents the error reduction brought about by the q-th dimension motion feature on the m-th tree;

[0052] The risk contribution vector is composed of the weights of the four-dimensional motion features. This vector directly reflects the causal driving strength of each motion feature on risk evolution, that is, the magnitude of the influence of the feature change on the scenario risk.

[0053] S204: To further obtain the local response gradient of the risk value to the motion feature, the partial derivative of the motion feature is calculated on the trained random forest regression model. The gradient direction represents the instantaneous impact of feature changes on risk. A positive gradient indicates that an increase in feature value leads to an increase in risk, while a negative gradient indicates that an increase in feature value leads to a decrease in risk. This provides an interpretable optimization direction for trajectory iterative optimization.

[0054]

[0055] in, The gradient function represents the motion characteristics. , , , These are the partial derivatives of the risk value with respect to the four motion characteristics: radius, polar angle, velocity, and acceleration.

[0056] A preferred option, in order to achieve controllable generation from the initial trajectory to the target risk level scenario and address the problem in existing technologies that lack a controllable generation mechanism based on risk evolution laws, involves randomly generating the initial background vehicle trajectory using roundabout traffic rules and vehicle kinematic constraints. This trajectory is then input into a causal correlation model to obtain the current scenario risk level. A collaborative update rule is constructed by combining risk contribution weights to determine the adjustment intensity and response gradients to determine the adjustment direction. The trajectory is iteratively optimized until it approaches the target risk level. The number of generated scenarios for each risk level interval is determined according to the target distribution. This, combined with random perturbations, generates diverse scenarios, achieving controllable and accurate generation of the target risk level scenario. Specifically, S205, S206, and S207 are as follows:

[0057] S205: Risk level of the given target scenario The scene generation objective is to solve for a set of background vehicle trajectories. , to make The peak converges to the target; firstly, an initial trajectory is randomly generated based on the traffic rules of the roundabout and vehicle kinematic constraints. The initial trajectory is input into the causal correlation model to obtain frame-by-frame results. and obtained This represents the peak value of the instantaneous risk in the time series, i.e., the risk level of the current scenario;

[0058] S206: Calculate the risk level of the current scenario Risk level of the target scenario Deviation:

[0059]

[0060] By combining risk contribution weights and feature response gradients, a collaborative feature update rule is constructed:

[0061]

[0062] in, Let be the trajectory update offset of the i-th background vehicle's motion features at time t in the k-th iteration. The iteration step size is used to ensure a smooth trajectory. The risk contribution vector determines the adjustment strength of each feature. The risk deviation in round k is... The sign function, which outputs 1 or -1, determines the direction of adjustment;

[0063] S207: Update the trajectory and recalculate. With peak Repeat the iteration until it approximates the target. The number of scenes generated in each SRL interval is determined according to the target distribution, and for the same... By using multiple sets of initial trajectories and random perturbations, diverse scenarios with different behaviors are generated:

[0064]

[0065] in, For the disturbance intensity, Let be the initial motion feature vector of the i-th background vehicle at time t after applying a random perturbation. This represents the original initial motion feature vector of the i-th vehicle at time t under undisturbed conditions. With a mean of 0 and a variance of Gaussian distributed random noise.

[0066] In a preferred embodiment, to achieve accurate prediction and uncertainty quantification of collision risk in untested scenarios using a Gaussian process regression model, and to provide a basis for targeted sampling of subsequent expected improvement strategies, a Gaussian process regression model is constructed with scenario risk level and scenario characteristic indicators as inputs and the shortest relative distance between the test vehicle and the background vehicle as output. A quantitative mapping relationship is established, enabling the model to simultaneously output the predicted mean to represent the expected collision risk and the predicted variance to represent the prediction uncertainty for any untested scenario, thus achieving complete output from the model in both the predicted value and confidence level dimensions. Specifically, S302 is as follows:

[0067] Based on the initial test results, a Gaussian process regression model is constructed to establish a quantitative mapping relationship between the risk level of scene units, scene characteristic indicators, and the shortest relative distance experienced by the test vehicle.

[0068]

[0069] in, Let be the scene feature vector, and y be the collision index value of the Gaussian process regression model. It is a Gaussian process function. It is a mean function. This is the covariance kernel function for a Gaussian process, used to measure the covariance of two sets of scenarios. , Similarity between them For the overall scale variance, The characteristic length scale matrix, , , These are the length scale hyperparameters corresponding to the features in the three dimensions;

[0070] Given the tested set ,in The collision index value obtained from the test of the g-th scene is... The total number of scenario samples that have been simulated and tested after the k-th iteration is given by the number of untested scenarios. Gaussian process regression models can output predicted mean. With prediction variance :

[0071]

[0072] in, For kernel vector, The kernel matrix of the training set. To observe the noise variance, This is an indicator function.

[0073] In a preferred embodiment, to achieve targeted selection of test scenarios during iterative sampling, and to gradually focus sampling points on high-risk and high-uncertainty regions, the expected improvement in collision risk of each untested scenario relative to the optimal collision risk in the currently tested samples is calculated. Under the posterior distribution of the Gaussian process regression model, regions with high prediction risk and high prediction uncertainty are weighed, and the scenario with the highest expected improvement value is selected for testing. This maximizes sampling efficiency and ensures that the scenario selected in each iteration provides the maximum information gain to the model. Specifically, S303 is as follows:

[0074] A target sampling strategy is performed using the expectation enhancement strategy as the scenario selection criterion; let the optimal collision risk in the tested samples be... The increase in risk for untested scenarios is defined as follows: Its expected improvement under the posterior distribution of the Gaussian process regression model is:

[0075]

[0076] in, Untested scenario The expected increase The cumulative distribution function of the standard normal distribution. It is the probability density function of the standard normal distribution.

[0077] In a preferred embodiment, to achieve reliable convergence of the Gaussian process regression model and ensure that the model fully learns the scenario risk characteristics while avoiding invalid testing, the top g scenarios with the highest expected improvement are selected for testing in each round and included in the training set to update the model. A dual convergence criterion of global average prediction standard deviation and global average prediction error is adopted. When both indicators simultaneously meet the preset threshold, it is determined that the model has fully learned the scenario risk characteristics and that subsequent new samples have a negligible impact on the model, thus terminating the iterative sampling and achieving the optimal balance between model generalization ability and testing cost. Specifically, S304 is as follows:

[0078] In each round, the top g scenarios with the highest expected improvement are selected for testing and included in the training set for updating, so that the sampling points are gradually focused on high-risk and high-uncertainty areas; the iteration process adopts a dual convergence criterion, and the iteration stops when the global average prediction standard deviation and the average prediction error meet the convergence condition, otherwise it returns to step S303 to continue the iteration;

[0079] The convergence condition is defined as:

[0080]

[0081] in, The convergence threshold for the average prediction standard deviation, This is the convergence threshold for the average prediction error. Let be the collision index value predicted by the Gaussian process regression model for the g-th scene. Let be the posterior standard deviation of the prediction result of the Gaussian process regression model for the g-th scenario. When both indicators meet the convergence condition, the iterative sampling is terminated; otherwise, return to step S303 to continue the iteration.

[0082] Beneficial effects: This invention constructs a potential energy field-kinetic energy field coupled risk model by integrating lane geometric constraints and the relative motion of background vehicles, achieving accurate quantification of risks in continuous multi-vehicle interaction scenarios at roundabouts; it establishes a causal relationship between risk level and motion characteristics through a random forest regression model, driving collaborative optimization of background vehicle trajectories to generate a scenario library covering the entire risk level range, effectively compensating for the sparseness of high-risk scenarios in natural driving data; simultaneously, it constructs a unified testing framework centered on scenarios by combining a Gaussian process regression model with an active learning sampling mechanism based on expectation enhancement strategies, supporting large-scale testing of multiple algorithms, significantly improving testing efficiency, and addressing the problems of insufficient risk modeling accuracy, inadequate scenario library coverage, and high binding of testing processes to specific algorithms in existing technologies, effectively reducing testing costs and meeting the requirements for constructing a general scenario library for multiple algorithms and efficient safety assessment. Attached Figure Description

[0083] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0084] Figure 1 This is a flowchart of the method of the present invention;

[0085] Figure 2 This is a scene unit risk field modeling diagram for the present invention;

[0086] Figure 3 This is a background vehicle trajectory diagram from the scene library of this invention;

[0087] Figure 4 This is a graph showing the average prediction error in the Gaussian process regression model of this invention.

[0088] Figure 5 This is a plot of the predicted standard deviation in the Gaussian process regression model of this invention. Detailed Implementation

[0089] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0090] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0091] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0092] This embodiment uses a roundabout as the test scenario, routeD as the natural driving dataset, the test vehicle as the high-level autonomous driving vehicle to be tested, and the background vehicles as multiple social vehicles participating in the interaction.

[0093] like Figure 1 As shown, a method for constructing an autonomous driving scenario library based on causal modeling includes the following steps:

[0094] S1. Risk Field Modeling and Scene Unit Risk Calculation: Scene units are constructed by extracting continuous frame sequences centered on the main vehicle from the natural driving dataset. A set of background vehicles with potential conflicts with the main vehicle is selected, and their positions and motion states are recorded. A potential energy field based on lane geometric boundary constraints and a kinetic energy field based on the relative motion states of the background vehicles are constructed. The potential and kinetic energy fields are coupled to obtain the total risk potential field for a single frame. The risk value for each frame is extracted from this field, and the maximum value across all frames within the scene unit is used as the risk level of that scene unit.

[0095] S101. Scene Unit Construction and Feature Extraction: Extract 100 consecutive frames of data centered on the main vehicle from the RounD Natural Driving dataset to form a scene unit, and filter the set of background vehicles that have potential conflicts with the main vehicle. Where l is the number of dynamic filters and satisfies The number of background cars varies in each scene unit, with a maximum limit set for the number of background cars. Record the polar coordinate position, velocity, and acceleration of each background vehicle, and combine them into a motion feature vector. To ensure that the risk diffusion pattern aligns with the driving direction at the roundabout, the Cartesian coordinate system is transformed into a polar coordinate system, where, Let be the spatial polar coordinates of the i-th background car at time t. and Let be the velocity and acceleration of the i-th background vehicle at time t, respectively.

[0096] S102. Considering the geometric constraints of the inner and outer ring road lines at a roundabout (inner ring extreme diameter 13m, outer ring extreme diameter 35m), construct a one-dimensional Gaussian kernel density potential energy field in the extreme diameter direction. Let the geometric constraints of the inner and outer ring road lines in the extreme diameter direction be the reference extreme diameter of the inner ring road line, respectively. Reference extreme diameter of outer ring road line Construct a one-dimensional Gaussian kernel density potential energy field:

[0097]

[0098] in, For potential energy field, The polar radius coordinates of the background vehicle. The reference polar radius coordinates for lane line l. The lane line constraint strength coefficient is 1 for the inner ring and 0.8 for the outer ring. The bandwidth of the potential energy field is 3.

[0099] S103. Considering the interactive directionality of the background vehicle's motion, based on the relative motion of the background vehicle, a two-dimensional Gaussian kernel density kinetic energy field is constructed by combining the two dimensions of polar radius and polar angle:

[0100]

[0101] in, Let i be the kinetic energy field of the i-th background car in frame t. For frame number, The polar coordinates of the background car. The bandwidth of the kinetic energy field is 3. The polar bandwidth of the kinetic energy field is taken as 0.3. and The weighting coefficients for velocity and acceleration are 0.6 and 0.4, respectively.

[0102] S104. Couple and normalize the potential energy field and kinetic energy field to obtain the total risk potential field of a single frame. :

[0103]

[0104] Where N is the number of background vehicles;

[0105] Pick The maximum value is used as the risk value for a single frame. :

[0106]

[0107] in, The effective spatial sampling domain of the roundabout; thus, the scene element risk level SRL is obtained:

[0108]

[0109] Where T is the number of frames in a scene unit.

[0110] like Figure 2 The image shows the risk modeling results of this method for a specific scenario unit. Figure 2 In the diagram, lighter-colored areas indicate higher risk potential field strength, clearly reflecting the comprehensive risk distribution formed by the combined effects of lane line geometric constraints (potential energy field) and the dynamic interaction of surrounding vehicles (kinetic energy field) at a specific moment in a roundabout.

[0111] S2. Construction of a Full-Risk Scenario Library: Based on the risk levels of all scenario units obtained in S1, normalization is performed, and kernel density estimation is used to fit their distribution. Importance sampling is used to enhance the sampling density of low-probability, high-risk areas, obtaining a target distribution covering the entire risk level range. A causal relationship model between scenario unit risk levels and background vehicle motion characteristics is constructed based on a random forest regression model. The background vehicle state motion characteristics are collaboratively optimized to generate variant scenarios. After trajectory smoothing, a scenario library covering the entire risk level range is constructed, thereby building a spatiotemporally continuous roundabout scenario library. The generated background vehicle trajectory is as follows: Figure 3 As shown;

[0112] S201. Risk Normalization and Target Distribution Reconstruction: The risk levels of all scene units calculated in S1 are normalized and mapped to the [0,1] interval. Kernel density estimation is used to fit the normalized risk distribution to obtain the distribution fitting function for the [0,1] interval. To improve the sampling probability of uncovered intervals in the original natural driving dataset and to compensate for the sparse high-risk scenes in the natural driving data, the importance sampling method is used to enhance the sampling density of low-probability high-risk areas, reconstruct the risk distribution, and obtain a target distribution covering the entire risk interval to ensure that the scene library generated subsequently can cover the entire risk interval [0,1].

[0113] S202. Random Forest Regression Model Construction and Training: A global training set is constructed by combining the motion feature vectors of all background vehicles in all scene units with their corresponding single-frame risk values. A random forest regression model is used to learn the non-linear mapping relationship between motion features and single-frame risk values, establishing a causal correlation model.

[0114] Motion characteristics include the extreme diameter of each background vehicle i. Polar angle ,speed acceleration The random forest regression model takes four dimensions as input, with background vehicle motion feature vectors as input and outputs the corresponding single-frame risk value estimate; it integrates the motion feature vectors of all scenes and all background vehicles in the natural driving data. Corresponding Constructing a global training set A random forest regression model is used to learn the nonlinear mapping between motion characteristics and risk values.

[0115]

[0116] in, The risk value for a single frame estimated by the random forest. This is the ensemble function for the random forest regression model. These are the structure parameters of the integration function.

[0117] S203. Motion Feature Risk Contribution Weight Extraction: Extract the risk contribution weight of each motion feature from the trained random forest regression model; traverse all decision trees in the forest, accumulate the error reduction brought by each motion feature when splitting at each decision tree node, and take the average value over all decision trees to obtain the risk contribution weight of each dimension of motion feature, thus constructing a risk contribution vector:

[0118] Random forest regression models quantify causal contributions by assigning importance to motion features, with the risk contribution weight of the k-th dimension motion feature. for:

[0119]

[0120] in, For the number of decision trees, This represents the error reduction brought about by the q-th dimension motion feature on the m-th tree;

[0121] The risk contribution vector is composed of the weights of the four-dimensional motion features. This vector directly reflects the causal driving strength of each motion feature on risk evolution, that is, the magnitude of the influence of the feature change on the scenario risk.

[0122] S204. Risk-Feature Local Response Gradient Calculation: On the trained random forest regression model, calculate the partial derivatives of the risk value with respect to each motion feature in a single frame to obtain the local response gradient vector of the risk value with respect to the motion feature.

[0123] To further obtain the local response gradient of the risk value to the motion feature, the partial derivative of the motion feature is calculated on the trained random forest regression model. The gradient direction represents the instantaneous impact of feature changes on risk; a positive gradient indicates that an increase in feature value leads to an increase in risk, while a negative gradient indicates that an increase in feature value leads to a decrease in risk. This provides an interpretable optimization direction for trajectory iterative optimization.

[0124]

[0125] in, The gradient function represents the motion characteristics. , , , These are the partial derivatives of the risk value with respect to the four motion characteristics: radius, polar angle, velocity, and acceleration.

[0126] S205. Initial Background Vehicle Trajectory Generation and Risk Assessment: Given the target scene risk level, based on the traffic rules of the roundabout and vehicle kinematic constraints, a set of initial background vehicle trajectories is randomly generated; the initial background vehicle trajectories are input into the causal correlation model constructed in S202 to obtain frame-by-frame risk values, and the peak value of the instantaneous risk in the time series is taken as the current scene risk level.

[0127] Given the risk level of the target scenario The scene generation objective is to solve for a set of background vehicle trajectories. , to make The peak converges to the target; firstly, an initial trajectory is randomly generated based on the traffic rules of the roundabout and vehicle kinematic constraints. The initial trajectory is input into the causal correlation model to obtain frame-by-frame results. and obtained This represents the peak value of the instantaneous risk in the time series, i.e., the risk level of the current scenario;

[0128] S206. Trajectory Cooperative Iterative Optimization and Scene Generation: Calculate the deviation between the current scene risk level and the target risk level; combine the risk contribution weights obtained in S203 and the local response gradients obtained in S204 to construct cooperative feature update rules. The risk contribution weights determine the adjustment intensity of each motion feature, and the sign of the response gradient determines the adjustment direction. Update the trajectory according to the set iteration step size.

[0129] Calculate the risk level of the current scenario Risk level of the target scenario Deviation:

[0130]

[0131] By combining risk contribution weights and feature response gradients, a collaborative feature update rule is constructed:

[0132]

[0133] in, Let be the trajectory update offset of the i-th background vehicle's motion features at time t in the k-th iteration. The iteration step size is used to ensure a smooth trajectory. The risk contribution vector determines the adjustment strength of each feature. The risk deviation in round k is... The sign function, which outputs 1 or -1, determines the direction of adjustment;

[0134] S207, Iterative Execution and Diverse Scene Generation: Repeat steps S205 to S207 to generate a spatiotemporal continuous scene library covering the entire risk range [0,1]. Each scene includes a test vehicle reference path (obtained by filtering and fitting the single-frame risk value position in S1) and a smoothed background vehicle trajectory (e.g., ...). Figure 3 As shown), this is suitable for autonomous driving simulation testing of continuous multi-vehicle interaction at roundabouts:

[0135] Update the trajectory and recalculate. With peak Repeat the iteration until it approximates the target. The number of scenes generated in each SRL interval is determined according to the target distribution, and for the same... By using multiple sets of initial trajectories and random perturbations, diverse scenarios with different behaviors are generated:

[0136]

[0137] in, For the disturbance intensity, Let be the initial motion feature vector of the i-th background vehicle at time t after applying a random perturbation. This represents the original initial motion feature vector of the i-th vehicle at time t under undisturbed conditions. With a mean of 0 and a variance of Gaussian distributed random noise.

[0138] S3. Sampling Test: Based on the scenario library built in S2, a simulation test platform is constructed. The autonomous driving algorithm under test is selected, and simulation tests are conducted in suitable scenarios to efficiently and comprehensively demonstrate the driving safety of the algorithm in these scenarios. For example... Figure 4 and Figure 5 As shown, this step presents a directional sampling strategy based on a Gaussian process regression model. This strategy achieves efficient safety testing by simultaneously monitoring two key indicators: average prediction error and prediction standard deviation, through an active learning mechanism.

[0139] In this embodiment, four open-source autonomous driving algorithms were selected for testing: Apollo, Autoware, CARLA, and LG Silicon Valley Simulator (LGSVL). Two scene feature metrics were chosen to represent dynamic change characteristics and key event characteristics, respectively: average rate of change and high-risk duration.

[0140] S301, Hierarchical Initial Sampling: The Latin hypercube sampling method is used to select initial test scenarios from the scenario library to ensure that the test scenarios cover the entire scenario unit risk range [0,1]. Within each risk range, the K-means clustering algorithm is used to divide multiple scenario categories according to scenario feature indicators (high average change rate and long high-risk duration, high average change rate but short high-risk duration, low average change rate but long high-risk duration, low average change rate and short high-risk duration). This hierarchical sampling strategy ensures that the initial test scenarios cover both different risk levels and different risk change characteristics, providing diverse training data for the subsequent Gaussian process regression model.

[0141] S302, Construction of Gaussian Process Regression Model:

[0142] In this embodiment, scenario testing proceeds in a multi-round iterative manner. The number of scenarios in each round of testing is fixed (500 scenarios per round, totaling 100,000 scenarios). Independent Gaussian process regression models are constructed for the four open-source autonomous driving algorithms to differentiate the safety performance of different algorithms.

[0143] Perform unified feature representation on the scene:

[0144]

[0145] in, The average rate of change of sSRV. For the duration of high risk of sSRV, For indicator functions, This is a high-risk threshold. Therefore, a scene feature vector is constructed. The minimum relative distance between the test vehicle and BVs is used as the crash assessment output. Where d is the minimum relative distance. Let be the two-dimensional planar position coordinate vector of the test vehicle AV in frame t. Let be the two-dimensional planar position coordinate vector of the i-th background vehicle BV in frame t. When, it is marked as a collision sample, where, This is the minimum relative distance threshold.

[0146] Based on the initial test results, a Gaussian process regression model is constructed to establish a quantitative mapping relationship between the risk level of scene units, scene characteristic indicators, and the shortest relative distance experienced by the test vehicle.

[0147]

[0148] in, Let be the scene feature vector, and y be the collision index value of the Gaussian process regression model. It is a Gaussian process function. It is a mean function. This is the covariance kernel function for a Gaussian process, used to measure the covariance of two sets of scenarios. , Similarity between them For the overall scale variance, The characteristic length scale matrix, , , These are the length scale hyperparameters corresponding to the features in the three dimensions;

[0149] Given the tested set ,in The collision index value obtained from the test of the g-th scene is... The total number of scenario samples that have been simulated and tested after the k-th iteration is given by the number of untested scenarios. Gaussian process regression models can output predicted mean. With prediction variance :

[0150]

[0151] in, For kernel vector, The kernel matrix of the training set. To observe the noise variance.

[0152] S303, Expected Improvement Strategy-Based Sampling: Targeted sampling is performed using the expected improvement strategy as the scenario selection criterion; the expected improvement of each untested scenario relative to the optimal collision risk in the currently tested samples is calculated, and the top few scenarios with the highest expected improvement values ​​are selected for testing.

[0153] Let the optimal collision risk in the tested samples be... The increase in risk for untested scenarios is defined as follows: Its expected increase under the posterior distribution of Gaussian process regression is:

[0154]

[0155] in, Untested scenario The expected increase The cumulative distribution function of the standard normal distribution. It is the probability density function of the standard normal distribution.

[0156] S304, Iterative Update and Dual Convergence Criterion: In each round, the test results of the scenario selected in S303 are included in the training set to update the Gaussian process regression model; the iterative process adopts a dual convergence criterion. When the global average prediction error and the average prediction standard deviation simultaneously meet the convergence condition, the iteration stops; otherwise, it returns to S303 to continue the next round of sampling until the Gaussian process regression model has fully learned the scenario risk characteristics.

[0157] In each round, the top g scenarios with the highest expected improvement are selected for testing and included in the training set for updating, so that the sampling points are gradually focused on high-risk and high-uncertainty areas; the iteration process adopts a dual convergence criterion, and the iteration stops when the global average prediction standard deviation and the average prediction error meet the convergence condition, otherwise it returns to step S303 to continue the iteration;

[0158] The convergence condition is defined as:

[0159]

[0160] in, The convergence threshold for the average prediction standard deviation is set to 0.1. The convergence threshold for the average prediction error is set to 0.2. Let be the collision index value predicted by the Gaussian process regression model for the g-th scene. Let be the posterior standard deviation of the prediction result of the Gaussian process regression model for the g-th scenario; when both indicators meet the convergence condition, terminate the iterative sampling; otherwise, return to step S303 to continue the iteration.

[0161] like Figure 4 and Figure 5 The study demonstrates the trends of average prediction error and standard deviation of four algorithms during iteration. The differences in convergence performance among the four algorithms show that Carla converges fastest at 14 iterations, indicating its highest learning efficiency in learning risk evolution patterns in roundabout scenarios. LGSVL requires 36 iterations to converge, suggesting weaker adaptability to complex interaction scenarios. Autoware and Apollo perform moderately, at 19 and 25 iterations respectively. After convergence, the average prediction error of all algorithms remains within the range of [0, 0.05], and the standard deviation stabilizes within [0.06, 0.13], with fluctuations less than 10%. This indicates that the Gaussian process regression model has fully learned the scenario risk characteristics, and subsequent new samples have a weak impact on the causal association model, demonstrating good generalization ability and supporting the subsequent S4 stage safety quantitative assessment.

[0162] Furthermore, if all scenarios in the scenario library are selected for testing, 200 simulation rounds are required, while the present method only requires a maximum of 36 rounds (LGSVL) to complete the convergence modeling of the causal relationship model, reducing the testing cost by more than 82%, thus fully demonstrating the efficiency of the present invention.

[0163] S4: Security Assessment

[0164] This step, based on the converged Gaussian process regression model in S3, quantitatively evaluates the safety of the autonomous driving algorithm, including the following:

[0165] (1) Collision probability distribution output.

[0166] Using a converged Gaussian process regression model, inputting scene unit risk level and scene feature indicators, the model outputs the predicted shortest relative distance between the test vehicle and the background vehicle. By analyzing the prediction output of the Gaussian process regression model under different combinations of risk level thresholds and scene feature indicators, the collision probability distribution of the target autonomous driving algorithm is generated.

[0167] (2) Determining the safety boundary of the algorithm.

[0168] Based on the collision probability distribution, the safe operating boundary of autonomous driving algorithms is clearly defined. For example, when the risk level of a scene unit is below a certain threshold, the collision probability decreases significantly; this threshold is the safety boundary of the algorithm. This boundary provides a quantitative basis for the actual deployment of the algorithm.

[0169] (3) Identification of easily collided scene types.

[0170] Analyze the combination of characteristic indicators for high-collision-probability scenarios to identify scenario types prone to collisions. For example, a combination of a specific risk level range and specific scenario characteristics may constitute a collision-prone scenario type.

[0171] (4) Quantitative assessment report generation.

[0172] Based on the above analysis results, a quantitative evaluation report is generated, including: algorithm security boundaries, which clarify the risk threshold range within which the algorithm can run safely; collision-prone scenario types, which list the characteristic index combinations of high-risk scenarios and their corresponding collision probabilities; and test efficiency descriptions, which explain the minimum number of test scenarios required for the evaluation based on the convergence conditions of the Gaussian process regression model, reflecting the efficiency of the test.

[0173] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0174] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for constructing an autonomous driving scenario library based on causal modeling, characterized in that: Includes the following steps: S1. Risk field modeling and scene unit risk degree calculation: Extract continuous frame sequences centered on the main vehicle from the natural driving dataset to form scene units. Filter the set of background vehicles that have potential conflicts with the main vehicle, record their positions and motion states, and construct a potential energy field based on lane geometric boundary constraints and a kinetic energy field based on the relative motion state of the background vehicles. Couple the potential energy field and the kinetic energy field to obtain the total risk potential field of a single frame. Extract the risk value of a single frame from it, and then use the maximum value of all frames within the scene unit as the risk degree of that scene unit. S2. Construction of a full-risk scenario library: Based on the risk levels of all scenario units obtained in S1, normalize the risk levels and fit their distribution using kernel density estimation. Enhance the sampling density of low-probability, high-risk areas through importance sampling to obtain a target distribution covering the entire risk level range. Construct a causal relationship between scenario unit risk levels and background vehicle motion characteristics based on a random forest regression model. Perform collaborative optimization on the background vehicle state motion characteristics to generate variant scenarios. After trajectory smoothing, construct a scenario library covering the entire risk level range. S3. Sampling test: Recalculate the single-frame risk value for each scene in the scene library of S2 and construct the reference path for the test vehicle. In the initial sampling stage, a sampling method based on coverage combined with scene feature clustering is used to select test scenes. During the directional iterative sampling phase, a Gaussian process regression model is constructed, taking the scene unit risk level and scene feature indicators as inputs and the shortest relative distance between the test vehicle and the background vehicle as outputs. Based on the expected improvement strategy, untested scenes are iteratively selected for testing and the Gaussian process regression model is updated until the convergence condition is met. S4. Safety Assessment: Based on the converged Gaussian process regression model, determine the minimum number of test scenarios required to assess the safety of autonomous driving algorithms, and identify the types of scenario features that are prone to collisions.

2. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 1, characterized in that: S1 specifically includes: S101. Scene Unit Construction and Feature Extraction: Extract continuous frame sequences centered on the main vehicle from the natural driving dataset to form scene units, and filter the set of background vehicles that have potential conflicts with the main vehicle. Where l is the number of dynamic filters and satisfies , Set a preset upper limit for the number of background vehicles; record the motion feature vectors of each background vehicle. To ensure that the risk diffusion pattern aligns with the driving direction at the roundabout, the Cartesian coordinate system is transformed into a polar coordinate system, where, Let be the spatial polar coordinates of the i-th background car at time t. and Let be the velocity and acceleration of the i-th background vehicle at time t, respectively. S102. Let the geometric constraints of the inner and outer ring road lines in the extreme radius direction be the reference extreme radius of the inner ring road line, respectively. Reference extreme diameter of outer ring road lines Construct a one-dimensional Gaussian kernel density potential energy field: ; in, For potential energy field, The polar radius coordinates of the background vehicle. The reference polar radius coordinates for lane line l. The lane line constraint strength coefficient, The bandwidth of the potential energy field; S103. Based on the relative motion of the background vehicle, a two-dimensional Gaussian kernel density kinetic energy field is constructed by combining the two dimensions of polar radius and polar angle: ; in, Let i be the kinetic energy field of the i-th background car in frame t. For frame number, The polar coordinates of the background car. The bandwidth of the kinetic energy field's polar radius. The polar bandwidth of the kinetic energy field. and The weighting coefficients for the background vehicle's speed and acceleration; S104. Couple and normalize the potential energy field and kinetic energy field to obtain the total risk potential field of a single frame. : ; Where N is the number of background vehicles; Pick The maximum value is used as the risk value for a single frame. : ; in, The effective spatial sampling domain of the roundabout; thus, the scene element risk level SRL is obtained: ; Where T is the number of frames in a scene unit.

3. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 1, characterized in that: S2 specifically includes: S201. Risk Normalization and Target Distribution Reconstruction: The risk levels of all scenario units calculated in S1 are normalized; kernel density estimation is used to fit the normalized risk distribution; to compensate for the sparseness of high-risk scenarios in natural driving data, importance sampling is used to enhance the sampling density of low-probability high-risk areas, reconstruct the risk distribution, and obtain a target distribution covering the entire risk range, ensuring that the scenario library generated subsequently can cover the entire risk range. S202. Random Forest Regression Model Construction and Training: The motion feature vectors of all background vehicles in all scene units and their corresponding single-frame risk values ​​constitute a global training set; the random forest regression algorithm is used to learn the nonlinear mapping relationship between motion features and single-frame risk values, and a causal relationship model is established. S203. Extraction of risk contribution weights for motion features: Extract the risk contribution weights of each motion feature from the trained random forest regression model; traverse all decision trees in the forest, accumulate the error reduction brought by each motion feature when splitting at each decision tree node, take the average value of all decision trees, and obtain the risk contribution weights of each dimension of motion features to form a risk contribution vector. S204. Risk-Feature Local Response Gradient Calculation: On the trained random forest regression model, calculate the partial derivative of the risk value of a single frame with respect to each motion feature to obtain the local response gradient vector of the risk value with respect to the motion feature. S205. Initial background vehicle trajectory generation and risk assessment: Given the risk level of the target scene, a set of initial background vehicle trajectories are randomly generated based on the traffic rules of the roundabout and the vehicle kinematic constraints. The initial background vehicle trajectories are input into the causal relationship model constructed in S202 to obtain the risk value of each frame, and the peak value of the instantaneous risk in the time series is taken as the risk level of the current scene. S206. Trajectory Cooperative Iterative Optimization and Scene Generation: Calculate the deviation between the current scene risk level and the target risk level; combine the risk contribution weight obtained in S203 and the local response gradient obtained in S204 to construct a cooperative feature update rule, use the risk contribution weight to determine the adjustment intensity of each motion feature, use the positive or negative sign of the response gradient to determine the adjustment direction, and update the trajectory according to the set iteration step size. S207. Iterative Execution and Diverse Scene Generation: After updating the trajectory, recalculate the frame-by-frame risk value and peak risk level, repeat the iteration until the target risk level is approached, determine the number of generated scenes for each risk level interval according to the target distribution, use multiple sets of initial trajectories and random perturbations for the same target risk level to generate variant scenes with diverse behaviors, and build a scene library covering the entire risk level interval after trajectory smoothing.

4. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 1, characterized in that: S3 specifically includes: S301. Hierarchical initial sampling: The Latin hypercube sampling method is used to select initial test scenarios from the scenario library to ensure that the test scenarios cover the risk level range of the entire scenario unit. Within each risk level range, the K-means clustering algorithm is used to divide multiple scenario categories according to scenario feature indicators, so that the initial test scenarios simultaneously cover different risk levels and different risk evolution modes, providing diversified training data for the subsequent Gaussian process regression model. S302. Construction of Gaussian process regression model: Based on the initial test results, a Gaussian process regression model is constructed, with the scenario risk level and scenario characteristic indicators as inputs and the shortest relative distance between the test vehicle and the background vehicle as output, to establish a quantitative mapping relationship. S303, Expected Improvement Strategy Targeted Sampling: Targeted sampling is performed using the expected improvement strategy as the scenario selection criterion; the expected improvement of each untested scenario relative to the optimal collision risk in the current tested samples is calculated, and the top few scenarios with the highest expected improvement values ​​are selected for testing; S304, Iterative Update and Dual Convergence Criteria: In each round, the test results of the scenario selected in S303 are included in the training set to update the Gaussian process regression model. The iterative process adopts a dual convergence criterion. When the global average prediction error and the average prediction standard deviation simultaneously meet the convergence condition, the iteration stops. Otherwise, it returns to S303 to continue the next round of sampling until the Gaussian process regression model has fully learned the scenario risk characteristics.

5. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 3, characterized in that: Specifically, S202 is as follows: Motion characteristics include the extreme diameter of the background vehicle. Polar angle ,speed acceleration The random forest regression model takes four dimensions as input, with background vehicle motion feature vectors as input and outputs the corresponding single-frame risk value estimate; it integrates the motion feature vectors of all scenes and all background vehicles in the natural driving data. Corresponding Constructing a global training set ; A random forest regression model is used to learn the nonlinear mapping between motion features and risk values: ; in, The risk value for a single frame estimated by the random forest. The ensemble function for random forest ensembles. These are the structure parameters of the integration function.

6. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 3, characterized in that: Specifically, S203 and S204 are as follows: S203: The random forest regression model quantifies causal contribution through the importance of motion features, with the risk contribution weight of the k-th dimension motion feature. for: ; in, For the number of decision trees, This represents the error reduction brought about by the q-th dimension motion feature on the m-th tree; The risk contribution vector is composed of the weights of the four-dimensional motion features. This vector directly reflects the causal driving strength of each motion feature on risk evolution, that is, the magnitude of the influence of the feature change on the scenario risk. S204: To further obtain the local response gradient of the risk value to the motion feature, the partial derivative of the motion feature is calculated on the trained random forest regression model. The gradient direction represents the instantaneous impact of feature changes on risk. A positive gradient indicates that an increase in feature value leads to an increase in risk, while a negative gradient indicates that an increase in feature value leads to a decrease in risk. This provides an interpretable optimization direction for trajectory iterative optimization. ; in, Let be the gradient function of the motion characteristics. , , , These are the partial derivatives of the risk value with respect to the four motion characteristics: radius, polar angle, velocity, and acceleration.

7. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 3, characterized in that: Specifically, S205, S206, and S207 are as follows: S205: Risk level of the given target scenario The scene generation objective is to solve for a set of background vehicle trajectories. , to make The peak converges to the target; firstly, an initial trajectory is randomly generated based on the traffic rules of the roundabout and vehicle kinematic constraints. The initial trajectory is input into the causal correlation model to obtain frame-by-frame results. and obtained This represents the peak value of the instantaneous risk in the time series, i.e., the risk level of the current scenario; S206: Calculate the risk level of the current scenario Risk level of the target scenario Deviation: ; By combining risk contribution weights and feature response gradients, a collaborative feature update rule is constructed: ; in, Let be the trajectory update offset of the i-th background vehicle's motion features at time t in the k-th iteration. The iteration step size is used to ensure a smooth trajectory. The risk contribution vector determines the adjustment strength of each feature. The risk deviation in round k is... The sign function, which outputs 1 or -1, determines the direction of adjustment; S207: Update the trajectory and recalculate. With peak Repeat the iteration until it approximates the target. The number of scenes generated in each SRL interval is determined according to the target distribution, and for the same... By using multiple sets of initial trajectories and random perturbations, diverse scenarios with different behaviors are generated: ; in, For the disturbance intensity, Let be the initial motion feature vector of the i-th background vehicle at time t after applying a random perturbation. This represents the original initial motion feature vector of the i-th vehicle at time t under undisturbed conditions. With a mean of 0 and a variance of Gaussian distributed random noise.

8. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 4, characterized in that: Specifically, S302 is as follows: Based on the initial test results, a Gaussian process regression model is constructed to establish a quantitative mapping relationship between the risk level of scene units, scene characteristic indicators, and the shortest relative distance experienced by the test vehicle. ; in, Let be the scene feature vector, and y be the collision index value of the Gaussian process regression model. It is a Gaussian process function. It is a mean function. This is the covariance kernel function for a Gaussian process, used to measure the covariance of two sets of scenarios. , Similarity between them For the overall scale variance, The characteristic length scale matrix, , , These are the length scale hyperparameters corresponding to the features in the three dimensions; Given the tested set ,in The collision index value obtained from the test of the g-th scene is... The total number of scenario samples that have been simulated and tested after the k-th iteration is given by the number of untested scenarios. Gaussian process regression models can output predicted mean. With prediction variance : ; in, For kernel vector, The kernel matrix of the training set. To observe the noise variance, This is an indicator function.

9. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 4, characterized in that: Specifically, S303 is: A target sampling strategy is performed using the expectation enhancement strategy as the scenario selection criterion; let the optimal collision risk in the tested samples be... The increase in risk for untested scenarios is defined as follows: Its expected improvement under the posterior distribution of the Gaussian process regression model is: ; in, Untested scenario The expected increase The cumulative distribution function of the standard normal distribution. It is the probability density function of the standard normal distribution.

10. The method for constructing an autonomous driving scenario library based on causal modeling according to claim 4, characterized in that: Specifically, S304 is: In each round, the top g scenarios with the highest expected improvement are selected for testing and included in the training set for updating, so that the sampling points are gradually focused on high-risk and high-uncertainty areas; the iteration process adopts a dual convergence criterion, and the iteration stops when the global average prediction standard deviation and the average prediction error meet the convergence condition, otherwise it returns to step S303 to continue the iteration; The convergence condition is defined as: ; in, The convergence threshold for the average prediction standard deviation, This is the convergence threshold for the average prediction error. Let be the collision index value predicted by the Gaussian process regression model for the g-th scene. Let be the posterior standard deviation of the prediction result of the Gaussian process regression model for the g-th scenario. When both indicators meet the convergence condition, the iterative sampling is terminated; otherwise, return to step S303 to continue the iteration.

Citation Information

Patent Citations

  • Construction method of automatic driving automobile test scene library

    CN114818381A

  • A risk assessment method for roundabout scenarios of intelligent connected vehicles based on risk field

    CN117400930B