Treatment effect estimation method, system, device and medium based on counterfactual prediction

By screening adjustment variables and confounding variables based on counterfactual prediction methods, and using integral probability measures and collaborative filtering methods, we solve the problem of unobserved potential results and the impact of confounding variables in observational studies, and improve the accuracy of treatment effect estimates. and robustness.

CN118299070BActive Publication Date: 2024-09-06SHANDONG UNIV
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202410725125.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-06
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

In observational studies, individual treatment effect estimates face the problem that all potential outcomes and the effects of confounding variables are not observed, existing methods are difficult to effectively identify treatment effects, and the assumption that all unit characteristics are confounding variables is difficult to implement.

Method used

Using a method based on counterfactual prediction, the mutual information method is used to screen out the representation of adjustment variables that are independent of treatment and related to treatment outcome, as well as the representation of confounding variables that are related to both treatment and treatment outcome. The integral probability measure is used to balance the confounding variables and eliminate inappropriate variables. Relevant instrumental variables are used to predict counterfactual outcomes based on collaborative filtering methods.

Benefits of technology

It improves the accuracy and robustness of treatment effect estimation, reduces the influence of confounding variables, realizes personalized counterfactual outcome prediction, and enhances the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118299070B
    Figure CN118299070B
Patent Text Reader

Abstract

The present invention discloses a method, system, device and medium for estimating treatment effect based on counterfactual prediction, which relates to the technical field of machine learning, including: obtaining treatment information of a tested individual and individual characteristic variables affecting treatment and treatment results, dividing treatment groups according to the treatment information, and obtaining treatment results corresponding to the treatment groups; in the individual characteristic variables, using the mutual information method to screen out confounding variable representation and adjustment variable representation; based on the treatment information of a control group and a treatment group, balancing the confounding variable representation; based on the adjustment variable representation and the balanced confounding variable representation, screening out samples in the control group whose similarity with the tested individual representation exceeds a set threshold, thereby obtaining the counterfactual result of the tested individual; subtracting the potential fact result from the counterfactual result to obtain the treatment effect estimation result of the tested individual. The selection bias is eliminated, the influence of confounding variables is reduced, and the robustness of treatment effect estimation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a method, system, device and medium for estimating treatment effects based on counterfactual prediction. Background Art

[0002] Due to the high heterogeneity of the disease and the different responses of individuals to different treatment options, more and more attention has been paid to personalized treatment prediction at home and abroad. Some studies have proposed a counterfactual framework, defining the individual treatment effect estimate (ITE) as the difference in potential outcomes under different treatments.

[0003] With the development of medical informatization, large-scale observational data of electronic health records have been generated, providing sufficient data support for ITE estimation. However, there are two problems in estimating ITE based on observational data: first, all potential outcomes are never observed; if a patient is treated in one way, then it is never observed what would happen if the patient received a potential alternative treatment under the same circumstances. Second, in addition to unknown counterfactual results, confounding variables are the main obstacle to ITE estimation, which not only affect treatment but also outcomes. For example, in the medical scenario, economic conditions affect both medication and patient recovery rates. It is crucial to find all confounding variables (i.e., those that affect treatment and outcomes) and control them to make accurate predictions, which means that the assumption of no confounding usually needs to be met in observational studies to make the treatment effect identifiable.

[0004] To solve this problem, some studies have proposed a counterfactual model based on the Potential Outcome Framework (PO). This method regards selection bias as a domain adaptation problem and learns a balanced representation of confounding variables used to infer outcomes, including factual outcomes and counterfactual outcomes. However, existing methods assume that all features of a unit are confounding variables, but this assumption is difficult to achieve. This is because some covariates only affect treatment and are called instrumental variables, while some covariates only affect outcomes and are called adjustment variables. Some covariates are even irrelevant variables that have no effect on either treatment or outcomes. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes a treatment effect estimation method, system, device and medium based on counterfactual prediction, which takes individual characteristics into consideration, uses observed data to perform ITE estimation, clarifies potential representations related to the results from input feature variables, balances confounding variables, eliminates selection bias, reduces the impact of confounding variables, and predicts counterfactual results through collaborative filtering methods based on learned potential representations, thereby improving prediction accuracy and the robustness of treatment effect estimation.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a method for estimating treatment effects based on counterfactual prediction, comprising:

[0008] Obtain the treatment information of the tested individuals and the individual characteristic variables that affect the treatment and treatment results, divide the treatment groups according to the treatment information, and obtain the potential factual results corresponding to the treatment groups;

[0009] Among the individual characteristic variables, the mutual information method was used to screen out the adjustment variables that were independent of treatment and related to treatment outcomes, as well as the confounding variables that were related to both treatment and treatment outcomes.

[0010] The mutual information method includes: maximizing the mutual information between the instrumental variable representation and the treatment and minimizing the mutual information between the instrumental variable representation and the treatment result as constraints on the instrumental variable representation learning, maximizing the mutual information between the confounding variable representation and the treatment and maximizing the mutual information between the confounding variable representation and the treatment result as constraints on the confounding variable representation learning, and minimizing the mutual information between the adjustment variable representation and the treatment as a constraint on the adjustment variable representation learning;

[0011] Based on the treatment information of the control and treatment groups, the integrated probability metric was used to balance the characterization of confounding variables;

[0012] Based on the representation of the adjustment variables and the balanced representation of the confounding variables, samples whose similarity with the representation of the tested individual exceeds a set threshold are screened out from the control group, thereby obtaining the counterfactual results of the tested individual;

[0013] The potential factual result is subtracted from the counterfactual result to obtain the estimated treatment effect of the individual being tested.

[0014] As an optional implementation, the constraints on instrumental variable representation learning include: using variational distribution to approximate the true conditional distribution by minimizing the first log-likelihood loss function After obtaining the optimal variational approximation, maximize the mutual information between the instrumental variable representation and the treatment:

[0015] ;

[0016] ;

[0017] By minimizing the second log-likelihood loss function After obtaining the optimal variational approximation, minimize the mutual information between the instrumental variable representation and the treatment outcome:

[0018] ;

[0019] ;

[0020] Where N is the sample size; For individuals The characteristic variables, For the treatment, For the treatment; For the The results of For the The results of , All are neural network parameters; is the weight of each pair of positive and negative samples; It is characterized by instrumental variables; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of ; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of .

[0021] As an optional implementation, the constraints on the learning of confounding variable representations include: using the variational distribution to approximate the true conditional distribution by minimizing the third log-likelihood loss function After obtaining the optimal variational approximation, maximize the mutual information between the confounding variable representation and the treatment:

[0022] ;

[0023] ;

[0024] By minimizing the fourth log-likelihood loss function After obtaining the optimal variational approximation, maximize the mutual information between the confounding variable representation and the treatment outcome:

