Model-independent accurate interpretable method based on feature critical value analysis

Through feature critical value analysis and mixed probability methods, the problem of unstable and unfaithful interpretation results of the existing model-independent interpretable methods is solved, the accurate interpretability of the machine learning model is achieved, and the credibility and application of the model are enhanced. promotion.

CN118734977APending Publication Date: 2024-10-01GUANGXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410394672.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-02
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The explanation results generated by existing model-independent interpretable methods are unstable and not faithful enough to the original model, and cannot accurately determine the decision boundary of the original model.

Method used

Using a method based on feature critical value analysis, by gradually perturbing the characteristics of the sample to be explained, calculating the feature sensitivity and determining the critical value of a single feature, a fully perturbed sample is generated, and a mixed probability method and linear regression fitting are used to construct a fitting explanation. The model approximates the decision boundary of the original model.

Benefits of technology

The stability and fidelity of model-independent explanation results are achieved, and the generated explanation results more accurately reflect the behavior of the original model, enhancing the interpretability and trust of the machine learning model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734977A_ABST
    Figure CN118734977A_ABST
Patent Text Reader

Abstract

The invention discloses a model-independent accurate interpretable method based on feature critical value analysis, which performs sensitivity analysis on features of each dimension of a to-be-interpreted sample to obtain a critical value, and uses the critical value as a disturbance boundary for disturbing an instance, so that people can be helped to understand the degree of dependence of a model interpretation result on different features, and the model interpretation accuracy is improved. And interference caused by an overlarge characteristic value is eliminated. For the generated disturbance sample, a model which is formed by combining a plurality of linear regression methods and can accurately fit a local highly nonlinear decision boundary of a machine learning model is finally realized by using a mixed probability method, a probability distribution idea, multivariate normal distribution and an expectation maximization algorithm. And taking an interpretation model which is most faithful to the prediction result of the original model as a final interpretation. According to the method, the black box model is explained, the result of accurately explaining the sample to be explained can be effectively achieved, and meanwhile the explaining result keeps good stability, loyalty and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interpretable machine learning, and in particular to a model-independent precise interpretable method based on feature critical value analysis. Background Art

[0002] In recent years, machine learning technology based on neural networks has been widely used in various fields and has achieved excellent results, leading to great progress in artificial intelligence related technologies. Although machine learning models have achieved great success, the disadvantages of machine learning models have gradually emerged: on the one hand, studies have shown that machine learning models are vulnerable to adversarial perturbations, and a slight perturbation on the input will cause the model to make wrong decisions. On the other hand, due to its black box nature and opaque learning process, it is difficult for people to understand its internal operating mechanism and decision-making basis, and thus it is impossible to confirm whether the output results given by the model are reliable. The above problems directly affect the application promotion and practical influence of machine learning models. In order to improve people's trust in machine learning models and enhance human-machine collaboration, explainable machine learning came into being.

[0003] Explainable machine learning seeks to provide human-understandable explanations for model prediction results to reveal the logic and behavior mechanism of the model, which can not only increase users' trust and acceptance of the model, but also help meet regulatory and ethical requirements. The basic standard of explainable machine learning is that the explanation must enable humans to understand how the decision model reaches the prediction result, that is, the features play a positive or negative role in the explanation result, so that humans can choose whether to believe the model's prediction result based on the explanation result. The transparency of this explanation result is not only helpful for troubleshooting and model performance improvement, but also has important significance for revealing and correcting possible bias and unfairness in the model, promoting the sustainable development and application of artificial intelligence in various fields. The explanation methods of explainable machine learning are divided into model-related explanations and model-independent explanations. Model-related explanations focus on explaining the overall decision logic of the model, while model-independent explanations focus on explaining the model's prediction for a certain instance. Among them, model-independent explainable methods can reveal the relationship between the given input of the machine learning model and the corresponding output information, and let people understand whether the model reaches the prediction result according to the correct logic by showing the impact of important features of the instance on the prediction result or revealing the judgment basis of the model prediction. However, traditional model-independent interpretable methods require unrestricted random perturbations of samples, which will generate perturbed samples that are too different from the samples or even counterintuitive, and linear regression fitting of all perturbed samples cannot accurately determine the decision boundary of the original model. Therefore, the interpretation results generated by traditional model-independent interpretable methods are unstable and not faithful enough to the original model. Summary of the invention

[0004] The present invention aims to solve the problem that the interpretation results generated by the existing model-independent interpretable methods are unstable and not faithful enough to the original model, and provides a model-independent precise interpretable method based on feature critical value analysis.

