Machine learning attribution analysis method introducing causal information

By introducing causal information in machine learning, combining data preprocessing and causal inference, the deviation problem caused by the neglect of causal information in the existing technology is solved, the stability and reliability of attribution analysis are improved, and the explanatory nature of the model is enhanced. and credibility provide more reliable support for areas such as data analysis and medical research.

CN119204202APending Publication Date: 2024-12-27TSINGHUA UNIVERSITY +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310812479.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing machine learning attribution analysis methods ignore causal information, resulting in deviations in interpreting model characteristics, and model training and attribution analysis are separated, making it difficult to ensure the reliability and effectiveness of the results, especially when humans intend to guide downstream applications. challenge.

Method used

By introducing causal information, a bridge between attribution analysis and model training is built, data preprocessing, causal inference, causal effect calculation and causal structure are used to screen out irrelevant features, stability judgment and optimization model training are carried out, and Bayesian The network and Pearl's do-calculus and other methods perform causality verification and effect calculation, and combine causal information for model training and attribution analysis.

Benefits of technology

It improves the stability and reliability of the attribution analysis results, enhances the interpretability and credibility of the model, ensures the accuracy of causal information, and provides more reliable data support for subsequent applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204202A_ABST
    Figure CN119204202A_ABST
Patent Text Reader

Abstract

The invention relates to a machine learning attribution analysis method introducing causal information, and belongs to the field of statistical learning and machine learning, and the machine learning attribution analysis method introducing causal information comprises the following steps: (1) data preprocessing; the method comprises the steps of preprocessing original data, including missing value processing, abnormal value processing and the like, and then performing standardization processing to ensure that the scales of all features are consistent so as to unify different magnitudes and units; (2) training model fitting data; a model suitable for problem types is adopted to carry out data fitting on the processed features, feature sorting is carried out in each iteration of model training to screen irrelevant features, attribution analysis is carried out to calculate the stability of each attribution analysis, and the stability is taken as an index to guide when the model stops training; (3) performing causal inference on the features of the model obtained in the step (2) on the data set preprocessed in the step (1); (4) introducing the causal information obtained in the step (3) into model training, designing a new loss function, and training again on the basis of the parameters of the previous model; and (5) the causal information obtained in the step (3) is used for guiding attribution analysis of the model obtained in the step (4), and reliable model interpretation is further obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of statistical analysis and machine learning, and in particular to a machine learning attribution analysis method that introduces causal information. Background Art

[0002] Attribution analysis is a post-explanation method in machine learning, which is used to determine the impact of each feature in the model on the output results, making the model's prediction results transparent and explainable. This is of great significance to the practical application and deployment of machine learning models, and can enhance people's trust in and explainability of machine learning systems. Through attribution analysis, we can better understand the rules and principles behind the model and make more accurate predictions for improving the model. Common explanation methods based on attribution analysis mainly include: LIME, Grad-CAM, Integrated Gradient (IG) and SHapley Additive exPlanations (SHAP), etc. They all provide good ideas for model explanation from different perspectives.

[0003] However, these methods all ignore the causal information in the data, which can easily lead to deviations in the process of interpreting model features. At the same time, mainstream attribution analysis methods have the characteristics of being model-independent, which separates model training from attribution analysis, making it difficult to ensure that the results of attribution analysis can meet human intentions and effectively guide downstream applications (such as discovering important genes related to a certain disease in the medical field).

[0004] Therefore, developing more consistent, transparent and reliable attribution analysis methods is an effective means to improve the credibility and explainability of artificial intelligence systems, and is an inevitable requirement for making attribution analysis methods one of the key technologies for the practical application of machine learning. Summary of the invention

[0005] In view of the shortcomings of attribution analysis methods in machine learning, the present invention proposes a machine learning attribution analysis method that introduces causal information. This method builds a bridge between attribution analysis and model training, and uses causal information to assist both model training and attribution analysis stages, thereby obtaining attribution conclusions with strong interpretability and reliability.

[0006] The purpose of the present invention is achieved through the following technical solutions:

[0007] Step 1: Data preprocessing: First, preprocess the original data, including missing value processing, outlier processing, etc., and then perform standardization to ensure that the scales of various features are consistent;

