Causal graph-based model for interpretable process prediction
By constructing a global causal graph and performing cluster pruning, using a graph neural network model for classification prediction, and extracting common subgraphs to generate interpretability reports, the interpretability problem of deep learning models in the field of medical diagnosis is solved, improving the interpretability and trustworthiness of the model.
Patent Information
- Application Number
- CN202510613929.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-05-13
AI Technical Summary
Existing deep learning models struggle to meet the stringent requirements of interpretability in the field of medical diagnosis, leading to insufficient clinical adoption and distrust in clinical decision-making. Existing interpretable methods such as SHAP, LIME, and attention-based models suffer from high computational complexity, poor stability, or large local approximation errors in high-dimensional data.
By constructing a global causal graph, features in high-dimensional structured data are represented as nodes, and causal relationships between features are represented as directed edges. Clustering and pruning are performed, and a graph neural network model is used for classification prediction. Common subgraphs are extracted, and interpretable reports are generated.
It achieves consistency between the model's interpretation results and human cognitive logic, improves the model's interpretability, establishes a trust mechanism for model decision-making, and can intuitively demonstrate the important impact of features on prediction results and their causal relationship.
Smart Images

Figure CN120688647B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to an interpretable method and device for a model prediction process based on a causal diagram. BACKGROUND
[0002] In the field of medical diagnosis, deep learning models have become the core technology engine for complex decision-making scenarios due to their powerful non-linear modeling capabilities. For example, a certain cancer screening model has achieved an accuracy rate of 98%, but due to its "black box" characteristics, it cannot explain the correlation mechanism between lesion features and pathological results, resulting in an adoption rate of less than 15% in hospital clinics. This problem not only limits the widespread application of artificial intelligence technology in the medical field, but also may lead to mistrust and misjudgment in clinical decision-making.
[0003] In related technologies, common interpretable methods in existing technologies include SHAP (SHapley Additive exPlanations), LIME (Local Interpretable Model-agnostic Explanations), and models based on attention mechanisms.
[0004] However, SHAP has high computational complexity, and for high-dimensional data (feature number > 1000), its computational cost increases significantly, and when there are strongly correlated features in high-dimensional data, the calculation of Shapley values becomes unstable. Second, LIME can only explain the prediction results of a single sample and cannot globally explain the prediction process of the entire data set, and the perturbation samples generated by it may not conform to the actual meaning, resulting in a large error between the local approximation model and the original model. In addition, models based on attention mechanisms can dynamically focus on important features, but their weight calculation complexity is high, and they only reflect correlation rather than causality.
[0005] Therefore, existing technologies cannot meet the stringent requirements of special scenarios such as medicine for model interpretability, and cannot effectively establish a trust mechanism for model decision-making in special scenarios. SUMMARY
[0006] The embodiments of the present application provide an interpretable method and device for a model prediction process based on a causal diagram. In order to have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not a general review, nor does it determine the key / important components or delineate the protection scope of these embodiments. Its only purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0007] In a first aspect, the embodiments of the present application provide an interpretable method for a model prediction process based on a causal diagram, the method comprising:
[0008] The high-dimensional structured data of the target scene is used to construct a global causal graph for describing the correlation and action relationship between features.
[0009] The global causal graph is clustered and pruned to obtain a plurality of pruned subgraphs.
[0010] Each subgraph is classified and predicted using a preset graph neural network model to obtain a GNN classification submodel corresponding to each subgraph.
[0011] The GNN classification submodels corresponding to each subgraph are integrated into an integrated model to obtain a prediction model.
[0012] The common parts of the plurality of subgraphs are extracted to obtain a common subgraph.
[0013] The prediction model is made interpretable according to the common subgraph to obtain an interpretability report.
[0014] Optionally, the structured high-dimensional data of the target scene is used to construct a global causal graph for describing the correlation and action relationship between features, including:
[0015] The high-dimensional structured data of the target scene is obtained and preprocessed to obtain to-be-analyzed data.
[0016] The existing causal relationships in the prior knowledge of the domain knowledge base or expert system are marked to obtain a first ordered variable pair with a causal relationship and a second ordered variable pair without a causal relationship.
[0017] The parameter features corresponding to the first ordered variable and the second ordered variable pair are extracted from the to-be-analyzed data.
[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] The parameter features corresponding to the second ordered variable pair are input into the pre-trained causal relationship prediction model to predict the causal relationship label corresponding to the second ordered variable pair.
[0020] The global causal graph for describing the correlation and action relationship between features is constructed according to the pre-marked causal relationship label of the first ordered variable pair and the predicted causal relationship label of the second ordered variable pair.
[0021] Optionally, the parameter features corresponding to the ordered variable pair are extracted, including:
[0022] The convolutional neural network is used to extract the variable distribution information in the kernel density estimation function image corresponding to the ordered variable pair from the to-be-analyzed data.
[0023] The preset graph neural network model is used to extract structural information and high-order graph structure characteristics of the Pearson graph corresponding to the ordered variable pair from the data to be analyzed.
[0024] The variable distribution information, the structural information and the high-order graph structure characteristics are taken as parameter characteristics corresponding to the ordered variable pair.
[0025] Optionally, according to the pre-labeled causal relationship label of the first ordered variable pair and the predicted causal relationship label of the second ordered variable pair, a global causal graph for describing the correlation and action relationship between characteristics is constructed, including:
[0026] All variables in the high-dimensional structured data are taken as graph nodes.
[0027] According to the pre-labeled causal relationship label and the predicted causal relationship label, whether there is a causal relationship between the graph nodes is identified.
[0028] Directed edges are established between the graph nodes with a causal relationship, and a global causal graph for describing the correlation and action relationship between characteristics is obtained.
[0029] Optionally, the global causal graph is clustered and pruned to obtain a plurality of pruned subgraphs, including:
[0030] All nodes in the global causal graph are clustered to divide nodes with dense edges between each other into the same community, and a node clustering result is obtained.
[0031] Based on the node clustering result, a pruning operation is performed on the nodes and edges of the global causal graph, and a plurality of pruned subgraphs are obtained.
[0032] Optionally, a common part of the plurality of subgraphs is extracted to obtain a public subgraph, including:
[0033] The number of occurrences of each variable in each subgraph is counted to obtain a variable occurrence list.
[0034] According to the variable occurrence list, variables with an occurrence number exceeding a preset number threshold are screened to obtain a public variable set.
[0035] From the global causal graph, directed edges between each public variable in the public variable set are extracted, and an edge list of the public subgraph is output.
[0036] According to the public variable set and the edge list of the public subgraph, the public subgraph is constructed.
[0037] Optionally, according to the public subgraph, the prediction model is made interpretable to obtain an interpretability report, including:
[0038] All node variables are extracted from the public subgraph, and each node variable carries an actual value.
[0039] According to each node variable carrying an actual value, a difference value of each node variable is calculated;
[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 a variable influence analysis result;
[0041] All directed edges are extracted from the public subgraph, and the directed edges are used to represent the causal relationship between variables;
[0042] According to the causal relationship of each directed edge of all directed edges, the interaction relationship between variables is explained to obtain a causal relationship analysis result;
[0043] The variable influence analysis result and the causal relationship analysis result are integrated to obtain an explainability report.
[0044] Optionally, according to each node variable carrying an actual value, a difference value of each node variable is calculated, including:
[0045] Obtain domain knowledge or historical data under a target scenario;
[0046] According to the domain knowledge or historical data, a standard value or an average value of each node variable is counted;
[0047] The difference between the actual value carried by each node variable and the standard value or the average value of each node variable is calculated to obtain a difference value of each node variable.
[0048] Optionally, according to the difference value of each node variable, the influence degree of each node variable on the prediction model is analyzed to obtain a variable influence analysis result, including:
[0049] The difference value of each node variable is normalized to obtain a normalized difference value;
[0050] According to the normalized difference value, a weight of each node variable is quantified in combination with a preset decision tree model;
[0051] 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 a variable influence analysis result.
[0052] In a second aspect, an embodiment of the present application provides an explainable device for a model prediction process based on a causal graph, and the device comprises:
[0053] A global causal graph construction module is configured to construct a global causal graph for describing the correlation and interaction relationship between features by using high-dimensional structured data of a target scenario; the nodes in the global causal graph are variables, and the directed edges are causal relationships between variables;
[0054] The clustering pruning module is configured to cluster and prune the global causal graph to obtain a plurality of pruned subgraphs;
[0055] The model processing module is configured to use a preset graph neural network model to perform classification prediction on each subgraph to obtain a GNN classification submodel corresponding to each subgraph.
[0056] The result synthesizing module is configured to synthesize the GNN classification submodels corresponding to the subgraphs into an integrated model to obtain a prediction model.
[0057] The common part extracting module is configured to extract common parts of the plurality of subgraphs to obtain a common subgraph.
[0058] The deduction logic explanation module is configured to perform explainability on the prediction model according to the common subgraph to obtain an explainability report.
[0059] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and performing the method steps described above.
[0060] In a fourth aspect, an embodiment of the present application provides a device, which can 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 performing the method steps described above.
[0061] The technical scheme provided by the embodiments of the present application can 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 high-dimensional structured data are represented as nodes, and the causal relationships between the features are represented as directed edges. The global causal graph can intuitively express the interaction relationships between the features, ensure that the explanation result is consistent with human cognitive logic, meet the stringent requirements of special scenarios on model explainability, and effectively establish a trust mechanism for model decision-making in special scenarios. On the other hand, by extracting common parts of a plurality of subgraphs to obtain a common subgraph, the nodes and edges in the common subgraph represent key factors and causal relationships that affect the prediction result. Through extraction of the common subgraph, it can be intuitively seen which features have an important influence on the prediction result and the causal relationships between these features, thereby improving the explainability of the model.
[0063] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0064] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.
[0065] Figure 1 is a flow diagram of an explainable method for model prediction process based on causal graph provided by an embodiment of the present application;
[0066] Figure 2 is a process diagram of a construction process of a global causal graph provided by an embodiment of the present application;
[0067] Figure 3 is a schematic diagram of a plurality of subgraphs provided by an embodiment of the present application;
[0068] Figure 4 is a model integration process diagram provided by an embodiment of the present application;
[0069] Figure 5 is a common subgraph extraction diagram provided by an embodiment of the present application;
[0070] Figure 6 is a structural diagram of an explainable device for model prediction process based on causal graph provided by the present application;
[0071] Figure 7 is a structural diagram of an apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION
[0072] The following description and drawings are illustrative of the specific embodiments of the present application and are not intended to be limiting thereof.
[0073] It should be apparent that the described embodiments are only some - but not all - of the embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative effort, fall within the scope of protection of the present application.
[0074] The following description refers to the accompanying drawings. Wherever possible, the same reference numbers in different drawings refer to the same or similar elements. The following description of the exemplary embodiments is not meant to limit or restrict the application in any way. Rather, the following description is meant to provide an example of how the application can be implemented in accordance with the aspects of the application detailed in the claims.
[0075] In the description of the present application, it is understood that the terms "first", "second" and the like are only for the purpose of description and cannot be understood as indicating or implying relative importance. The above terms can be understood in the specific meaning in the present application according to the specific circumstances for those skilled in the art. In addition, in the description of the present application, "multiple" refers to two or more than two, unless otherwise specified. The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0076] The present application provides an interpretable method and device for model prediction process based on causal diagram to solve the problems in the above related technical problems. In the embodiments of the present application, on the one hand, by constructing a global causal diagram, the features in high-dimensional structured data are represented as nodes, and the causal relationship between the features is represented as directed edges. The global causal diagram can intuitively express the interaction relationship between the features, ensure that the interpretation result is consistent with human cognitive logic, meet the strict requirements of special scenarios for model interpretability, and effectively establish a trust mechanism for model decision in special scenarios. On the other hand, by extracting the common part of multiple subgraphs, a public subgraph is obtained, and the nodes and edges in the public subgraph represent the key factors and causal relationships that affect the prediction results. Through the extraction of the public subgraph, it can be seen intuitively which features have important influence on the prediction results and the causal relationship between these features, thereby improving the interpretability of the model. The following exemplary embodiments are described in detail.
[0077] The following will be combined with the accompanying Figure 1 -Appendix Figure 5 The interpretable method for model prediction process based on causal diagram provided by the embodiments of the present application is described in detail. The method can be realized by relying on a computer program and can run on an interpretable device for model prediction process based on causal diagram based on von Neumann system. The computer program can be integrated in an application or run as an independent tool application.
[0078] Please refer to Figure 1 A flowchart of an interpretable method for model prediction process based on causal diagram is provided for the embodiments of the present application. As Figure 1 shown, the method of the embodiments of the present application can include the following steps:
[0079] S101, using high-dimensional structured data of a target scene, a global causal diagram for describing the correlation and action relationship between features is constructed; the nodes in the global causal diagram are variables, and the directed edges are the causal relationship between the variables;
[0080] Generally, the core of the interpretable method in the prior art is the correlation-based model (such as SHAP), and in high-dimensional data, there are inevitably features with high correlation with the system state identification. At this time, the correlation-based model (such as SHAP) cannot stably explain the importance of the features to the prediction results.
[0081] Therefore, the causal relationship represents that the change of one variable will lead to the change of another variable. The "Simpson Paradox" points out that only relying on correlation cannot correctly reflect the real world situation. As shown in Table 1, when grouped by gender, the recovery rate of patients taking medicine is higher than that of patients not taking medicine, and it can be considered that the medicine is effective according to the correlation; however, from the overall point of view, it is found that the recovery rate of patients taking medicine is lower than that of patients not taking medicine, which is completely contrary to the grouping situation. From the perspective of causal relationship, considering that the gender of the patient will affect the recovery, the higher the estrogen level of the patient, the lower the recovery rate; and the proportion of female patients in the overall patients is high, therefore, the paradox appears. As can be seen from this example, only relying on correlation is not enough to dig the essence of data, and it is necessary to start from the perspective of causal relationship to better understand the interaction mechanism between variables and correctly analyze the data. In the problem of data dimension reduction and system state identification of high-dimensional data, the introduction of causal relationship can bring stronger interpretability to the model.
[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 table form, with each column representing a feature (variable) and each row representing a record. For example, medical data may include patient age, gender, symptoms, test results, and other features. Node is the basic unit in causal graph, representing a variable or feature. For example, in medical data, nodes can be patient age, gender, symptoms, etc. Directed edge is an arrow connecting two nodes in the causal graph, representing the direction of the causal relationship.
[0085] In some embodiments of the present application, the specific process of constructing a global causal graph for describing the correlation and action relationship between features by using the structured high-dimensional data of the target scene includes: obtaining and preprocessing the high-dimensional structured data of the target scene to obtain the data to be analyzed; marking the existing causal relationship in the prior knowledge of the domain knowledge base or expert system to obtain the first ordered variable pair with a causal relationship and the second ordered variable pair without a causal relationship; extracting the parameter features corresponding to the first ordered variable and the second ordered variable pair from the data to be analyzed; taking the parameter features corresponding to the first ordered variable as a training set, training a neural network by using the training set, and obtaining 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 and action relationship between features according to 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, the high-dimensional structured data of the target scene, such as the high-dimensional structured data of an electronic health record (EHR) system, contains information such as the age, gender, symptoms, and examination results of a patient. The high-dimensional structured data is processed to eliminate missing values and abnormal values and to standardize the data. According to medical literature and expert opinions, known causal relationships are marked, such as “high blood pressure” possibly leading to “heart disease”. These relationships are divided into two groups, which are the first ordered variable pair with a known causal relationship and the second ordered variable pair with an unknown causal relationship. The features related to the first and second ordered variable pairs are extracted from the preprocessed data. A multi-layer perceptron (MLP) neural network is selected. The features of the first ordered variable pair are used as a training set to train the MLP model, and the model parameters are optimized by back propagation. The features of the second ordered variable pair are input into the trained MLP model, and the model outputs the predicted causal relationship label. 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, in which the nodes represent medical features and the directed edges represent causal relationships.
[0087] In some embodiments of the present application, the specific process of extracting the parameter features corresponding to the ordered variable pair includes: using a convolutional neural network to extract the variable distribution information in the kernel density estimation function image corresponding to the ordered variable pair from the data to be analyzed; using a preset graph neural network model to extract the structure information and high-order graph structure features in the Pearson graph corresponding to the ordered variable pair from the data to be analyzed; and taking the variable distribution information, the structure information, and the high-order graph structure features as the parameter features corresponding to the ordered variable pair.
[0088] In some embodiments of the present application, the specific process of constructing a global causal graph for describing the interaction relationship between features according to the pre-labeled causal relationship label of the first ordered variable pair, the predicted causal relationship label 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 according to the pre-labeled causal relationship label and the predicted causal relationship label; establishing a directed edge between the graph nodes with a causal relationship to obtain a global causal graph for describing the interaction relationship between features.
[0089] For example Figure 2 As shown, through high-dimensional data and prior knowledge, causal graph construction can be performed to obtain the final global causal graph.
[0090] In the embodiments of the present application, for system state recognition of structured table data, the interaction relationship between features is mined to enrich the data expression content and effectively extract the implicit information in the data for recognition. The construction and visualization of the global causal graph can intuitively understand the interaction of features through the edges between nodes in the graph.
[0091] S102, clustering and pruning the global causal graph to obtain a plurality of pruned subgraphs;
[0092] In some embodiments of the present application, the specific process of clustering and pruning the global causal graph to obtain a plurality of pruned subgraphs includes: clustering all nodes in the global causal graph to divide nodes with dense edges between each other into the same community to obtain a node clustering result; and performing a pruning operation on the nodes and edges of the global causal graph based on the node clustering result to obtain a plurality of pruned subgraphs. The plurality of subgraphs, for example Figure 3 As shown, pruning the global causal graph reduces the computational complexity of a single GNN prediction.
[0093] The clustering can be implemented by using a community detection algorithm, which is an unsupervised clustering method. The community detection algorithm classifies nodes according to the edge relationship in the graph model, and clusters nodes with relatively dense edges between each other into a class. The community detection can reflect the information interaction of the nodes to some extent, and divides the graph model into a hierarchical structure. Nodes in the same layer (class) have more edges and thus more information interaction, and can be considered to have a higher similarity.
[0094] The pruning can be implemented by using a random algorithm. The global causal graph often contains a large number of nodes and edges, and there can be many ring structures. The ring structure cannot be avoided when reflecting the interaction relationship, which corresponds to the action and reaction mechanism in the real world. However, such a structure often brings difficulties to the prediction of the GNN, which makes the model repeatedly use the same node information for prediction, resulting in an increase in the calculation cost of the model and a decrease in the prediction performance. Therefore, pruning the global causal graph can simplify the global causal graph and improve the calculation efficiency and prediction performance of the subsequent GNN by randomly reducing the global causal graph. The graph pruning based on the classification result of community detection can retain the layered structure of the global causal graph in the process of deleting nodes and edges, delete similar nodes in the same layer, and retain the nodes and edges of interlayer interaction as much as possible, so that the layered structure of the global causal graph can be simplified while the information interaction process between layers is retained.
[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] The graph neural network is a deep learning model specially designed for processing graph structured data. It can learn the relationships between nodes in a graph and the topology of the graph, and is used for tasks such as node classification, graph classification, and link prediction. The preset graph neural network model is obtained by pre-training based on the graph neural network.
[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) that can learn the feature representation of nodes and predict the class labels of nodes. During training, the model learns the relationships between nodes in the subgraph and their contributions 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 representing the likelihood of the user belonging to a certain category.
[0098] S104, integrating the GNN classification submodel corresponding to each subgraph into an ensemble model to obtain a prediction model;
[0099] In some embodiments of the present application, the results of the GNN classification submodels corresponding to all subgraphs are integrated, for example, by voting or stacking, to improve the accuracy and robustness of the final classification.
[0100] Wherein, for the subgraph after graph pruning and the corresponding GNN classification model, due to the deletion process including a random algorithm, a single graph model will make the model recognition unstable and have the risk of overfitting, and by combining the classification results of multiple subgraphs to construct an ensemble model, the stability can be enhanced while the recognition performance of the submodel is retained, and the generalization ability of the model is increased by avoiding overfitting.
[0101] For example Figure 4 As shown, each subgraph is classified and predicted using a respective base learner "preset graph neural network model" to obtain a corresponding GNN classification submodel for each subgraph, and then the GNN classification submodels corresponding to each subgraph are integrated into an ensemble model to obtain a prediction model.
[0102] In the embodiments of the present application, the interpretable prediction model based on the causal graph expresses the interaction relationship between features through the causal graph, thereby avoiding the interference of false correlation relationships on the recognition ability of the model.
[0103] S105, extracting a common part of the multiple subgraphs to obtain a public subgraph;
[0104] In some embodiments of the present application, the specific process of extracting the common part of the multiple subgraphs to obtain the public subgraph includes: counting the number of occurrences of each variable in each subgraph to obtain a variable occurrence list; filtering variables with occurrence numbers exceeding a preset number threshold according to the variable occurrence list to obtain a public variable set; extracting directed edges between each public variable in the public variable set from the global causal graph to output an edge list of the public subgraph; and constructing the public subgraph according to the public variable set and the edge list of the public subgraph. Wherein, the extraction of the common part of each subgraph can summarize and analyze the recognition process of multiple submodels, and the analysis of nodes and edges in the public subgraph can realize the interpretability of the model. Wherein, the extraction of the public subgraph filters important features and also gives the relationship between these features.
[0105] For example Figure 5 As shown, in the sub Figure 1 、 2 , N, nodes 2, 4, 7, and 8 are nodes common to each subgraph, so the public variable set is 2, 4, 7, and 8, and the public subgraph can be constructed based on 2, 4, 7, and 8 and the edge list of the public subgraph.
[0106] In the embodiments of the present application, by extracting the common part of the multiple subgraphs to obtain the public subgraph, the nodes and edges in the public subgraph represent the key factors and causal relationships affecting the prediction results, and through the extraction of the public subgraph, it can be seen directly which features have an important influence on the prediction results and the causal relationship between these features, thereby improving the interpretability of the model.
[0107] S106, according to the public subgraph, the prediction model is interpretable, and an interpretability report is obtained.
[0108] In some embodiments of the present application, the specific process of interpreting the prediction model according to the public subgraph to obtain the interpretability report includes: extracting all node variables from the public 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 degree of each node variable on the prediction model according to the difference value of each node variable to obtain a variable influence analysis result; extracting all directed edges from the public subgraph, the directed edges being used to represent the causal relationship between variables; explaining the interaction relationship between variables according to the causal relationship of each directed edge of all directed edges to obtain a causal relationship analysis result; and integrating the variable influence 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 according to the actual value carried by each node variable includes: obtaining domain knowledge or historical data under a target scenario; according to the domain knowledge or historical data, the standard value or average value of each node variable is counted; 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.
[0110] Specifically, the specific process of analyzing the influence degree of each node variable on the prediction model according to the difference value of each node variable to obtain a variable influence analysis result includes: normalizing the difference value of each node variable to obtain a normalized difference value; quantifying the weight of each node variable according to the normalized difference value and a preset decision tree model; determining the influence degree of each variable on the prediction result according to the size of the weight of each node variable to obtain 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 directed edges. The global causal graph can intuitively express the interaction relationship between the features, ensure that the explanation result is consistent with human cognitive logic, meet the strict requirements of special scenarios on model interpretability, and effectively establish a trust mechanism for model decision-making in special scenarios. On the other hand, by extracting the common part of multiple subgraphs to obtain a public subgraph, the nodes and edges in the public subgraph represent the key factors and causal relationships that affect the prediction result. Through the extraction of the public subgraph, it can be directly seen which features have an important influence on the prediction result and the causal relationship between these features, thereby improving the interpretability of the model.
[0112] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, refer to the method embodiments of the present application.
[0113] Please refer to Figure 6 which shows a structural schematic diagram of an interpretable apparatus of a model prediction process based on a causal diagram provided by an example embodiment of the present application. The interpretable apparatus of the model prediction process based on the causal diagram can be realized by software, hardware or a combination of both to become all or part of a device. The apparatus 1 includes a global causal graph construction module 10, a clustering pruning module 20, a model processing module 30, a result synthesis module 40, a common part extraction module 50 and a deduction logic explanation module 60.
[0114] The global causal graph construction module 10 is configured to construct a global causal graph for describing the correlation and action relationship between features by using high-dimensional structured data of a target scene; the nodes in the global causal graph are variables, and the directed edges are the causal relationships between variables.
[0115] The clustering pruning module 20 is configured to cluster and prune the global causal graph to obtain a plurality of pruned subgraphs.
[0116] The model processing module 30 is configured to use a preset graph neural network model to perform classification prediction on each subgraph to obtain a GNN classification submodel corresponding to each subgraph.
[0117] The result synthesis module 40 is configured to synthesize the GNN classification submodels corresponding to each subgraph into an integrated model to obtain a prediction model.
[0118] The common part extraction module 50 is configured to extract common parts of the plurality of subgraphs to obtain a public subgraph.
[0119] The deduction logic explanation module 60 is configured to perform interpretability on the prediction model according to the public subgraph to obtain an interpretability report.
[0120] It should be noted that the interpretable apparatus of the model prediction process based on the causal diagram provided in the above embodiments is used to execute the interpretable method of the model prediction process based on the causal diagram, and only the division of the above functional modules is used as an example for illustration. In actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the interpretable apparatus of the model prediction process based on the causal diagram provided in the above embodiments and the method embodiments of the model prediction process based on the causal diagram belong to the same concept, and the implementation process is described in detail in the method embodiments, which will not be repeated here.
[0121] The above sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages and 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 relationships between the features are represented as directed edges. The global causal graph can intuitively express the interaction relationship between the features, ensure that the interpretation result is consistent with human cognitive logic, meet the strict requirements of special scenarios on model interpretability, and effectively establish a trust mechanism for model decision-making of special scenarios. On the other hand, by extracting a common part of multiple subgraphs, a public subgraph is obtained. The nodes and edges in the public subgraph represent key factors and causal relationships that affect the prediction result. Through extraction of the public subgraph, it can be intuitively seen which features have an important influence on the prediction result and 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, implement the interpretable method of the model prediction process based on the causal graph provided by each of the method embodiments.
[0124] The present application also provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the interpretable method of the model prediction process based on the causal graph of each of the method embodiments.
[0125] Please refer to Figure 7 , the present application provides a structural schematic diagram of an equipment. As shown in Figure 7 , the equipment 1000 can 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 realize the connection and communication between the components.
[0127] The user interface 1003 can include a display screen (Display), a camera (Camera), and can optionally include a standard wired interface and a wireless interface.
[0128] The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0129] The processor 1001 can include one or more processing cores. The processor 1001 connects various parts within the entire device 1000 by various interfaces and lines, and performs various functions of the device 1000 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Alternatively, the processor 1001 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 can integrate a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes operating devices, user interfaces, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1001, but can be realized by a separate chip.
[0130] The memory 1005 can include a random access memory (RAM) and can also include a read-only memory (ROM). 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 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing operating devices, instructions for at least one function (such as touch function, sound playing function, image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 1005 can also be at least one storage device located away from the above-mentioned processor 1001. As shown, the memory 1005 as a computer storage medium can include operating devices, network communication modules, user interface modules, and interpretable application programs based on causal diagram-based model prediction processes. Figure 7
[0131] In Figure 7 In the device 1000 shown, the user interface 1003 is mainly used to provide an interface for the user to input, and obtain data input by the user; and the processor 1001 can be used to call the interpretable application program of the model prediction process based on the causal diagram stored in the memory 1005, and specifically perform the following operations:
[0132] High-dimensional structured data of a target scene is adopted to construct a global causal diagram for describing the correlation and action relationship between features; nodes in the global causal diagram are variables, and directed edges are causal relationships between variables;
[0133] The global causal diagram is clustered and pruned to obtain a plurality of pruned sub-diagrams;
[0134] Each sub-diagram is classified and predicted using a preset graph neural network model to obtain a GNN classification sub-model corresponding to each sub-diagram;
[0135] The GNN classification sub-model corresponding to each sub-diagram is integrated into an ensemble model to obtain a prediction model;
[0136] Common parts of the plurality of sub-diagrams are extracted to obtain a common sub-diagram;
[0137] The prediction model is interpreted according to the common sub-diagram to obtain an interpretability report.
[0138] In one embodiment, the processor 1001, when constructing a global causal diagram for describing the correlation and action relationship between features by adopting structured high-dimensional data of a target scene, specifically performs the following operations:
[0139] High-dimensional structured data of a target scene is obtained and preprocessed to obtain data to be analyzed;
[0140] Existing causal relationships in prior knowledge of a domain knowledge base or an expert system are marked to obtain a first ordered variable pair with a causal relationship and a second ordered variable pair without a causal relationship;
[0141] Parameter features corresponding to the first ordered variable and the second ordered variable pair are extracted from the data to be analyzed, respectively;
[0142] The parameter features corresponding to the first ordered variable are used as a training set, and a neural network is trained using the training set to obtain a pre-trained causal relationship prediction model;
[0143] The parameter features corresponding to the second ordered variable pair are input into the pre-trained causal relationship prediction model to predict a causal relationship label corresponding to the second ordered variable pair;
[0144] A global causal diagram for describing the correlation and action relationship between features is constructed according to the pre-marked causal relationship label of the first ordered variable pair and the predicted causal relationship label of the second ordered variable pair.
[0145] In an embodiment, the processor 1001, when performing the extraction of the parameter feature corresponding to the ordered variable pair, specifically performs the following operations:
[0146] Using a convolutional neural network, the variable distribution information in the kernel density estimation function image corresponding to the ordered variable pair is extracted from the data to be analyzed;
[0147] Using a preset graph neural network model, the structural information and high-order graph structure features in the Pearson graph corresponding to the ordered variable pair are extracted from the data to be analyzed;
[0148] The variable distribution information, the structural information and the high-order graph structure features are taken as the parameter feature corresponding to the ordered variable pair.
[0149] In an embodiment, the processor 1001, when performing the construction of the global causal graph for describing the correlation and action relationship between features according to the pre-labeled causal relationship label of the first ordered variable pair and the predicted causal relationship label of the second ordered variable pair, specifically performs the following operations:
[0150] All variables in the high-dimensional structured data are taken as graph nodes;
[0151] According to the pre-labeled causal relationship label and the predicted causal relationship label, it is identified whether there is a causal relationship between the graph nodes;
[0152] Directed edges are established between the graph nodes with causal relationships, and a global causal graph for describing the correlation and action relationship between features is obtained.
[0153] In an embodiment, the processor 1001, when performing the clustering and pruning of the global causal graph to obtain a plurality of pruned subgraphs, specifically performs the following operations:
[0154] All nodes in the global causal graph are clustered to divide nodes with dense edges between each other into the same community, and a node clustering result is obtained;
[0155] Based on the node clustering result, the nodes and edges of the global causal graph are pruned to obtain a plurality of pruned subgraphs.
[0156] In an embodiment, the processor 1001, when performing the extraction of the common part of the plurality of subgraphs to obtain a public subgraph, specifically performs the following operations:
[0157] The number of occurrences of each variable in each subgraph is counted to obtain a variable occurrence list;
[0158] According to the variable occurrence list, variables with an occurrence number exceeding a preset number threshold are screened to obtain a public variable set;
[0159] From the global causal graph, extract the directed edges between each public variable in the public variable set, and output the edge list of the public subgraph;
[0160] According to the public variable set and the edge list of the public subgraph, the public subgraph is constructed.
[0161] In one embodiment, the processor 1001, when performing the explainability report of the prediction model according to the public subgraph, specifically performs the following operations:
[0162] Extract all node variables from the public subgraph, each node variable carrying an actual value;
[0163] According to the actual value carried by each node variable, the difference value of each node variable is calculated;
[0164] According to the difference value of each node variable, the influence degree of each node variable on the prediction model is analyzed, and the variable influence analysis result is obtained;
[0165] Extract all directed edges from the public subgraph, and the directed edges are used to represent the causal relationship between variables;
[0166] According to the causal relationship of each directed edge in all directed edges, the interaction relationship between variables is explained, and the causal relationship analysis result is obtained;
[0167] Integrate the variable influence analysis result and the causal relationship analysis result to obtain the explainability report.
[0168] In one embodiment, the processor 1001, when calculating the difference value of each node variable according to the actual value carried by each node variable, specifically performs the following operations:
[0169] Obtain the domain knowledge or historical data under the target scene;
[0170] According to the domain knowledge or historical data, the standard value or average value of each node variable is calculated;
[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, the processor 1001, when performing the variable influence analysis result according to the difference value of each node variable, specifically performs the following operations:
[0173] The difference value of each node variable is normalized to obtain the normalized difference value;
[0174] According to the normalized difference value, a weight of each node variable is quantified in combination with a preset decision tree model;
[0175] According to the weight of each node variable, an influence degree of each variable on a prediction result is determined, and a variable influence analysis result is obtained.
[0176] In the embodiments of the present application, on the one hand, by constructing a global causal graph, features in high-dimensional structured data are represented as nodes, and causal relationships between the features are represented as directed edges. The global causal graph can intuitively express the interaction relationship between the features, ensure that the interpretation result is consistent with human cognitive logic, meet the strict requirements of special scenarios on model interpretability, and effectively establish a trust mechanism for model decision-making in special scenarios. On the other hand, by extracting a common part of multiple subgraphs, a public subgraph is obtained. The nodes and edges in the public subgraph represent key factors and causal relationships that affect the prediction result. Through extraction of the public subgraph, it can be directly seen which features have an important influence on the prediction result and the causal relationship between these features, thereby improving the interpretability of the model.
[0177] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The interpretable program of the model prediction process based on the causal graph can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium of the interpretable program of the model prediction process based on the causal graph can be a disc, an optical disc, a read-only memory, or a random access memory.
[0178] The above only describes the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. An interpretable method for predicting a process based on a causal diagram model for medical diagnosis, the age, gender, and symptoms of a patient in medical data as nodes, characterized in that, The method comprises: Using high-dimensional structured data of a target scene, the high-dimensional structured data comprising age, gender, symptoms, examination results of a patient, a global causal graph for describing the correlation and action relationship between features is constructed; nodes in the global causal graph are variables, and directed edges are causal relationships between variables; The global causal graph is clustered and pruned to obtain a plurality of pruned subgraphs; The global causal graph is clustered and pruned to obtain a plurality of pruned subgraphs, comprising: All nodes in the global causal graph are clustered to divide nodes with dense edges between each other into the same community to obtain a node clustering result; Based on the node clustering result, the nodes and edges of the global causal graph are pruned to obtain a plurality of pruned subgraphs; Each subgraph is classified and predicted using a preset graph neural network model to obtain a GNN classification submodel corresponding to each subgraph; The GNN classification submodels corresponding to each subgraph are integrated into an ensemble model to obtain a prediction model; Common parts of the plurality of subgraphs are extracted to obtain a common subgraph; The common parts of the plurality of subgraphs are extracted to obtain a common subgraph, comprising: The number of occurrences of each variable in each subgraph is counted to obtain a variable occurrence list; According to the variable occurrence list, variables with an occurrence number exceeding a preset number threshold are screened to obtain a public variable set; From the global causal graph, directed edges between variables in the public variable set are extracted to output an edge list of the common subgraph; The common subgraph is constructed according to the public variable set and the edge list of the common subgraph; The prediction model is made interpretable according to the common subgraph to obtain an interpretability report.
2. The method of claim 1, wherein, The high-dimensional structured data of a target scene is used to construct a global causal graph for describing the correlation and action relationship between features, comprising: High-dimensional structured data of a target scene is obtained and preprocessed to obtain data to be analyzed; Prior knowledge in a domain knowledge base or an expert system is marked to obtain a first ordered variable pair with a causal relationship and a second ordered variable pair without a causal relationship; Parameter features corresponding to the first ordered variable pair and the second ordered variable pair are extracted from the data to be analyzed, respectively; The parameter features corresponding to the first ordered variable pair are used as a training set, and a neural network is trained using the training set to obtain a pre-trained causal relationship prediction model; The parameter features corresponding to the second ordered variable pair are input into the pre-trained causal relationship prediction model to predict the causal relationship label corresponding to the second ordered variable pair; According to the pre-marked causal relationship label of the first ordered variable pair and the predicted causal relationship label of the second ordered variable pair, a global causal graph for describing the correlation and action relationship between features is constructed.
3. The method of claim 2, wherein, Extracting parameter features corresponding to an ordered variable pair comprises: Using a convolutional neural network, variable distribution information in a kernel density estimation function image corresponding to an ordered variable pair is extracted from the data to be analyzed; extracting, from the to-be-analyzed data, structural information and high-order graph structure features of a Pearson graph corresponding to an ordered variable pair by using a preset graph neural network model; using the variable distribution information, the structural information and the high-order graph structure features as parameter features corresponding to the ordered variable pair.
4. The method of claim 2, wherein, constructing a global causal graph for describing the correlation and action relationship between features according to the pre-labeled causal relationship label of the first ordered variable pair and the predicted causal relationship label of the second ordered variable pair, including: taking all variables in the high-dimensional structured data as graph nodes; identifying whether there is a causal relationship between the graph nodes according to the pre-labeled causal relationship label and the predicted causal relationship label; establishing a directed edge between the graph nodes with the causal relationship to obtain the global causal graph for describing the correlation and action relationship between features.
5. The method of claim 1, wherein, performing interpretability on the prediction model according to the common subgraph to obtain an interpretability report, including: extracting all node variables from the common subgraph, each node variable carrying an actual value; calculating a difference value of each node variable according to the actual value carried by each node variable; analyzing an influence degree of each node variable on the prediction model according to the difference value of each node variable to obtain a variable influence analysis result; extracting all directed edges from the common subgraph, the directed edges being used to represent the causal relationship between variables; explaining the interaction relationship between variables according to the causal relationship of each directed edge of all directed edges to obtain a causal relationship analysis result; integrating the variable influence analysis result and the causal relationship analysis result to obtain the interpretability report.
6. The method of claim 5, wherein, calculating the difference value of each node variable according to the actual value carried by each node variable, including: obtaining domain knowledge or historical data under the target scene; statistically calculating a standard value or an average value of each node variable according to the domain knowledge or the historical data; calculating a difference between the actual value carried by each node variable and the standard value or the average value of each node variable to obtain a difference value of each node variable.
7. The method of claim 5, wherein, analyzing the influence degree of each node variable on the prediction model according to the difference value of each node variable to obtain a variable influence analysis result, including: normalizing the difference value of each node variable to obtain a normalized difference value; quantifying a weight of each node variable according to the normalized difference value and a preset decision tree model; determining the influence degree of each variable on a prediction result according to the size of the weight of each node variable to obtain the variable influence analysis result.
8. An explainable apparatus for model predictive process based on a causal graph implemented using the method of any one of claims 1-7, characterized in that, The device includes: a global causal graph construction module configured to construct a global causal graph for describing the correlation and action relationship between features by using high-dimensional structured data of a target scene; nodes in the global causal graph are variables, and directed edges are 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 configured to use a preset graph neural network model to perform classification prediction on each subgraph, to obtain a GNN classification submodel corresponding to each subgraph. The result synthesizing module is configured to synthesize the GNN classification submodels corresponding to the subgraphs into an integrated model, to obtain a prediction model. The common part extracting module is configured to extract a common part of the subgraphs, to obtain a common subgraph. The deduction logic explanation module is configured to perform explainability on the prediction model according to the common subgraph, to obtain an explainability report.
Citation Information
Patent Citations
Data processing method, related device, equipment and storage medium
CN116957126A
Positivity validation and explainability for causal inference via asymmetrically pruned decision trees
WO2023060105A1