[0005] To solve the above problems, the present invention is achieved through the following technical solutions:

[0006] A model-independent, accurate and interpretable method based on feature critical value analysis includes the following steps:

[0007] Step 1: Input the sample to be explained into the model to be explained to obtain the baseline prediction value of the model to be explained;

[0008] Step 2: perturb a feature of the sample to be interpreted, and gradually change the feature value of the current feature within the range of the minimum value and the maximum value of the current feature to obtain L single perturbation samples to be interpreted based on the current feature;

[0009] Step 3: Input the L single-disturbance samples to be explained based on the current features into the model to be explained respectively, and obtain the L single-disturbance prediction values ​​of the model to be explained based on the current features;

[0010] Step 4: Calculate the sensitivity of the current feature:

[0011]

[0012] Among them, S i is the i-th sensitivity of the current feature, y′ i is the i-th single perturbation prediction value based on the current feature, y is the baseline prediction value, z′ i is the i-th change disturbance eigenvalue of the current feature, z is the original eigenvalue of the current feature, i=1,2,…,L, L is the number of single disturbance samples to be explained based on the current feature;

[0013] Step 5: Determine the critical value of the current feature based on the L sensitivities of the current feature: that is, if there is an i-th change disturbance eigenvalue z′ of the current feature i Let the i-th sensitivity of the current feature be S i When the derivative is 0, the i-th single disturbance prediction value y′ based on the current feature i If it is not equal to the baseline prediction value y, then the i-th change perturbation feature value z′ of the current feature i Recorded as the critical value of the current feature; otherwise, the original value of the current feature is taken as the critical value of the current feature;

[0014] Step 6: Traverse all the features of the sample to be explained, repeat steps 2 to 5, and obtain the critical value of each feature of the sample to be explained;

[0015] Step 7: perturb all features of the sample to be interpreted, and obtain M fully perturbed samples to be interpreted by randomly changing the feature value of each feature within the range of its critical value; where M is a positive integer set artificially;

[0016] Step 8: Group the M fully perturbed samples to be explained by a mixed probability method to obtain K sample groups; where K is a positive integer set artificially;

[0017] Step 9: Perform linear regression fitting on the fully perturbed samples to be explained in each sample group to obtain K fitting explanation models;

[0018] Step 10: For each sample group, each fully perturbed sample to be explained of the current sample group is input into the model to be explained and the fitted explanation model of the current sample group, respectively, to obtain the predicted value to be explained and the fitted predicted value, and accordingly calculate the difference between the fitted explanation model of the current sample group and the model to be explained:

[0019]

[0020] In the formula, Φ k Represents the fitted explanatory model g for the current sample group k The difference between the model to be explained and f; x″ j′ represents the j′th fully perturbed sample to be explained in sample group k, f(x″ j′ ) represents the fully perturbed sample x″ to be explained in sample group k j′ The predicted value to be explained, g k (x″ j′ ) represents the fully perturbed sample x″ to be explained in sample group k j′ The fitted prediction value, j′=1,2,…,M k , M k represents the number of fully perturbed samples to be explained in sample group k;

[0021] Step 11: The fitted explanatory model of the sample group with the smallest difference from the model to be explained is taken as the final explanatory model.

[0022] In the above step 2, the number L of samples to be explained based on the single disturbance of the current feature is determined by the value range and the variation step determined by the minimum value and the maximum value of the current feature.

[0023] In the above step 7, when the eigenvalue of each feature of the sample to be explained is randomly changed within the range of its critical value: if the original eigenvalue of the feature is between the minimum value of the feature and the critical value of the feature, then the randomly perturbed eigenvalue of the feature is between the minimum value of the feature and the critical value of the feature; if the original eigenvalue of the feature is between the critical value of the feature and the maximum value of the feature, then the randomly perturbed eigenvalue of the feature is between the critical value of the feature and the maximum value of the feature; if the original eigenvalue of the feature is equal to the critical value, then the randomly perturbed eigenvalue of the feature is between the minimum value of the feature and the maximum value of the feature.

[0024] The specific process of step 8 above is as follows:

[0025] Step 8.1, set the number of sample groups K, and initialize the weight, mean and covariance of each sample group;

[0026] Step 8.2, traverse the M fully perturbed samples to be explained, calculate the posterior probability of the current fully perturbed sample to be explained relative to each sample group based on the weight, mean and covariance of each sample group, and classify the current fully perturbed sample to be explained into the sample group with the highest posterior probability;