[0025] ;

[0026] ;

[0027] Where N is the sample size; For individuals The characteristic variables, For the treatment, For the treatment; For the The results of For the The results of , All are neural network parameters; Characterize confounding variables; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of , is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of .

[0028] As an optional implementation, the constraints on learning the adjusted variable representation include: using the variational distribution to approximate the true conditional distribution by minimizing the fifth log-likelihood loss function After obtaining the optimal variational approximation, minimize the mutual information between the adjusted variable representation and the treatment:

[0029] ;

[0030] ;

[0031] Where N is the sample size; For individuals The characteristic variables, For the treatment, For the treatment; are neural network parameters; To adjust the variable characterization; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of .

[0032] As an alternative embodiment, the confounding variable representation and the treatment information of the control group and the treatment group are used as the integral probability measure The input is characterized by balanced confounding variables; specifically:

[0033] ;

[0034] in, Characterize confounding variables; For individuals characteristic variables; is the treatment information of the control group, is the treatment information of the treatment group.

[0035] As an optional implementation, in the process of balancing the confounding variable representation, the relevant loss includes: adding the first to fifth log-likelihood loss functions to obtain the total log-likelihood loss function , and then combine all mutual information constraints to get the balanced total loss function: :

[0036] ;

[0037] in, , , and are all hyperparameters.

[0038] As an optional implementation, the process of predicting the counterfactual outcome of the tested individual includes: connecting the adjusted variable representation and the balanced confounding variable representation to obtain the individual latent representation, dividing the individuals into several groups according to different treatments, considering the individual similarities between different groups, using the K nearest neighbor algorithm for the individual latent representation, and finding the result with the highest similarity to the tested individual as the counterfactual outcome.

[0039] In a second aspect, the present invention provides a treatment effect estimation system based on counterfactual prediction, comprising:

[0040] An acquisition module is configured to acquire treatment information of the individual being tested and individual characteristic variables that affect treatment and treatment results, divide treatment groups according to the treatment information, and acquire potential fact results corresponding to the treatment groups;

[0041] A representation learning module is configured to use a mutual information method to screen out adjustment variable representations that are independent of treatment and related to treatment outcomes, and confounding variable representations that are related to both treatment and treatment outcomes from individual characteristic variables; the mutual information method includes: maximizing the mutual information between the instrumental variable representation and the treatment and minimizing the mutual information between the instrumental variable representation and the treatment outcome as constraints on instrumental variable representation learning, maximizing the mutual information between the confounding variable representation and the treatment and maximizing the mutual information between the confounding variable representation and the treatment outcome as constraints on confounding variable representation learning, and minimizing the mutual information between the adjustment variable representation and the treatment as a constraint on adjustment variable representation learning;

[0042] A balanced distribution module is configured to balance the confounding variable representation using an integrated probability metric based on the treatment information of the control group and the treatment group;

[0043] The counterfactual prediction module is configured to screen out samples in the control group whose similarity with the representation of the tested individual exceeds a set threshold according to the representation of the adjustment variable and the representation of the balanced confounding variable, so as to obtain the counterfactual result of the tested individual;

[0044] The estimation module is configured to obtain an estimated result of the treatment effect of the tested individual by subtracting the potential factual result from the counterfactual result.

[0045] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is completed.

[0046] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.

[0047] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in the first aspect.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] The present invention proposes a treatment effect estimation method based on counterfactual prediction, which uses deep representation learning to extract confounding representations. Although instrumental variables can help estimate treatment effects when confounding variables are unobservable, when all confounding variables are observable, instrumental variables will bring about confounding bias. Therefore, the present invention eliminates irrelevant instrumental variables in the treatment effect estimation method to improve prediction accuracy.

[0050] Although the adjustment variable has an impact on the results like the confounding variable, it does not produce selection bias. Therefore, the present invention does not balance the representation of the adjustment variable, but only balances the confounding variable, which is achieved by learning the balanced representation of the confounding variable between the treatment group and the control group.

[0051] Finally, the present invention predicts counterfactual results based on the collaborative filtering method, connects the adjustment variable representation and the confounding variable representation to obtain the individual potential representation, and uses the learned individual potential representation; adopts the K-nearest neighbor algorithm to find patient samples similar to the query sample's potential representation. These similar samples must be assigned to a treatment group different from the query sample, that is, samples existing in the control group, thereby estimating the individual's counterfactual results through the collaborative filtering method.

[0052] The present invention proposes a treatment effect estimation method based on counterfactual prediction, focusing on personalized counterfactual outcome prediction, considering individual characteristics, and using observed data for ITE estimation. Specifically, the potential representations related to the outcome are sorted out from the input patient characteristics. In order to further eliminate selection bias and improve the robustness of treatment effect estimation, integral probability metric regularization is added to the model to reduce the influence of confounding variables. Finally, the potential outcome is inferred through collaborative filtering based on the learned potential representation to improve the prediction accuracy.

[0053] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0055] Figure 1 A flow chart of a method for estimating treatment effects based on counterfactual prediction provided in Example 1 of the present invention;

[0056] Figure 2 The causal graph structure provided by Embodiment 1 of the present invention;

[0057] Figure 3 This is a model structure diagram of the treatment effect estimation method based on counterfactual prediction provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0058] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0059] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0060] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "comprise" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0061] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0062] Example 1

[0063] Research status.

[0064] Due to the high heterogeneity of diseases and the different responses of individuals to different treatment options, personalized treatment prediction is increasingly valued at home and abroad. Some studies have proposed a counterfactual framework, defining the individual treatment effect as the difference in potential outcomes under different treatments. Since then, in order to make counterfactual and personalized treatment predictions from observational data, scholars at home and abroad have proposed various counterfactual inference methods, which are mainly divided into three categories: personalized treatment prediction methods based on classical statistical methods, personalized treatment prediction methods based on machine learning, and personalized treatment prediction methods based on deep learning.

[0065] Traditional counterfactual prediction algorithms adjust the impact of confounding variables by fitting the functional relationship between covariates, treatments, and outcomes. For example, regression adjustment fits the functional relationship between treatment, covariates, and outcomes through observed data, and is used to predict individual factual and counterfactual outcomes. The matching method forms a matching set by finding a sample of the treatment group that is most similar to the covariate for the control group sample, which may be one or more. After matching, the control group and the treatment group have similar covariate distributions, which is close to a randomized trial, and the individual's counterfactual results can be directly calculated. Inverse probability weighting is the most common method of using propensity scores for sample reweighting. By assigning a suitable weight to each sample in the observed data, a virtual population is constructed. In the virtual population, the distribution between the treatment group and the control group is similar. At this time, the treatment allocation is no longer affected by confounding factors. However, statistical methods usually require assumptions about the relationship between variables in advance, which are usually linear, and are therefore susceptible to model misspecification.

