Inplausible method and device for model prediction process based on causal diagram
By constructing a global causal graph and extracting common subgraphs, the problem of deep learning models being difficult to explain causal relationships in medical diagnosis is solved, and the interpretability and trustworthiness of the model are improved.
Patent Information
- Application Number
- CN202510613929.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-05-13
AI Technical Summary
Existing technologies have difficulty effectively explaining the causal relationships of deep learning models in the field of medical diagnosis, resulting in low clinical adoption rates and distrust in decision-making.
Construct a global causal graph, generate multiple subgraphs through clustering and pruning, use graph neural networks for classification prediction, and extract common subgraphs to generate explainable reports to intuitively express the causal relationship between features.
It improves the interpretability of the model, meets the stringent requirements of model interpretability in special scenarios such as medical care, and establishes a trust mechanism for model decision-making.
Smart Images

Figure CN120688647A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an interpretable method and device for a model prediction process based on a causal graph. Background Art
[0002] In the field of medical diagnosis, deep learning models, with their powerful nonlinear modeling capabilities, have become the core technology engine for complex decision-making scenarios. For example, while a certain cancer screening model achieves 98% accuracy, its "black box" nature prevents it from explaining the correlation between lesion characteristics and pathological results, resulting in a clinical adoption rate of less than 15% in hospitals. This issue not only limits the widespread application of AI technology in the medical field but can also lead to distrust and misjudgment in clinical decision-making.
[0003] In related technologies, common interpretable methods in the existing technology include SHAP (SHapley Additive exPlanations), LIME (Local Interpretable Model-agnostic Explanations), etc., as well as models based on the attention mechanism.
[0004] However, SHAP has a high computational complexity, significantly increasing the cost for high-dimensional data (feature count > 1000). Furthermore, the calculation of the Shapley value becomes unstable when strongly correlated features are present in high-dimensional data. Furthermore, LIME can only explain the prediction results of a single sample and cannot provide a global explanation of the prediction process for the entire dataset. Furthermore, the perturbed samples it generates may not be realistic, resulting in large errors between the local approximate model and the original model. Furthermore, while attention-based models can dynamically focus on important features, their weight calculation is complex and only reflects correlation, not causality.
[0005] Therefore, existing technologies are difficult to meet the stringent requirements for model interpretability in special scenarios such as medical care, and are unable to effectively establish a trust mechanism for model decisions in special scenarios. Summary of the Invention
[0006] The present invention provides an interpretable method and apparatus for a model prediction process based on a causal graph. To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is provided below. This summary is not intended to be a comprehensive review, identify key or important elements, or delineate the scope of protection for these embodiments. Its sole purpose is to present some concepts in a simplified form, serving as a prelude to the detailed description that follows.
[0007] In a first aspect, an embodiment of the present application provides an interpretable method for a model prediction process based on a causal graph, the method comprising:
[0008] Using high-dimensional structured data of the target scene, a global causal graph is constructed to describe the correlation between features. The nodes in the global causal graph are variables, and the directed edges are the causal relationships between variables.
[0009] Cluster and prune the global causal graph to obtain multiple pruned subgraphs;
[0010] Use the preset graph neural network model to perform classification prediction on each subgraph to obtain the GNN classification submodel corresponding to each subgraph;
[0011] The GNN classification sub-model corresponding to each sub-graph is integrated into an integrated model to obtain a prediction model;
[0012] Extract the common parts of multiple subgraphs to obtain a common subgraph;
[0013] According to the common subgraph, the prediction model is interpretable and an interpretability report is obtained.
[0014] Optionally, structured high-dimensional data of the target scenario is used to construct a global causal graph that describes the correlation between features, including:
[0015] Acquire and preprocess high-dimensional structured data of the target scene to obtain the data to be analyzed;
[0016] Marking the existing causal relationships in the domain knowledge base or the prior knowledge of the expert system to obtain a marked first ordered variable pair with causal relationships and a marked second ordered variable pair without causal relationships;
[0017] Extracting parameter features corresponding to the first ordered variable and the second ordered variable from the data to be analyzed;
[0018] The parameter features corresponding to the first ordered variable are used as a training set, and the neural network is trained using the training set to obtain a pre-trained causal relationship prediction model;
[0019] Inputting the parameter features corresponding to the second ordered variable pair into the pre-trained causal relationship prediction model to predict the causal relationship label corresponding to the second ordered variable pair;
[0020] A global causal graph for describing the correlation between features is constructed according to the pre-labeled causal relationship labels of the first ordered variable pair and the predicted causal relationship labels of the second ordered variable pair.
[0021] Optionally, extract parameter features corresponding to ordered variable pairs, including:
[0022] Using convolutional neural networks, we extract variable distribution information from the kernel density estimation function image corresponding to the ordered variable pairs from the data to be analyzed.
[0023] Using a preset graph neural network model, we extract structural information and high-order graph structure features from the Pearson graph corresponding to the ordered variable pairs from the data to be analyzed.
[0024] The variable distribution information, structural information and high-order graph structure characteristics are used as parameter features corresponding to ordered variable pairs.
[0025] Optionally, constructing a global causal graph for describing the correlation between features based on the pre-labeled causal relationship labels of the first ordered variable pair and the predicted causal relationship labels of the second ordered variable pair includes:
[0026] Treat all variables in high-dimensional structured data as graph nodes;
[0027] Identify whether there is a causal relationship between graph nodes based on the pre-labeled causal relationship labels and the predicted causal relationship labels;
[0028] Directed edges are established between graph nodes with causal relationships to obtain a global causal graph used to describe the correlation between features.
[0029] Optionally, cluster and prune the global causal graph to obtain multiple pruned subgraphs, including:
[0030] Cluster all nodes in the global causal graph to divide nodes with densely connected edges into the same community and obtain the node clustering results;
[0031] Based on the node clustering results, the nodes and edges of the global causal graph are pruned to obtain multiple pruned subgraphs.
[0032] Optionally, extract the common parts of multiple subgraphs to obtain a common subgraph, including:
[0033] Count the number of times each variable appears in each subgraph to obtain a list of variable occurrences;
[0034] According to the variable occurrence count list, the variables whose occurrence count exceeds the preset threshold are filtered to obtain the common variable set;
[0035] Extract the directed edges between the public variables in the public variable set from the global causal graph and output the edge list of the public subgraph;
[0036] Construct a public subgraph based on the public variable set and the public subgraph edge list.
[0037] Optionally, the prediction model can be interpreted based on the common subgraph to obtain an interpretability report, including:
[0038] Extract all node variables from the common subgraph, each node variable carries the actual value;
[0039] Calculate the difference value of each node variable based on the actual value carried by each node variable;
[0040] According to the difference value of each node variable, the influence degree of each node variable on the prediction model is analyzed to obtain the variable influence analysis results;
[0041] Extract all directed edges from the common subgraph. Directed edges are used to represent the causal relationship between variables.
[0042] According to the causal relationship of each directed edge among all directed edges, the interaction relationship between variables is explained to obtain the causal relationship analysis results;
[0043] Integrate the results of variable impact analysis and causal relationship analysis to obtain an interpretability report.
[0044] Optionally, calculate the difference value of each node variable based on the actual value carried by each node variable, including:
[0045] Acquire domain knowledge or historical data in the target scenario;
[0046] Based on domain knowledge or historical data, calculate the standard value or average value of each node variable;
[0047] Calculate the difference between the actual value carried by each node variable and the standard value or average value of each node variable to obtain the difference value of each node variable.
[0048] Optionally, based on the difference value of each node variable, analyze the degree of influence of each node variable on the prediction model to obtain the variable impact analysis results, including:
[0049] Normalize the difference value of each node variable to obtain the normalized difference value;
[0050] According to the normalized difference value, the weight of each node variable is quantified in combination with the preset decision tree model;
[0051] According to the weight of each node variable, the influence of each variable on the prediction result is determined to obtain the variable impact analysis result.
[0052] In a second aspect, an embodiment of the present application provides an interpretable device for a model prediction process based on a causal graph, the device comprising:
[0053] The global causal graph construction module is used to construct a global causal graph that describes the correlation between features using high-dimensional structured data of the target scene. The nodes in the global causal graph are variables, and the directed edges are the causal relationships between variables.
[0054] The clustering and pruning module is used to cluster and prune the global causal graph to obtain multiple pruned subgraphs;
[0055] The model processing module is used to perform classification prediction on each subgraph using a preset graph neural network model to obtain the GNN classification submodel corresponding to each subgraph;
[0056] The result synthesis module is used to synthesize the GNN classification sub-model corresponding to each sub-graph into an integrated model to obtain a prediction model;
[0057] A common part extraction module is used to extract the common parts of multiple subgraphs to obtain a common subgraph;
[0058] The inference logic explanation module is used to interpret the prediction model based on the common subgraph and obtain an interpretability report.
[0059] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions suitable for being loaded by a processor and executing the above-mentioned method steps.
[0060] In a fourth aspect, an embodiment of the present application provides a device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0061] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0062] In the embodiments of the present application, on the one hand, by constructing a global causal graph, the features in the high-dimensional structured data are represented as nodes, and the causal relationship between the features is represented as a directed edge. The global causal graph can intuitively express the interaction relationship between the features, ensure that the interpretation results are consistent with human cognitive logic, meet the strict requirements of special scenarios for model interpretability, and effectively establish a trust mechanism for model decisions in special scenarios. On the other hand, by extracting the common parts of multiple subgraphs, a common subgraph is obtained. The nodes and edges in the common subgraph represent the key factors and causal relationships that affect the prediction results. By extracting the common subgraph, you can intuitively see which features have an important impact on the prediction results, as well as the causal relationship between these features, thereby improving the interpretability of the model.
[0063] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0065] Figure 1 This is a flow chart of an interpretable method for a model prediction process based on a causal graph provided in an embodiment of the present application;
[0066] Figure 2 This is a schematic diagram of a process for constructing a global causal graph provided by an embodiment of the present application;
[0067] Figure 3 is a schematic diagram of multiple subgraphs provided in an embodiment of the present application;
[0068] Figure 4 This is a schematic diagram of a model integration process provided by an embodiment of the present application;
[0069] Figure 5 This is a common subgraph extraction schematic diagram provided by an embodiment of the present application;
[0070] Figure 6 This is a schematic diagram of the structure of an interpretable device for a model prediction process based on a causal graph provided by the present application;
[0071] Figure 7 It is a structural diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The following description and the drawings sufficiently illustrate specific embodiments of the application to enable those skilled in the art to practice them.
[0073] It should be clear that the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0074] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0075] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0076] The present application provides an interpretable method and device for a model prediction process based on a causal graph to solve the problems existing in the above-mentioned related technical problems. In an embodiment of the present application, on the one hand, by constructing a global causal graph, the features in the high-dimensional structured data are represented as nodes, and the causal relationship between the features is represented as a directed edge. The global causal graph can intuitively express the interaction relationship between the features, ensure that the interpretation result is consistent with the human cognitive logic, meet the strict requirements of the model interpretability of special scenarios, and effectively establish a trust mechanism for model decisions in special scenarios. On the other hand, by extracting the common parts of multiple subgraphs, a common subgraph is obtained. The nodes and edges in the common subgraph represent the key factors and causal relationships that affect the prediction results. Through the extraction of the common subgraph, it is possible to intuitively see which features have an important impact on the prediction results, as well as the causal relationship between these features, thereby improving the interpretability of the model. The following is a detailed explanation using an exemplary embodiment.
[0077] The following will be combined with the Figure 1 -Attached Figure 5 This article details the interpretable method for the causal graph-based model prediction process provided by the embodiments of this application. This method can be implemented using a computer program and run on an interpretable device for the causal graph-based model prediction process based on the von Neumann architecture. This computer program can be integrated into an application or run as a standalone tool application.
[0078] See Figure 1 , provides a flow chart of an interpretable method for the model prediction process based on a causal graph for the embodiment of the present application. Figure 1 As shown, the method of the embodiment of the present application may include the following steps:
[0079] S101 uses high-dimensional structured data of the target scene to construct a global causal graph to describe the correlation between features. The nodes in the global causal graph are variables, and the directed edges are the causal relationships between variables.
[0080] Generally, the core of the interpretable method in the existing technology is the correlation-based model (such as SHAP). High-dimensional data inevitably contain features that are highly correlated with system state identification. At this time, the correlation-based model (such as SHAP) cannot stably explain the importance of features for prediction results.
[0081] Therefore, causality indicates that changes in one variable cause changes in another. "Simpson's Paradox" states that correlation alone does not necessarily accurately reflect real-world conditions. As shown in Table 1, when grouped by gender, both male and female patients who took medication had higher recovery rates than those who did not. Correlation suggests that the medication is effective. However, overall, the recovery rate for those who took medication was lower than for those who did not, a stark contrast to the grouping. From a causal perspective, considering that patient gender can affect recovery, higher estrogen levels are associated with lower recovery rates. Given the high proportion of female patients overall, this paradox arises. This example demonstrates that correlation alone is insufficient to uncover the true nature of data. A causal perspective is necessary to better understand the interaction mechanisms between variables and accurately analyze the data. In data dimensionality reduction and system state identification for high-dimensional data, incorporating causality can enhance model interpretability.
[0082] Table 1
[0083] gender Taking medication Not taking medication Male patients 81 of 87 recovered (93%) 234 of 270 recovered (87%) Female patients 192 of 263 recovered (73%) 55 of 80 recovered (69%) All patients 273 of 350 recovered (78%) 289 of 350 recovered (83%)
[0084] Among them, the target scenario refers to a specific application field or problem background, such as medical diagnosis, financial risk assessment, autonomous driving, etc. High-dimensional structured data refers to structured data with multiple features (dimensions). Structured data is usually organized in a tabular form, with each column representing a feature (variable) and each row representing a record. For example, medical data may contain multiple features such as the patient's age, gender, symptoms, and test results. The node is the basic unit in the causal graph, representing a variable or feature. For example, in medical data, a node can be a variable such as the patient's age, gender, and symptoms. A directed edge is an arrow connecting two nodes in a causal graph, indicating the direction of the causal relationship.
[0085] In some embodiments of the present application, the specific process of using structured high-dimensional data of the target scene to construct a global causal graph for describing the correlation relationship between features includes: acquiring and preprocessing the high-dimensional structured data of the target scene to obtain data to be analyzed; marking the existing causal relationships in the prior knowledge of the domain knowledge base or expert system to obtain a marked first ordered variable pair with causal relationship and a second ordered variable pair without causal relationship; extracting the parameter features corresponding to the first ordered variable and the second ordered variable pair from the data to be analyzed; using the parameter features corresponding to the first ordered variable as a training set, and using the training set to train a neural network to obtain a pre-trained causal relationship prediction model; inputting the parameter features corresponding to the second ordered variable pair into the pre-trained causal relationship prediction model to predict the causal relationship label corresponding to the second ordered variable pair; and constructing a global causal graph for describing the correlation relationship between features based on the pre-marked causal relationship label of the first ordered variable pair and the predicted causal relationship label of the second ordered variable pair.
[0086] Specifically, high-dimensional structured data from the target scenario is acquired, such as high-dimensional structured data from an electronic health record (EHR) system, containing information such as a patient's age, gender, symptoms, and test results. Missing values and outliers are processed for the high-dimensional structured data, and the data is standardized. Based on medical literature and expert opinion, known causal relationships are labeled, such as "high blood pressure" may cause "heart disease." These relationships are divided into two groups: first ordered variable pairs with known causal relationships and second ordered variable pairs with unknown causal relationships. Features associated with the first and second ordered variable pairs are extracted from the preprocessed data. A multilayer perceptron (MLP) neural network is selected. The features of the first ordered variable pair are used as the training set to train the MLP model, and the model parameters are optimized through backpropagation. The features of the second ordered variable pair are input into the trained MLP model, and the model outputs predicted causal relationship labels. The known labels of the first ordered variable pair and the predicted labels of the second ordered variable pair are integrated to construct a causal graph, with nodes representing medical features and directed edges representing causal relationships.
[0087] In some embodiments of the present application, the specific process of extracting parameter features corresponding to ordered variable pairs includes: using a convolutional neural network to extract variable distribution information in the kernel density estimation function image corresponding to the ordered variable pairs from the data to be analyzed; using a preset graph neural network model to extract structural information and high-order graph structural features in the Pearson graph corresponding to the ordered variable pairs from the data to be analyzed; and using the variable distribution information, structural information and high-order graph structural features as parameter features corresponding to the ordered variable pairs.
[0088] In some embodiments of the present application, the specific process of constructing a global causal graph for describing the correlation relationship between features based on the pre-labeled causal relationship labels of the first ordered variable pair and the predicted causal relationship labels of the second ordered variable pair includes: taking all variables in the high-dimensional structured data as graph nodes; identifying whether there is a causal relationship between the graph nodes based on the pre-labeled causal relationship labels and the predicted causal relationship labels; establishing directed edges between the graph nodes with causal relationships, and obtaining a global causal graph for describing the correlation relationship between features.
[0089] For example Figure 2 As shown in the figure, through high-dimensional data and prior knowledge, a causal graph can be constructed to obtain the final global causal graph.
[0090] In this embodiment, system state identification for structured tabular data is achieved by mining the interactions between features, enriching the data representation and effectively extracting implicit information from the data for identification. The construction and visualization of a global causal graph allows for intuitive understanding of feature interactions through the edges between nodes in the graph.
[0091] S102, clustering and pruning the global causal graph to obtain multiple pruned subgraphs;
[0092] In some embodiments of the present application, the specific process of clustering and pruning the global causal graph to obtain multiple pruned subgraphs includes: clustering all nodes in the global causal graph to divide nodes with densely connected edges into the same community to obtain node clustering results; based on the node clustering results, pruning the nodes and edges of the global causal graph to obtain multiple pruned subgraphs. Multiple subgraphs, for example Figure 3 As shown in Figure 3, the computational complexity of a single GNN prediction is reduced by pruning the global causal graph.
[0093] Clustering can be achieved using a community detection algorithm, an unsupervised clustering method that categorizes nodes based on their edge connections within a graph model, clustering nodes with denser edge connections. Community detection can, to a certain extent, reflect the information interactions among nodes. By dividing the graph model into a hierarchical structure, nodes in the same layer (class) have more edges connected to each other, indicating closer information interaction. This also indicates that nodes in the same layer are more similar.
[0094] Pruning can be implemented using randomized algorithms. Global causal graphs often contain a large number of nodes and edges, and may contain numerous loops. Loops are unavoidable when reflecting interactive relationships and correspond to the action-reaction mechanisms in the real world. However, such structures often pose difficulties for GNN predictions, causing the model to repeatedly reuse information from the same nodes, increasing computational cost and decreasing prediction performance. Therefore, pruning the global causal graph by randomly deleting it can simplify it, improving the computational efficiency and prediction performance of subsequent GNNs. Pruning the graph based on the classification results of community detection preserves the hierarchical structure of the global causal graph during node and edge pruning. Similar nodes within the same layer are deleted, while nodes and edges that interact between layers are retained as much as possible. This simplifies the global causal graph while preserving the information exchange between layers.
[0095] S103, using a preset graph neural network model to perform classification prediction on each subgraph to obtain a GNN classification submodel corresponding to each subgraph;
[0096] Graph neural networks are deep learning models specifically designed to process graph-structured data. They can learn the relationships between nodes and the graph's topology, and are used for tasks such as node classification, graph classification, and link prediction. The pre-trained graph neural network model is based on pre-trained graph neural networks.
[0097] In some embodiments of the present application, a preset graph neural network model is used to train each subgraph. This model can be a multi-layer graph convolutional network (GCN), which can learn the feature representation of nodes and predict the category labels of nodes. During the training process, the model learns the relationship between nodes in the subgraph and their contribution to the classification task. For each subgraph, the graph neural network model outputs a classification result, indicating which behavior category the user in the subgraph belongs to. These results can be probability values, indicating the possibility that the user belongs to a certain category.
[0098] S104, combining the GNN classification sub-models corresponding to each sub-graph into an integrated model to obtain a prediction model;
[0099] In some embodiments of the present application, the results of the GNN classification sub-models corresponding to all sub-graphs are integrated, for example, by voting or stacking, to improve the accuracy and robustness of the final classification.
[0100] Among them, for the sub-graphs after graph pruning and the corresponding GNN classification model, since the pruning process includes a random algorithm, a single graph model will make the model identification unstable and have the risk of overfitting. By combining the classification results of multiple sub-graphs to build an integrated model, the identification performance of the sub-model can be retained while enhancing stability, avoiding overfitting and thus increasing the generalization ability of the model.
[0101] For example Figure 4 As shown, each subgraph is classified and predicted using its own base learner "preset graph neural network model" to obtain the GNN classification sub-model corresponding to each subgraph, and then the GNN classification sub-model corresponding to each subgraph is integrated into an integrated model to obtain a prediction model.
[0102] In an embodiment of the present application, an interpretable prediction model based on a causal graph expresses the interaction relationship between features through the causal graph, thereby avoiding false correlations from interfering with the recognition ability of the model.
[0103] S105, extracting the common parts of the multiple subgraphs to obtain a common subgraph;
[0104] In some embodiments of the present application, the specific process of extracting the common parts of multiple subgraphs to obtain a common subgraph includes: counting the number of occurrences of each variable in each subgraph to obtain a variable occurrence list; based on the variable occurrence list, screening variables whose occurrences exceed a preset threshold value to obtain a common variable set; extracting the directed edges between each common variable in the common variable set from the global causal graph, and outputting an edge list of the common subgraph; constructing a common subgraph based on the common variable set and the edge list of the common subgraph. Among them, extracting the common parts in each subgraph can summarize and analyze the identification process of multiple sub-models, and the interpretability of the model can be achieved by analyzing the nodes and edges in the common subgraph. Among them, the extraction of the common subgraph not only screens important features but also gives the connection between these features.
[0105] For example Figure 5 As shown in the sub Figure 1 、 2 In N, nodes 2, 4, 7, and 8 are common to each subgraph, so the set of common variables is 2, 4, 7, and 8. A common subgraph can be constructed based on 2, 4, 7, 8 and the edge list of the common subgraph.
[0106] In an embodiment of the present application, a common subgraph is obtained by extracting the common parts of multiple subgraphs. The nodes and edges in the common subgraph represent the key factors and causal relationships that affect the prediction results. By extracting the common subgraph, it is possible to intuitively see which features have an important impact on the prediction results, as well as the causal relationship between these features, thereby improving the interpretability of the model.
[0107] S106: Based on the common subgraph, the prediction model is interpretable to obtain an interpretability report.
[0108] In some embodiments of the present application, the prediction model is interpretable based on the common subgraph, and the specific process of obtaining an interpretability report includes: extracting all node variables from the common subgraph, each node variable carrying an actual value; calculating the difference value of each node variable based on the actual value carried by each node variable; analyzing the degree of influence of each node variable on the prediction model based on the difference value of each node variable, and obtaining the variable impact analysis result; extracting all directed edges from the common subgraph, and the directed edges are used to characterize the causal relationship between variables; based on the causal relationship of each directed edge among all the directed edges, explaining the interaction relationship between variables, and obtaining the causal relationship analysis result; integrating the variable impact analysis result and the causal relationship analysis result to obtain the interpretability report.
[0109] Specifically, the specific process of calculating the difference value of each node variable based on the actual value carried by each node variable includes: obtaining domain knowledge or historical data in the target scenario; based on the domain knowledge or historical data, counting the standard value or average value of each node variable; calculating the difference between the actual value carried by each node variable and the standard value or average value of each node variable to obtain the difference value of each node variable.
[0110] Specifically, according to the difference value of each node variable, the influence of each node variable on the prediction model is analyzed, and the specific process of obtaining the variable influence analysis result includes: normalizing the difference value of each node variable to obtain the normalized difference value; quantifying the weight of each node variable based on the normalized difference value in combination with the preset decision tree model; determining the influence of each variable on the prediction result based on the size of the weight of each node variable, and obtaining the variable influence analysis result.
[0111] In the embodiments of the present application, on the one hand, by constructing a global causal graph, the features in the high-dimensional structured data are represented as nodes, and the causal relationship between the features is represented as a directed edge. The global causal graph can intuitively express the interaction relationship between the features, ensure that the interpretation results are consistent with human cognitive logic, meet the strict requirements of special scenarios for model interpretability, and effectively establish a trust mechanism for model decisions in special scenarios. On the other hand, by extracting the common parts of multiple subgraphs, a common subgraph is obtained. The nodes and edges in the common subgraph represent the key factors and causal relationships that affect the prediction results. By extracting the common subgraph, you can intuitively see which features have an important impact on the prediction results, as well as the causal relationship between these features, thereby improving the interpretability of the model.
[0112] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0113] See Figure 6 , which shows a schematic diagram of the structure of an interpretable device for a causal graph-based model prediction process provided by an exemplary embodiment of the present application. The interpretable device for a causal graph-based model prediction process can be implemented as all or part of a device through software, hardware, or a combination of both. The device 1 includes a global causal graph construction module 10, a cluster pruning module 20, a model processing module 30, a result synthesis module 40, a common part extraction module 50, and a derivation logic interpretation module 60.
[0114] A global causal graph construction module 10 is used to construct a global causal graph for describing the correlation between features using high-dimensional structured data of the target scene; the nodes in the global causal graph are variables, and the directed edges are the causal relationships between the variables;
[0115] A clustering and pruning module 20 is used to cluster and prune the global causal graph to obtain multiple pruned subgraphs;
[0116] The model processing module 30 is used to perform classification prediction on each subgraph using a preset graph neural network model to obtain a GNN classification submodel corresponding to each subgraph;
[0117] A result synthesis module 40 is used to synthesize the GNN classification sub-models corresponding to each sub-graph into an integrated model to obtain a prediction model;
[0118] A common part extraction module 50 is used to extract the common parts of multiple subgraphs to obtain a common subgraph;
[0119] The inference logic explanation module 60 is used to explain the prediction model based on the common subgraph and obtain an explainability report.
[0120] It should be noted that the interpretable device for the model prediction process based on the causal graph provided in the above embodiment only uses the division of the above functional modules as an example when executing the interpretable method for the model prediction process based on the causal graph. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the interpretable device for the model prediction process based on the causal graph provided in the above embodiment and the interpretable method for the model prediction process based on the causal graph are based on the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.
[0121] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0122] In the embodiments of the present application, on the one hand, by constructing a global causal graph, the features in the high-dimensional structured data are represented as nodes, and the causal relationship between the features is represented as a directed edge. The global causal graph can intuitively express the interaction relationship between the features, ensure that the interpretation results are consistent with human cognitive logic, meet the strict requirements of special scenarios for model interpretability, and effectively establish a trust mechanism for model decisions in special scenarios. On the other hand, by extracting the common parts of multiple subgraphs, a common subgraph is obtained. The nodes and edges in the common subgraph represent the key factors and causal relationships that affect the prediction results. By extracting the common subgraph, you can intuitively see which features have an important impact on the prediction results, as well as the causal relationship between these features, thereby improving the interpretability of the model.
[0123] The present application also provides a computer-readable medium having program instructions stored thereon, which, when executed by a processor, implements an interpretable method for the model prediction process based on the causal graph provided by the above-mentioned various method embodiments.
[0124] The present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the interpretable method of the model prediction process based on the causal graph of each of the above-mentioned method embodiments.
[0125] See Figure 7 , which is a schematic diagram of the structure of a device provided in the embodiment of the present application. Figure 7 As shown, the device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0126] The communication bus 1002 is used to implement the connection and communication between these components.
[0127] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0128] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0129] The processor 1001 may include one or more processing cores. The processor 1001 utilizes various interfaces and circuits to connect the various components within the entire device 1000. It executes instructions, programs, code sets, or instruction sets stored in the memory 1005, and calls data stored in the memory 1005 to perform various functions and process data for the device 1000. Optionally, the processor 1001 may be implemented in the form of at least one hardware component: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 1001 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily handles operating devices, user interfaces, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the display; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 1001 and may be implemented separately on a single chip.
[0130] Among them, the memory 1005 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing the operating device, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may also be optionally at least one storage device located away from the aforementioned processor 1001. As Figure 7 As shown, the memory 1005 as a computer storage medium may include an operating device, a network communication module, a user interface module, and an interpretable application program for the model prediction process based on the causal graph.
[0131] exist Figure 7In the device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain user input data; and the processor 1001 can be used to call the interpretable application of the causal graph-based model prediction process stored in the memory 1005 and specifically perform the following operations:
[0132] Using high-dimensional structured data of the target scene, a global causal graph is constructed to describe the correlation between features. The nodes in the global causal graph are variables, and the directed edges are the causal relationships between variables.
[0133] Cluster and prune the global causal graph to obtain multiple pruned subgraphs;
[0134] Use the preset graph neural network model to perform classification prediction on each subgraph to obtain the GNN classification submodel corresponding to each subgraph;
[0135] The GNN classification sub-model corresponding to each sub-graph is integrated into an integrated model to obtain a prediction model;
[0136] Extract the common parts of multiple subgraphs to obtain a common subgraph;
[0137] According to the common subgraph, the prediction model is interpretable and an interpretability report is obtained.
[0138] In one embodiment, when constructing a global causal graph for describing the correlation between features using structured high-dimensional data of a target scene, the processor 1001 specifically performs the following operations:
[0139] Acquire and preprocess high-dimensional structured data of the target scene to obtain the data to be analyzed;
[0140] Marking the existing causal relationships in the domain knowledge base or the prior knowledge of the expert system to obtain a marked first ordered variable pair with causal relationships and a marked second ordered variable pair without causal relationships;
[0141] Extracting parameter features corresponding to the first ordered variable and the second ordered variable from the data to be analyzed;
[0142] The parameter features corresponding to the first ordered variable are used as a training set, and the neural network is trained using the training set to obtain a pre-trained causal relationship prediction model;
[0143] Inputting the parameter features corresponding to the second ordered variable pair into the pre-trained causal relationship prediction model to predict the causal relationship label corresponding to the second ordered variable pair;
[0144] A global causal graph for describing the correlation between features is constructed according to the pre-labeled causal relationship labels of the first ordered variable pair and the predicted causal relationship labels of the second ordered variable pair.
[0145] In one embodiment, when extracting parameter features corresponding to ordered variable pairs, the processor 1001 specifically performs the following operations:
[0146] Using convolutional neural networks, we extract variable distribution information from the kernel density estimation function image corresponding to the ordered variable pairs from the data to be analyzed.
[0147] Using a preset graph neural network model, we extract structural information and high-order graph structure features from the Pearson graph corresponding to the ordered variable pairs from the data to be analyzed.
[0148] The variable distribution information, structural information and high-order graph structure characteristics are used as parameter features corresponding to ordered variable pairs.
[0149] In one embodiment, when the processor 1001 constructs a global causal graph for describing the inter-feature correlation relationship based on the pre-labeled causal relationship labels of the first ordered variable pair and the predicted causal relationship labels of the second ordered variable pair, the processor 1001 specifically performs the following operations:
[0150] Treat all variables in high-dimensional structured data as graph nodes;
[0151] Identify whether there is a causal relationship between graph nodes based on the pre-labeled causal relationship labels and the predicted causal relationship labels;
[0152] Directed edges are established between graph nodes with causal relationships to obtain a global causal graph used to describe the correlation between features.
[0153] In one embodiment, when the processor 1001 performs clustering and pruning on the global causal graph to obtain multiple pruned subgraphs, the processor 1001 specifically performs the following operations:
[0154] Cluster all nodes in the global causal graph to divide nodes with densely connected edges into the same community and obtain the node clustering results;
[0155] Based on the node clustering results, the nodes and edges of the global causal graph are pruned to obtain multiple pruned subgraphs.
[0156] In one embodiment, when extracting the common portion of multiple subgraphs to obtain a common subgraph, the processor 1001 specifically performs the following operations:
[0157] Count the number of times each variable appears in each subgraph to obtain a list of variable occurrences;
[0158] According to the variable occurrence count list, the variables whose occurrence count exceeds the preset threshold are filtered to obtain the common variable set;
[0159] Extract the directed edges between the public variables in the public variable set from the global causal graph and output the edge list of the public subgraph;
[0160] Construct a public subgraph based on the public variable set and the public subgraph edge list.
[0161] In one embodiment, when the processor 1001 interprets the prediction model based on the common subgraph and obtains the interpretability report, it specifically performs the following operations:
[0162] Extract all node variables from the common subgraph, each node variable carries the actual value;
[0163] Calculate the difference value of each node variable based on the actual value carried by each node variable;
[0164] According to the difference value of each node variable, the influence degree of each node variable on the prediction model is analyzed to obtain the variable influence analysis results;
[0165] Extract all directed edges from the common subgraph. Directed edges are used to represent the causal relationship between variables.
[0166] According to the causal relationship of each directed edge among all directed edges, the interaction relationship between variables is explained to obtain the causal relationship analysis results;
[0167] Integrate the results of variable impact analysis and causal relationship analysis to obtain an interpretability report.
[0168] In one embodiment, when the processor 1001 calculates the difference value of each node variable according to the actual value carried by each node variable, it specifically performs the following operations:
[0169] Acquire domain knowledge or historical data in the target scenario;
[0170] Based on domain knowledge or historical data, calculate the standard value or average value of each node variable;
[0171] Calculate the difference between the actual value carried by each node variable and the standard value or average value of each node variable to obtain the difference value of each node variable.
[0172] In one embodiment, when the processor 1001 analyzes the influence of each node variable on the prediction model based on the difference value of each node variable and obtains the variable influence analysis result, the processor 1001 specifically performs the following operations:
[0173] Normalize the difference value of each node variable to obtain the normalized difference value;
[0174] According to the normalized difference value, the weight of each node variable is quantified in combination with the preset decision tree model;
[0175] According to the weight of each node variable, the influence of each variable on the prediction result is determined to obtain the variable impact analysis result.
[0176] In the embodiments of the present application, on the one hand, by constructing a global causal graph, the features in the high-dimensional structured data are represented as nodes, and the causal relationship between the features is represented as a directed edge. The global causal graph can intuitively express the interaction relationship between the features, ensure that the interpretation results are consistent with human cognitive logic, meet the strict requirements of special scenarios for model interpretability, and effectively establish a trust mechanism for model decisions in special scenarios. On the other hand, by extracting the common parts of multiple subgraphs, a common subgraph is obtained. The nodes and edges in the common subgraph represent the key factors and causal relationships that affect the prediction results. By extracting the common subgraph, you can intuitively see which features have an important impact on the prediction results, as well as the causal relationship between these features, thereby improving the interpretability of the model.
[0177] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The interpretable program for the causal graph-based model prediction process can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The storage medium for the interpretable program for the causal graph-based model prediction process can be a magnetic disk, an optical disk, a read-only memory, or a random access memory.
[0178] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. An interpretable method for model prediction process based on causal graph, characterized in that: The method comprises: Using high-dimensional structured data of the target scene, a global causal graph is constructed to describe the correlation between features; the nodes in the global causal graph are variables, and the directed edges are the causal relationships between variables; Clustering and pruning the global causal graph to obtain multiple pruned subgraphs; Use the preset graph neural network model to perform classification prediction on each subgraph to obtain the GNN classification submodel corresponding to each subgraph; The GNN classification sub-model corresponding to each sub-graph is integrated into an integrated model to obtain a prediction model; Extracting a common portion of the multiple subgraphs to obtain a common subgraph; The prediction model is interpretable according to the common subgraph to obtain an interpretability report.
2. The method according to claim 1, characterized in that The method uses structured high-dimensional data of the target scene to construct a global causal graph for describing the correlation between features, including: Acquire and preprocess high-dimensional structured data of the target scene to obtain the data to be analyzed; Marking the existing causal relationships in the domain knowledge base or the prior knowledge of the expert system to obtain a marked first ordered variable pair with causal relationships and a marked second ordered variable pair without causal relationships; Extracting parameter features corresponding to the first ordered variable and the second ordered variable from the data to be analyzed; Using the parameter features corresponding to the first ordered variable as a training set, and using the training set to train a neural network to obtain a pre-trained causal relationship prediction model; Inputting the parameter features corresponding to the second ordered variable pair into the pre-trained causal relationship prediction model to predict the causal relationship label corresponding to the second ordered variable pair; A global causal graph for describing the correlation relationship between features is constructed based on the pre-labeled causal relationship labels of the first ordered variable pair and the predicted causal relationship labels of the second ordered variable pair.
3. The method according to claim 2, characterized in that Extract parameter features corresponding to ordered variable pairs, including: Using a convolutional neural network, extracting variable distribution information in a kernel density estimation function image corresponding to ordered variable pairs from the data to be analyzed; Using a preset graph neural network model, extracting structural information and high-order graph structure features in the Pearson graph corresponding to the ordered variable pairs from the data to be analyzed; The variable distribution information, the structural information and the high-order graph structural features are used as parameter features corresponding to ordered variable pairs.
4. The method according to claim 2, characterized in that The constructing a global causal graph for describing the correlation between features based on the pre-labeled causal relationship labels of the first ordered variable pair and the predicted causal relationship labels of the second ordered variable pair includes: Taking all variables in the high-dimensional structured data as graph nodes; Identifying whether a causal relationship exists between the graph nodes based on the pre-labeled causal relationship labels and the predicted causal relationship labels; Directed edges are established between graph nodes with causal relationships to obtain a global causal graph used to describe the correlation between features.
5. The method according to claim 1, wherein The clustering and pruning of the global causal graph to obtain a plurality of pruned subgraphs includes: Clustering all nodes in the global causal graph to divide nodes with densely connected edges into the same community, thereby obtaining a node clustering result; Based on the node clustering result, a pruning operation is performed on the nodes and edges of the global causal graph to obtain a plurality of pruned subgraphs.
6. The method according to claim 1, characterized in that The extracting the common part of the plurality of subgraphs to obtain a common subgraph includes: Count the number of times each variable appears in each subgraph to obtain a list of variable occurrences; According to the variable occurrence count list, the variables whose occurrence count exceeds a preset threshold are screened to obtain a common variable set; Extracting directed edges between the public variables in the public variable set from the global causal graph, and outputting an edge list of the public subgraph; A common subgraph is constructed according to the common variable set and the edge list of the common subgraph.
7. The method according to claim 1, characterized in that The predictive model is explained based on the common subgraph to obtain an explainability report, including: Extract all node variables from the common subgraph, each node variable carrying an actual value; Calculating the difference value of each node variable according to the actual value carried by each node variable; Analyzing the influence of each node variable on the prediction model according to the difference value of each node variable to obtain a variable influence analysis result; Extract all directed edges from the common subgraph, where the directed edges are used to represent the causal relationship between variables; According to the causal relationship of each directed edge among all the directed edges, the interaction relationship between the variables is explained to obtain the causal relationship analysis result; The variable impact analysis results and the causal relationship analysis results are integrated to obtain an interpretability report.
8. The method according to claim 7, characterized in that Calculating the difference value of each node variable according to the actual value carried by each node variable includes: Acquire domain knowledge or historical data under the target scenario; Calculate the standard value or average value of each node variable based on the domain knowledge or historical data; The difference between the actual value carried by each node variable and the standard value or average value of each node variable is calculated to obtain the difference value of each node variable.
9. The method according to claim 7, characterized in that Analyzing the influence of each node variable on the prediction model based on the difference value of each node variable to obtain the variable influence analysis result includes: Normalizing the difference value of each node variable to obtain a normalized difference value; According to the normalized difference value, the weight of each node variable is quantified in combination with a preset decision tree model; According to the size of the weight of each node variable, the influence degree of each variable on the prediction result is determined to obtain the variable influence analysis result.
10. An interpretable device for a model prediction process based on a causal graph, characterized in that: The device comprises: A global causal graph construction module is used to construct a global causal graph for describing the correlation between features using high-dimensional structured data of the target scene; the nodes in the global causal graph are variables, and the directed edges are the causal relationships between variables; A clustering and pruning module, configured to cluster and prune the global causal graph to obtain a plurality of pruned subgraphs; The model processing module is used to perform classification prediction on each subgraph using a preset graph neural network model to obtain the GNN classification submodel corresponding to each subgraph; A result synthesis module is used to synthesize the GNN classification sub-models corresponding to each sub-graph into an integrated model to obtain a prediction model; A common part extraction module, configured to extract the common part of the plurality of subgraphs to obtain a common subgraph; A derivation logic explanation module is used to explain the prediction model based on the common subgraph to obtain an explainability report.
Citation Information
Patent Citations
Case affirmation method and system for performing causal inference based on correlation graph information
CN114429140A
Data processing method, related device, equipment and storage medium
CN116957126A
Information processing system, information processing device, prediction model extraction method, and prediction model extraction program
US20200074486A1
Positivity validation and explainability for causal inference via asymmetrically pruned decision trees
WO2023060105A1