[0027] Step 8.3: After the M fully perturbed samples to be explained are classified, the weight, mean and covariance of each sample group are updated based on the fully perturbed samples to be explained and their posterior probabilities in each sample group;

[0028] Step 8.4, repeat steps 8.2 and 8.3 until the parameters converge, that is, the perturbed samples to be explained in each group obtained this time are the same as the perturbed samples to be explained in each group obtained last time. At this time, the M fully perturbed samples to be explained are classified into K sample groups.

[0029] In the above step 8.2, the fully perturbed sample to be explained x″ j The posterior probability p for each sample group k is jk for:

[0030]

[0031] In the formula, w k represents the weight of sample group k, μ k represents the mean of sample group k, σ k represents the covariance of sample group k, N is the feature dimension of the fully perturbed sample to be explained, x″ j represents the kth fully perturbed sample to be explained, k = 1, 2, ..., M, M represents the number of fully perturbed samples to be explained, k = 1, 2, ..., K, K is the number of sample groups, superscript (■) T Indicates transpose.

[0032] In step 8.3 above:

[0033] The updated weight w of sample group k k 'for:

[0034]

[0035] Updated mean μ of sample group k k 'for:

[0036]

[0037] The updated covariance σ of sample group k k 'for:

[0038]

[0039] In the formula, x″ j′ represents the j′th fully perturbed sample to be explained in sample group k, p j′k Represents the fully perturbed sample to be explained x″ j ′ is the posterior probability of sample group k, σ k represents the covariance of sample group k before updating, j′=1,2,…,M k , M k It represents the number of fully perturbed samples to be explained in sample group k, k = 1, 2, …, K, where K is the number of sample groups.

[0040] In step 9 above, linear regression fitting is performed on sample group k to obtain the fitted explanatory model g k It is expressed as:

[0041] g k =β k0 +β k1 Z1+β k2 Z2+…+β kN Z N

[0042] In the formula, Z n represents the nth feature of the fully perturbed sample to be explained, β kn represents the weight of the nth feature of the fully perturbed sample to be explained, n = 1, 2, ..., N, N is the feature vector of the fully perturbed sample to be explained, k = 1, 2, ..., K, K is the number of sample groups;

[0043] Fitted explanatory model g for sample group k k The weight vector β k for:

[0044] β k =(X kT K k ) -1 K k T Y k

[0045] In the formula, β k represents the weight vector of sample group k, β k is a (N+1)×1-dimensional vector, whose first row is the intercept term β0, and the 2nd to N+1st rows are β k1 , β k2 , …, β kN The value of

[0046] X k represents the sample matrix of sample group k, X k It is an M k ×(N+1)-dimensional matrix, each row of which is a fully perturbed sample to be explained of sample group k, the first column of which is a constant term 1, and the 2nd to N+1st columns are the randomly perturbed eigenvalues ​​of the i-th feature of the fully perturbed sample to be explained of sample group k;

[0047] Y k represents the prediction vector of sample group k, Y k It is an M k ×1-dimensional vector, whose 1st to Mth k The rows are the 1st to Mth rows of sample group k. k The fully perturbed predicted value obtained by inputting the fully perturbed samples to be explained into the model to be explained;

[0048] Superscript (■) T Indicates transposition; M k Represents the number of fully perturbed samples to be explained in sample group k.

[0049] Compared with the prior art, the present invention has the following characteristics:

[0050] 1. The concept of single feature critical value is proposed. The critical value of a single feature is obtained by analysis and calculation as the disturbance boundary, which eliminates the interference of the perturbed sample on the interpretation result due to excessive perturbation of a certain feature.

[0051] 2. Design a hybrid probability method, using multivariate normal distribution and expectation-maximization algorithm to generate multiple explanation results composed of linear regression methods that are locally closer to the local nonlinear decision boundary of the model to be explained, and take the fitting result that is most faithful to the original model, that is, the error within the threshold, as the final explanation. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 Flowchart of a model-independent exact interpretable method based on feature critical value analysis.

[0053] Figure 2 Flowchart for determining feature critical values ​​based on the single feature critical value method.

[0054] Figure 3 Flowchart for determining the final explanatory model based on mixed probability and linear regression fitting methods. DETAILED DESCRIPTION

[0055] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in combination with specific examples and with reference to the accompanying drawings.

[0056] In this embodiment, the model to be explained f is a black box model, and the sample to be explained x is the input data of the black box model. Since the black box model is a system that does not reveal its internal mechanism, its training process and decision-making principle are not transparent, so it is a model whose decision logic cannot be understood by viewing the parameters. The input data is an N-dimensional vector, each dimension of the vector corresponds to the feature value of the feature used for prediction or classification, and N is the number of features (dimension) of the sample to be explained x.