[0066] As the scale of data increases, the defect of traditional counterfactual prediction methods that they cannot model complex relationships between data becomes more and more prominent, and machine learning methods gradually occupy an important position in counterfactual prediction tasks. Machine learning-based methods can learn the relationship between variables from observed data and perform counterfactual inferences by simulating interventions in the real world. The regression tree algorithm can divide samples into different subsets according to the characteristics of the data and generate a regression model for each subset to predict unobserved counterfactual results. The random forest algorithm further improves the accuracy and stability of predictions by integrating multiple regression tree models. In addition, some studies have proposed the use of support vector machines to determine the maximum balanced subset in the data, and simultaneously handle the problems of covariate balance and treatment allocation prediction through hinge loss functions. Some studies have proposed the use of the dual form of support vector machines to obtain the weights of causal effect estimates. This method can be regarded as a continuous relaxation of the maximum balanced subset selection problem. The application of these classic machine learning methods in counterfactual inference can better adapt to complex data in the real world, remove the impact of confounding variables in observed data, and infer the results under different intervention conditions.

[0067] In addition to using traditional and classical machine learning methods, in recent years, there has been particular attention paid to using the powerful fitting and representation learning capabilities of deep neural networks for counterfactual inference. Bayesian neural networks are the first method to use neural networks to infer counterfactuals from observed data. They bring together the ideas of domain adaptation and representation learning, so that the model learned in the source domain dataset (the factual results in the observed data) can also perform well in the target domain (unobservable counterfactual results). Since then, researchers have made many improvements based on this method, mainly focusing on two aspects: one is various methods of balancing covariates; for example, by setting a triplet pair to retain local similarity information while balancing the representation; by minimizing the mutual information loss between the input covariates and the representation to retain information that is highly relevant to the predicted individual effect. On the other hand, there are regularization terms; neural networks can flexibly use various regularization terms to measure the distance between the distribution of covariates between different groups, among which the integral probability metric (IPM) is a type of metric between probability distributions, and the optimal transmission distance (Wasserstein distance) and the maximum average difference distance are the most commonly used.

[0068] Some studies have modified the standard GAN (Generative Adversarial Networks) and proposed a deep causal inference model (GANITE), which can accurately predict the counterfactual outcomes of individuals given covariates, but GANITE cannot adapt to the situation of continuous treatment. Variational Autoencoders (VAE) are also widely used in the field of counterfactual inference to learn unobserved confounding factors and perform variable decomposition to obtain more stable and accurate counterfactual results. Using deep learning to make counterfactual predictions from observed data has great potential, and various methods have currently achieved satisfactory results, but there is still a lot of room for development.

[0069] Therefore, this embodiment provides a method for estimating treatment effects based on counterfactual prediction, such as Figure 1 As shown, including:

[0070] Obtain the treatment information of the tested individuals and the individual characteristic variables that affect the treatment and treatment results, divide the treatment groups according to the treatment information, and obtain the potential factual results corresponding to the treatment groups;

[0071] Among the individual characteristic variables, the mutual information method was used to screen out the adjustment variables that were independent of treatment and related to treatment outcomes, as well as the confounding variables that were related to both treatment and treatment outcomes.

[0072] The mutual information method includes: maximizing the mutual information between the instrumental variable representation and the treatment and minimizing the mutual information between the instrumental variable representation and the treatment result as constraints on the instrumental variable representation learning, maximizing the mutual information between the confounding variable representation and the treatment and maximizing the mutual information between the confounding variable representation and the treatment result as constraints on the confounding variable representation learning, and minimizing the mutual information between the adjustment variable representation and the treatment as a constraint on the adjustment variable representation learning;

[0073] Based on the treatment information of the control and treatment groups, the integrated probability metric was used to balance the characterization of confounding variables;

[0074] Based on the representation of the adjustment variables and the balanced representation of the confounding variables, samples whose similarity with the representation of the tested individual exceeds a set threshold are screened out from the control group, thereby obtaining the counterfactual results of the tested individual;

[0075] The potential factual result is subtracted from the counterfactual result to obtain the estimated treatment effect of the individual being tested.

[0076] Individual treatment effect estimation (ITE) aims to examine whether treatment T affects outcome Y for a specific individual i. represents the set of characteristic variables of individual i, such as age, gender, weight, economic status, social status and genes, where d is the number of characteristic variables and individual i refers to the object (patient) of interest in (clinical) ITE research. represents the treatment information set for individual i. In the case of binary treatment, if , individual i will be assigned to the control group, or if , individual i will be assigned to the treatment group.

[0077] for The control group and Treatment group, with two potential outcomes and , the individual treatment effect estimate for individual i is defined as the underlying factual outcome and counterfactual outcomes The difference between: In observational studies, only the factual outcome is available, and the counterfactual outcome is never observed, so the estimated The challenge also lies in predicting missing counterfactual outcomes.

[0078] Existing counterfactual forecasting methods usually make the following important assumptions.

[0079] Assumption 1 (Stable Individual Intervention Value Assumption): The potential treatment outcome of each individual does not depend on the intervention status of other individuals, and the intervention level is the same for all individuals. For example, when examining the therapeutic effect of a drug, the drug given to all patients should be the same in terms of efficacy. Some patients cannot receive the full amount of active ingredients while others receive half the amount.

[0080] Assumption 2 (Consistency): The potential treatment outcome equals the observed outcome if the actual treatment received is t.

[0081] Assumption 3 (Ignorance): Given the pre-processed individual characteristic variable X, the result Y 0 and Y 1 Independent of treatment assignment. The ignorability assumption makes the ITE estimate identifiable, and this assumption is also known as “no unmeasured confounding variables.”

[0082] Assumption 4 (Positivity): For any set of characteristic variables x, the probability of receiving treatment 0 or 1 is positive, that is, , and x if for some values ​​of X, the treatment assignment is deterministic (i.e. Or 1), there will be missing observations for one treatment group, so it is unlikely to estimate the counterfactual outcome. Therefore, the positivity assumption guarantees that ITE can be estimated.

[0083] The method of this embodiment is described in detail below.

[0084] 1. Representation learning network for decoupled variables.

[0085] Variables X, T, and Y correspond to observed individual characteristic variables, treatments, and outcomes, respectively, and variable e is an unobserved confounding variable that is correlated with both T and Y, such as Figure 2 As shown. Each variable X of each unit can only be the cause of the treatment and the outcome, because the variable is an inherent attribute of the unit. Therefore, each variable X may belong to the confounding variable U, the instrumental variable Z, and the adjustment variable A. Each item of X will be judged to belong to which category of variable. When all items are judged, the variable will be split. In this method, it is assumed that the observed variable X is assumed to be exogenous, so the decomposition representation of the instrumental variable, confounding variable, and adjustment variable is also exogenous. Suppose there is a set of data , N is the number of individuals, and the representations of Z, U, and A are learned from variable X according to the relationship between variable X and T and Y.

