Driving trajectory risk analysis method and device
Patent Information
- Application Number
- CN202610942923.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-06-29
AI Technical Summary
[0003]虽然相关技术能够通过自动驾驶模型来实现车辆的自动驾驶,但自动驾驶模型如果在环境理解或行为规划的过程中出现错误,就会使得自动驾驶模型输出错误的驾驶轨迹,会使得车辆在行驶的过程存在风险
[0017] The aforementioned driving trajectory risk analysis method and apparatus acquire the driving trajectory output by an autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and a pre-trained driving analysis model. Then, the driving trajectory and input data are input into the driving analysis model to determine analysis text data and analysis tags. Based on the analysis tags, a tag score is determined; based on a preset keyword library, the analysis text data, and the analysis tags, an inference score is determined; based on the tag score and the inference score, a consistency score is determined; and based on the tag score, the inference score, and the consistency score, a risk score corresponding to the driving trajectory data is determined. This enables risk analysis of the driving trajectory output by the autonomous driving model, thereby reducing the risks to the vehicle during operation.
Smart Images

Figure CN122472231B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of model analysis technology, and in particular to a method and apparatus for analyzing driving trajectory risks. Background Technology
[0002] With the development of the field of autonomous driving, autonomous driving models have emerged. These models can understand the input driving environment, make driving decisions, and ultimately output a planned driving trajectory so that the vehicle can drive according to the planned trajectory.
[0003] Although the relevant technologies can achieve autonomous driving of vehicles through autonomous driving models, if the autonomous driving model makes mistakes in the process of environmental understanding or behavior planning, it will cause the autonomous driving model to output incorrect driving trajectories, which will put the vehicle at risk during the driving process.
[0004] Therefore, there is an urgent need for a solution that can perform risk analysis on the driving trajectory output by the autonomous driving model in order to reduce the risks of the vehicle during driving. Summary of the Invention
[0005] Therefore, it is necessary to provide a driving trajectory risk analysis method and apparatus for performing risk analysis on the driving trajectory output by an autonomous driving model, in order to address the aforementioned technical problems.
[0006] In a first aspect, this application provides a driving trajectory risk analysis method, wherein the driving trajectory is a driving trajectory output by an autonomous driving model. The method includes: acquiring the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and a pre-trained driving analysis model; inputting the driving trajectory and the input data into the driving analysis model to determine analysis text data and analysis tags; determining tag scores based on the analysis tags; determining inference scores based on a preset keyword library, the analysis text data, and the analysis tags; determining consistency scores based on the tag scores and the inference scores; and determining a risk score corresponding to the driving trajectory data based on the tag scores, the inference scores, and the consistency scores.
[0007] In one embodiment, the method further includes: acquiring a training driving dataset and an initial analysis model, wherein the training driving dataset includes a training set, a validation set, and a test set, and the sample data in the training set, validation set, and test set have the same format; the sample data includes input data of an autonomous driving model, driving trajectory output by the autonomous driving model, and training safety labels; training the initial analysis model based on the training set to determine the trained initial analysis model; making predictions based on the input data of the autonomous driving model in the validation set, the driving trajectory output by the autonomous driving model, and the trained initial analysis model to determine predicted safety labels; if the predicted safety labels correspond to the training safety labels in the validation set, then determining the validated initial analysis model; and testing based on the test set and the validated initial analysis model to determine the driving analysis model.
[0008] In one embodiment, the analyzed text data includes inference text, multiple analytical phrases corresponding to the inference text, and the generation probability of each analytical phrase. The analytical labels include a target label, a first confidence level corresponding to a danger label, and a second confidence level corresponding to a safety label. The target label is either a danger label or a safety label.
[0009] In one embodiment, determining the label score based on the analyzed label includes: adding the first confidence level corresponding to the danger label and the second confidence level corresponding to the safety label to determine the total confidence level; and dividing the confidence level corresponding to the target label by the total confidence level to determine the label score.
[0010] In one embodiment, the preset keyword library includes multiple key phrases and corresponding enhancement weights. Determining the inference score based on the preset keyword library, the analyzed text data, and the analyzed tags includes: performing phrase matching based on the preset keyword library and the inference text to determine multiple matching key phrases and the enhancement weight corresponding to each matching key phrase; determining a phrase score corresponding to each matching key phrase based on the multiple matching key phrases and the enhancement weight corresponding to each matching key phrase; determining the support level corresponding to the inference text based on the phrase scores corresponding to the multiple matching key phrases; and determining the inference score based on the generation probability of each analyzed phrase, the support level corresponding to the inference text, and the target tag.
[0011] In one embodiment, determining the phrase score corresponding to each matching key phrase based on the plurality of matching key phrases and the enhancement weight corresponding to each matching key phrase includes: determining the phrase length of each matching key phrase based on the plurality of matching key phrases; determining the repetition frequency of each matching key phrase based on the inference text; determining an initial phrase score for a target key phrase based on a preset length enhancement rule, the enhancement weight corresponding to the target key phrase, and the phrase length of the target key phrase; wherein the target key phrase is any one of the plurality of matching key phrases; and determining the phrase score of the target key phrase based on the frequency enhancement rule, the initial phrase score, and the repetition frequency of the target key phrase.
[0012] In one embodiment, determining the support of the inference text based on the phrase scores corresponding to the multiple matching key phrases includes: sorting the phrase scores corresponding to the multiple matching key phrases to determine the ranking of each matching key phrase; for a target key phrase, determining the contribution of the target key phrase based on its phrase score, its ranking, and a preset attenuation coefficient; accumulating the contributions of the multiple matching key phrases to determine the evidence strength of the inference text; and determining the support of the inference text based on a preset smoothing constant and the evidence strength of the inference text.
[0013] In one embodiment, determining the inference score based on the generation probability of each analytical phrase, the support of the inference text, and the target label includes: determining the average generation probability of the inference text based on the generation probability of each analytical phrase; determining the offset of the inference text based on the preset offset determination rule, the average generation probability of the inference text, and the support; if the target label is a dangerous label, determining the inference score based on the preset first formula and the offset of the inference text; if the target label is a safe label, determining the inference score based on the preset second formula and the offset of the inference text.
[0014] In one embodiment, determining the risk score corresponding to the driving trajectory data based on the label score, the inference score, and the consistency score includes: multiplying the label score by a preset label weight to determine the label parameter; multiplying the inference score by a preset inference weight to determine the inference parameter; multiplying the consistency score by a preset consistency weight to determine the consistency parameter; determining the target parameter based on the label weight, the inference weight, and the consistency weight; and adding the label parameter, the inference parameter, and the consistency parameter together and dividing by the target parameter to determine the risk score corresponding to the driving trajectory data.
[0015] Secondly, this application also provides a driving trajectory risk analysis device. The device includes:
[0016] The system includes an acquisition module for acquiring the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and a pre-trained driving analysis model; a driving analysis module for inputting the driving trajectory and input data into the driving analysis model to determine the analysis text data and analysis tags; a scoring determination module for determining a tag score based on the analysis tags; determining an inference score based on a preset keyword library, the analysis text data, and the analysis tags; determining a consistency score based on the tag score and the inference score; and determining a risk score corresponding to the driving trajectory data based on the tag score, the inference score, and the consistency score.
[0017] The aforementioned driving trajectory risk analysis method and apparatus acquire the driving trajectory output by an autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and a pre-trained driving analysis model. Then, the driving trajectory and input data are input into the driving analysis model to determine analysis text data and analysis tags. Based on the analysis tags, a tag score is determined; based on a preset keyword library, the analysis text data, and the analysis tags, an inference score is determined; based on the tag score and the inference score, a consistency score is determined; and based on the tag score, the inference score, and the consistency score, a risk score corresponding to the driving trajectory data is determined. This enables risk analysis of the driving trajectory output by the autonomous driving model, thereby reducing the risks to the vehicle during operation. Attached Figure Description
[0018] Figure 1 This is a diagram illustrating the application environment of a driving trajectory risk analysis method in one embodiment.
[0019] Figure 2 This is a flowchart illustrating a driving trajectory risk analysis method in one embodiment;
[0020] Figure 3 This is a schematic diagram of the process of training a driving supervision model in one embodiment;
[0021] Figure 4 This is a schematic diagram of the process for training a driving supervision model in another embodiment;
[0022] Figure 5 This is a schematic diagram of the process for determining training security labels in one embodiment;
[0023] Figure 6 This is a schematic diagram of the process for determining a risk score in one embodiment;
[0024] Figure 7This is a schematic diagram of the process for determining the reasoning score in one embodiment;
[0025] Figure 8 This is a structural block diagram of a driving trajectory risk analysis device in one embodiment;
[0026] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0028] As autonomous driving technology evolves from traditional modular architectures to end-to-end intelligent driving models, autonomous driving systems are increasingly relying on deep learning models to directly perform environmental understanding, behavioral decision-making, and trajectory planning, thereby outputting driving trajectories. Simultaneously, the development of multimodal large models and visual language models enables autonomous driving systems to jointly process multiple inputs, including images, trajectories, maps, text, and structured states, and to uniformly conduct scene understanding and semantic reasoning in space. These technological advancements enhance the adaptability of autonomous driving systems to complex environments, but also extend system risks beyond traditional perception errors to include semantic illusions, misoperations, adversarial attacks, and uncertain behaviors in complex scenarios. For autonomous driving, a safety-critical task, any local error in target recognition, scene understanding, or behavior planning by the autonomous driving model can directly affect vehicle operation and lead to serious consequences in real-world road environments. Therefore, relying solely on the direct output of planning results from the autonomous driving model is insufficient to meet safety requirements in complex scenarios. Against this backdrop, constructing a multimodal small model that combines visual information, historical states, planned trajectories, and semantic information to perform risk identification and auxiliary verification of the driving trajectory output by the autonomous driving model has become a crucial issue in autonomous driving safety research.
[0029] Related technological developments: Existing research on autonomous driving safety supervision can be broadly divided into two categories. The first category is rule-based or risk indicator-based supervision methods. These methods typically utilize predefined thresholds and rule-based detection techniques to perform additional checks on the output of the autonomous driving model. Their advantages include a relatively clear implementation path, good interpretability, and ease of integration with traditional formal autonomous driving safety assessment research, providing a solid theoretical foundation. However, their limitation lies in their reliance on manually predefined rule sets, making it difficult to cover real-world scenarios. The second category is training supervision methods based on external feedback. These methods place greater emphasis on supplementary analysis of the reasons for autonomous driving model failures and can further improve the training process through feedback analysis. These methods primarily focus on the training of the autonomous driving model rather than analyzing the driving trajectory output by the model.
[0030] In summary, the relevant technologies suffer from insufficient generalization ability and applicability. This is mainly because they primarily employ formal rule-based detection methods, resulting in poor generalization and adaptability to unknown scenarios. Furthermore, these technologies lack targeted practical application. In technologies utilizing external feedback, such as the Feedback-Guided Autonomous Driving method, the focus is primarily on training the autonomous driving model, rather than analyzing the driving trajectory output by the model.
[0031] The driving trajectory risk analysis method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. Server 104 is used to execute the driving trajectory risk analysis method. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0032] To address the aforementioned problems, in one embodiment of this application, such as Figure 2 As shown, a driving trajectory risk analysis method is provided, including the following steps:
[0033] Step 201: Obtain the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and the pre-trained driving analysis model.
[0034] The driving trajectory output by the autonomous driving model is the vehicle's driving trajectory planned by the autonomous driving model based on the input data. The input data of the autonomous driving model, which serves as the basis for trajectory planning, includes image data, text data, and point cloud data. Among them, image data consists of photographs of the vehicle's surrounding environment, providing visual perception information; text data consists of text commands from the navigation system, such as "turn right ahead," providing text perception information; and point cloud data consists of point cloud data from LiDAR, used to describe the three-dimensional spatial structure of the vehicle's surrounding environment, providing point cloud perception information.
[0035] It's important to note that the process of an autonomous driving model outputting a driving trajectory can be understood as the model simulating driving within the scenario corresponding to the input data. However, the driving trajectory output by the autonomous driving model is not necessarily accurate and may include unsafe driving actions. This is precisely why we need to analyze it using a driving analysis model.
[0036] It should be noted that during the training process, the driving trajectory output by the autonomous driving model is compared with a reference trajectory. The reference trajectory is the actual trajectory of a human driver operating the vehicle, providing a reference result so that the driving trajectory output by the autonomous driving model can approach the reference trajectory.
[0037] The autonomous driving model can perform trajectory planning based on image data, text data, and point cloud data in the input data to obtain a driving trajectory. The data format of the driving trajectory is recognizable and understandable by the vehicle. After receiving the driving trajectory, the vehicle can drive on the road according to the driving trajectory. For example, in this embodiment, the autonomous driving model is the NVIDIA Alpamayo-R1 model.
[0038] The driving analysis model is a pre-trained model used to analyze the driving trajectory output by the autonomous driving model based on the input data of the autonomous driving model. It can be a large language model, such as the Deepseek model.
[0039] It should be noted that, in this embodiment, after the autonomous driving model performs trajectory planning based on the input data and outputs the driving trajectory, the driving trajectory risk analysis method provided in this application will obtain the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and the pre-trained driving analysis model.
[0040] Step 202: Input the driving trajectory and input data into the driving analysis model, and determine the analysis text data and analysis labels.
[0041] In this embodiment, after receiving the driving trajectory and input data, the driving analysis model will analyze and reason about the driving trajectory based on the input data to obtain analysis text data and analysis tags.
[0042] In this embodiment, the analysis text data characterizes the process of the driving analysis model performing analysis and reasoning, including the reasoning text, multiple analysis phrases corresponding to the reasoning text, and the generation probability of each analysis phrase. The reasoning text is represented as a piece of text, which is used to represent the analysis logic of the driving analysis model performing analysis and reasoning. Multiple analysis phrases correspond to the reasoning text.
[0043] Analysis labels are used to characterize whether a driving trajectory is safe. These labels include a target label, a first confidence level corresponding to a hazard label, and a second confidence level corresponding to a safety label. The target label can be either a hazard label or a safety label. A hazard label indicates that the driving trajectory analyzed and inferred by the driving analysis model is dangerous. A safety label indicates that the driving trajectory analyzed and inferred by the driving analysis model is safe. The first confidence level, corresponding to the hazard label, is a parameter used to characterize the degree of confidence the driving analysis model has in considering the analyzed and inferred driving trajectory to be dangerous. The second confidence level, corresponding to the safety label, is a parameter used to characterize the degree of confidence the driving analysis model has in considering the analyzed and inferred driving trajectory to be safe.
[0044] Understandably, during the analysis and reasoning process of the driving analysis model, the entire reasoning text is not directly output. Instead, it is output step by step, that is, one analysis phrase is output at a time. These analysis phrases are then connected to obtain the reasoning text. For example, the driving analysis model outputs "123", "456", and "789" step by step, resulting in the reasoning text "123456789", with the corresponding analysis phrases "123", "456", and "789". The generation probability of each analysis phrase is the probability of generating each analysis phrase during the process of generating the reasoning text by the driving analysis model. It corresponds one-to-one with each analysis phrase, and the generation probability is internal data of the analysis model during the analysis and reasoning process, which can be directly obtained.
[0045] It should be noted that before outputting the target label, the driving analysis model determines the first confidence level of the danger label and the second confidence level of the safety label based on the inference text. Then, it selects the label corresponding to the larger confidence level between the first and second confidence levels as the target label. For example, if the first confidence level is 0.2 and the second confidence level is 0.3, then the safety label will be used as the target label.
[0046] Step 203: Based on the analyzed text data and analysis tags, determine the risk score corresponding to the driving trajectory data.
[0047] In this embodiment, a tag score is determined based on the analyzed tags. Then, an inference score is determined based on the pre-defined keyword library, the analyzed text data, and the analyzed tags. Next, a consistency score is determined based on the consistency between the tag score and the inference score. Finally, a risk score corresponding to the driving trajectory data is determined based on the tag score, the inference score, and the consistency score.
[0048] The label score characterizes the tendency of the target label output by the driving analysis model. The preset keyword library is a pre-defined lexicon including multiple key phrases and corresponding enhancement weights. Key phrases are pre-compiled important words that may be included in the inference text. Enhancement weights are pre-determined weights corresponding to the key phrases, used to characterize the importance of the key phrases. The inference score characterizes the credibility of the inference text. The consistency score characterizes the consistency between the label score and the inference score. The risk score characterizes the credibility of the driving trajectory output by the autonomous driving model.
[0049] The aforementioned driving trajectory risk analysis method acquires the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and a pre-trained driving analysis model. Then, the driving trajectory and input data are input into the driving analysis model to determine the analysis text data and analysis labels. Finally, based on the analysis text data and analysis labels, the risk score corresponding to the driving trajectory data is determined, thereby realizing risk analysis of the driving trajectory output by the autonomous driving model to reduce the risk of the vehicle during driving.
[0050] In other embodiments of this application, such as Figure 3 As shown, the method also includes:
[0051] Step 1: Obtain the training driving dataset and the initial analysis model.
[0052] The training dataset for driving includes a training set, a validation set, and a test set. The sample data in all three sets are in the same format. The sample data includes the input data of the autonomous driving model, the driving trajectory output by the autonomous driving model, and training safety labels.
[0053] like Figure 4As shown, the driving trajectory output by the autonomous driving model is the vehicle's driving trajectory planned by the autonomous driving model based on the input data. The input data of the autonomous driving model, which serves as the basis for trajectory planning, includes image data, text data, and point cloud data. Image data consists of photographs of the vehicle's surrounding environment, text data consists of text commands from the navigation system, such as "turn right ahead," and point cloud data consists of LiDAR point cloud data used to describe the three-dimensional spatial structure of the vehicle's surrounding environment. Training safety labels are reference labels used to measure the correctness of the initial analysis model's output. An evaluation process is executed based on the reference trajectory and the driving trajectory output by the autonomous driving model, thereby forming the training safety labels and evaluation reasons. The training safety labels are either safety labels or danger labels. In other words, the data composition of the training samples for the autonomous driving analysis model includes the input data of the autonomous driving model, the driving trajectory output by the autonomous driving model, and the training safety labels.
[0054] In this embodiment, as Figure 5 As shown, the process of determining the training safety label employs rule-based review. Specifically, it involves: obtaining the reference trajectory corresponding to the driving trajectory output by the autonomous driving model; then, sampling the driving trajectory at preset time intervals to determine multiple first sampling points; and sampling the reference trajectory at preset time intervals to determine multiple second sampling points. If the distance between each first sampling point and its corresponding second sampling point is less than or equal to a preset threshold, the training safety label for the driving trajectory is a safety label. If, among the multiple first sampling points, there is a first sampling point whose distance to its corresponding second sampling point is greater than the preset threshold, the training safety label for the driving trajectory is a danger label. Furthermore, after determining the training safety label, a more powerful multimodal large model is used for evaluation to obtain more reliable training safety labels. Finally, manual review is conducted to re-evaluate the more reliable training safety labels obtained after evaluation by the multimodal large model, further improving the reliability of the labels.
[0055] It should be noted that since both the first and second sampling points are obtained by sampling at a preset time interval, the first and second sampling points correspond one-to-one.
[0056] The preset time interval is a pre-set time interval, such as 5 minutes, and the preset threshold is a pre-set threshold for the distance between the first sampling point and the corresponding second sampling point.
[0057] It should be noted that the sample data in the training set, validation set, and test set are in the same format, but the amount of sample data in each set differs. The data is divided according to a pre-set ratio. For example, the sample data in the training set is 60% of all the sample data in the training driving dataset, the sample data in the validation set is 20% of all the sample data in the training driving dataset, and the sample data in the test set is 20% of all the sample data in the training driving dataset.
[0058] The training set is used to train the initial analysis model, the validation set is used for feedback adjustments to verify the training effect, and the test set is used to evaluate the performance metrics of the initial analysis model.
[0059] It should be noted that the training driving dataset and the initial analysis model are pre-stored in the database, and can be retrieved directly from the database when needed.
[0060] Step 2: Train the initial analysis model based on the training set to determine the trained initial analysis model.
[0061] In this embodiment, the initial analysis model is trained based on the sample data in the training set, and the parameters in the initial analysis model are continuously iterated until the preset conditions are met. Then, the initial analysis model that meets the preset conditions is used as the trained initial analysis model.
[0062] It should be noted that the method used in this embodiment to train the initial analysis model based on the training set is a training method already existing in the art. The preset training conditions are predefined training conditions, such as iterating the parameters of the initial analysis model a preset number of times. The preset number of iterations is a preset number of iterations, such as 2000.
[0063] The initial analysis model after training is the initial analysis model that has been trained to meet the preset training conditions.
[0064] Step 3: Based on the input data of the autonomous driving model in the validation set, the driving trajectory output by the autonomous driving model, and the initial analysis model after training, make predictions to determine the predicted safety label.
[0065] In this embodiment, the input data of the autonomous driving model and the driving trajectory output by the autonomous driving model of a certain sample data in the validation set are input into the trained initial analysis model. The trained initial analysis model analyzes the input data of the autonomous driving model of the autonomous driving model of a certain sample data and the driving trajectory output by the autonomous driving model, thereby outputting training analysis text data for analyzing the driving trajectory and predicting safety labels.
[0066] Predicting a safety label represents whether a driving trajectory in the validation set is safe, including the target label, the first confidence level corresponding to the hazard label, and the second confidence level corresponding to the safety label. The target label can be either a hazard label or a safety label. Training and analyzing text data represents the process of the initial analysis model performing analysis and reasoning after training, including the reasoning text, multiple analysis phrases corresponding to the reasoning text, and the generation probability of each analysis phrase.
[0067] Step 4: If the predicted security label corresponds to the training security label in the validation set, then determine the initial analysis model after validation.
[0068] In this embodiment, the target label in the predicted security label is compared with the corresponding training security label in the validation set. If they are the same, the trained initial analysis model is used as the validated initial analysis model. If they are different, the training set is used to retrain the trained initial analysis model until the target label in the predicted security label is the same as the corresponding training security label in the validation set.
[0069] The validated initial analysis model is the target label in the output predicted security label, which is the initial analysis model for the corresponding trained security label.
[0070] Step 5: Conduct tests based on the test set and the validated initial analysis model to determine the driving analysis model.
[0071] In this embodiment, a test set will be used to test the verified initial analysis model. If the verified initial analysis model meets the preset test conditions, the initial analysis model will be used as the driving analysis model.
[0072] It should be noted that, in this embodiment, the method of testing the validated initial analysis model based on the test set is a testing method that is already available in the art.
[0073] The driving analysis model is an initial analysis model that meets preset test conditions. It can analyze the driving trajectory output by the autonomous driving model based on the input data of the autonomous driving model. The preset test conditions are pre-defined test conditions, such as the convergence of the loss function of the initial analysis model.
[0074] It should be noted that in this embodiment, the LoRA fine-tuning method will be adopted, and the output of the supervised initial analysis model will be used as the metric for the loss function. The training effect will be confirmed using the validation set, and finally tested using the test set to obtain the driving analysis model.
[0075] It should be noted that in this embodiment, a training driving dataset and an initial analysis model are obtained. Then, the initial analysis model is trained based on the training set to determine the trained initial analysis model. Based on the input data of the autonomous driving model in the validation set, the driving trajectory output by the autonomous driving model, and the trained initial analysis model, a prediction is made to determine the predicted safety label. If the predicted safety label corresponds to the training safety label in the validation set, the validated initial analysis model is determined. Finally, the test is performed based on the test set and the validated initial analysis model to determine the driving analysis model. This lays the foundation for subsequently inputting the driving trajectory and input data into the driving analysis model to determine the analysis text data and analysis label.
[0076] In other embodiments of this application, such as Figure 6 As shown, the analyzed text data includes inference text, multiple analysis phrases corresponding to the inference text, and the generation probability of each analysis phrase. The analysis labels include target labels, the first confidence level corresponding to the danger label, and the second confidence level corresponding to the safety label. The target label is either a danger label or a safety label.
[0077] The analysis text data characterizes the process of the driving analysis model's analysis and reasoning, including the reasoning text, the multiple analysis phrases corresponding to the reasoning text, and the generation probability of each analysis phrase. The reasoning text is represented as a piece of text, which is used to represent the analysis logic of the driving analysis model's analysis and reasoning. Multiple analysis phrases correspond to the reasoning text.
[0078] Analysis labels are used to characterize whether a driving trajectory is safe. These labels include a target label, a first confidence level corresponding to a hazard label, and a second confidence level corresponding to a safety label. The target label can be either a hazard label or a safety label. A hazard label indicates that the driving trajectory analyzed and inferred by the driving analysis model is dangerous. A safety label indicates that the driving trajectory analyzed and inferred by the driving analysis model is safe. The first confidence level, corresponding to the hazard label, is a parameter used to characterize the degree of confidence the driving analysis model has in considering the analyzed and inferred driving trajectory to be dangerous. The second confidence level, corresponding to the safety label, is a parameter used to characterize the degree of confidence the driving analysis model has in considering the analyzed and inferred driving trajectory to be safe.
[0079] Based on the analysis of text data and tags, the risk score corresponding to the driving trajectory data is determined as follows:
[0080] Step 601: Determine the tag score based on the analyzed tags.
[0081] In this embodiment, determining the tag score based on the analyzed tags includes:
[0082] Step 1: Add the first confidence level corresponding to the hazard label and the second confidence level corresponding to the safety label to determine the total confidence level.
[0083] The first confidence level corresponding to the hazard label and the second confidence level corresponding to the safety label are added together, and the result is used as the total confidence level. For example, if the first confidence level is 0.2 and the second confidence level is 0.3, then the total confidence level is 0.5.
[0084] The total confidence level is the sum of the first confidence level and the second confidence level.
[0085] Step 2: Divide the confidence level of the target label by the total confidence level to determine the label score.
[0086] Divide the confidence level corresponding to the target label by the total confidence level, and use the result as the final label score.
[0087] As shown above, before outputting the target label, the driving analysis model determines the first confidence level for the hazard label and the second confidence level for the safety label based on the inference text. Then, it selects the label with the higher confidence level (first or second) as the target label. Therefore, with a first confidence level of 0.2 and a second confidence level of 0.3, the target label is a safety label, meaning the second confidence level for the safety label is divided by the total confidence level, resulting in a label score of 0.6.
[0088] Label scores are scores that characterize the tendency of a driving analysis model to output target labels. They can reflect the intuitive tendency of the driving analysis model when outputting target labels. However, since label score data is often quite extreme, it is only used as auxiliary information in the overall score.
[0089] Step 602: Determine the reasoning score based on the preset keyword library, analyzed text data, and analyzed tags.
[0090] In this embodiment, a preset keyword library and the inference text are matched with phrases to determine multiple matching key phrases and the enhancement weights corresponding to each matching key phrase. Then, based on the multiple matching key phrases and the enhancement weights corresponding to each matching key phrase, the support of the inference text is determined. Finally, based on the generation probability of each analysis phrase, the support of the inference text, and the target label, the inference score is determined.
[0091] The preset keyword library is a pre-defined lexicon, including multiple key phrases and their corresponding enhancement weights. Key phrases are pre-compiled, representing important words that the inference text may contain. Enhancement weights are pre-determined weights corresponding to key phrases, used to characterize the importance of each key phrase. Matching key phrases are the key phrases contained in the inference text, and the support score for the inference text represents the credibility of the inference text. The inference score is a rating that characterizes the credibility of the inference text.
[0092] Step 603: Determine the consistency score based on the label score and the reasoning score.
[0093] In this embodiment, the support level of the tag score is determined based on the tag score, the support level of the inference score is determined based on the inference score, and the consistency score is determined based on the support level of the tag score and the support level of the inference score.
[0094] The support score for the label rating represents the credibility of the label rating. The support score for the inference rating represents the credibility of the inference rating. The consistency score represents the consistency between the label rating and the inference rating.
[0095] Specifically, the support for the label rating is determined by subtracting 0.5 from the label rating and multiplying the result by 2. Similarly, the support for the inference rating is determined by subtracting 0.5 from the inference rating and multiplying the result by 2.
[0096] The consistency score is determined as follows: the smaller of the support of the label score and the support of the inference score is taken as the target support. Then, the result of multiplying the target support by 0.5 is added to 0.5 to obtain the consistency score.
[0097] It should be noted that when the label score and the reasoning score support the same direction, the consistency score is higher; when the label score and the reasoning score conflict, the consistency score approaches 0.5, thereby reducing the extreme nature of the risk score.
[0098] Step 604: Determine the risk score corresponding to the driving trajectory data based on the label score, reasoning score, and consistency score.
[0099] In this embodiment, the risk score corresponding to the driving trajectory data is determined based on the label score, inference score, and consistency score, including:
[0100] Step 1: Multiply the tag score by the preset tag weight to determine the tag parameters.
[0101] The result of multiplying the tag score by the preset tag weight is used as the tag parameter.
[0102] The preset tag weights are pre-set weights corresponding to the tag scores, used to represent the importance of the tag scores. The tag parameters are the result of the tag score multiplied by the preset tag weights.
[0103] Step 2: Multiply the reasoning score by the preset reasoning weight to determine the reasoning parameters.
[0104] The reasoning score is multiplied by the preset reasoning weight and used as the reasoning parameter.
[0105] The preset inference weights are pre-set weights corresponding to the inference score, used to characterize the importance of the inference score. The inference parameter is the result of multiplying the inference score by the preset inference weights.
[0106] Step 3: Multiply the consistency score by the preset consistency weight to determine the consistency parameters.
[0107] The consistency score is multiplied by the preset consistency weight and used as the consistency parameter.
[0108] The preset consistency weight is a pre-set weight corresponding to the consistency score, used to characterize the importance of the consistency score. The consistency parameter is the result of multiplying the consistency score by the preset consistency weight.
[0109] Step 4: Determine the target parameters based on the label weight, inference weight, and consistency weight.
[0110] The label weight, inference weight, and consistency weight are summed, and the result is used as the target parameter. The target parameter is the sum of the label weight, inference weight, and consistency weight.
[0111] Step 5: Add the label parameters, inference parameters, and consistency parameters together, and divide by the target parameter to determine the risk score corresponding to the driving trajectory data.
[0112] The risk score corresponding to the driving trajectory data is calculated by adding the label parameters, inference parameters, and consistency parameters together and then dividing the sum by the target parameter.
[0113] The risk score is a rating that characterizes the credibility of the driving trajectory output by the autonomous driving model.
[0114] For example, the risk score corresponding to the driving trajectory data is determined as follows:
[0115] .
[0116] in, Risk scores corresponding to driving trajectory data. Rate the tags To preset tag weights, Rate the reasoning. To pre-determine the inference weights, For consistency scoring, Preset consistency weights.
[0117] It should be noted that this application proposes a scoring mechanism for evaluating the decision-making risk level of autonomous driving models. Unlike traditional schemes that rely solely on the model's final output safety or danger labels, this application integrates multi-layered information to provide a more stable and interpretable quantitative evaluation of the autonomous driving model's decisions, ultimately obtaining a risk score, `dangerous_score`, with a value ranging from 0 to 1. A risk score > 0.5 indicates a stronger bias towards danger, a risk score < 0.5 indicates a stronger bias towards safety, and a score close to 0.5 indicates insufficient evidence or uncertainty. In the specific implementation, the driving analysis model first generates a complete output, including analysis text data and analysis labels. Simultaneously, the generation probabilities of multiple analysis phrases corresponding to the reasoning text are recorded during the generation process for subsequent score calculation.
[0118] In other embodiments of this application, such as Figure 7 As shown, the preset keyword library includes multiple key phrases and their corresponding enhanced weights.
[0119] The preset keyword library is a pre-defined thesaurus that includes multiple key phrases and their corresponding weights. The key phrases are pre-compiled important words that the inference text may contain. The weights are pre-determined weights corresponding to the key phrases, used to characterize the importance of the key phrases.
[0120] Based on a pre-defined keyword database, analyzed text data, and analyzed tags, the reasoning score is determined to include:
[0121] Step 701: Perform phrase matching based on the preset keyword library and inference text to determine multiple matching key phrases and the enhancement weight corresponding to each matching key phrase.
[0122] In this embodiment, a key phrase from a preset keyword library is screened in the reasoning text to determine whether the reasoning text includes the key phrase. If it is included, the key phrase is used as the matching key phrase, and the enhancement weight corresponding to the key phrase is used as the enhancement weight corresponding to the matching key phrase, thereby determining multiple matching key phrases and the enhancement weight corresponding to each matching key phrase.
[0123] In other embodiments of this application, a key phrase in a preset keyword library is screened among multiple analysis phrases corresponding to the reasoning text to determine whether the key phrase is included in the multiple analysis phrases corresponding to the reasoning text. If it is included, the key phrase is used as the matching key phrase, and the enhancement weight corresponding to the key phrase is used as the enhancement weight corresponding to the matching key phrase, thereby determining multiple matching key phrases and the enhancement weight corresponding to each matching key phrase.
[0124] The matching key phrases are the key phrases contained in the inference text. The enhancement weights corresponding to the matching key phrases are the enhancement weights for a given matching key phrase.
[0125] Step 702: Determine the phrase score for each matching key phrase based on multiple matching key phrases and the enhancement weights corresponding to each matching key phrase.
[0126] In this embodiment, the phrase score for each matching key phrase is determined based on multiple matching key phrases and the enhancement weights corresponding to each matching key phrase, including:
[0127] Step 1: Determine the phrase length of each matching key phrase based on multiple matching key phrases.
[0128] For a given matching key phrase, determine the length of the matching key phrase based on it, and use it as the phrase length of the matching key phrase, thereby determining the phrase length of each matching key phrase.
[0129] The phrase length is the length of the matching key phrase. For example, if the matching key phrase is "123", its phrase length is 3.
[0130] Step 2: Determine the repetition frequency of each matching key phrase based on the inference text.
[0131] In this embodiment, for a given matching key phrase, the number of times the matching key phrase appears in the inference text is determined based on the inference text, and this number is used as the repetition frequency of the matching key phrase, thereby determining the repetition frequency of each matching key phrase.
[0132] The repetition frequency is the number of times a matching key phrase appears in the inference text. For example, if a matching key phrase is "123", it appears 4 times in the inference text, so the repetition frequency of this matching key phrase is 4 times.
[0133] Step 3: For the target key phrase, determine the initial phrase score of the target key phrase based on the preset length enhancement rules, the enhancement weight corresponding to the target key phrase, and the phrase length of the target key phrase.
[0134] In this embodiment, the initial phrase score of the target key phrase is calculated based on the enhancement weight corresponding to the target key phrase and the phrase length of the target key phrase according to the preset length enhancement rules.
[0135] The initial phrase score is the parameter obtained by length enhancement of the enhanced weights corresponding to the target key phrase.
[0136] The preset length enhancement rule is a preset rule for calculating the initial phrase score, specifically:
[0137] .
[0138] in, Initial phrase scoring for the target key phrase. Enhance the weights corresponding to the target key phrases. This is a preset length enhancement coefficient, a unique value, used to control the impact of phrase length. `min()` is a common mathematical formula, and its output is the minimum value of each parameter in the parentheses. The phrase length of the target keyword phrase. This is a preset upper limit for length enhancement, and is a unique value. This process means that, based on the basic enhancement weight, more complete matching key phrases are given appropriate enhancement.
[0139] The target keyword phrase is any one of multiple matching keyword phrases. In this embodiment, the steps related to the target keyword phrase are explained as an example. In practice, the steps in this embodiment need to be performed for each matching keyword phrase.
[0140] Step 4: Determine the phrase score of the target key phrase based on the frequency enhancement rules, the initial phrase score, and the repetition frequency of the target key phrase.
[0141] In this embodiment, the phrase score of the target key phrase is calculated according to the frequency enhancement rule, based on the initial phrase score and the repetition frequency of the target key phrase.
[0142] The phrase score is a parameter obtained by frequency enhancement of the initial phrase score.
[0143] The frequency enhancement rule is a preset rule for calculating phrase scores, specifically:
[0144] .
[0145] in, Score the target key phrases using phrase scoring. Initial phrase scoring for the target key phrase. Here is the preset repetition enhancement coefficient, which is a unique value. `min()` is a common mathematical formula, and its output is the minimum value of each parameter in the parentheses. The repetition frequency of the target key phrase. This is a preset upper limit for the number of repetitions, and it is a unique value. This process means that if the driving analysis model emphasizes a certain matching key phrase multiple times in the inference text, the phrase score of that matching key phrase should be appropriately increased.
[0146] Step 703: Determine the support level of the inference text based on the phrase scores corresponding to multiple matching key phrases.
[0147] In this embodiment, the support level of the inference text is determined based on phrase scores corresponding to multiple matching key phrases, including:
[0148] Step 1: Sort the phrase scores corresponding to multiple matching key phrases to determine the ranking of each matching key phrase.
[0149] In this embodiment, the phrase scores corresponding to multiple matching key phrases are sorted in descending order, and the sorted order of the phrase scores is used as the ranking of the corresponding matching key phrases.
[0150] The ranking of the matched key phrases is the order in which the scores of the matched key phrases are sorted.
[0151] It should be noted that the minimum rank for each matching keyword phrase is 1.
[0152] Step 2: For the target key phrase, determine the contribution of the target key phrase based on its phrase score, ranking, and preset attenuation coefficient.
[0153] The contribution of the target key phrases is determined as follows:
[0154] .
[0155] in, Contribution to the target key phrase. The phrase score is assigned to the target keyword, where i represents the rank of the target keyword. A preset decay coefficient is used to control the decay rate of phrase scores for matching key phrases. It should be noted that this step is to avoid a linear increase in inference scores due to a large number of similar matching key phrases. Therefore, a diminishing marginal return mechanism is introduced to decay the phrase scores of matching key phrases. This can be understood as: the later a matching key phrase appears in the list, the smaller its contribution.
[0156] The preset attenuation coefficient is a pre-set attenuation coefficient. The contribution of the target key phrase is a parameter used to characterize the degree of contribution of the target key phrase.
[0157] Step 3: Accumulate the contributions of multiple matching key phrases to determine the strength of evidence corresponding to the reasoning text.
[0158] The contribution of each matching key phrase is summed up, and the sum is used as the evidence strength of the inference text.
[0159] The strength of evidence corresponding to the reasoning text is a parameter that characterizes the overall contribution of the reasoning text.
[0160] The specific steps to determine the strength of evidence corresponding to the reasoning text are as follows:
[0161] .
[0162] in, The strength of evidence corresponding to the reasoning text. The contribution of each matching key phrase.
[0163] Step 4: Determine the support level of the inference text based on the preset smoothing constant and the strength of evidence corresponding to the inference text.
[0164] In this embodiment, the evidence strength corresponding to the reasoning text is smoothed by a preset smoothing constant, thereby obtaining the support level corresponding to the reasoning text.
[0165] The preset smoothing constant is a preset constant used to smooth the strength of evidence corresponding to the reasoning text.
[0166] The support level corresponding to the reasoning text is a parameter obtained by smoothing the evidence strength corresponding to the reasoning text.
[0167] The specific steps to determine the support level corresponding to the inference text are as follows:
[0168] .
[0169] in, The support level corresponding to the inference text. The strength of evidence corresponding to the reasoning text. This is a preset smoothing constant. It should be noted that the formula for determining the support corresponding to the reasoning text has a "saturation" characteristic: when the evidence strength corresponding to the reasoning text is high, the growth of the support corresponding to the reasoning text gradually slows down, thereby avoiding the situation where the support corresponding to the reasoning text is an extreme value.
[0170] In this embodiment, in order to ensure that the reasoning score has a stable numerical range, the evidence strength corresponding to the reasoning text is mapped to the support level corresponding to the reasoning text.
[0171] Step 704: Determine the inference score based on the generation probability of each analysis phrase, the support of the inference text, and the target label.
[0172] In this embodiment, the inference score is determined based on the generation probability of each analysis phrase, the support level of the inference text, and the target label, including:
[0173] Step 1: Determine the average generation probability of the inference text based on the generation probability of each analysis phrase.
[0174] In this embodiment, the generation probability of each analysis phrase is accumulated, and the accumulated result is divided by the number of analysis phrases to obtain the average generation probability of the inference text.
[0175] The average generation probability represents the average probability of the driving analysis model generating each analysis phrase.
[0176] The average generation probability of the inference text is determined as follows:
[0177] .
[0178] in, This represents the average generation probability of the inference text. To analyze the number of phrases, The generation probability of each analytical phrase.
[0179] Step 2: Determine the offset corresponding to the inference text based on the preset offset determination rule, the average generation probability and support of the inference text.
[0180] In this embodiment, the offset of the inference text is calculated based on the average generation probability and support of the inference text according to the preset offset determination rules.
[0181] The preset offset determination rule is a pre-defined rule used to determine the offset amount corresponding to the inference text, and is used to measure the confidence level of the driving analysis model when generating inference text. The offset amount corresponding to the inference text represents the offset value of the inference text; the larger the value, the stronger the logic of the inference text.
[0182] Based on the preset offset determination rules, the specific offset amount corresponding to the inference text is determined as follows:
[0183] .
[0184] in, This is the offset corresponding to the inference text. This is the preset overall scaling factor, and it has a unique value. 'a' and 'b' are preset confidence level adjustment parameters, and they also have unique values. The support level corresponding to the inference text. This represents the average generation probability of the inference text.
[0185] Step 3: If the target label is a danger label, determine the reasoning score based on the preset first formula and the offset corresponding to the reasoning text.
[0186] When the target label is a dangerous label, the offset corresponding to the reasoning text will be substituted into the first formula for calculation to obtain the reasoning score.
[0187] Reasoning score is a rating that characterizes the credibility of the reasoning text.
[0188] When the target label is a hazard label, the first formula is as follows:
[0189] .
[0190] in, For reasoning scoring, min() is a common mathematical formula, and its output is the minimum value of each parameter in the parentheses. This is the offset corresponding to the inference text.
[0191] Step 4: If the target label is a security label, then determine the reasoning score based on the preset second formula and the offset corresponding to the reasoning text.
[0192] When the target label is a safe label, the offset corresponding to the reasoning text will be substituted into the second formula for calculation to obtain the reasoning score.
[0193] Reasoning score is a rating that characterizes the credibility of the reasoning text.
[0194] When the target label is a security label, the second formula is as follows:
[0195] .
[0196] in, For reasoning scoring, max() is a common mathematical formula, and its output is the maximum value of each parameter in the parentheses. This is the offset corresponding to the inference text.
[0197] It should be noted that the reasoning score is centered at 0.5 and shifts to both sides. The degree of shift is determined by the average generation probability and support of the reasoning text.
[0198] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0199] Based on the same inventive concept, this application also provides a driving trajectory risk analysis device for implementing the driving trajectory risk analysis method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more driving trajectory risk analysis device embodiments provided below can be found in the limitations of the driving trajectory risk analysis method described above, and will not be repeated here.
[0200] In one embodiment of this application, such as Figure 8 As shown, a driving trajectory risk analysis device is provided, comprising:
[0201] The acquisition module 100 is used to acquire the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and the pre-trained driving analysis model.
[0202] The driving analysis module 200 is used to input the driving trajectory and input data into the driving analysis model to determine the analysis text data and analysis labels.
[0203] The scoring determination module 300 is used to determine the risk score corresponding to the driving trajectory data based on the analyzed text data and the analyzed tags.
[0204] In other embodiments of this application, the acquisition module 100 is further configured to acquire a training driving dataset and an initial analysis model. The training driving dataset includes a training set, a validation set, and a test set, wherein the sample data in the training set, validation set, and test set have the same format. The sample data includes input data of an autonomous driving model, driving trajectories output by the autonomous driving model, and training safety labels. The initial analysis model is trained based on the training set to determine the trained initial analysis model. Prediction is performed based on the input data of the autonomous driving model in the validation set, the driving trajectories output by the autonomous driving model, and the trained initial analysis model to determine the predicted safety labels. If the predicted safety labels correspond to the training safety labels in the validation set, the validated initial analysis model is determined. The driving analysis model is determined by testing based on the test set and the validated initial analysis model.
[0205] In other embodiments of this application, the scoring determination module 300 is further configured to determine a tag score based on the analysis tags; determine an inference score based on a preset keyword library, the analysis text data, and the analysis tags; determine a consistency score based on the tag score and the inference score; and determine a risk score corresponding to the driving trajectory data based on the tag score, the inference score, and the consistency score.
[0206] In other embodiments of this application, the scoring determination module 300 is further configured to add the first confidence level corresponding to the danger label and the second confidence level corresponding to the safety label to determine the total confidence level; and divide the confidence level corresponding to the target label by the total confidence level to determine the label score.
[0207] In other embodiments of this application, the scoring determination module 300 is further configured to perform phrase matching based on the preset keyword library and the inference text, determine multiple matching key phrases and the enhancement weight corresponding to each matching key phrase; determine the phrase score corresponding to each matching key phrase based on the multiple matching key phrases and the enhancement weight corresponding to each matching key phrase; determine the support level corresponding to the inference text based on the phrase scores corresponding to the multiple matching key phrases; and determine the inference score based on the generation probability of each analysis phrase, the support level corresponding to the inference text, and the target label.
[0208] In other embodiments of this application, the scoring determination module 300 is further configured to: determine the phrase length of each matching key phrase based on the plurality of matching key phrases; determine the repetition frequency of each matching key phrase based on the inference text; and, for a target key phrase, determine an initial phrase score for the target key phrase based on a preset length enhancement rule, the enhancement weight corresponding to the target key phrase, and the phrase length of the target key phrase; wherein the target key phrase is any one of the plurality of matching key phrases; and determine the phrase score of the target key phrase based on the frequency enhancement rule, the initial phrase score, and the repetition frequency of the target key phrase.
[0209] In other embodiments of this application, the scoring determination module 300 is further configured to sort the phrase scores corresponding to the multiple matching key phrases to determine the ranking of each matching key phrase; for a target key phrase, determine the contribution of the target key phrase based on the phrase score of the target key phrase, the ranking of the target key phrase, and a preset attenuation coefficient; accumulate the contributions corresponding to the multiple matching key phrases to determine the evidence strength corresponding to the inference text; and determine the support of the inference text based on a preset smoothing constant and the evidence strength corresponding to the inference text.
[0210] In other embodiments of this application, the scoring determination module 300 is further configured to determine the average generation probability corresponding to the inference text based on the generation probability of each analysis phrase; determine the offset corresponding to the inference text based on the preset offset determination rule, the average generation probability corresponding to the inference text, and the support; if the target label is a dangerous label, then determine the inference score based on the preset first formula and the offset corresponding to the inference text; if the target label is a safe label, then determine the inference score based on the preset second formula and the offset corresponding to the inference text.
[0211] In other embodiments of this application, the scoring determination module 300 is further configured to multiply the label score by a preset label weight to determine label parameters; multiply the inference score by a preset inference weight to determine inference parameters; multiply the consistency score by a preset consistency weight to determine consistency parameters; determine target parameters based on the label weight, inference weight, and consistency weight; and add the label parameters, inference parameters, and consistency parameters together and divide by the target parameters to determine the risk score corresponding to the driving trajectory data.
[0212] Each module in the aforementioned driving trajectory risk analysis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0213] In one embodiment of this application, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 9 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores all relevant data for executing a driving trajectory risk analysis method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a driving trajectory risk analysis method.
[0214] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0215] In one embodiment of this application, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the driving trajectory risk analysis method in the above embodiment.
[0216] In one embodiment of this application, a computer-readable storage medium is provided, on which a computer program is stored, the computer program being executed by a processor to implement the steps of the driving trajectory risk analysis method in the above-described method embodiments.
[0217] In one embodiment of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the driving trajectory risk analysis method in the above-described method embodiments.
[0218] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0219] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0220] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0221] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for analyzing driving trajectory risks, characterized in that, The driving trajectory is the driving trajectory output by the autonomous driving model, and the method includes: Acquire the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and the pre-trained driving analysis model; The driving trajectory and input data are input into the driving analysis model to determine the analysis text data and analysis labels; Based on the analyzed tags, determine the tag score; The reasoning score is determined based on the preset keyword library, the analyzed text data, and the analyzed tags; A consistency score is determined based on the label score and the reasoning score; Based on the label score, the reasoning score, and the consistency score, the risk score corresponding to the driving trajectory data is determined; The analyzed text data includes inference text, multiple analytical phrases corresponding to the inference text, and the generation probability of each analytical phrase. The analytical labels include target labels, a first confidence level corresponding to a danger label, and a second confidence level corresponding to a safety label. The target label is either a danger label or a safety label. The preset keyword library includes multiple key phrases and corresponding enhanced weights. The determination of the inference score based on the preset keyword library, the analyzed text data, and the analyzed tags includes: Phrase matching is performed based on the preset keyword library and the inference text to determine multiple matching key phrases and the enhancement weight corresponding to each matching key phrase; Based on the multiple matching key phrases and the enhancement weights corresponding to each matching key phrase, determine the phrase score corresponding to each matching key phrase; The support level of the inference text is determined based on the phrase scores corresponding to multiple matching key phrases. The inference score is determined based on the generation probability of each analytical phrase, the support of the inference text, and the target label.
2. The driving trajectory risk analysis method according to claim 1, characterized in that, The method further includes: Obtain a training driving dataset and an initial analysis model. The training driving dataset includes a training set, a validation set, and a test set. The sample data in the training set, validation set, and test set have the same format. The sample data includes the input data of the autonomous driving model, the driving trajectory output by the autonomous driving model, and training safety labels. The initial analysis model is trained based on the training set to determine the trained initial analysis model; Based on the input data of the autonomous driving model in the validation set, the driving trajectory output by the autonomous driving model, and the initial analysis model after training, a prediction is made to determine the predicted safety label. If the predicted security label corresponds to the training security label in the validation set, then the initial analysis model after validation is determined. The driving analysis model is determined by testing the test set and the validated initial analysis model.
3. The driving trajectory risk analysis method according to claim 1, characterized in that, The step of determining the tag score based on the analyzed tags includes: The total confidence level is determined by adding the first confidence level corresponding to the danger label and the second confidence level corresponding to the safety label. The label score is determined by dividing the confidence level corresponding to the target label by the total confidence level.
4. The driving trajectory risk analysis method according to claim 1, characterized in that, The step of determining the phrase score corresponding to each matching key phrase based on multiple matching key phrases and the enhancement weight corresponding to each matching key phrase includes: Based on the multiple matching key phrases, determine the phrase length of each matching key phrase; Based on the inference text, determine the repetition frequency of each matching key phrase; For a target key phrase, an initial phrase score is determined based on a preset length enhancement rule, the enhancement weight corresponding to the target key phrase, and the phrase length of the target key phrase; the target key phrase is any one of a plurality of matching key phrases. The phrase score of the target key phrase is determined based on the frequency enhancement rule, the initial phrase score, and the repetition frequency of the target key phrase.
5. The driving trajectory risk analysis method according to claim 1, characterized in that, The step of determining the support level of the inference text based on phrase scores corresponding to multiple matching key phrases includes: The ranking of each matching key phrase is determined by sorting the phrase scores corresponding to multiple matching key phrases. For each target keyword phrase, its contribution is determined based on its phrase score, ranking, and preset attenuation coefficient. The contribution scores corresponding to multiple matching key phrases are summed to determine the strength of evidence corresponding to the reasoning text. The support level corresponding to the inference text is determined based on the preset smoothing constant and the evidence strength corresponding to the inference text.
6. The driving trajectory risk analysis method according to claim 1, characterized in that, The determination of the inference score based on the generation probability of each analysis phrase, the support of the inference text, and the target label includes: Based on the generation probability of each analytical phrase, determine the average generation probability of the inference text. Based on the preset offset determination rules, the average generation probability and support of the inference text, determine the offset corresponding to the inference text; If the target label is a danger label, the reasoning score is determined according to the preset first formula and the offset corresponding to the reasoning text; If the target label is a security label, the reasoning score is determined based on the preset second formula and the offset corresponding to the reasoning text.
7. The driving trajectory risk analysis method according to claim 1, characterized in that, The step of determining the risk score corresponding to the driving trajectory data based on the label score, the inference score, and the consistency score includes: Multiply the tag score by a preset tag weight to determine the tag parameters; Multiply the reasoning score by a preset reasoning weight to determine the reasoning parameters; The consistency score is multiplied by a preset consistency weight to determine the consistency parameters; The target parameters are determined based on the label weight, inference weight, and consistency weight. The risk score corresponding to the driving trajectory data is determined by adding the label parameters, inference parameters, and consistency parameters together and dividing by the target parameter.
8. A driving trajectory risk analysis device, characterized in that, The device includes: The acquisition module is used to acquire the driving trajectory output by the autonomous driving model, the input data of the autonomous driving model when outputting the driving trajectory, and the pre-trained driving analysis model; The driving analysis module is used to input the driving trajectory and input data into the driving analysis model, and determine the analysis text data and analysis tags; The scoring determination module is used to determine a tag score based on the analysis tags; determine an inference score based on a preset keyword library, the analysis text data, and the analysis tags; determine a consistency score based on the tag score and the inference score; and determine a risk score corresponding to the driving trajectory data based on the tag score, the inference score, and the consistency score. The analysis text data includes inference text, multiple analysis phrases corresponding to the inference text, and the generation probability of each analysis phrase. The analysis tags include a target tag, a first confidence level corresponding to a danger tag, and a second confidence level corresponding to a safety tag. The target tag is either a danger tag or a safety tag. The preset keyword library includes multiple key phrases and corresponding enhancement weights. The scoring determination module is used to perform phrase matching based on the preset keyword library and the inference text to determine multiple matching key phrases and the enhancement weights corresponding to each matching key phrase; determine the phrase score corresponding to each matching key phrase based on the multiple matching key phrases and the enhancement weights corresponding to each matching key phrase; determine the support level corresponding to the inference text based on the phrase scores corresponding to the multiple matching key phrases; and determine the inference score based on the generation probability of each analysis phrase, the support level corresponding to the inference text, and the target label.
Citation Information
Patent Citations
Control method, device, equipment, vehicle, chip and medium
CN120552856A