[0057] In view of the problem that the traditional model-independent interpretable method requires unrestricted random perturbation of samples, which will generate perturbed samples that are too different from the samples or even counterintuitive, and linear regression fitting of all perturbed samples cannot accurately determine the decision boundary of the original model, the present invention proposes a model-independent accurate interpretable method based on feature critical value analysis, such as Figure 1 As shown, it includes the following steps:

[0058] (1) Use the single feature critical value analysis method to obtain the critical value of each feature of the sample to be explained.

[0059] The single-feature critical value analysis method is used to analyze each dimension feature of the sample x to be explained. By observing how the prediction results of the model f to be explained change with the change of a single feature of the instance, the feature sensitivity is calculated and the critical value is found. This method only needs to change one feature (variable) of the sample x to be explained during the experiment, while keeping the other features (variables) of the sample x to be explained unchanged, which makes it relatively easy to implement and the results easy to understand and explain, and can intuitively reflect the corresponding relationship between the feature and the prediction result. Figure 2 As shown, the specific process of determining the critical value of a feature by the single feature critical value analysis method is as follows:

[0060] Step 1: Input the sample to be explained x into the model to be explained f, and obtain the baseline prediction value y of the model to be explained f. The feature value of each feature of the sample to be explained x is the original feature value.

[0061] Step 2: Perturb a feature of the sample x to be interpreted, and gradually change the feature value of the current feature within the range [Min, Max] between the minimum value Min and the maximum value Max of the current feature to obtain L single perturbation samples x′ to be interpreted based on the current feature. i ,i=1,2,…,L,single perturbation sample x′ to be explained based on the current feature i The number L is determined by the range and step size of the minimum and maximum values ​​of the feature.

[0062] Step 3: L single perturbation samples x′ to be explained based on the current feature i Input them into the model to be explained f respectively, and obtain L single disturbance prediction values ​​y′ of the model to be explained f based on the current features i .

[0063] Step 4: Calculate the sensitivity of the current feature:

[0064]

[0065] Among them, S i is the i-th sensitivity of the current feature, y′ i is the i-th single perturbation prediction value based on the current feature, y is the baseline prediction value, z′ i is the i-th change disturbance eigenvalue of the current feature, and z is the original eigenvalue of the current feature.

[0066] The model prediction results after each feature change are recorded to form a mapping between the change in a single feature value and the prediction result. The sensitivity of the current feature is defined as the ratio of the change in the prediction result to the change in the input feature. The size of this ratio reflects the sensitivity of the current feature. The greater the sensitivity, the more sensitive the model is to the change in this feature.

[0067] Step 5: Determine the critical value of the current feature based on the sensitivity of the current feature That is, the i-th change perturbs the eigenvalue z′ of the current feature i Let the i-th sensitivity of the current feature be S i When the derivative is 0, if the i-th single disturbance prediction value y′ based on the current feature i If it is not equal to the baseline prediction value y, then the i-th change perturbation feature value z′ of the current feature i Recorded as the critical value of the current feature

[0068] The relationship between the eigenvalue and the prediction result is plotted into a graph, and the impact of the feature change on the prediction result can be intuitively seen through visualization. Analyze the graph and observe the degree of influence of the feature change on the model prediction result, which can help us understand which feature changes have a greater impact on the model prediction result and which features have a smaller impact. The present invention uses the eigenvalue with the greatest seasonal sensitivity when the prediction result no longer changes as the critical value, providing a basis for further interpretability research of the model, that is, taking the original eigenvalue z of the current feature as the benchmark, for the changed eigenvalue z′ i , if satisfied: existence And y≠y′ i , then the eigenvalue z′ i Critical value Otherwise (there is no feature value that satisfies the above conditions), the original value of the current feature is used as the critical value of the current feature.

[0069] Step 6: Traverse all features of the sample to be explained x, repeat steps 2 to 5, and obtain the critical value of each feature of the sample to be explained.

[0070] (2) Based on the critical values ​​of each feature of the sample to be explained, all features of the sample to be explained are randomly perturbed.

[0071] Step 7: Perturb all features of the sample to be explained, and randomly change the feature value of each feature within the range of its critical value to obtain M fully perturbed samples x″ to be explained. j , j = 1, 2,…, M, where M is an artificially set positive integer.