[0086] The three basic assumptions that instrumental variables must satisfy are: (i) Relevance: They are related to the treatment, i.e. ; (ii) Exclusive: affects the outcome only indirectly through its effect on the treatment, i.e. ; (iii) Independence: independence from unmeasured confounding variables, i.e. .

[0087] First, a neural network is used to simulate the representation of instrumental variables Z, confounding variables U and adjustment variables A as instrumental variable representations. , confounding variable representation and adjustment variable characterization Since the exogeneity of the variable X is assumed, the learned representation always satisfies the instrumental condition of independence.

[0088] About mutual information. Let A and B be two correlated random variables, and the samples drawn from the distributions of A and B are and b i . Increase (or decrease) the correlation between A and B by maximizing (or minimizing) the mutual information between them. However, in the task of this embodiment, only the sample pairs , and estimating mutual information requires data distribution. Therefore, first, learn the variational distribution To approximate ; Sample pairs with the same index Considered as positive sample pairs, sample pairs with different indexes Treated as negative sample pairs; by maximizing (or minimizing) the variational approximation of the positive sample pairs Variational Approximation to Negative Pairs to increase (or decrease) the correlation between A and B. It can be intuitively understood that when and The correlation between the corresponding sample pairs is and When there is a significant difference in the correlation between the two, the mutual information maximization task is achieved, while the mutual information minimization is to reduce this difference.

[0089] Specifically:

[0090] (1) By maximizing and minimizing the mutual information, the representation of the learning instrument variable Z is constrained to meet the conditions of relevance to the treatment and exclusivity with the outcome.

[0091] (1-1) Learning correlation. Instrumental variable representation is required is related to treatment T. First, we use a neural network with parameters The first variation distribution of Approximate the true conditional distribution , the corresponding log-likelihood loss function is:

[0092] ;

[0093] By minimizing the above log-likelihood loss function, we obtain the optimal variational approximation, and then maximize the instrumental variable representation The mutual information between and treatment is:

[0094] ;

[0095] Where N represents the sample size; For individuals The characteristic variables, For the treatment, For the treatment; logarithm Represents a positive sample pair The conditional log-likelihood of , Represents negative sample pairs The conditional log-likelihood value of , which optimizes the instrumental variable representation of the correlation condition by maximizing the difference between positive and negative sample pairs .

[0096] (1-2) Learning exclusivity. The instrumental variable Z is required to represent the correlation with the outcome Y only through the treatment T and the unobserved error variable e, that is, . Similar to step (1-1), first obtain the second variation distribution , the corresponding log-likelihood loss function is:

[0097] ;

[0098] Then the mutual information between Z and Y that satisfies the condition of T is minimized as follows:

[0099] ;

[0100] in, is the weight of each pair of positive and negative samples; are neural network parameters; For the The results of For the The results of Represents a positive sample pair The conditional log-likelihood of , Represents negative sample pairs The conditional log-likelihood of .

[0101] Different from maximizing mutual information in correlation learning, let the positive samples And negative sample pairs The log-likelihood value of is close to that of and the outcome Y conditionally independent.

[0102] (2) Decomposing and learning representations of confounding factors associated with treatment and outcomes by maximizing mutual information.

[0103] (2-1) First, learn the confounding variable representation associated with treatment T Specifically, using the third variation distribution (i.e. optimal variational approximation) approximate conditional distribution , the corresponding log-likelihood loss function is:

[0104] ;

[0105] Then, maximize the confounding variable representation The mutual information between and treatment T is:

[0106] ;

[0107] in, are neural network parameters; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood value of the positive sample pair And negative sample pairs Used to increase the association between U and T.

[0108] (2-2) Characterization of confounding variables Related to the result Y, using the fourth variation distribution (i.e. optimal variational approximation) approximate conditional distribution , the corresponding log-likelihood loss function is:

[0109] ;

[0110] Maximizing the representation of confounding variables The mutual information between and the result Y is:

[0111] ;

[0112] in, are neural network parameters; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood value of ; minimize the above mutual information so that the confounding variable representation Related to outcome Y.

[0113] (3) Treatment T, outcome Y, and adjustment variable A form a collision structure. According to the general causal structure rule, the starting node in the collision structure is independent of the ending node, that is, Therefore, the above mutual information method is used to find the variables that are independent of treatment T and related to outcome Y, which is the representation of the adjustment variable A. .

[0114] Specifically, using a neural network with parameters The fifth variation distribution of Approximate the true conditional distribution , the corresponding log-likelihood loss function is:

[0115] ;

[0116] Then, minimize the adjustment variable representation The mutual information between and treatment T is:

[0117] ;

[0118] in, is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of .

[0119] In the above process with mutual information constraints, instrumental variables characterize Trying to extract information related to treatment T and conditionally independent of outcome Y, confounding variable representation is encouraged to be related to both T and Y, and the adjustment variable represents It is unrelated to T, and thus the instrumental variable representation, confounding variable representation and adjustment variable representation are decomposed through mutual information.

[0120] 2. Balanced distribution.

[0121] Although instrumental variables can help estimate treatment effects when confounding variables are unobservable, they can introduce bias when all confounding variables are observable. Therefore, the input of this embodiment excludes instrumental variables. Although adjustment variables have an impact on the results like confounding variables, they do not produce selection bias. Therefore, this embodiment does not balance the representation of adjustment variables, but only balances the confounding variables, connects the representation of adjustment variables and the representation of confounding variables, and the shared base layer enables them to effectively share information across each treatment representation in the head network. Figure 3 shown.

[0122] Integral Probability Metric (IPM) is a type of metric between probability distributions. In order to more accurately balance the distribution of the treatment group and the control group in the representation space, an additional regularization term is added to the model loss to correct the distribution distance between the treatment group and the control group. This distribution distance is the IPM, which can be used with the Wasserstein distance to measure the difference between the two distributions.

[0123] For the definition in The two probability density functions p and q on , and the function The function family G of , has:

[0124] .

[0125] The integral probability metric is symmetric and obeys the triangle inequality, and naturally satisfies For a sufficiently rich family of functions G, we also have , at this time That’s a real measure.

[0126] Compared with confounding variables, adjustment variables do not need to be balanced because the correlation with t was previously removed using mutual information, so only the representation and treatment of the confounding variables are needed as inputs to the IPM. Minimizing the IPM and adding the relevant loss can achieve the balance of the confounding variables:

[0127] ;

