A method and system for generating high-risk car-following scenarios based on semantic data
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]本发明提供了一种基于语义数据的高危跟驰场景生成方法及系统,以解决现有的高危跟驰场景生成方式存在行为关联性差、高危跟驰特征缺失的问题
本发明提供的基于语义数据的高危跟驰场景生成方法,通过构建包含跟驰间距、相对速度、车辆纵向加速度的跟驰轨迹交互特征,并提取初始间距、最大逼近速率、后车响应方式及关键交互时刻等多维特征,能够完整描述后车持续逼近、前车减速后后车迟滞响应等时序动态过程,克服了传统数值特征对车辆交互行为描述片面的缺陷,解决了高危跟驰场景生成过程中的特征缺失问题,通过将数值轨迹特征转换为跟驰轨迹语义文本,并利用主题模型进行语义聚类。通过计算场景主题分布向量并划分高危语义簇,能够从交通行为和场景语义角度解释不同簇之间的本质差异,解决了传统数值聚类结果缺乏语义含义的问题,通过利用跟驰轨迹语义文本中簇内语义的连续性,提高了场景生成过程中车辆交互过程的行为关联性,能够更加清楚的描述后车持续逼近、前车减速后后车迟滞响应、速度波动传递等动态过程,便于场景库构建和测试用例设计;通过从高危语义簇中提取原型场景,并对关键轨迹参数向量施加可控扰动,能够在保留原有高危语义特征的前提下自动生成多样化的新高危跟驰轨迹。同时,通过语义聚类距离判断和高危语义簇接受阈值验证,确保了新生成场景的有效性和高危特性,克服了现有技术仅停留在样本筛选而缺乏生成机制的问题。
Smart Images