[0072] When the feature value of each feature of the sample to be explained is randomly changed within the range of its critical value:

[0073] If the original eigenvalue z of the feature is between the minimum value Min of the feature and the critical value of the feature Between Then the random perturbation eigenvalue z″ of the feature is between the minimum value Min of the feature and the critical value of the feature Between

[0074] If the original eigenvalue z of the feature is between the critical value of the feature and the maximum value of the feature. Then the random perturbation eigenvalue z″ of the feature is between the critical value of the feature and the maximum value Max of the feature, that is

[0075] If the original eigenvalue z of the feature is equal to the critical value Right now Then the randomly perturbed eigenvalue z″ of the feature is between the minimum value Min and the maximum value Max of the feature, that is, z″∈[Min,Max].

[0076] (3) The fully perturbed samples to be explained are grouped using the mixed probability method, and the linear regression fitting method is used to fit each group to obtain the explanation model, and the final explanation model is determined.

[0077] The mixed probability method is based on probability distribution. It first assumes that all samples conform to the multivariate normal distribution, where each normal distribution is called a component. The probability of each sample conforming to each component is determined, and the weight, mean, and covariance of each component are adjusted iteratively until the parameter changes are small enough and converge to a local optimal solution. Since the mixed probability method is based on the multivariate normal distribution, multiple fitting results (fitting explanatory models) can be generated by performing linear regression on each group through the linear regression method, which makes the final linear fit more faithful and accurate, and the approximation process can produce an optimal linear regression result to accurately point out important features as an explanation. Figure 3 As shown in Figure 2, the specific process of determining the final explanatory model based on the mixed probability grouping and linear regression fitting method is as follows:

[0078] Step 8: Set the number of sample groups K, where K is a positive integer, and initialize the weight w, mean μ, and covariance σ of each component.

[0079] The number of sample groups K is the number of components of the mixed probability, and each component represents a normal distribution. The weight w indicates the contribution of the component to the entire method. The larger the weight w, the more instances are ultimately considered to belong to the component. The mean μ determines the center position of the component. The covariance σ determines the distribution shape of the component.

[0080] Step 9, traverse the M fully perturbed samples to be explained, calculate the posterior probability of the current fully perturbed sample to be explained relative to each sample group based on the weight, mean and covariance of each sample group, and classify the current fully perturbed sample to be explained into the sample group with the highest posterior probability.

[0081] First, calculate the current full perturbation sample to be explained x″ j The probability density N(x″) of the multivariate Gaussian distribution for each sample group k j |μ k ,σ k ):

[0082]

[0083] Where N is the current fully perturbed sample to be explained x″ j That is, the characteristic dimension of the sample x to be explained, μ krepresents the mean of component k, σ k represents the covariance of component k, j = 1, 2, ..., M, M represents the number of fully perturbed samples to be explained, k = 1, 2, ..., K, K is the number of sample groups, superscript (■) T Indicates transpose.

[0084] Next, calculate the current full perturbation sample to be explained x″ j The posterior probability p for each sample group k is jk :

[0085]

[0086] In the formula, N(x″ j |μ k ,σ k ) represents the current fully perturbed sample to be explained x″ j The probability density of component k, w k represents the weight of component k, and the weight w of component k k It indicates the contribution of the component to the entire model, and can also be regarded as the probability that the instance belongs to this component. The denominator is the sum of the posterior probabilities of all components of the instance to ensure the normalization of the posterior probability.

[0087] Finally, for the current fully perturbed sample to be explained x″ j , classify it to its posterior probability p jk In the highest amount.

[0088] Step 10: After the M fully perturbed samples to be explained are classified, the weight, mean and covariance of each sample grouping are updated based on the fully perturbed samples to be explained in each component k and their posterior probabilities.

[0089] Weight w k It indicates the ratio of the number of data points assigned to component k to the total number of data points. The weight w of each component in the mixed probability method k The update formula is as follows:

[0090]

[0091] Mean μ k It indicates that it is the weighted average of all data points belonging to component k, and the mean μ of each component is k The update formula is as follows:

[0092]

[0093] Covariance σ k It indicates the weighted average covariance of all data points belonging to component k, and the covariance σ of each component k The update formula is as follows:

[0094]

[0095] In the formula, w k ′ represents the weight of the updated sample group k, μ k ′ represents the mean of the updated sample group k, σ k ′ represents the covariance of the updated sample group k, σ k represents the covariance of sample group k before updating, x″ j′ represents the fully perturbed sample to be explained in sample group k, p j′k Represents the fully perturbed sample to be explained x″ j′ Relative to the posterior probability of sample group k, M k Represents the number of fully perturbed samples to be explained in sample group k.