[0128] in, is the treatment information of the control group, is the treatment information of the treatment group;

[0129] The relevant losses include:

[0130] Each variational distribution approximates the corresponding conditional distribution, and the total log-likelihood loss function is obtained by combining the log-likelihood loss functions of all variational approximations: : .

[0131] Note that each loss term in the above equation optimizes the corresponding parameter and they do not affect each other. Then, all mutual information constraints are combined. Therefore, the balanced total loss function for:

[0132] ;

[0133] in, , , and is a hyperparameter tuned on a held-out validation set.

[0134] 3. Predict counterfactual results based on collaborative filtering methods.

[0135] For the prediction of counterfactual outcomes, the adjusted variable representation and the balanced confounding variable representation are connected to obtain the individual latent representation , through the learned individual latent representation , the counterfactual outcome of individual i is estimated through collaborative filtering methods.

[0136] The collaborative filtering algorithm is a recommendation algorithm that discovers the user's preferences based on the mining of the user's historical behavior data, and predicts the products that the user may like for recommendation. User-based collaborative filtering means that when the target user needs personalized recommendations, other users with similar interests can be found first, and then items that the user likes but the target user has not heard of can be recommended. The essence of collaborative filtering is to consider the results of users with similar interests to oneself, so this embodiment predicts counterfactual results with the help of the recommendation system idea.

[0137] There are many methods for screening similar samples in the collaborative filtering method. In this embodiment, the K nearest neighbor algorithm is used to find patient samples with potential characteristics similar to the query sample. These similar samples must be assigned to a treatment group different from the query sample, that is, samples existing in the control group.

[0138] Specifically, the data are divided into several groups according to different treatments, and only the individual similarities between different groups are considered. , and perform the K nearest neighbor algorithm. For simplicity, the Gower similarity coefficient is used to measure the similarity between a pair of patient samples. After that, the individual result with the highest similarity to the tested individual is found according to KNN as the counterfactual result , and the individual is in the control group. Finally, using the potential factual outcome (observations that come with the observation data) and counterfactual results Subtract and get the estimated result of individual treatment effect: .

[0139] In this embodiment, we focus on personalized counterfactual outcome prediction, consider individual characteristics, and propose a new model to use observed data for ITE estimation. Specifically, the potential representations related to the outcome are sorted out from the input patient characteristics. In order to further eliminate selection bias and improve the robustness of treatment effect estimation, integral probability metric regularization is added to the model to reduce the influence of confounding variables. Finally, the potential results are inferred by collaborative filtering based on the learned potential representation. Due to the flexibility of neural networks as function approximators, various modeling assumptions can be combined and tested. Finally, the model performance is evaluated on semi-simulated and real data sets, and the electronic health record data collected in the UKB database are used to study the effect of montelukast treatment on Alzheimer's disease, providing a new method for further providing personalized medication of montelukast to patients.

[0140] Experimental verification.

[0141] It is usually difficult to evaluate causal inference algorithms because counterfactual results are often omitted. Without counterfactual results, the true ITE is unknown. Therefore, most previous works use synthetic or semi-synthetic datasets for experiments. This embodiment uses a semi-synthetic dataset (Infant Health and Development Program, IHDP) and a real dataset to evaluate the method of this embodiment. In addition, the model of this embodiment is evaluated on a real-world clinical dataset, which comes from Electronic Health Records (EHR).

[0142] The IHDP generates 100 undersampled values ​​(for the accuracy of splitting covariates) and is evaluated repeatedly. In this dataset, the treatment is a specialist home visit and the outcome is the infant's future cognitive test score. The number of covariates is 25, which are some information about the infants and their mothers. Since the IHDP has a true value ITE, the precision in estimation of heterogeneous effects (PEHE) can be used to assess the accuracy of predicting ITE.

[0143] The real dataset consists of randomized controlled trials (RCTs) and observational experiments. In this dataset, the treatment refers to whether a person participates in vocational training, and the outcome represents whether a person has a job in a certain year. Obviously, both the treatment and the outcome are binary variables. The covariates contain some information about the job seekers, such as age, education level, etc. Because there are no counterfactual results in this real dataset, the true value of ITE is unknown. Some studies have proposed policy risk criteria to evaluate causal inference algorithms.

[0144] With the rapid development of hospital information systems, a large number of electronic health records (EHRs) have been generated. Obviously, it is meaningful to select appropriate drug treatment strategies for patients based on their clinical conditions and expected treatment outcomes. The purpose of this case study is to analyze the effect of treatment strategies. First, electronic health record (EHR) data is collected; then data cleaning is performed to handle missing values, outliers, and standardize data formats; then, feature engineering is performed to select features related to treatment effects, which may include patients' clinical indicators, medical history, genetic information, etc. Potential confounding variables that affect study treatment exposure and Alzheimer's disease (AD) onset include age, gender, race, and comorbidities at the start of follow-up. The effect of Montelukast treatment on Alzheimer's disease is explored, using the onset of AD as an implicit measure of increased AD risk level as the outcome, and the treatment is montelukast and placebo pills. The performance of the proposed model is evaluated on the EHR dataset to verify its effectiveness, and ultimately such an ITE estimation service is deployed in a real clinical setting. Specifically, the model is trained to learn the relationship between patient characteristics, treatment, and outcomes on the collected observational dataset. For the test patients, the features are fed into the trained model and the output is the potential outcome of whether or not to receive treatment. The treatment with a better potential outcome is then recommended to the clinician.

[0145] It should be noted that all data is obtained in compliance with laws and regulations and user consent, and the data is used legally.

[0146] Example 2

[0147] This embodiment provides a treatment effect estimation system based on counterfactual prediction, including:

[0148] An acquisition module is configured to acquire treatment information of the individual being tested and individual characteristic variables that affect treatment and treatment results, divide treatment groups according to the treatment information, and acquire potential fact results corresponding to the treatment groups;

[0149] A representation learning module is configured to use a mutual information method to screen out adjustment variable representations that are independent of treatment and related to treatment outcomes, and confounding variable representations that are related to both treatment and treatment outcomes from individual characteristic variables; the mutual information method includes: maximizing the mutual information between the instrumental variable representation and the treatment and minimizing the mutual information between the instrumental variable representation and the treatment outcome as constraints on instrumental variable representation learning, maximizing the mutual information between the confounding variable representation and the treatment and maximizing the mutual information between the confounding variable representation and the treatment outcome as constraints on confounding variable representation learning, and minimizing the mutual information between the adjustment variable representation and the treatment as a constraint on adjustment variable representation learning;

[0150] A balanced distribution module is configured to balance the confounding variable representation using an integrated probability metric based on the treatment information of the control group and the treatment group;