Figure CN122572175A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to a method and system for generating high-risk car-following scenarios based on semantic data. Background Technology
[0002] With the development of intelligent connected vehicles, autonomous driving systems, and traffic safety analysis technologies, how to efficiently extract, represent, and generate representative high-risk traffic scenarios from natural driving data has become an important research problem in traffic engineering and autonomous driving testing. Car-following scenarios are one of the most basic and common vehicle interaction scenarios in road traffic, and their operational status directly affects traffic flow stability, vehicle longitudinal control safety, and the reliability of the car-following function of autonomous driving systems. Therefore, research on the identification, semantic representation, and automatic generation of high-risk car-following scenarios has significant theoretical and engineering application value.
[0003] Existing methods for constructing high-risk car-following scenarios are mostly based on numerical thresholds, statistical indicators, or rule-based screening. For example, high-risk samples are extracted using indicators such as vehicle headway, headway distance, collision time, and relative speed, and then clustering or classification methods are used for inductive analysis. While these methods can identify some high-risk samples, they still have the following shortcomings. First, traditional numerical features have limited expressive power. The vehicle interaction process in car-following scenarios has obvious temporal and behavioral correlations, and it is difficult to fully describe the dynamic processes such as the continuous approach of the following vehicle, the delayed response of the following vehicle after the deceleration of the preceding vehicle, and the transmission of speed fluctuations using only a small number of statistical quantities. Second, the interpretability of existing scenario analysis results is insufficient. Clustering based on numerical features usually only yields a few sample clusters with similar values, but it is difficult to explain the essential differences between different clusters from the perspective of traffic behavior and scenario semantics, which is not conducive to the construction of autonomous driving scenario libraries and test case design. Third, existing methods lack research on scenario generation. Existing research mostly focuses on screening and classifying existing samples, lacking a mechanism that can automatically generate new scenarios while retaining high-risk features, making it difficult to meet the needs of autonomous driving simulation testing for the diversity and controllability of high-risk car-following scenarios. Fourth, existing technologies lack a complete technical chain from trajectory data and semantic analysis to scene generation. Trajectory feature extraction, text representation, topic modeling, and scene generation are often carried out separately, and a unified closed-loop methodology has not yet been formed. Therefore, existing methods for generating high-risk following scenarios suffer from poor behavioral correlation and missing high-risk following features. Summary of the Invention
[0004] This invention provides a method and system for generating high-risk car-following scenarios based on semantic data, in order to solve the problems of poor behavioral correlation and lack of high-risk car-following features in existing high-risk car-following scenario generation methods.
[0005] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, the present invention provides a method for generating high-risk car-following scenarios based on semantic data, comprising: S1. Obtain the dual-vehicle following trajectory data in the dual-vehicle following scenario, and preprocess the dual-vehicle following trajectory data to obtain dual-vehicle following scenario samples. S2. Determine the car-following trajectory relationship in the dual-vehicle car-following scenario sample, and construct car-following trajectory interaction features based on the car-following trajectory relationship; S3. Convert the car-following trajectory interaction features into car-following trajectory semantic text, and preprocess the car-following trajectory semantic text to obtain standardized semantic corpus; S4. Convert the standardized semantic corpus into a scene topic model, calculate the distribution vector of the scene topic model, and determine the high-risk follow-up semantic clusters based on the distribution vector; S5. Identify prototype scenarios from high-risk car-following semantic clusters and construct new high-risk car-following trajectories based on prototype scenarios; S6. Convert the new high-risk car-following trajectory into newly generated semantic text, perform semantic clustering distance judgment on the newly generated semantic text, and when the semantic clustering distance is less than or equal to the acceptance threshold of the high-risk semantic cluster, generate the final high-risk car-following scenario based on the new high-risk car-following trajectory.
[0006] Preferably, in S1, the dual-vehicle following trajectory data includes: vehicle position information, vehicle speed information, lane number information, and time frame number information; Preprocessing the dual-vehicle following trajectory data yields dual-vehicle following scenario samples, including: The continuous following scenario is determined based on vehicle location information, lane number information, and time frame number information. In continuous following scenarios, the positions of the preceding and following vehicles in the same lane are determined based on vehicle location information and lane number information in dual-vehicle following scenarios. In continuous car-following scenarios, the speeds of the preceding and following vehicles are determined based on vehicle speed information; Based on the positions of the preceding and following vehicles, the speed of the preceding vehicle, and the speed of the following vehicle in a continuous car-following scenario, a sample of a dual-vehicle car-following scenario is constructed.
[0007] Preferably, in S2, determining the following trajectory relationship in the dual-vehicle following scenario samples includes: The following distance is determined based on the positions of the preceding and following vehicles, where the following distance satisfies the following relationship: ; In the formula, Indicates the position of the vehicle in front. Indicates the position of the following vehicle. Indicates the following distance; The relative speed is determined based on the speeds of the vehicles in front and behind, where the relative speed satisfies the following relationship: ; In the formula, Indicates the speed of the following vehicle. Indicates the speed of the vehicle in front. Represents relative velocity; The vehicle's longitudinal acceleration is determined based on the vehicle speed in the previous time frame and the vehicle speed in the current time frame, where the vehicle's longitudinal acceleration satisfies the following relationship: , ; In the formula, Indicates the interval between adjacent time frames. This indicates the vehicle speed in the previous time frame. This indicates the vehicle speed in the current time frame. Indicates the longitudinal acceleration of the vehicle; The following trajectory relationship in the dual-vehicle following scenario sample is determined based on the following distance, relative speed, and vehicle longitudinal acceleration. Based on the car-following trajectory relationship, car-following trajectory interaction features are constructed, including: The initial and minimum car-following distances are determined based on the car-following distance. The maximum approach rate and car-following stability phase are determined based on the relative speed. The speed change trend of the preceding vehicle, the response mode of the following vehicle, and the key interaction moments are determined based on the vehicle's longitudinal acceleration. The initial car-following distance, minimum car-following distance, maximum approach rate, car-following stability phase, speed change trend of the preceding vehicle, response mode of the following vehicle, and key interaction moments are used to construct the car-following trajectory interaction features.
[0008] Preferably, in S3, the car-following trajectory interaction features are converted into car-following trajectory semantic text, and the car-following trajectory semantic text is preprocessed to obtain standardized semantic corpus, including: Key moment information is extracted from the interaction features of the car-following trajectory, and the key moment information is used as the input of the semantic model to generate semantic text of the car-following trajectory. The key moment information includes: start frame, end frame, minimum gap frame, maximum approach frame, maximum deceleration frame of the preceding vehicle, and maximum braking frame of the following vehicle. The semantic text of the car-following trajectory includes: the roles of the vehicles in front and behind, the initial speed, initial distance and lane position of the vehicles, the trend of the car-following distance and relative speed, the acceleration and deceleration behavior of the vehicles in front and behind, and the machine timing relationship of key interaction events. Standardized semantic corpus is obtained by processing the semantic text of the car-following trajectory using standardized rules. The standardized rules include: lowercase text conversion, removal of numerical expressions, removal of redundant spaces and punctuation marks, removal of common English stop words, removal of custom stop words, stemming, and deletion of low-frequency terms.
[0009] Preferably, in S4, the standardized semantic corpus is converted into a scene topic model, and the distribution vector and intra-cluster scatter of the scene topic model are calculated, including: A semantic text set is constructed based on a standardized semantic corpus, wherein the semantic text set satisfies the following relation: ; In the formula, Represents a collection of semantic texts. A scenario document representing a standardized semantic expectation. Indicates the total number of text elements in the scene; Set the range of candidate topic numbers, and construct the scene topic model corresponding to each candidate topic number based on the candidate topic number range and the semantic text set; For each scenario topic model, residual index, semantic consistency index, and exclusivity index are calculated, and the optimal scenario topic model is determined based on the minimum residual index and the maximum semantic consistency index and exclusivity index. The residual index is calculated according to the following formula: ; In the formula, Indicates the total number of scene texts. Indicates the size of the vocabulary. Indicates the first Words in a text True word frequency Indicates the first Words in a text Predicted word frequencies; The semantic consistency index is calculated according to the following relationship: ; In the formula, Indicates the number of candidate topics. This indicates the high-frequency words in each topic. , They represent the first The most frequent words and the first High-frequency words, Indicates that it contains the first The most frequent words and the first The number of texts containing high-frequency words. Indicates containing the first The number of texts containing high-frequency words. Represents a small smoothing constant. The normalization coefficient represents the quantity of word pairs; The exclusivity index is calculated according to the following relationship: ; In the formula, Indicates the topic The generation of the first The probability of each word Indicates the first The sum of the probabilities of each word in all topics; Calculate the distribution vector and intra-cluster discretization of the optimal scene topic model, where the distribution vector is calculated according to the following relationship: ; ; ; In the formula, This represents the distribution vector of the optimal scene topic model. Representing a scene In the Probability weights for each topic Indicates the first All words in the first scenario are assigned to the first... The cumulative posterior probability of each topic. This represents the number of topics corresponding to the optimal scenario topic model. This indicates the number of samples in the following scenarios.
[0010] Preferably, in S4, the high-risk catwalk semantic cluster is determined based on the distribution vector, including: Semantic clustering is performed on the distribution vectors, and M candidate semantic clusters C are formed based on the semantic clustering distance. The semantic clustering distance satisfies the following relationship: ; In the formula, Represents semantic clustering distance. Representing candidate semantic clusters The center; High-risk scenarios are identified in candidate semantic clusters using a threshold calibration method, and the proportion of high-risk scenarios in the candidate semantic clusters is calculated based on the high-risk scenarios within each cluster. The calculation of the high-risk proportion satisfies the following relationship: ; In the formula, This indicates the high-risk percentage of candidate semantic clusters. Indicates the number of high-risk scenarios within the cluster. Indicates the total number of scenes within the cluster; The high-risk percentage of candidate semantic clusters is compared with a preset high-risk percentage threshold. When the high-risk percentage of a candidate semantic cluster is greater than or equal to the preset high-risk percentage threshold, the candidate semantic cluster is determined as a high-risk follower semantic cluster. When the high-risk percentage of a candidate semantic cluster is less than the preset high-risk percentage threshold, the candidate semantic cluster is determined as a normal semantic cluster.
[0011] Preferably, in S5, the prototype scenario is determined from the high-risk follow-up semantic cluster, including: Calculate the cluster center vector and intra-cluster scatter of the high-risk catastrophe semantic cluster, wherein the calculation of the cluster center vector satisfies the following relationship: ; The calculation of intra-cluster dispersion satisfies the following relationship: ; In the formula, Represents the cluster center vector. Indicates the first A high-risk semantic cluster, Indicates the degree of dispersion within a cluster; The selection threshold for prototype scenarios is determined based on intra-cluster dispersion, and prototype scenarios are then selected from high-risk catastrophe semantic clusters based on this threshold. The determination of the prototype scenario selection threshold satisfies the following relationship: ; The prototype scene is determined according to the following relationship: ; In the formula, This represents the selection threshold for the prototype scene. Indicates the preset scaling factor. This represents the prototype scenario.
[0012] Preferably, in S5, a new high-risk following trajectory is constructed based on the prototype scenario, including: Extract key trajectory parameter vectors from the prototype scenes to construct a set of prototype scenes, where the set of prototype scenes satisfies the following relationship: ; In the formula, This is the initial following distance. The initial relative velocity, The minimum acceleration of the vehicle in front. The minimum acceleration of the following vehicle. For the response delay of the following vehicle, The duration of the key interaction; By perturbing the key trajectory parameter vectors in the prototype scenario set, new high-risk car-following trajectories are obtained. The new high-risk car-following trajectories obtained by perturbing satisfy the following relationship: ; In the formula, Indicates the applied disturbance. This represents a new set of high-risk following trajectories.
[0013] Preferably, S6 includes: After converting the new high-risk car-following trajectory set into newly generated semantic text, the newly generated semantic text is converted into a new scene topic model, and the topic distribution vector of the new scene subject model is calculated. The new semantic clustering distance is calculated based on the topic distribution vector of the new scene subject model, and the acceptance threshold of high-risk catastrophe semantic clusters is determined based on the intra-cluster dispersion. The acceptance threshold of high-risk catastrophe semantic clusters satisfies the following relationship: ; ; In the formula, This indicates the acceptance threshold for high-risk chain reaction semantic clusters. This indicates the overall high-risk baseline percentage. This represents the total number of all scenarios. This represents the total number of all high-risk scenarios. Indicates the preset offset increment; The new semantic clustering distance is compared with the acceptance threshold of the high-risk car-following semantic cluster. If the new semantic clustering distance is less than or equal to the acceptance threshold of the high-risk car-following semantic cluster, the new high-risk car-following trajectory set is retained as a valid scenario, and the valid scenario is generated as the final high-risk car-following scenario.
[0014] Secondly, the present invention also provides a high-risk car-following scenario generation system based on semantic data, including a processor and a memory; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of the method described in the first aspect.
[0015] Beneficial effects: The high-risk car-following scenario generation method provided by this invention constructs car-following trajectory interaction features including car-following distance, relative speed, and vehicle longitudinal acceleration, and extracts multi-dimensional features such as initial distance, maximum approach rate, following vehicle response mode, and key interaction moments. It can completely describe the temporal dynamic process such as the continuous approach of the following vehicle and the delayed response of the following vehicle after the deceleration of the preceding vehicle. It overcomes the shortcomings of traditional numerical features in describing vehicle interaction behavior in a one-sided manner and solves the problem of feature loss in the high-risk car-following scenario generation process. It converts numerical trajectory features into car-following trajectory semantic text and uses topic models for semantic clustering. By calculating the scene theme distribution vector and dividing it into high-risk semantic clusters, the essential differences between different clusters can be explained from the perspective of traffic behavior and scene semantics. This solves the problem of the lack of semantic meaning in traditional numerical clustering results. By utilizing the continuity of semantics within clusters in the car-following trajectory semantic text, the behavioral correlation of vehicle interaction processes during scene generation is improved. This allows for a clearer description of dynamic processes such as the continuous approach of following vehicles, the delayed response of following vehicles after the deceleration of the preceding vehicle, and the transmission of speed fluctuations, facilitating the construction of scene libraries and the design of test cases. By extracting prototype scenes from high-risk semantic clusters and applying controllable perturbations to key trajectory parameter vectors, diverse new high-risk car-following trajectories can be automatically generated while retaining the original high-risk semantic features. At the same time, by using semantic clustering distance judgment and high-risk semantic cluster acceptance threshold verification, the effectiveness and high-risk characteristics of the newly generated scenes are ensured, overcoming the problem that existing technologies only focus on sample selection and lack a generation mechanism. Attached Figure Description
[0016] Figure 1 This is a flowchart of a preferred embodiment of the high-risk car-following scenario generation method based on semantic data of the present invention; Figure 2 This is a flowchart illustrating the trajectory-to-semantic text conversion of a preferred embodiment of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will be clearly and completely described below. 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.
[0018] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms "an" or "a" and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms "connected" or "linked" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up," "down," "left," "right," etc., are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship also changes accordingly.
[0019] Please see Figures 1-2 This application provides a method for generating high-risk car-following scenarios based on semantic data, including: S1. Obtain the dual-vehicle following trajectory data in the dual-vehicle following scenario, and preprocess the dual-vehicle following trajectory data to obtain dual-vehicle following scenario samples. S2. Determine the car-following trajectory relationship in the dual-vehicle car-following scenario sample, and construct car-following trajectory interaction features based on the car-following trajectory relationship; S3. Convert the car-following trajectory interaction features into car-following trajectory semantic text, and preprocess the car-following trajectory semantic text to obtain standardized semantic corpus; S4. Convert the standardized semantic corpus into a scene topic model, calculate the distribution vector of the scene topic model, and determine the high-risk follow-up semantic clusters based on the distribution vector; S5. Identify prototype scenarios from high-risk car-following semantic clusters and construct new high-risk car-following trajectories based on prototype scenarios; S6. Convert the new high-risk car-following trajectory into newly generated semantic text, perform semantic clustering distance judgment on the newly generated semantic text, and when the semantic clustering distance is less than or equal to the acceptance threshold of the high-risk semantic cluster, generate the final high-risk car-following scenario based on the new high-risk car-following trajectory.
[0020] In the above embodiments, by acquiring and preprocessing dual-vehicle following trajectory data, the shortcomings of traditional methods that rely solely on a single statistical indicator and ignore dynamic processes are addressed. By determining the relationship between following trajectories and constructing interaction features, the ability to characterize the behavioral correlation of the scene is enhanced. By converting numerical features into semantic text and performing standardization processing, the foundation for subsequent semantic analysis is laid, solving the problem of insufficient interpretability of traditional numerical features. Through semantic topic modeling and distribution vector calculation, high-risk following semantic clusters can be automatically discovered and labeled from the semantic dimension. By extracting prototypes from semantic clusters and generating new high-risk trajectories, a scene generation mechanism is established, filling the gap in the lack of generation capabilities in existing technologies. By performing semantic verification and acceptance threshold judgment on the newly generated trajectories, the real high-risk characteristics of the generated scene are ensured. Overall, a complete closed-loop technical link is constructed from trajectory data to semantic analysis to scene generation and verification.
[0021] Preferably, in S1, the dual-vehicle following trajectory data includes: vehicle position information, vehicle speed information, lane number information, and time frame number information; Preprocessing the dual-vehicle following trajectory data yields dual-vehicle following scenario samples, including: The continuous following scenario is determined based on vehicle location information, lane number information, and time frame number information. In continuous following scenarios, the positions of the preceding and following vehicles in the same lane are determined based on vehicle location information and lane number information in dual-vehicle following scenarios. In continuous car-following scenarios, the speeds of the preceding and following vehicles are determined based on vehicle speed information; Based on the positions of the preceding and following vehicles, the speed of the preceding vehicle, and the speed of the following vehicle in a continuous car-following scenario, a sample of a dual-vehicle car-following scenario is constructed.
[0022] In the above embodiments, by clearly defining that the dual-vehicle following trajectory data includes multi-dimensional information such as vehicle position, speed, lane number, and time frame number, the integrity of the scene data source is ensured; by determining the positional relationship between the preceding and following vehicles in the same lane based on vehicle position and lane number, continuous following scenarios can be accurately identified, avoiding misjudging other non-following traffic scenarios as following scenarios; by extracting the position and speed data of the preceding and following vehicles in the continuous following state to construct samples, a structural input basis is provided for the subsequent extraction of complex interaction features, thereby avoiding the problem of high-risk features being missed due to the one-sided representation of basic data in traditional methods.
[0023] Preferably, in S2, determining the following trajectory relationship in the dual-vehicle following scenario samples includes: The following distance is determined based on the positions of the preceding and following vehicles, where the following distance satisfies the following relationship: ; In the formula, Indicates the position of the vehicle in front. Indicates the position of the following vehicle. Indicates the following distance; The relative speed is determined based on the speeds of the vehicles in front and behind, where the relative speed satisfies the following relationship: ; In the formula, Indicates the speed of the following vehicle. Indicates the speed of the vehicle in front. Represents relative velocity; The vehicle's longitudinal acceleration is determined based on the vehicle speed in the previous time frame and the vehicle speed in the current time frame, where the vehicle's longitudinal acceleration satisfies the following relationship: , ; In the formula, Indicates the interval between adjacent time frames. This indicates the vehicle speed in the previous time frame. This indicates the vehicle speed in the current time frame. Indicates the longitudinal acceleration of the vehicle; The following trajectory relationship in the dual-vehicle following scenario sample is determined based on the following distance, relative speed, and vehicle longitudinal acceleration. Based on the car-following trajectory relationship, car-following trajectory interaction features are constructed, including: The initial and minimum car-following distances are determined based on the car-following distance. The maximum approach rate and car-following stability phase are determined based on the relative speed. The speed change trend of the preceding vehicle, the response mode of the following vehicle, and the key interaction moments are determined based on the vehicle's longitudinal acceleration. The initial car-following distance, minimum car-following distance, maximum approach rate, car-following stability phase, speed change trend of the preceding vehicle, response mode of the following vehicle, and key interaction moments are used to construct the car-following trajectory interaction features.
[0024] In the above embodiments, by clarifying the mathematical relationship between following distance, relative speed, and vehicle longitudinal acceleration, the originally complex spatiotemporal interaction relationship between vehicles is transformed into quantifiable physical indicators, providing a standardized basis for feature extraction. Based on this, the following trajectory interaction features constructed not only include static boundary information such as initial and minimum distances, but also dynamic process descriptions such as maximum approach rate and following stability phases, as well as behavioral causal chains such as the changing trend of the preceding vehicle and the response mode of the following vehicle. This multi-dimensional feature structure comprehensively depicts the dynamic processes of approach, deceleration, response, and stabilization in vehicle interaction, especially in two-vehicle following interactions.
[0025] Preferably, in S3, the car-following trajectory interaction features are converted into car-following trajectory semantic text, and the car-following trajectory semantic text is preprocessed to obtain standardized semantic corpus, including: Key moment information is extracted from the interaction features of the car-following trajectory, and the key moment information is used as the input of the semantic model to generate semantic text of the car-following trajectory. The key moment information includes: start frame, end frame, minimum gap frame, maximum approach frame, maximum deceleration frame of the preceding vehicle, and maximum braking frame of the following vehicle. The semantic text of the car-following trajectory includes: the roles of the vehicles in front and behind, the initial speed, initial distance and lane position of the vehicles, the trend of the car-following distance and relative speed, the acceleration and deceleration behavior of the vehicles in front and behind, and the machine timing relationship of key interaction events. Standardized semantic corpus is obtained by processing the semantic text of the car-following trajectory using standardized rules. The standardized rules include: lowercase text conversion, removal of numerical expressions, removal of redundant spaces and punctuation marks, removal of common English stop words, removal of custom stop words, stemming, and deletion of low-frequency terms.
[0026] In the above embodiments, by extracting key moment information from the starting frame to the maximum braking frame of the following vehicle, the most representative time nodes in the vehicle interaction process are accurately located, avoiding redundant calculations of the entire data; the discrete key moment information is transformed into structured natural language text using a semantic model, realizing the mapping from numerical data to the semantic space, and enabling the scene features to have human-readable traffic behavior descriptions; the text is cleaned through standardized rules such as lowercase conversion, number removal, stop word filtering, and stemming, eliminating noise interference and unifying the corpus format, thereby improving the stability of subsequent topic modeling and the accuracy of semantic clustering.
[0027] In the embodiments, custom stop words preferably include the following categories: The first category consists of unit words, such as meter, frame, second, etc. The second category consists of template-based descriptive phrases, such as observed, sequence, consistent, and objective. The third category consists of general vehicle pronouns, such as vehicle, vehicles, identified, both, two, etc. The fourth category consists of words related to coordinates and geometric skeletons, such as coordinate, longitudinal, lateral, and alignment.
[0028] Preferably, in S4, the standardized semantic corpus is converted into a scene topic model, and the distribution vector and intra-cluster scatter of the scene topic model are calculated, including: A semantic text set is constructed based on a standardized semantic corpus, wherein the semantic text set satisfies the following relation: ; In the formula, Represents a collection of semantic texts. A scenario document representing a standardized semantic expectation. Indicates the total number of text elements in the scene; Set the range of candidate topic numbers, and construct the scene topic model corresponding to each candidate topic number based on the candidate topic number range and the semantic text set; For each scenario topic model, residual index, semantic consistency index, and exclusivity index are calculated, and the optimal scenario topic model is determined based on the minimum residual index and the maximum semantic consistency index and exclusivity index. The residual index is calculated according to the following formula: ; In the formula, Indicates the total number of scene texts. Indicates the size of the vocabulary. Indicates the first Words in a text True word frequency Indicates the first Words in a text Predicted word frequencies; The semantic consistency index is calculated according to the following relationship: ; In the formula, Indicates the number of candidate topics. This indicates the high-frequency words in each topic. , They represent the first The most frequent words and the first High-frequency words, Indicates that it contains the first The most frequent words and the first The number of texts containing high-frequency words. Indicates containing the first The number of texts containing high-frequency words. Represents a small smoothing constant. The normalization coefficient represents the quantity of word pairs; The exclusivity index is calculated according to the following relationship: ; In the formula, Indicates the topic The generation of the first The probability of each word Indicates the first The sum of the probabilities of each word in all topics; Calculate the distribution vector and intra-cluster discretization of the optimal scene topic model, where the distribution vector is calculated according to the following relationship: ; ; ; In the formula, This represents the distribution vector of the optimal scene topic model. Representing a scene In the Probability weights for each topic Indicates the first All words in the first scenario are assigned to the first... The cumulative posterior probability of each topic. This represents the number of topics corresponding to the optimal scenario topic model. This indicates the number of samples in the following scenarios.
[0029] In the above embodiments, by constructing a semantic text set and setting a range for the number of candidate topics, the optimal semantic structure of the scene corpus was systematically explored. The optimal topic model was selected using a triple evaluation criterion of residual index, semantic consistency index, and exclusivity index. The residual index ensures the model's fitting accuracy to real data, the semantic consistency index ensures the logical correlation of words within the same topic, and the exclusivity index ensures the significant differences between different topics. The combination of the three effectively avoids the problems of model overfitting or topic ambiguity. The calculated topic distribution vector maps each scene to a mathematical representation of the probability distribution, realizing high-dimensional semantic quantification of scene content and providing an accurate measurement basis for subsequent semantic clustering and high-risk cluster identification.
[0030] In this embodiment, the selection criteria of minimizing the residual index and maximizing the semantic consistency index and the exclusivity index are specifically expressed as follows: An index change curve is plotted, with the horizontal axis representing the number of topics K, and the vertical axes representing the residual index, semantic consistency index, and exclusivity index, respectively. As the number of topics K changes, the residual index will show a rapid downward trend until it flattens out. This inflection point from the decrease to the flattening out of the residual index is the selection point for the residual index. Taking this inflection point K0 as the midpoint, the horizontal axis of the maximum semantic consistency index and exclusivity index is determined within the range of K0±2. The number of topics K corresponding to this horizontal axis is the optimal number of topics, and the scene topic model corresponding to the optimal number of topics is the optimal scene topic model.
[0031] Preferably, in S4, the high-risk catwalk semantic cluster is determined based on the distribution vector, including: Semantic clustering is performed on the distribution vectors, and M candidate semantic clusters C are formed based on the semantic clustering distance. The semantic clustering distance satisfies the following relationship: ; In the formula, Represents semantic clustering distance. Representing candidate semantic clusters The center; High-risk scenarios are identified in candidate semantic clusters using a threshold calibration method, and the proportion of high-risk scenarios in the candidate semantic clusters is calculated based on the high-risk scenarios within each cluster. The calculation of the high-risk proportion satisfies the following relationship: ; In the formula, This indicates the high-risk percentage of candidate semantic clusters. Indicates the number of high-risk scenarios within the cluster. Indicates the total number of scenes within the cluster; The high-risk percentage of candidate semantic clusters is compared with a preset high-risk percentage threshold. When the high-risk percentage of a candidate semantic cluster is greater than or equal to the preset high-risk percentage threshold, the candidate semantic cluster is determined as a high-risk follower semantic cluster. When the high-risk percentage of a candidate semantic cluster is less than the preset high-risk percentage threshold, the candidate semantic cluster is determined as a normal semantic cluster.
[0032] In the above embodiments, the scene distribution in the high-dimensional semantic space is transformed into a measurable geometric distance by calculating the semantic clustering distance, ensuring that similar following behaviors can be clustered into the same semantic cluster. The objective judgment criteria for high-risk scenes are predefined by the threshold calibration method, avoiding the subjective bias of manual annotation. The introduction of a high-risk proportion index to screen candidate semantic clusters can automatically identify semantic clusters that contain high-risk scenes. This not only distinguishes between high-risk and ordinary semantic clusters, but also realizes the semantic attribution of high-risk scenes. That is, it clarifies which type of semantic feature combination is strongly correlated with high risk, effectively avoiding the problem that traditional clustering methods cannot explain the essence of scene differences.
[0033] Preferably, in S5, the prototype scenario is determined from the high-risk follow-up semantic cluster, including: Calculate the cluster center vector and intra-cluster scatter of the high-risk catastrophe semantic cluster, wherein the calculation of the cluster center vector satisfies the following relationship: ; The calculation of intra-cluster dispersion satisfies the following relationship: ; In the formula, Represents the cluster center vector. Indicates the first A high-risk semantic cluster, Indicates the degree of dispersion within a cluster; The selection threshold for prototype scenarios is determined based on intra-cluster dispersion, and prototype scenarios are then selected from high-risk catastrophe semantic clusters based on this threshold. The determination of the prototype scenario selection threshold satisfies the following relationship: ; The prototype scene is determined according to the following relationship: ; In the formula, This represents the selection threshold for the prototype scene. Indicates the preset scaling factor. This represents the prototype scenario.
[0034] In the above embodiments, the core feature direction of the high-risk semantic cluster is clarified by calculating the cluster center vector, providing a reference center point for prototype selection; the dispersion of samples within the semantic cluster is quantified by calculating the discrete metric within the cluster, so that the prototype selection threshold can be adaptively adjusted based on the actual data distribution, avoiding the blindness of manually setting the threshold; selecting prototype scenarios near the cluster center ensures that the prototype can represent the most typical risk behavior pattern in the high-risk semantic cluster, rather than marginal noise samples, providing a high-quality basic template for subsequent scene synthesis.
[0035] Preferably, in S5, a new high-risk following trajectory is constructed based on the prototype scenario, including: Extract key trajectory parameter vectors from the prototype scenes to construct a set of prototype scenes, where the set of prototype scenes satisfies the following relationship: ; In the formula, This is the initial following distance. The initial relative velocity, The minimum acceleration of the vehicle in front. The minimum acceleration of the following vehicle. For the response delay of the following vehicle, Duration of key interactions; By perturbing the key trajectory parameter vectors in the prototype scenario set, new high-risk car-following trajectories are obtained. The new high-risk car-following trajectories obtained by perturbing satisfy the following relationship: ; In the formula, Indicates the applied disturbance. This represents a new set of high-risk following trajectories.
[0036] In the above embodiments, by constructing a key parameter vector including the initial following distance, initial relative speed, minimum acceleration of the vehicles in front and behind, response delay of the following vehicle, and duration of key interactions, the core risk control parameters of the high-risk prototype scenario are fully extracted. By applying controlled perturbations to the prototype parameter vector to generate new following trajectories, the high-risk behavioral logic and high-risk characteristics identified in the prototype scenario are preserved, and reasonable physical changes are introduced through parameter fine-tuning, thereby generating high-risk following scenarios that conform to actual physical constraints and have diversity.
[0037] Preferably, in S6, the specific components include: After converting the new high-risk car-following trajectory set into newly generated semantic text, the newly generated semantic text is converted into a new scene topic model, and the topic distribution vector of the new scene subject model is calculated. The new semantic clustering distance is calculated based on the topic distribution vector of the new scene subject model, and the acceptance threshold of high-risk catastrophe semantic clusters is determined based on the intra-cluster dispersion. The acceptance threshold of high-risk catastrophe semantic clusters satisfies the following relationship: ; ; In the formula, This indicates the acceptance threshold for high-risk chain reaction semantic clusters. This indicates the overall high-risk baseline percentage. This represents the total number of all scenarios. This represents the total number of all high-risk scenarios. Indicates the preset offset increment; The new semantic clustering distance is compared with the acceptance threshold of the high-risk car-following semantic cluster. If the new semantic clustering distance is less than or equal to the acceptance threshold of the high-risk car-following semantic cluster, the new high-risk car-following trajectory set is retained as a valid scenario, and the valid scenario is generated as the final high-risk car-following scenario.
[0038] In the above embodiments, by converting the newly generated high-risk trajectories back into semantic text and mapping them to the same topic space, it is ensured that the new scene and the original scene are compared and evaluated on the same semantic scale. By calculating the global high-risk baseline ratio and introducing a preset offset increment to determine the acceptance threshold, an adjustable quantitative judgment standard based on data statistics is provided for the high-risk validity of the new scene. Only when the semantic clustering distance of the new scene is less than or equal to the acceptance threshold is it retained as a valid scene, ensuring that the generated result does fall within the reasonable range of the target high-risk semantic cluster, avoiding the situation where the new scene deviates from the high-risk semantic features due to excessive perturbation, and realizing closed-loop control of the generation quality.
[0039] This application also provides a high-risk car-following scenario generation system based on semantic data, including a processor and a memory; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps described in the method for generating high-risk car-following scenarios based on semantic data.
[0040] The aforementioned high-risk car-following scenario generation system based on semantic data can implement various embodiments of the aforementioned high-risk car-following scenario generation method based on semantic data, and can achieve the same beneficial effects. Here, it will not be elaborated further.
[0041] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A method for generating high-risk car-following scenarios based on semantic data, characterized in that, include: S1. Obtain dual-vehicle following trajectory data in a dual-vehicle following scenario, and preprocess the dual-vehicle following trajectory data to obtain a dual-vehicle following scenario sample. S2. Determine the following trajectory relationship in the dual-vehicle following scenario sample, and construct following trajectory interaction features based on the following trajectory relationship; S3. Convert the car-following trajectory interaction features into car-following trajectory semantic text, and preprocess the car-following trajectory semantic text to obtain standardized semantic corpus; S4. Convert the standardized semantic corpus into a scene topic model, calculate the distribution vector of the scene topic model, and determine the high-risk follow-up semantic clusters based on the distribution vector; S5. Determine the prototype scenario from the high-risk car-following semantic cluster, and construct a new high-risk car-following trajectory based on the prototype scenario; S6. Convert the new high-risk car-following trajectory into newly generated semantic text, perform semantic clustering distance judgment on the newly generated semantic text, and when the semantic clustering distance is less than or equal to the acceptance threshold of the high-risk semantic cluster, generate the final high-risk car-following scenario based on the new high-risk car-following trajectory.
2. The method for generating high-risk car-following scenarios based on semantic data according to claim 1, characterized in that, In S1, the dual-vehicle following trajectory data includes: vehicle position information, vehicle speed information, lane number information, and time frame number information; The dual-vehicle following trajectory data is preprocessed to obtain dual-vehicle following scenario samples, including: The continuous following scenario is determined based on vehicle location information, lane number information, and time frame number information. In continuous following scenarios, the positions of the preceding and following vehicles in the same lane are determined based on vehicle location information and lane number information in dual-vehicle following scenarios. In continuous car-following scenarios, the speeds of the preceding and following vehicles are determined based on vehicle speed information; Based on the positions of the preceding and following vehicles, the speed of the preceding vehicle, and the speed of the following vehicle in a continuous car-following scenario, a sample of a dual-vehicle car-following scenario is constructed.
3. The method for generating high-risk car-following scenarios based on semantic data according to claim 1, characterized in that, In step S2, determining the following trajectory relationship in the dual-vehicle following scenario sample includes: The following distance is determined based on the positions of the preceding and following vehicles, where the following distance satisfies the following relationship: ; In the formula, Indicates the position of the vehicle in front. Indicates the position of the following vehicle. Indicates the following distance; The relative speed is determined based on the speeds of the vehicles in front and behind, where the relative speed satisfies the following relationship: ; In the formula, Indicates the speed of the following vehicle. Indicates the speed of the vehicle in front. Represents relative velocity; The vehicle's longitudinal acceleration is determined based on the vehicle speed in the previous time frame and the vehicle speed in the current time frame, where the vehicle's longitudinal acceleration satisfies the following relationship: , ; In the formula, Indicates the interval between adjacent time frames. This indicates the vehicle speed in the previous time frame. This indicates the vehicle speed in the current time frame. Indicates the longitudinal acceleration of the vehicle; The following trajectory relationship in the dual-vehicle following scenario sample is determined based on the following distance, relative speed, and vehicle longitudinal acceleration. Based on the aforementioned car-following trajectory relationship, car-following trajectory interaction features are constructed, including: The initial and minimum car-following distances are determined based on the car-following distance; the maximum approach rate and car-following stability phase are determined based on the relative speed; and the speed change trend of the preceding vehicle, the response mode of the following vehicle, and key interaction moments are determined based on the vehicle's longitudinal acceleration. The initial car-following distance, the minimum car-following distance, the maximum approach rate, the car-following stability phase, the speed change trend of the preceding vehicle, the response mode of the following vehicle, and the key interaction moments are used to construct the car-following trajectory interaction features.
4. The method for generating high-risk car-following scenarios based on semantic data according to claim 1, characterized in that, In step S3, the car-following trajectory interaction features are converted into car-following trajectory semantic text, and the car-following trajectory semantic text is preprocessed to obtain standardized semantic corpus, including: Key moment information is extracted from the car-following trajectory interaction features, and the key moment information is used as input to the semantic model to generate car-following trajectory semantic text. The key moment information includes: start frame, end frame, minimum gap frame, maximum approach frame, maximum deceleration frame of the preceding vehicle, and maximum braking frame of the following vehicle. The semantic text of the car-following trajectory includes: the roles of the vehicles in front and behind, the initial speed, initial distance and lane position of the vehicles, the trend of the car-following distance and relative speed, the acceleration and deceleration behavior of the vehicles in front and behind, and the machine timing relationship of key interaction events. The semantic text of the car-following trajectory is processed by standardization rules to obtain a standardized semantic corpus. The standardization rules include: lowercase text conversion, removal of numerical expressions, removal of redundant spaces and punctuation marks, removal of common English stop words, removal of custom stop words, stemming, and deletion of low-frequency terms.
5. The method for generating high-risk car-following scenarios based on semantic data according to claim 1, characterized in that, In step S4, the standardized semantic corpus is converted into a scene topic model, and the distribution vector and intra-cluster scatter of the scene topic model are calculated, including: A semantic text set is constructed based on the standardized semantic corpus, wherein the semantic text set satisfies the following relation: ; In the formula, Represents a collection of semantic texts. A scenario document representing a standardized semantic expectation. Indicates the total number of text elements in the scene; Set the range of candidate topic numbers, and construct the scene topic model corresponding to each candidate topic number based on the candidate topic number range and the semantic text set; For each scenario topic model, residual index, semantic consistency index, and exclusivity index are calculated, and the optimal scenario topic model is determined based on the minimum residual index and the maximum semantic consistency index and exclusivity index. The residual index is calculated according to the following formula: ; In the formula, Indicates the total number of scene texts. Indicates the size of the vocabulary. Indicates the first Words in a text True word frequency Indicates the first Words in a text Predicted word frequencies; The semantic consistency index is calculated according to the following relationship: ; In the formula, Indicates the number of candidate topics. This indicates the high-frequency words in each topic. , They represent the first The most frequent words and the first High-frequency words, Indicates that it contains the first The most frequent words and the first The number of texts containing high-frequency words. Indicates containing the first The number of texts containing high-frequency words. Represents a small smoothing constant. The normalization coefficient represents the quantity of word pairs; The exclusivity index is calculated according to the following relationship: ; In the formula, Indicates the topic The generation of the first The probability of each word Indicates the first The sum of the probabilities of each word in all topics; Calculate the distribution vector and intra-cluster discretization of the optimal scene topic model, where the distribution vector is calculated according to the following relationship: ; ; ; In the formula, This represents the distribution vector of the optimal scene topic model. Representing a scene In the Probability weights for each topic Indicates the first All words in the first scenario are assigned to the first... The cumulative posterior probability of each topic. This represents the number of topics corresponding to the optimal scenario topic model. This indicates the number of samples in the following scenarios.
6. The method for generating high-risk car-following scenarios based on semantic data according to claim 5, characterized in that, In S4, high-risk catfight semantic clusters are determined based on distribution vectors, including: Semantic clustering is performed on the distribution vectors, and M candidate semantic clusters C are formed based on the semantic clustering distance. The semantic clustering distance satisfies the following relationship: ; In the formula, Represents semantic clustering distance. Representing candidate semantic clusters The center; High-risk scenarios are identified in candidate semantic clusters using a threshold calibration method, and the proportion of high-risk scenarios in the candidate semantic clusters is calculated based on the high-risk scenarios within each cluster. The calculation of the high-risk proportion satisfies the following relationship: ; In the formula, This indicates the high-risk percentage of candidate semantic clusters. Indicates the number of high-risk scenarios within the cluster. Indicates the total number of scenes within the cluster; The high-risk percentage of candidate semantic clusters is compared with a preset high-risk percentage threshold. When the high-risk percentage of a candidate semantic cluster is greater than or equal to the preset high-risk percentage threshold, the candidate semantic cluster is determined as a high-risk follower semantic cluster. When the high-risk percentage of a candidate semantic cluster is less than the preset high-risk percentage threshold, the candidate semantic cluster is determined as a normal semantic cluster.
7. The method for generating high-risk car-following scenarios based on semantic data according to claim 6, characterized in that, In step S5, determining the prototype scenario from the high-risk carousel semantic cluster includes: Calculate the cluster center vector and intra-cluster scatter of the high-risk catastrophe semantic cluster, wherein the calculation of the cluster center vector satisfies the following relationship: ; The calculation of intra-cluster dispersion satisfies the following relationship: ; In the formula, Represents the cluster center vector. Indicates the first A high-risk semantic cluster, Indicates the degree of dispersion within a cluster; The selection threshold for prototype scenarios is determined based on intra-cluster dispersion, and prototype scenarios are then selected from high-risk catastrophe semantic clusters based on this threshold. The determination of the prototype scenario selection threshold satisfies the following relationship: ; The prototype scene is determined according to the following relationship: ; In the formula, This represents the selection threshold for the prototype scene. Indicates the preset scaling factor. This represents the prototype scenario.
8. The method for generating high-risk car-following scenarios based on semantic data according to claim 7, characterized in that, In step S5, a new high-risk following trajectory is constructed based on the prototype scenario, including: A set of prototype scenes is constructed by extracting key trajectory parameter vectors from the prototype scenes, wherein the set of prototype scenes satisfies the following relationship: ; In the formula, This is the initial following distance. The initial relative velocity, The minimum acceleration of the vehicle in front. The minimum acceleration of the following vehicle. For the response delay of the following vehicle, Duration of key interactions; By perturbing the key trajectory parameter vectors in the prototype scenario set, new high-risk car-following trajectories are obtained. The new high-risk car-following trajectories obtained by perturbing satisfy the following relationship: ; In the formula, Indicates the applied disturbance. This represents a new set of high-risk following trajectories.
9. The method for generating high-risk car-following scenarios based on semantic data according to claim 8, characterized in that, The S6 includes: After converting the new high-risk car-following trajectory set into newly generated semantic text, the newly generated semantic text is converted into a new scene topic model, and the topic distribution vector of the new scene subject model is calculated. The new semantic clustering distance is calculated based on the topic distribution vector of the new scene subject model, and the acceptance threshold of high-risk catastrophe semantic clusters is determined based on the intra-cluster dispersion. The acceptance threshold of high-risk catastrophe semantic clusters satisfies the following relationship: ; ; In the formula, This indicates the acceptance threshold for high-risk chain reaction semantic clusters. This indicates the overall high-risk baseline percentage. This represents the total number of all scenarios. This represents the total number of all high-risk scenarios. Indicates the preset offset increment; The new semantic clustering distance is compared with the acceptance threshold of the high-risk car-following semantic cluster. If the new semantic clustering distance is less than or equal to the acceptance threshold of the high-risk car-following semantic cluster, the new high-risk car-following trajectory set is retained as a valid scenario, and the valid scenario is generated as the final high-risk car-following scenario.
10. A high-risk car-following scenario generation system based on semantic data, comprising a processor and a memory, characterized in that... ; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method as described in any one of claims 1-9.