[0008] Step 2: Train the model to fit the data. Use a model suitable for the problem type to fit the features processed in step 1. If the adjustments are met, the model training is completed.

[0009] Step 3: Perform causal inference based on the features involved in the model in step 2, including automated causal relationship discovery, causal relationship verification, and causal effect calculation;

[0010] Step 4: Introduce causal information into model training, set the parameters of the model obtained in step 2 as the initial parameters of the new model, and then retrain the new model on the preprocessed data in combination with the causal information;

[0011] Step 5: Perform attribution analysis based on the structural information of the causal model. For the model trained in step 4, combine the differences in causal structures to distinguish the attribution analysis results under different causal structures.

[0012] Furthermore, the machine learning attribution analysis method that introduces causal information is characterized in that the standardization method in step one adopts Z-score standardization.

[0013] Furthermore, the machine learning attribution analysis method that introduces causal information is characterized in that each iteration of the model training in step 2 should include the following processing: 1) using the permutation importance method to screen out irrelevant features; 2) performing attribution analysis on the model and measuring the stability of the attribution analysis; 3) judging whether the stability of the model attribution analysis meets the threshold, and if so, ending the training iteration and saving the model.

[0014] Furthermore, the machine learning attribution analysis method that introduces causal information is characterized in that the process of causal inference in step three is: 1) using the Bayesian network method to discover causal relationships: involving the construction of causal models and the calculation of model parameters; 2) causal relationship verification: verifying the automatically discovered causal relationships, and using sensitivity analysis and knowledge graph verification to discover possible contradictions; 3) causal effect calculation: after determining the causal graph model, the graph traversal algorithm depth-first search (BFS) in the causal path analysis is used to identify direct and indirect causal effects, and Pearl's do-calculus is used to estimate the indirect causal effects of multi-variable combinations.

[0015] Furthermore, the machine learning attribution analysis method that introduces causal information is characterized in that, in the step four, the causal information is selected to be incorporated into the training loss of the model in the form of a causal effect, and a suitable optimization algorithm is selected to minimize the loss, thereby training the model.

[0016] Furthermore, the machine learning attribution analysis method that introduces causal information is characterized in that three causal structures of chain, fork, and confounder are considered in step five.

[0017] The beneficial effects of the present invention are as follows:

[0018] Regarding the first model training, its role is to: screen out irrelevant features for causal modeling and bind attribution analysis to the model. Choosing to stop model training when the attribution analysis is stable, rather than judging by the indicators of model fitting data, helps to improve the availability of attribution analysis conclusions. Regarding causal inference, choose to carry out on a smaller and more reliable set of variables, and introduce relevant verification to reduce the error of automatic causal relationship discovery, and finally focus on causal effects under multiple causal paths. The above processing is to focus on the accuracy of causal information and prepare for the subsequent application of causal information; Regarding the second model training and the final attribution analysis, its purpose is to introduce causal information to obtain a more reliable model, and then conduct a more reliable attribution analysis.

[0019] In summary, the present invention improves the stability and reference value of the final attribution analysis results by establishing the relationship between the model and attribution analysis, designing a more reliable causal inference process, and using causal information to train and attribute the model. It has broad application prospects in data analysis, medical research and other fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Control flow chart for this method.

[0021] Figure 2 Flowchart for introducing attribution stability to guide model training in the first stage of model training.

[0022] Figure 3 Flowchart for using model features for causal inference.

[0023] Figure 4 Diagrams of causal models with different structures.

[0024] Figure 5 This is the data causal chain diagram after considering the causal structure DETAILED DESCRIPTION

[0025] The present invention will be described in detail below based on the accompanying drawings and preferred embodiments, and the purpose and effects of the present invention will become more clear. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0026] like Figure 1 As shown, a machine learning attribution analysis method of the present invention that introduces causal information specifically includes the following steps:

[0027] Step 1: Data preprocessing

[0028] First, the original data is preprocessed, including missing value processing, outlier processing and other steps, and then standardized to ensure the consistency of the scale between the features. Each feature is standardized, and the Z-score standardization method is used to standardize each variable. The specific steps are as follows:

[0029] 1) Calculate the mean μ and standard deviation σ of each variable:

[0030]

[0031]

[0032] Among them, x i represents the value of the i-th sample, and N represents the sample size.

[0033] 2) Standardize the value of each variable using the following formula:

[0034] z i =(x i -μ) / σ (3)

[0035] Among them, x i represents the variable value before standardization, z i Represents the standardized variable value.

[0036] After standardization, the mean of each variable becomes 0 and the standard deviation becomes 1. The values ​​of different variables are mapped between -3 and 3 to achieve the unification of the magnitude and units of different variables.

[0037] Step 2: Train the model to fit the data

[0038] Use a model suitable for the problem type to fit the features processed in step 1. In each iteration of model training:

[0039] 1) Use the permutation importance method to filter out irrelevant features:

[0040] The Permutation importance method can evaluate and rank the contribution of each feature to the model to filter out features that are not relevant to the model, so that the new feature set can be trained with the next iteration of the model. Permutationimportance is a method based on feature permutation. By randomly permuting the value of a feature, the influence of the feature on the model prediction results is calculated. The specific steps are as follows: a. For the trained model, calculate the accuracy of the model on the test set; b. For each feature, randomly permutate the value of the feature and recalculate the accuracy of the model on the test set; c. Calculate the importance score of each feature, that is, the average of the difference between the original accuracy and the accuracy after random permutation:

[0041]

[0042] Among them, X i represents the i-th feature, f(x j ) represents the prediction value of the original model on sample j, It represents the predicted value of the model on the arranged samples after randomly arranging the i-th feature of sample j, and n represents the total number of samples.

[0043] 2) Perform attribution analysis on the model and measure the stability of the attribution analysis:

[0044] Use appropriate attribution analysis methods to perform attribution analysis on the model generated in this iteration and record the results of the attribution analysis. Compare this result with the attribution analysis result of the previous model and record the stability of this attribution analysis. Specifically, Spearman's rank correlation coefficient is used to measure the stability of feature ranking after two attribution analyses. The calculation formula of Spearman's coefficient is as follows:

[0045]

[0046] Where d is the difference between each pair of feature rankings, ∑d 2 is the sum of the squares of all differences, and n is the length of the rank.

[0047] 3) Determine whether the stability of the model attribution analysis meets the threshold:

[0048] The stability threshold of the model attribution analysis is set to 0.8 (adjusted according to the experimental results). If the value of Spearman's score is greater than this threshold, it can be considered that the ranking of the attribution analysis is relatively stable, and the model training is no longer iterated and the model is saved.

[0049] Step 3: Perform causal inference based on the above model features

[0050] Causal inference is performed on the preprocessed data set based on the features involved in the model trained in step 2. The automatic causal discovery algorithm is selected to construct a causal graph. In the process of judging the causal relationship between features, the knowledge graph of domain experts is introduced for verification, and the causal relationship that does not conform to common sense is adjusted. Finally, a high-quality directed acyclic graph is generated, and causal effect calculation is performed to calculate the causal effect value of each feature on the target variable.

[0051] 1)Causal relationship discovery:

[0052] The Bayesian network method is selected to explore the causal relationship between features, thereby constructing a causal graph model. Suppose we have a set of variables V, and the goal is to learn the causal relationship between these variables.

[0053] a. Construct a fully connected Bayesian network between variables: Let G = (V, E) represent the Bayesian network, where V is the node set and E is the edge set. For all variables X i and X j , if i≠j, then add an edge (X i, X j ) to E.

[0054] b. Calculate marginal probability and conditional probability: For each variable X i , given its parent variable Pa(X i ), and learn the parameterized conditional probability distribution P(X) from the data through statistical learning methods (such as maximum likelihood estimation or Bayesian estimation). i |Pa(X i )).

[0055] c. Constraints that satisfy the Markov condition: For all variable pairs (X i, X j ),if and Then perform a conditional independence test. When there is a contradictory causal relationship, measures can be taken: ① Delete the contradictory causal edge: Remove the edge (X i ,X j );② The direction of the reverse causal edge: change the edge (X i ,X j ) to Edge(X j, X i );③Add potential link variables or hidden variables: introduce new variables X k , and use it as X i and X j The mediating variable between .