[0096] Step 11, repeat steps 9 and 10 until the parameters converge (the perturbed samples to be explained in each group obtained this time are the same as the perturbed samples to be explained in each group obtained last time), at which time the M fully perturbed samples to be explained are classified into K sample groups.

[0097] After updating the parameters through the above process, the various parameters of the components will better adapt to the data distribution. The goal of the whole process is to maximize the parameters of the mixed probability method of the observed data, which enables the mixed probability method to flexibly adapt to complex data distribution. After obtaining the converged parameters in the mixed probability method, for each data sample, the component with the maximum posterior probability is selected, that is, the component with the highest probability.

[0098] Step 12: Perform linear regression fitting on the fully perturbed samples to be explained in each sample group to obtain K fitting explanation models.

[0099] Linear regression fitting is performed on all fully perturbed samples to be explained that are classified into components. The fitting result is equivalent to training a model, which is called the fitted explanatory model g. The purpose is to obtain the fitted explanatory model g that can approximately fit the prediction results of the model to be explained f, that is, the fitted explanatory model g makes the difference between the prediction results of the fully perturbation samples to be explained in all components k in the model to be explained f and the prediction results in the fitted explanatory model g minimal.

[0100] The sample group k is subjected to linear regression fitting to obtain the fitting explanatory model g. k The representation is as follows:

[0101] g k =β k0 +β k1 Z1+β k2 Z2+…+β kN Z N

[0102] In the formula, Z n represents the nth feature of the fully perturbed sample to be explained, β kn Represents the weight of the nth feature of the fully perturbed sample to be explained, which is the parameter obtained by fitting and represents the feature Z n k=1,2,…,K, K is the number of sample groups; n=1,2,…,N, N is the feature vector of the fully perturbed sample to be explained.

[0103] Fitted explanatory model g for sample group k k The weight vector β k The solution formula is:

[0104] β k =(X k T X k ) -1 X k T Y k

[0105] In the formula, β k represents the weight vector of sample group k, β k is a (N+1)×1-dimensional vector, whose first row is the intercept term β0, and the 2nd to N+1st rows are β k1 , β k2 , …, β kN The value of X k represents the sample matrix of sample group k, X k It is an M k ×(N+1)-dimensional matrix, each row of which is a fully perturbed sample to be explained for sample group k, the first column is the constant term 1, and the 2nd to N+1st columns are the randomly perturbed eigenvalues ​​of the i-th feature of the fully perturbed sample to be explained for sample group k. k represents the prediction vector of sample group k, Y k It is an M k ×1-dimensional vector, whose 1st to Mth k The rows are the 1st to Mth rows of sample group k. k The fully perturbed predicted value is obtained by inputting the fully perturbed samples to be explained into the model to be explained.

[0106] By solving the weight vector β k Get the weight β of the nth feature kn , and finally obtain β kn The larger the value, the greater the importance of the feature. kn The closer the value is to 0, the less important the feature is. kn is a positive number, indicating that the feature supports the prediction result.kn A negative number means that the feature has an adverse effect on the prediction result.

[0107] Step 13: For each sample group, each fully perturbed sample to be explained of the current sample group is input into the model to be explained and the fitted explanation model of the current sample group, respectively, to obtain the predicted value to be explained and the fitted predicted value, and accordingly calculate the difference between the fitted explanation model of the current sample group and the model to be explained:

[0108]

[0109] In the formula, Φ k Represents the fitted explanatory model g for the current sample group k The difference between the model to be explained and f; x″ j′ represents the fully perturbed sample to be explained in sample group k, f(x″ j′ ) represents the fully perturbed sample x″ to be explained in sample group k j′ The predicted value to be explained, g k (x″ j′ ) represents the fully perturbed sample x″ to be explained in sample group k j′ The fitted prediction value, M k Represents the number of fully perturbed samples to be explained in sample group k.

[0110] Step 14: The fitted explanatory model of the sample group with the smallest difference from the model to be explained is taken as the final explanatory model Φ.

[0111] Φ=minΦ k

[0112] The result with the smallest prediction error with the model to be explained f is selected as the final explanation model, and the parameters of each feature are used as the importance of the feature, so as to accurately fit the highly nonlinear decision boundary of the original model f to the sample to be explained x. The final explanation model obtained through the above steps guarantees reliability and effectiveness, making it more practical and credible in practical applications. In practical applications, accurate explanation results can help decision makers better understand the decision-making process of machine learning models, thereby supporting more informed and reliable decision-making.

