Explainable method for shap-based autonomous driving accident severity classification model

By combining CatBoost and SHAP algorithms, a classification model for the severity of autonomous driving accidents was established, which solves the problem of insufficient explanation of the influencing factors of autonomous driving accidents in existing technologies. It enables in-depth quantification of accident severity and analysis of interactive effects, thereby improving the effectiveness of road safety management.

CN116127389BActive Publication Date: 2026-03-31SOUTHEAST UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively explain the factors influencing the severity of autonomous driving accidents, especially when processing autonomous driving accident data using the CatBoost model, which lacks the ability to quantify and interpret the severity of accident data.

Method used

By combining the CatBoost model and the SHAP algorithm, and through multi-source data preprocessing, feature engineering, Pearson correlation coefficient screening, Bayesian optimization parameter tuning, CatBoost training, and SHAP interpretation tools, a classification model for the severity of autonomous driving accidents is established to quantify influencing factors and explore their interactive effects.

Benefits of technology

It enables an in-depth explanation of the severity of autonomous driving accidents, reveals key factors and their interaction effects, and provides safety recommendations to improve road safety design and management policy formulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127389B_ABST
    Figure CN116127389B_ABST
Patent Text Reader

Abstract

The application discloses an interpretable method of an automatic driving accident severity classification model based on SHAP, and comprises the following steps: acquiring automatic driving accidents in previous years, jointly pre-processing and feature engineering coding of multi-source data, and establishing an automatic driving accident mining and analysis dataset; checking variable correlation through a Pearson correlation coefficient matrix, and dividing a training set and a test set; adjusting hyperparameters by using a Bayesian optimization principle to obtain a relatively optimal algorithm hyperparameter combination; training the training set data by using a CatBoost algorithm, determining an accident severity classification model according to evaluation indexes such as accuracy, and outputting feature importance; and inputting the automatic driving accident mining and analysis dataset into the trained classification model, and outputting a prediction value of each severity. The application is helpful for traffic agencies to formulate effective policy measures and engineering countermeasures, and improve the safety level of automatic driving in practical application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of accident causation analysis technology, and more specifically, relates to an interpretable method for a SHAP-based classification model of the severity of autonomous driving accidents. Background Technology

[0002] Analyzing the factors influencing the severity of autonomous vehicle (CAV) traffic accidents is an effective way to improve the operational safety of CAVs. Previous research has typically focused on analyzing CAV accidents using traditional statistical methods. Machine learning methods are more flexible and efficient, as they do not require pre-setting the severity of accident data. The CatBoost model, as an improved gradient boosting tree algorithm, can handle categorical features well, but it has rarely been used to analyze the different factors influencing the severity of traffic accidents, especially in the exploration of CAV accidents. Meanwhile, the SCAPE (Shapely Additive Explanation) algorithm, based on game theory and local interpretation, can calculate the relative importance of each attribute to the prediction, thus explaining the results of machine learning models. Therefore, this study utilizes the CatBoost model to handle various categorical features in CAV accident data, quantifies the safety impact of key factors related to CAV collision rates and different severity levels, and applies SHAP to explain the individual and interactive effects of accident risk factors. The interpretable method of the SHAP-based CAV accident severity classification model can provide insights for road management departments to formulate safety improvement policies for CAVs, and has practical value. Summary of the Invention

[0003] The problem this invention aims to solve is to overcome the shortcomings of existing technologies and provide a method for classifying the severity of autonomous driving accidents by combining CatBoost and SHAP, quantifying the safety impact of factors related to the severity of autonomous driving accidents, and applying SHAP to explain the individual and interactive effects of accident risk factors output by the model.

[0004] To address at least one of the aforementioned technical problems, according to one aspect of the present invention, an interpretable method for a SHAP-based classification model of the severity of autonomous driving accidents is provided, comprising the following steps:

[0005] S1. Obtain historical accident data for autonomous driving, perform joint preprocessing and feature engineering encoding on multi-source data, and establish an autonomous driving accident mining and analysis dataset D. Collect relevant data for autonomous driving accidents, including the original accident report dataset D1 and the satellite map location dataset D2. Combine and preprocess the multi-source data D1 and D2 using accident locations, imput missing values ​​using the mode, delete dirty data, and encode the text into unordered categorical variables to establish the accident mining and analysis dataset D. The dataset includes factors such as roads, environment, and vehicles.

[0006] S2. Determine the correlation between variables using the Pearson correlation coefficient matrix R, and utilize ρ XY Preliminary screening of accident influencing factors was conducted, retaining variables strongly correlated with the severity of the accident, and dividing the dataset into training and test sets.