[0056] d. Satisfy the directed acyclic graph (DAG) constraint: Make G a DAG by detecting feedback loops in the network and removing the corresponding edges.

[0057] e. Select the network with the maximum likelihood as the final causal model:

[0058] Calculate different network G k The likelihood of the joint probability distribution of: L(G k )=P(D|G k ), where D is the observed data.

[0059] Select the network with the largest likelihood as the final causal model:

[0060]

[0061] 2) Causality verification:

[0062] Verify the automatically discovered causal relationships, and use sensitivity analysis and knowledge graph verification to find possible contradictions. The specific steps are as follows:

[0063] a. Sensitivity analysis: used to evaluate the impact of parameter changes in causal relationships on results. By analyzing the impact of parameter changes on causal effects, it is determined whether the causal relationship is stable. The specific steps are as follows:

[0064] Calculate the baseline value of the original causal effect: P(Y|do(X)), where X is the dependent variable and Y is the outcome variable;

[0065] Change the value of a variable or add a new variable: Modify the conditional probability distribution P(X i |Pa(X i )) in the parameter value;

[0066] Relearn the causal structure and compute the causal effect: P(Y|do(X')), where X' is the modified dependent variable;

[0067] Compare the cause-effect structure with the newly learned cause-effect structure and calculate the sensitivity index:

[0068]

[0069] If the cause-effect structure changes significantly, there are uncertainties and the cause-effect structure needs to be adjusted.

[0070] b. Knowledge graph verification:

[0071] Obtain a knowledge graph containing each node in the causal model, and retrieve whether the relationship between the nodes in the causal model exists in the knowledge graph. If the relationship between the two is contradictory, delete the corresponding two nodes in the causal model.

[0072] e. Output: Finally, the learned directed acyclic graph G is output, which is our causal graph model.

[0073] 3)Causal effect calculation:

[0074] After determining the causal graph model, various causal relationships between variables are found through causal path analysis, and the causal effect calculation of the causal graph model is performed. The specific steps are as follows:

[0075] a. Use the graph traversal algorithm depth-first search (DFS) to identify direct and indirect causal paths between all variables in the model;

[0076] b. Calculate the direct causal effect between variables based on the identified direct causal path. The calculation method of the direct causal effect can be expressed as:

[0077] DirectEffect(X i ,X j )=P(X j |do(X i )) (8)

[0078] c. Calculate the indirect causal effect between variables based on the identified indirect causal path. The calculation method of the indirect causal effect is: use Pearl's do-calculus to control the mediating variable M on the path, block the influence of other variables on the path, achieve intervention between variables, and then calculate the indirect causal effect:

[0079]

[0080] d. For variable combinations, by controlling multiple variables at the same time, Pearl's do-calculus is used to calculate the indirect causal effect of the combination of multiple variables on the target variable, thus realizing causal reasoning of variable combinations:

[0081]

[0082] Step 4: Introducing causality into model training

[0083] Set the parameters of the model obtained in step 2 as the initial parameters of the new model, combine the causal effect with the training loss of the model, and retrain the new model on the preprocessed data. The specific steps are as follows:

[0084] 1) Add Loss to the causal effect result:

[0085] Add the causal effect CE obtained in step 3 to the loss function and formalize it as follows:

[0086]

[0087] Among them, y is the true value; is the model prediction; is the original loss function, such as mean square error MSE or cross entropy loss Cross-Entropy; CE is the calculated causal effect; λ is a regularization parameter that determines the weight of the causal effect in the entire loss.

[0088] 2) Training model:

[0089] During the training process, select a suitable optimization algorithm to minimize the above loss function. Here we take the gradient descent algorithm as an example:

[0090]

[0091] Among them, α is a positive scalar, called the learning rate, which determines the moving step size in the gradient direction; is the loss function in w old The gradient at .

[0092] Step 5: Attribution analysis combined with causal structure

[0093] For the final trained model, the differences in causal structures are combined to distinguish the attribution analysis results under different causal structures. In the linear model, the SHAP attribution analysis method is taken as an example. Under the data with the same feature observation distribution, there are Figure 4 As shown, three different causal structures; Figure 4 Take the chain structure as an example to calculate the Shapley value:

[0094]

[0095] When there is a causal relationship between features and they are not interfered with each other, the variable distribution satisfies the Markov property based on the directed acyclic graph and can be expressed by the causal directed acyclic graph model, the complete feature causal ordering can be calculated using the joint probability distribution shown in formula (13), where pa() is the parent node of node j;

[0096]

[0097] If there is no other conditional independence, then all prefix nodes adjacent to j are its parent nodes. For a causal directed acyclic graph, the intervention formula (9) can be used: where yes The subset is also the parent node of node j;

[0098] Based on the above premise, the joint probability distribution P(X) in the chain graph can be decomposed into a "directed acyclic graph of chain components" (chain components such as Figure 5 ):

[0099]

[0100] where τ is a chain component that includes all features treated equally. It is assumed that intervention on a particular feature will break the dependencies of other features. In this case, the set of chain components is T confounding The non-directional part can also correspond to the equilibrium distribution of a dynamic process caused by the interaction between variables within the components. In this case, setting the value of a feature does affect the distribution of variables within the same component. These sets of components are called

[0101] In order to calculate the causal Shapley value, under the premise of the standard do calculus rules, any required intervention expectation can be obtained by the theorem shown in formula x. This formula represents the transformation of intervention expectation into observation expectation:

[0102]

[0103] Those skilled in the art will appreciate that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features therein with equivalents. Any modifications, equivalent replacements, etc. made within the spirit and principles of the invention shall be included in the protection scope of the invention.

Claims

1. Claim 1: A machine learning attribution analysis method that introduces causal information, characterized in that: The method comprises the following steps: Step 1: Data preprocessing: First, preprocess the original data, including missing value processing, outlier processing, etc., and then perform standardization to ensure that the scales of various features are consistent; Step 2: Train the model to fit the data. Use a model suitable for the problem type to fit the features processed in step 1. If the adjustments are met, the model training is completed. Step 3: Perform causal inference based on the features involved in the model in step 2, including automated causal relationship discovery, causal relationship verification, and causal effect calculation; Step 4: Introduce causal information into model training, set the parameters of the model obtained in step 2 as the initial parameters of the new model, and then retrain the new model on the preprocessed data in combination with the causal information; Step 5: Perform attribution analysis based on the structural information of the causal model. For the model trained in step 4, combine the differences in causal structures to distinguish the attribution analysis results under different causal structures.

2. Claim 2: The method according to claim 1, characterized in that: The standardization method in step 1 adopts Z-score standardization.

3. Claim 3: The method according to claim 1, characterized in that: Each iteration of the model training in step 2 should include the following processing: 1) using the permutation importance method to filter out irrelevant features; 2) Perform attribution analysis on the model and measure the stability of the attribution analysis; 3) Determine whether the stability of the model attribution analysis meets the threshold. If so, end the training iteration and save the model.

4. Claim 4: The method according to claim 1, characterized in that: The process of causal inference in step three is as follows: 1) using the Bayesian network method to discover causal relationships: involving the construction of causal models and the calculation of model parameters; 2) causal relationship verification: verifying the automatically discovered causal relationships, using sensitivity analysis and knowledge graph verification to discover possible contradictions; 3) causal effect calculation: after determining the causal graph model, the graph traversal algorithm depth-first search (BFS) in the causal path analysis is used to identify direct and indirect causal effects, and Pearl's do-calculus is used to estimate the indirect causal effects of multi-variable combinations.

5. Claim 5: The method according to claim 1, characterized in that: In the step 4, the causal information is selected to be incorporated into the training loss of the model in the form of a causal effect, and a suitable optimization algorithm is selected to minimize the loss, thereby training the model.

6. Claim 6: The method according to claim 1, characterized in that: In step 5, three causal structures, chain, fork and confounder, are considered.

Citation Information

Cited By

  • Data management method and system based on machine learning

    CN119988847A

  • A machine learning-based data governance method and system

    CN119988847B

  • Agricultural ecology intelligent monitoring regulation and control method and system based on machine learning

    CN121032144A