[0113] The present invention is based on single feature critical value analysis, performs sensitivity analysis on the features of each dimension of the sample to be explained, obtains the critical value, and then uses the critical value as the perturbation boundary for perturbing the instance, which can help us understand the degree of dependence of the model interpretation results on different features, understand which features have a greater impact on the prediction results, and eliminate the interference caused by excessive feature values. For the generated perturbed samples, a mixed probability method is used, using the idea of ​​probability distribution, based on the multivariate normal distribution, and using the expectation maximization algorithm, a model that can accurately fit the local highly nonlinear decision boundary of the machine learning model is finally realized by combining multiple linear regression methods, and the most faithful explanation model to the original model prediction result is used as the final explanation. The present invention realizes the interpretation of a black box model, which can effectively achieve the result of accurate interpretation of the sample to be explained, and at the same time, the interpretation result maintains good stability, fidelity and accuracy.

[0114] It should be noted that, although the embodiments of the present invention described above are illustrative, they are not intended to limit the present invention, and therefore the present invention is not limited to the above specific embodiments. Without departing from the principles of the present invention, any other embodiments obtained by those skilled in the art under the guidance of the present invention are deemed to be within the protection of the present invention.

Claims

1. A model-independent, exact interpretable method based on feature critical value analysis, characterized by: The steps include: Step 1: Input the sample to be explained into the model to be explained to obtain the baseline prediction value of the model to be explained; Step 2: perturb a feature of the sample to be interpreted, and gradually change the feature value of the current feature within the range of the minimum value and the maximum value of the current feature to obtain L single perturbation samples to be interpreted based on the current feature; Step 3: Input the L single-disturbance samples to be explained based on the current features into the model to be explained respectively, and obtain the L single-disturbance prediction values ​​of the model to be explained based on the current features; Step 4: Calculate the sensitivity of the current feature: Among them, S i is the i-th sensitivity of the current feature, y i ′ is the i-th single perturbation prediction value based on the current feature, y is the baseline prediction value, z i ′ is the i-th change disturbance eigenvalue of the current feature, z is the original eigenvalue of the current feature, i=1,2,…,L, L is the number of single disturbance samples to be explained based on the current feature; Step 5: Determine the critical value of the current feature based on the L sensitivities of the current feature: that is, if there is an i-th change disturbance feature value z of the current feature i ′ makes the i-th sensitivity of the current feature S i When the derivative is 0, the predicted value y of the i-th single disturbance based on the current feature i ′ is not equal to the baseline prediction value y, then the i-th change perturbation feature value z of the current feature i ′ is recorded as the critical value of the current feature; otherwise, the original value of the current feature is taken as the critical value of the current feature; Step 6: Traverse all the features of the sample to be explained, repeat steps 2 to 5, and obtain the critical value of each feature of the sample to be explained; Step 7: perturb all features of the sample to be interpreted, and obtain M fully perturbed samples to be interpreted by randomly changing the feature value of each feature within the range of its critical value; where M is a positive integer set artificially; Step 8: Group the M fully perturbed samples to be explained by a mixed probability method to obtain K sample groups; where K is a positive integer set artificially; Step 9: Perform linear regression fitting on the fully perturbed samples to be explained in each sample group to obtain K fitting explanation models; Step 10: For each sample group, each fully perturbed sample to be explained of the current sample group is input into the model to be explained and the fitted explanation model of the current sample group, respectively, to obtain the predicted value to be explained and the fitted predicted value, and accordingly calculate the difference between the fitted explanation model of the current sample group and the model to be explained: In the formula, Φ k Represents the fitted explanatory model g for the current sample group k The difference between the model to be explained and f; x″ j′ represents the j′th fully perturbed sample to be explained in sample group k, f(x″ j′ ) represents the fully perturbed sample x″ to be explained in sample group k j′ The predicted value to be explained, g k (x″ j′ ) represents the fully perturbed sample x″ to be explained in sample group k j′ The fitted prediction value, j′=1,2,…,M k , M k represents the number of fully perturbed samples to be explained in sample group k; Step 11: The fitted explanatory model of the sample group with the smallest difference from the model to be explained is taken as the final explanatory model.

2. The model-independent accurate interpretable method based on feature critical value analysis according to claim 1, characterized in that: In step 2, the number L of samples to be explained based on the single disturbance of the current feature is determined by the value range and the variation step determined by the minimum value and the maximum value of the current feature.