[0007]

[0008]

[0009] S3. Use the Bayesian optimization principle (Equation 3) to adjust the hyperparameters and obtain a relatively optimal combination of algorithm hyperparameters.

[0010]

[0011] Where x represents the hyperparameters of the CatBoost multi-class classification model, and x is the setting of hyperparameters such as learning rate and maximum tree depth.

[0012] S4. The CatBoost algorithm is used to train the training set data. The accident severity classification model is determined based on evaluation metrics such as AUC, and the feature importance is output. First, the improved target variable statistical method (TS) is used to calculate the label TS value of each sample (Equation 4), and then the ordinal gradient is used for the classification task (Equations 5-8).

[0013]

[0014] Here, we assume the training set is represented as D = {(x k ,y k ) k=1,…,n},in It is a vector with m features, where p is the prior value, a is the prior weight, and y is the prior weight. k ∈R is the objective. CatBoost introduces a k-random permutation σ of the training samples.

[0015] F t =F t-1 +αh t (5)

[0016] Where α is the step size; t = 1, 2, ..., and the function F t : The (base learner) is selected from the function family H to minimize the expected loss, as shown in Equation 6. The loss is typically calculated using the least squares method, as shown in Equation 7.

[0017]

[0018]

[0019] in, However, the expected value in reality is unknown, and it is usually estimated using the same dataset D, as shown in Equation 8.

[0020]

[0021] Orderly boost training is performed on a random sample permutation σ, maintaining n distinct models M1,...,Mn, where model Mi is learned using only the first i samples from the permutation. S5. Input the autonomous driving accident mining and analysis dataset D into the trained classification model, outputting the predicted value for each severity level. Use the SHAP interpretation tool to convert the output of the classification model into SHAP values ​​for visualization analysis (Equation 9), and explore the interaction relationship between variables (Equation 10).

[0022]

[0023]

[0024] Where S is the feature subset of the model, x j It is the feature vector of the explained sample, p is the number of features, and f S φ is the model output value of feature combination S, where p! represents the number of feature combinations considering p features in the order they are considered. If feature j is fixed, there are a total of (p-|S|-1)!S! feature combinations. i φ represents the shap value of feature i. i,j This represents the shap interaction value between feature i and feature j.

[0025] According to another aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the interpretable method of the SHAP-based autonomous driving accident severity classification model of the present invention.

[0026] According to another aspect of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the interpretable method of the SHAP-based autonomous driving accident severity classification model of the present invention.

[0027] Compared with the prior art, the present invention has at least the following beneficial effects:

[0028] This invention presents an interpretable method for classifying the severity of autonomous driving accidents based on SHAP. By collecting autonomous driving accident data and combining CatBoost and SHAP technologies, a multi-classification model is established to explore the causes of autonomous driving accident severity. This model quantifies the influencing factors related to accident severity, investigates the causes and occurrence patterns of accidents of different severity levels involving connected autonomous vehicles, and analyzes the interaction effects between key factors. A deeper understanding of the factors affecting autonomous driving safety and their interactions helps explain the complex conflict mechanisms in traffic flow, providing reliable suggestions for safe autonomous driving, improving road safety design, and enabling road management departments to formulate management improvement policies for connected autonomous vehicles. Attached Figure Description