[0151] The counterfactual prediction module is configured to screen out samples in the control group whose similarity with the representation of the tested individual exceeds a set threshold according to the representation of the adjustment variable and the representation of the balanced confounding variable, so as to obtain the counterfactual result of the tested individual;

[0152] The estimation module is configured to obtain an estimated result of the treatment effect of the tested individual by subtracting the potential factual result from the counterfactual result.

[0153] In this embodiment, the constraints on instrumental variable representation learning include: using variational distribution to approximate the true conditional distribution by minimizing the first log-likelihood loss function After obtaining the optimal variational approximation, maximize the mutual information between the instrumental variable representation and the treatment:

[0154] ;

[0155] ;

[0156] By minimizing the second log-likelihood loss function After obtaining the optimal variational approximation, minimize the mutual information between the instrumental variable representation and the treatment outcome:

[0157] ;

[0158] ;

[0159] Where N is the sample size; For individuals The characteristic variables, For the treatment, For the treatment; For the The results of For the The results of , All are neural network parameters; is the weight of each pair of positive and negative samples; It is characterized by instrumental variables; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of ; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of .

[0160] In this embodiment, the constraints on the learning of confounding variable representations include: using variational distribution to approximate the true conditional distribution, by minimizing the third log-likelihood loss function After obtaining the optimal variational approximation, maximize the mutual information between the confounding variable representation and the treatment:

[0161] ;

[0162] ;

[0163] By minimizing the fourth log-likelihood loss function After obtaining the optimal variational approximation, maximize the mutual information between the confounding variable representation and the treatment outcome:

[0164] ;

[0165] ;

[0166] Where N is the sample size; For individuals The characteristic variables, For the treatment, For the treatment; For the The results of For the The results of , All are neural network parameters; Characterize confounding variables; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of , is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of .

[0167] In this embodiment, the constraints on the learning of the adjustment variable representation include: using the variational distribution to approximate the true conditional distribution by minimizing the fifth log-likelihood loss function After obtaining the optimal variational approximation, minimize the mutual information between the adjusted variable representation and the treatment:

[0168] ;

[0169] ;

[0170] Where N is the sample size; For individuals The characteristic variables, For the treatment, For the treatment; are neural network parameters; To adjust the variable characterization; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of .

[0171] In this embodiment, the confounding variable representation and the treatment information of the control group and the treatment group are used as the integral probability metric The input is characterized by balanced confounding variables; specifically:

[0172] ;

[0173] in, Characterize confounding variables; For individuals characteristic variables; is the treatment information of the control group, is the treatment information of the treatment group.

[0174] In this embodiment, in the process of balancing the confounding variable representation, the relevant loss includes: adding the first to fifth log-likelihood loss functions to obtain the total log-likelihood loss function , and then combine all mutual information constraints to get the balanced total loss function: :

[0175] ;

[0176] in, , , and are all hyperparameters.

[0177] In this embodiment, the process of predicting the counterfactual results of the tested individual includes: connecting the adjusted variable representation and the balanced confounding variable representation to obtain the individual latent representation, dividing the individual into several groups according to different treatments, considering the individual similarities between different groups, using the K nearest neighbor algorithm for the individual latent representation, and finding the result with the highest similarity to the tested individual as the counterfactual result.

[0178] It should be noted that the above modules correspond to the steps described in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer executable instructions.

[0179] In further embodiments, there is also provided:

[0180] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, it will not be described in detail here.

[0181] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0182] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0183] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is completed.

[0184] The method in Example 1 can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here.

[0185] A computer program product includes a computer program, and when the computer program is executed by a processor, the method described in embodiment 1 is implemented.

[0186] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer executable instructions, such as instructions included in a program module, which are executed in a device on a real or virtual processor of the target to perform the process / method as described above. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided between program modules as needed. Machine executable instructions for program modules can be executed in local or distributed devices. In distributed devices, program modules can be located in local and remote storage media.

[0187] The computer program code for implementing the method of the present invention can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the computer or other programmable data processing device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.