3. The model-independent accurate interpretable method based on feature critical value analysis according to claim 1, characterized in that: In step 7, when the feature value of each feature of the sample to be explained is randomly changed within the range of its critical value: If the original eigenvalue of the feature is between the minimum value of the feature and the critical value of the feature, then the randomly perturbed eigenvalue of the feature is between the minimum value of the feature and the critical value of the feature; If the original eigenvalue of the feature is between the critical value of the feature and the maximum value of the feature, then the randomly perturbed eigenvalue of the feature is between the critical value of the feature and the maximum value of the feature; If the original eigenvalue of the feature is equal to the critical value, the randomly perturbed eigenvalue of the feature is between the minimum value of the feature and the maximum value of the feature.

4. The model-independent accurate interpretable method based on feature critical value analysis according to claim 1, characterized in that: The specific process of step 8 is as follows: Step 8.1, set the number of sample groups K, and initialize the weight, mean and covariance of each sample group; Step 8.2, traverse the M fully perturbed samples to be explained, calculate the posterior probability of the current fully perturbed sample to be explained relative to each sample group based on the weight, mean and covariance of each sample group, and classify the current fully perturbed sample to be explained into the sample group with the highest posterior probability; Step 8.3: After the M fully perturbed samples to be explained are classified, the weight, mean and covariance of each sample group are updated based on the fully perturbed samples to be explained and their posterior probabilities in each sample group; Step 8.4, repeat steps 8.2 and 8.3 until the parameters converge, that is, the perturbed samples to be explained in each group obtained this time are the same as the perturbed samples to be explained in each group obtained last time. At this time, the M fully perturbed samples to be explained are classified into K sample groups.

5. The model-independent accurate interpretable method based on feature critical value analysis according to claim 4, characterized in that: In step 8.2, the fully perturbed sample to be explained x″ j The posterior probability p for each sample group k is jk for: In the formula, w k represents the weight of sample group k, μ k represents the mean of sample group k, σ k represents the covariance of sample group k, N is the feature dimension of the fully perturbed sample to be explained, x″ j represents the jth fully perturbed sample to be explained, j = 1, 2, ..., M, M represents the number of fully perturbed samples to be explained, k = 1, 2, ..., K, K is the number of sample groups, and the superscript (■) T Indicates transpose.

6. The model-independent accurate interpretable method based on feature critical value analysis according to claim 4, characterized in that: In step 8.3: The updated weight w of sample group k k 'for: Updated mean μ of sample group k k 'for: The updated covariance σ of sample group k k 'for: In the formula, x″ j′ represents the j′th fully perturbed sample to be explained in sample group k, p j′k Represents the fully perturbed sample to be explained x″ j′ Relative to the posterior probability of sample group k, σ k represents the covariance of sample group k before updating, j′=1,2,…,M k , M k It represents the number of fully perturbed samples to be explained in sample group k, k = 1, 2, …, K, where K is the number of sample groups.

7. The model-independent accurate interpretable method based on feature critical value analysis according to claim 4, characterized in that: In step 9, linear regression fitting is performed on sample group k to obtain the fitted explanatory model g k It is expressed as: g k =b k0 +b k1 Z1+β k2 Z2+…+β kN Z N In the formula, Z n represents the nth feature of the fully perturbed sample to be explained, β kn represents the weight of the nth feature of the fully perturbed sample to be explained, n = 1, 2, ..., N, N is the feature vector of the fully perturbed sample to be explained, k = 1, 2, ..., K, K is the number of sample groups; Fitted explanatory model g for sample group k k The weight vector β k for: β k =(X k T X k ) -1 X k T Y k In the formula, β k represents the weight vector of sample group k, β k is a (N+1)×1-dimensional vector, whose first row is the intercept term β0, and the 2nd to N+1st rows are β k1 , β k2 , …, β kN The value of X k represents the sample matrix of sample group k, X k It is an M k ×(N+1)-dimensional matrix, each row of which is a fully perturbed sample to be explained of sample group k, the first column of which is a constant term 1, and the 2nd to N+1st columns are the randomly perturbed eigenvalues ​​of the i-th feature of the fully perturbed sample to be explained of sample group k; Y k represents the prediction vector of sample group k, Y k It is an M k ×1-dimensional vector, whose 1st to Mth k The rows are the 1st to Mth rows of sample group k. k The fully perturbed predicted value obtained by inputting the fully perturbed samples to be explained into the model to be explained; Superscript (■) T Indicates transposition; M k Represents the number of fully perturbed samples to be explained in sample group k.