[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings of the embodiments will be briefly described below. Obviously, the drawings described below only relate to some embodiments of the present invention and are not intended to limit the present invention.

[0030] Figure 1 A flowchart of the method of the present invention is shown. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention.

[0032] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.

[0033] Example 1:

[0034] Interpretable methods for SHAP-based classification models of autonomous driving accident severity, such as... Figure 1 As shown, it includes the following steps:

[0035] Step 1: Collect data related to autonomous driving accidents, including raw accident report data and satellite map location data. Search online for the publicly available connected autonomous driving accident dataset D1 from the California Department of Motor Vehicles (DMV). Collect data on direct factors such as vehicle movement behavior, vehicle type, accident type, and accident time from 479 detailed accident reports from January 2015 to September 2022. Use Google Maps to match latitude and longitude at accident locations to collect data D2 on road type, geometric design factors, and traffic facilities. Combine and preprocess the multi-source data D1 and D2 using accident IDs to create an accident mining and analysis dataset D. Merge the raw dataset and location dataset row-wise according to the accident location index to form an accident set containing multiple factors such as roads, vehicles, and environment. Preprocess the accident dataset by filling missing values ​​with the mode, deleting dirty data, and encoding attribute values ​​under different variables into unordered categorical variables.

[0036] Table 1 Accident Mining and Analysis Dataset D

[0037]

[0038] Step 2: Determine the correlation between variables using the Pearson correlation coefficient matrix R, and utilize ρ XY Preliminary screening of accident influencing factors was conducted, retaining variables strongly correlated with the severity of the accident, such as accident type, pre-accident motion behavior of autonomous vehicles, pre-accident motion behavior of manually driven vehicles, weather, lighting, intersection geometry design, road type, etc., and dividing the training set and test set at a ratio of 0.8.

[0039]

[0040]

[0041] Table 2 Accident Training Dataset

[0042] Num Vec_type AV_Move Time … Weather Severity Crash_type … Bus_sta … Road_park 1 1 1 1 … 1 1 1 … 1 … 1 2 2 2 2 … 2 2 2 … 1 … 1 3 4 5 4 … 3 3 4 … 0 … 0 … … … … … … … … … … … … 379 2 7 1 … 5 2 5 … 0 … 1 380 3 9 3 … 4 4 6 … 0 … 0

[0043] Step 3: Debug hyperparameters using the Bayesian optimization principle (Equation 3), including learning rate, tree depth, number of iterations, etc., and determine the relatively optimal combination of algorithm hyperparameters {iterations:1000,max depth:4,learning rate:0.11,l2_leaf_reg:1,od_wait:20} after three-fold cross-validation.

[0044]

[0045] Step 4: Train the training set data using the CatBoost algorithm, evaluate the accident severity classification model based on evaluation metrics such as AUC, and output feature importance. First, calculate the label TS value for each sample using the improved target variable statistical method (TS) (Equation 4), and then perform the classification task using sequential gradients (Equations 5-7). The evaluation metrics results of the model output are shown in Table 3. The AUCs for the four severity levels are: None, 0.57; Minor, 0.77; Moderate, 0.80; Major, 0.56.

[0046]

[0047] F t =F t-1 +αh t (5)

[0048]

[0049]

[0050] Table 3 Importance of features in the accident dataset

[0051] Num Feature Uniquevalues Feature importance 1 Crash type 6 11.5 2 Time 4 10.8 3 HDV movement before collision 10 10.5 4 CAV movement 10 9.6 … … … … 19 Roadside parking 2 0.3

[0052] in, However, the expected value in reality is unknown, and it is usually estimated using the same dataset D, as shown in Equation 8.

[0053]

[0054] Ordered boosting trains a random sample permutation σ and maintains n distinct models M1,...,Mn, where model Mi is learned using only the first i samples from the permutation.

[0055] S5. Input the autonomous driving accident mining and analysis dataset D into the trained classification model, output the predicted value of each severity level, and use the SHAP interpretation tool to convert the output of the classification model into SHAP values ​​for visualization analysis (Equation 9), and explore the interaction relationship between variables (Equation 10).

[0056]

[0057]

[0058] Where S is the feature subset of the model, x j It is the feature vector of the explained sample, p is the number of features, and f Sφ is the model output value of feature combination S, where p! represents the number of feature combinations considering p features in the order they are considered. If feature j is fixed, there are a total of (p-|S|-1)!S! feature combinations. i φ represents the shap value of feature i. i,j This represents the shap interaction value between feature i and feature j.

[0059] The CatBoost multi-class classification model's analysis of factors influencing accident severity indicates that road type and number of lanes, accident cause, vehicle type involved, time of accident, the movement behavior of autonomous and conventional vehicles, and weather and lighting conditions are crucial features affecting accident severity. The number of lanes is the most important feature affecting lossless accidents; roads with more lanes increase the risk of riskless accidents. Accidents involving scrapes with non-motorized vehicles or pedestrians have negative SHAP values, indicating that this type of accident increases its severity. Road type and number of lanes are important features affecting minor accidents; one-way roads and two-way roads with a median strip have positive SHAP values, indicating that these types of roads increase the risk of minor accidents. The number of lanes and the vehicle type involved are important features affecting moderate accidents. Accident type, vehicle type, road surface, and lighting conditions are all important factors affecting severe accidents.

[0060] The feature interaction results of the CatBoost multi-classification model output show that for lossless accidents, autonomous vehicle motion is negatively correlated with lighting conditions; the better the lighting and visibility, the more complex the autonomous vehicle behavior (such as merging, diverging, turning, overtaking, etc.). For minor accidents, road conditions are positively correlated with weather conditions, because adverse weather conditions such as rain and snow create slippery road surfaces, reducing the probability of minor accidents (increasing their severity). The interaction graph for moderate-severe collisions shows the correlation between lighting conditions, vehicle motion, collision type, and vehicle type, reflecting the impact of the interaction effects of these features on the output of the moderate-severe collision model. The partial dependency graph for severe accidents illustrates the influence of the interactions between features such as accident type, vehicle motion, environmental conditions, and road factors on the CatBoost model output.

[0061] Example 2:

[0062] The computer-readable storage medium of this embodiment stores a computer program that, when executed by a processor, implements the steps in the interpretable method of the SHAP-based autonomous driving accident severity classification model of Embodiment 1.

[0063] The computer-readable storage medium in this embodiment can be an internal storage unit of the terminal, such as the terminal's hard disk or memory; the computer-readable storage medium in this embodiment can also be an external storage device of the terminal, such as a plug-in hard disk, smart memory card, secure digital card, flash memory card, etc. equipped on the terminal; furthermore, the computer-readable storage medium can include both the terminal's internal storage unit and external storage devices.

[0064] The computer-readable storage medium of this embodiment is used to store computer programs and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0065] Example 3:

[0066] The computer device of this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the interpretable method of the SHAP-based autonomous driving accident severity classification model of Embodiment 1.

[0067] In this embodiment, the processor can be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The memory can include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.

[0068] Those skilled in the art will understand that the content disclosed in the embodiments can be provided as a method, system, or computer program product. Therefore, this solution can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this solution can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage) containing computer-usable program code.

[0069] This solution is described with reference to flowchart illustrations and / or block diagrams of methods and computer program products according to embodiments of this solution. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0070] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0071] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0072] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0073] The examples described herein are merely preferred embodiments of the invention and are not intended to limit the concept and scope of the invention. Any modifications and improvements made by those skilled in the art to the technical solutions of the invention without departing from the design concept of the invention should fall within the protection scope of the invention.

Claims

1. An explainable method for a SHAP-based autonomous driving accident severity classification model, characterized in that, Comprise the following steps: S1, obtain the automatic driving accident, preprocess and feature engineering coding on multi-source data, and establish the automatic driving accident mining and analysis dataset; S2, determine the correlation of variables by Pearson correlation coefficient matrix, use Preliminary screening of influencing factors, retaining variables with strong correlation with accident severity, dividing training set and test set; S3, use the Bayesian optimization principle to debug the hyperparameters, and obtain the relatively optimal algorithm hyperparameter combination; S4, train the training set data using the CatBoost algorithm, determine the accident severity classification model according to the accuracy and other evaluation indexes, and output the feature importance; S5, input the automatic driving accident mining and analysis dataset into the trained classification model, output the prediction value of each severity, convert the output result of the classification model into shap value using SHAP explanation tool for visual analysis, and explore the interaction between variables; Step S4 comprises the following steps: First, calculate the label TS value of each sample using the improved target variable statistical method: ; where the training set is assumed to be represented as where is a vector of m features, p is a prior value, is a weight of the prior, is the target; CatBoost introduces k random permutations σ of the training samples; Then use sequential gradient for classification task: wherein, is a step size; t = 1, 2,..., the function is selected from the family of functions H to minimize the expected loss as shown in equation (8); the loss is calculated using least squares method; ; ; wherein, but the true value is unknown in reality and is estimated using the same dataset D; ; In S5, the output result of the classification model is converted into shap value using SHAP explanation tool for visual analysis, and the formula is as follows: And explore the interaction between variables, the formula is as follows: where S is a feature subset of the model, x j is a feature vector of the explained sample, p is the number of features, f S is the model output value of the feature combination S, p! represents the number of feature combinations of the p feature consideration order, if feature j is fixed, there are a total of (p-| S |-1)! S! feature combinations; represents the shap value of feature i, represents the shap interaction value of feature i and feature j.

2. The method of claim 1, wherein, In step S2 The calculation formula is as follows: ; 。 3. The method of claim 1, wherein, The implementation formula of step S3 is as follows: ; where x denotes CatBoost multi-classification model hyperparameters.

4. A computer readable storage medium having stored thereon a computer program, characterized in that: The program is executed by the processor to realize the steps in the SHAP-based interpretable method of the automatic driving accident severity classification model according to any one of claims 1-3.

5. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the steps in the SHAP-based interpretable method of the automatic driving accident severity classification model according to any one of claims 1-3.

Citation Information

Patent Citations

  • Automatic driving accident classification and severity prediction method

    CN116522256A