[0188] In the context of the present invention, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, etc. Examples of signals may include electrical, optical, radio, acoustic or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0189] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0190] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A method for estimating treatment effects based on counterfactual predictions, It is characterized in that include: Obtain the treatment information of the tested individuals and the individual characteristic variables that affect the treatment and treatment results, divide the treatment groups according to the treatment information, and obtain the potential factual results corresponding to the treatment groups; Among the individual characteristic variables, the mutual information method was used to screen out the adjustment variables that were independent of treatment and related to treatment outcomes, as well as the confounding variables that were related to both treatment and treatment outcomes. The mutual information method includes: maximizing the mutual information between the instrumental variable representation and the treatment and minimizing the mutual information between the instrumental variable representation and the treatment result as constraints on the instrumental variable representation learning, maximizing the mutual information between the confounding variable representation and the treatment and maximizing the mutual information between the confounding variable representation and the treatment result as constraints on the confounding variable representation learning, and minimizing the mutual information between the adjustment variable representation and the treatment as a constraint on the adjustment variable representation learning; Based on the treatment information of the control and treatment groups, the integrated probability metric was used to balance the characterization of confounding variables; Based on the representation of the adjustment variables and the balanced representation of the confounding variables, samples whose similarity with the representation of the tested individual exceeds a set threshold are screened out from the control group, thereby obtaining the counterfactual results of the tested individual; Subtract the potential factual result from the counterfactual result to obtain the estimated treatment effect of the individual being tested; Representation learning networks for disentangled variables; Variables X, T and Y correspond to observed individual characteristic variables, treatments and outcomes respectively, and variable e is an unobserved confounding variable that is related to both T and Y; each variable X of each unit can only be the cause of treatment and outcome, because the variable is an inherent attribute of the unit; each variable X may belong to confounding variable U, instrumental variable Z and adjustment variable A; each item of X will be judged to which category of variable it belongs; when all items are judged, the variable will be divided; in this method, it is assumed that the observed variable X is exogenous, and the decomposition representation of instrumental variables, confounding variables and adjustment variables is also exogenous; assuming there is a set of data , N is the number of individuals, and the representation of Z, U and A is learned from variable X according to the relationship between variable X and T and Y; The three basic assumptions that instrumental variables must satisfy are: (i) relevance: related to the treatment, ; (ii) Exclusive: affects the outcome only indirectly through its effect on treatment, ; (iii) Independence: independence from unmeasured confounding variables, ; Use neural networks to simulate the representation of instrumental variables Z, confounding variables U and adjustment variables A as instrumental variable representations , confounding variable representation and adjustment variable characterization ; Since the exogeneity of variable X is assumed, and the learned representation always satisfies the instrumental condition of independence; Regarding mutual information; let A and B be two correlated random variables, and the samples obtained by sampling from the distributions of A and B are and b i ; Increase / decrease the correlation between A and B by maximizing / minimizing the mutual information between them; Sample pair , estimating mutual information requires data distribution; learning variational distribution To approximate ; Sample pairs with the same index Considered as positive sample pairs, sample pairs with different indexes Treated as negative sample pairs; by maximizing / minimizing the variational approximation of positive sample pairs Variational Approximation to Negative Pairs to increase / decrease the correlation between A and B; it can be intuitively understood that when and The correlation between the corresponding sample pairs is and When there is a significant difference in the correlation between them, the mutual information maximization task is achieved, while the mutual information minimization is to reduce this difference; (1) Constrain the representation of the learning instrument variable Z by maximizing and minimizing the mutual information to satisfy the conditions of relevance to the treatment and exclusivity with the outcome; (1-1) Learning correlation; requiring instrumental variables to represent Related to treatment T; using neural network parameters The first variation distribution of Approximate the true conditional distribution , the corresponding log-likelihood loss function is: ; By minimizing the above log-likelihood loss function, we obtain the optimal variational approximation, and then maximize the instrumental variable representation The mutual information between and treatment is: ; Where N represents the sample size; For individuals The characteristic variables, For the treatment, For the treatment; logarithm Represents a positive sample pair The conditional log-likelihood of , Represents negative sample pairs The conditional log-likelihood value of , which optimizes the instrumental variable representation of the correlation condition by maximizing the difference between positive and negative sample pairs ; (1-2) Learning exclusivity: requiring the instrumental variable Z to represent the correlation with the outcome Y only through the treatment T and the unobserved error variable e, ; Get the second variation distribution , the corresponding log-likelihood loss function is: ; Then the mutual information between Z and Y that satisfies the condition of T is minimized as follows: ; in, is the weight of each pair of positive and negative samples; are neural network parameters; For the The results of For the The results of Represents a positive sample pair The conditional log-likelihood of , Represents negative sample pairs The conditional log-likelihood of ; Different from maximizing mutual information in correlation learning, let the positive samples And negative sample pairs The log-likelihood value of is close to that of and the outcome Y conditionally independent; (2) decomposing and learning representations of confounders associated with treatment and outcomes by maximizing mutual information; (2-1) Learning the representation of confounding variables related to treatment T ; Specifically, using the third variation distribution Approximate conditional distribution , the corresponding log-likelihood loss function is: ; Maximizing the representation of confounding variables The mutual information between and treatment T is: ; in, are neural network parameters; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood value of the positive sample pair And negative sample pairs It is used to increase the association between U and T; (2-2) Characterization of confounding variables Related to the result Y, using the fourth variation distribution Approximate conditional distribution , the corresponding log-likelihood loss function is: ; Maximizing the representation of confounding variables The mutual information between and the result Y is: ; in, are neural network parameters; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood value of ; maximize the above mutual information so that the confounding variable representation Related to outcome Y; (3) Treatment T, outcome Y, and adjustment variable A form a collision structure. According to the general causal structure rules, the starting node in the collision structure is independent of the ending node. , using the above mutual information method to find the variables that are independent of treatment T and related to outcome Y, which is the representation of the adjustment variable A ; Using neural network parameters The fifth variation distribution of Approximate the true conditional distribution , the corresponding log-likelihood loss function is: ; Minimize the Adjustment Variable Characterization The mutual information between and treatment T is: ; in, is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of ; In the above process with mutual information constraints, instrumental variables characterize Trying to extract information related to treatment T and conditionally independent of outcome Y, confounding variable representation is encouraged to be related to both T and Y, and the adjustment variable represents It is unrelated to T, and thus the instrumental variable representation, the confounding variable representation, and the adjustment variable representation are decomposed through mutual information; Balanced distribution; The integral probability metric is a type of metric between probability distributions. In order to balance the distribution of the treatment group and the control group in the representation space, an additional regularization term is added to the model loss to correct the distribution distance between the treatment group and the control group. This distribution distance is the IPM, and the Wasserstein distance is used to measure the difference between the two distributions. For the definition in The two probability density functions p and q on , and the function The function family G of , has: ; The integral probability metric is symmetric and obeys the triangle inequality, and naturally satisfies conditions; for a sufficiently rich family of functions G, , at this time It is a true measure; Compared with confounding variables, adjustment variables do not need to be balanced because the correlation with t was previously removed using mutual information, so only the representation and treatment of the confounding variables are needed as inputs to the IPM. Minimizing the IPM and adding the relevant loss can achieve the balance of the confounding variables: ; in, are individuals assigned to the control group. are the individuals assigned to the treatment group; The relevant losses include: each variational distribution will approximate the corresponding conditional distribution, and the log-likelihood loss function of all variational approximations is combined to obtain the total log-likelihood loss function : .

2. A method for estimating treatment effects based on counterfactual prediction as claimed in claim 1, It is characterized in that The process of predicting the counterfactual results of the tested individuals includes: connecting the adjusted variable representation and the balanced confounding variable representation to obtain the individual latent representation, dividing the individuals into several groups according to different treatments, considering the individual similarities between different groups, using the K nearest neighbor algorithm for the individual latent representation, and finding the result with the highest similarity to the tested individual as the counterfactual result.

3. A treatment effect estimation system based on counterfactual prediction, It is characterized in that include: An acquisition module is configured to acquire treatment information of the individual being tested and individual characteristic variables that affect treatment and treatment results, divide treatment groups according to the treatment information, and acquire potential fact results corresponding to the treatment groups; A representation learning module is configured to use a mutual information method to screen out adjustment variable representations that are independent of treatment and related to treatment outcomes, and confounding variable representations that are related to both treatment and treatment outcomes from individual characteristic variables; the mutual information method includes: maximizing the mutual information between the instrumental variable representation and the treatment and minimizing the mutual information between the instrumental variable representation and the treatment outcome as constraints on instrumental variable representation learning, maximizing the mutual information between the confounding variable representation and the treatment and maximizing the mutual information between the confounding variable representation and the treatment outcome as constraints on confounding variable representation learning, and minimizing the mutual information between the adjustment variable representation and the treatment as a constraint on adjustment variable representation learning; A balanced distribution module is configured to balance the confounding variable representation using an integrated probability metric based on the treatment information of the control group and the treatment group; The counterfactual prediction module is configured to screen out samples in the control group whose similarity with the representation of the tested individual exceeds a set threshold according to the representation of the adjustment variable and the representation of the balanced confounding variable, so as to obtain the counterfactual result of the tested individual; An estimation module, configured to obtain an estimated treatment effect of the individual being tested by subtracting a potential factual result from a counterfactual result; Representation learning networks for disentangled variables; Variables X, T and Y correspond to observed individual characteristic variables, treatments and outcomes respectively, and variable e is an unobserved confounding variable that is related to both T and Y; each variable X of each unit can only be the cause of treatment and outcome, because the variable is an inherent attribute of the unit; each variable X may belong to confounding variable U, instrumental variable Z and adjustment variable A; each item of X will be judged to which category of variable it belongs; when all items are judged, the variable will be divided; in this method, it is assumed that the observed variable X is exogenous, and the decomposition representation of instrumental variables, confounding variables and adjustment variables is also exogenous; assuming there is a set of data , N is the number of individuals, and the representations of Z, U, and A are learned from variable X according to the relationship between variable X and T and Y; The three basic assumptions that instrumental variables must satisfy are: (i) relevance: related to the treatment, ; (ii) Exclusive: affects the outcome only indirectly through its effect on treatment, ; (iii) Independence: independence from unmeasured confounding variables, ; Use neural networks to simulate the representation of instrumental variables Z, confounding variables U and adjustment variables A as instrumental variable representations , confounding variable representation and adjustment variable characterization ; Since the exogeneity of variable X is assumed, and the learned representation always satisfies the instrumental condition of independence; Regarding mutual information; let A and B be two correlated random variables, and the samples obtained by sampling from the distributions of A and B are and b i ; Increase / decrease the correlation between A and B by maximizing / minimizing the mutual information between them; Sample pair , estimating mutual information requires data distribution; learning variational distribution To approximate ; Sample pairs with the same index Considered as positive sample pairs, sample pairs with different indexes Treated as negative sample pairs; by maximizing / minimizing the variational approximation of positive sample pairs Variational Approximation to Negative Pairs to increase / decrease the correlation between A and B; it can be intuitively understood that when and The correlation between the corresponding sample pairs is and When there is a significant difference in the correlation between them, the mutual information maximization task is achieved, while the mutual information minimization is to reduce this difference; (1) Constrain the representation of the learning instrument variable Z by maximizing and minimizing the mutual information to satisfy the conditions of relevance to the treatment and exclusivity with the outcome; (1-1) Learning correlation; requiring instrumental variables to represent Related to treatment T; using neural network parameters The first variation distribution of Approximate the true conditional distribution , the corresponding log-likelihood loss function is: ; By minimizing the above log-likelihood loss function, we obtain the optimal variational approximation, and then maximize the instrumental variable representation The mutual information between and treatment is: ; Where N represents the sample size; For individuals The characteristic variables, For the treatment, For the treatment; logarithm Represents a positive sample pair The conditional log-likelihood of , Represents negative sample pairs The conditional log-likelihood value of , which optimizes the instrumental variable representation of the correlation condition by maximizing the difference between positive and negative sample pairs ; (1-2) Learning exclusivity: requiring the instrumental variable Z to represent the correlation with the outcome Y only through the treatment T and the unobserved error variable e, ; Get the second variation distribution , the corresponding log-likelihood loss function is: ; Then the mutual information between Z and Y that satisfies the condition of T is minimized as follows: ; in, is the weight of each pair of positive and negative samples; are neural network parameters; For the The results of For the The results of Represents a positive sample pair The conditional log-likelihood of , Represents negative sample pairs The conditional log-likelihood of ; Different from maximizing mutual information in correlation learning, let the positive samples And negative sample pairs The log-likelihood value of is close to that of and the outcome Y conditionally independent; (2) decomposing and learning representations of confounders associated with treatment and outcomes by maximizing mutual information; (2-1) Learning the representation of confounding variables related to treatment T ; Specifically, using the third variation distribution Approximate conditional distribution , the corresponding log-likelihood loss function is: ; Maximizing the representation of confounding variables The mutual information between and treatment T is: ; in, are neural network parameters; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood value of the positive sample pair And negative sample pairs It is used to increase the association between U and T; (2-2) Characterization of confounding variables Related to the result Y, using the fourth variation distribution Approximate conditional distribution , the corresponding log-likelihood loss function is: ; Maximizing the representation of confounding variables The mutual information between and the result Y is: ; in, are neural network parameters; is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood value of ; maximize the above mutual information so that the confounding variable representation Related to outcome Y; (3) Treatment T, outcome Y, and adjustment variable A form a collision structure. According to the general causal structure rules, the starting node in the collision structure is independent of the ending node. , using the above mutual information method to find the variables that are independent of treatment T and related to outcome Y, which is the representation of the adjustment variable A ; Using neural network parameters The fifth variation distribution of Approximate the true conditional distribution , the corresponding log-likelihood loss function is: ; Minimize the Adjustment Variable Characterization The mutual information between and treatment T is: ; in, is a positive sample pair The conditional log-likelihood of , is a negative sample pair The conditional log-likelihood of ; In the above process with mutual information constraints, instrumental variables characterize Trying to extract information related to treatment T and conditionally independent of outcome Y, confounding variable representation is encouraged to be related to both T and Y, and the adjustment variable represents It is unrelated to T, and thus the instrumental variable representation, the confounding variable representation, and the adjustment variable representation are decomposed through mutual information; Balanced distribution; The integral probability metric is a type of metric between probability distributions. In order to balance the distribution of the treatment group and the control group in the representation space, an additional regularization term is added to the model loss to correct the distribution distance between the treatment group and the control group. This distribution distance is the IPM, and the Wasserstein distance is used to measure the difference between the two distributions. For the definition in The two probability density functions p and q on , and the function The function family G of , has: ; The integral probability metric is symmetric and obeys the triangle inequality, and naturally satisfies conditions; for a sufficiently rich family of functions G, , at this time It is a true measure; Compared with confounding variables, adjustment variables do not need to be balanced because the correlation with t was previously removed using mutual information, so only the representation and treatment of the confounding variables are needed as inputs to the IPM. Minimizing the IPM and adding the relevant loss can achieve the balance of the confounding variables: ; in, are individuals assigned to the control group. are the individuals assigned to the treatment group; The relevant losses include: each variational distribution will approximate the corresponding conditional distribution, and the log-likelihood loss function of all variational approximations is combined to obtain the total log-likelihood loss function : .

4. An electronic device, It is characterized in that The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 2 is completed.

5. A computer-readable storage medium, It is characterized in that Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1-2.

Citation Information

Patent Citations

  • Personalized adverse drug reaction prediction method, system and device and medium

    CN111863281A

  • Diuretic dosage reasoning equipment based on deep representation learning and reinforcement learning

    CN112329921A

  • Anti-fact prediction model data processing method and device, equipment and storage medium

    CN112988851A

  • Multi-party mixed data tracing method and system based on potential group tool variables

    CN115188484A

  • Real-world-oriented multi-SNP-site mediated antipsychotic drug curative effect prediction and accurate decision-making system

    CN116543922A