E STIMATING COUNTERFACTUAL TREATMENT OUTCOMES OVER TIME THROUGH ADVERSARIALLY BALANCED REPRESENTATIONS
A BSTRACT
Identifying when to give treatments to patients and how to select among multiple treatments over time are important medical problems with a few existing solutions.
In this paper, we introduce the Counterfactual Recurrent Network (CRN), a novel sequence-to-sequence model that leverages the increasingly available patient observational data to estimate treatment effects over time and answer such medical questions.
To handle the bias from time-varying confounders, covariates affecting the treatment assignment policy in the observational data, CRN uses domain adversarial training to build balancing representations of the patient history.
At each timestep, CRN constructs a treatment invariant representation which removes the association between patient history and treatment assignments and thus can be reliably used for making counterfactual predictions.
On a simulated model of tumour growth, with varying degree of time-dependent confounding, we show how our model achieves lower error in estimating counterfactuals and in choosing the correct treatment and timing of treatment than current state-of-the-art methods.
I NTRODUCTION
As clinical decision-makers are often faced with the problem of choosing between treatment alternatives for patients, reliably estimating their effects is paramount.
While clinical trials represent the gold standard for causal inference, they are expensive, have a few patients and narrow inclusion criteria (Booth & Tannock, 2014).
Leveraging the increasingly available observational data about patients, such as electronic health records, represents a more viable alternative for estimating treatment effects.
A large number of methods have been proposed for performing causal inference using observational data in the static setting (Johansson et al., 2016; Shalit et al., 2017; Alaa & van der Schaar, 2017;
Li & Fu, 2017; Yoon et al., 2018; Alaa & van der Schaar, 2018; Yao et al., 2018) and only a few methods address the longitudinal setting (Xu et al., 2016; Roy et al., 2016; Soleimani et al., 2017;
Schulam & Saria, 2017; Lim et al., 2018).
However, estimating the effects of treatments over time poses unique opportunities such as understanding how diseases evolve under different treatment plans, how individual patients respond to medication over time, but also which are optimal timings for assigning treatments, thus providing new tools to improve clinical decision support systems.
The biggest challenge when estimating the effects of time-dependent treatments from observational data involves correctly handling the time-dependent confounders: patient covariates that are affected by past treatments which then inﬂuence future treatments and outcomes (Platt et al., 2009).
For instance, consider that treatment A is given when a certain patient covariate (e.g. white blood cell [Table] [Figure] [Table]
[Figure]
[Table]
_base64="(null)">(null)</latexit> ¯ H (2) t <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> ¯ H (3) t <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> [Figure] count) has been outside of normal range values for several consecutive timesteps. Suppose also that this patient covariate was itself affected by the past administration of treatment
B.
If these patients are more likely to die, without adjusting for the time-dependent confounding (e.g. the changes in the white blood cell count over time), we will incorrectly conclude that treatment A is harmful to patients.
Moreover, estimating the effect of a different sequence of treatments on the patient outcome would require not only adjusting for the bias at the current step (in treatment A), but also for the bias introduced by the previous application of treatment B.
Existing methods for causal inference in the static setting cannot be applied in this longitudinal setting since they are designed to handle the cross-sectional set-up, where the treatment and outcome depend only on a static value of the patient covariates.
If we consider again the above example, these methods would not be able to model how the changes in patient covariates over time affect the assignment of treatments and they would also not be able to estimate the effect of a sequence of treatments on the patient outcome (e.g. sequential application of treatment A followed by treatment B).
Different models that can handle these temporal dependencies in the observational data and varying-length patient histories are needed for estimating treatment effects over time.
Time-dependent confounders are present in observational data because doctors follow policies: the history of the patients’ covariates and the patients’ response to past treatments are used to decide future treatments (Mansournia et al., 2012).
The direct use of supervised learning methods will be biased by the treatment policies present in the observational data and will not be able to correctly estimate counterfactuals for different treatment assignment policies.
Standard methods for adjusting for time-varying confounding and estimating the effects of timevarying exposures are based on ideas from epidemiology.
The most widely used among these are
Marginal Structural Models (MSMs) (Robins et al., 2000; Mansournia et al., 2012) which use the inverse probability of treatment weighting (IPTW) to adjust for the time-dependent confounding bias.
Through IPTW, MSMs create a pseudo-population where the probability of treatment does not depend on the time-varying confounders.
However, MSMs are not robust to model misspeciﬁcation in computing the IPTWs.
MSMs can also give high-variance estimates due to extreme weights; computing the IPTW involves dividing by probability of assigning a treatment conditional on patient history which can be numerically unstable if the probability is small.
We introduce the Counterfactual Recurrent Network (CRN), a novel sequence-to-sequence architecture for estimating treatment effects over time.
CRN leverages recent advances in representation learning (Bengio et al., 2012) and domain adversarial training (Ganin et al., 2016) to overcome the problems of existing methods for causal inference over time.
Our main contributions are as follows.
Treatment invariant representations over time.
CRN constructs treatment invariant representations at each timestep in order to break the association between patient history and treatment assignment and thus removes the bias from time-dependent confounders.
For this, CRN uses domain adversarial training (Ganin et al., 2016;
Li et al., 2018; Sebag et al., 2019) to trade-off between build- ing this balancing representation and predicting patient outcomes.
We show that these representations remove the bias from time-varying confounders and can be reliably used for estimating counterfactual outcomes.
This represents the ﬁrst work that introduces ideas from domain adaptation to the area of estimating treatment effects over time.
In addition, by building balancing representations, we propose a novel way of removing the bias introduced by time-varying confounders.
Counterfactual estimation of future outcomes.
To estimate counterfactual outcomes for treatment plans (and not just single treatments), we integrate the domain adversarial training procedure as part of a sequence-to-sequence architecture.
CRN consists of an encoder network which builds treatment invariant representations of the patient history that are used to initialize the decoder.
The decoder network estimates outcomes under an intended sequence of future treatments, while also updating the balanced representation.
By performing counterfactual estimation of future treatment outcomes, CRN can be used to answer critical medical questions such as deciding when to give treatments to patients, when to start and stop treatment regimes, and also how to select from multiple treatments over time.
We illustrate in Figure 1 the applicability of our method in choosing optimal cancer treatments.
In our experiments, we evaluate CRN in a realistic set-up using a model of tumour growth (Geng et al., 2017).
We show that CRN achieves better performance in predicting counterfactual outcomes, but also in choosing the right treatment and timing of treatment than current state-of-the-art methods.
R ELATED WORK
We focus on methods for estimating treatment effects over time and for building balancing representations for causal inference.
A more in-depth review of related work is in Appendix A.
Treatment effects over time.
Standard methods for estimating the effects of time-varying exposures were ﬁrst developed in the epidemiology literature and include the g-computation formula, Structural
Nested Models and Marginal Structural Models (MSMs) (Robins, 1986; 1994; Robins et al., 2000;
Robins & Hernán, 2008).
Originally, these methods have used predictors performing logistic/linear regression which makes them unsuitable for handling complex time-dependencies (Hernán et al., 2001; Mansournia et al., 2012; Mortimer et al., 2005).
To address these limitations, methods that use Bayesian non-parametrics or recurrent neural networks as part of these frameworks have been proposed.
(Xu et al., 2016; Roy et al., 2016; Lim et al., 2018).
To begin with, Xu et al.
(2016) use Gaussian processes to model discrete patient outcomes as a generalized mixed-effects model and uses the g -computation method to handle time-varying confounders.
Soleimani et al.
(2017) extend the approach in Xu et al.
(2016) to the continuous time-setting and model treatment responses using linear time-invariant dynamical systems.
Roy et al.
(2016) use Dirichlet and Gaussian processes to model the observational data and estimate the IPTW in Marginal Structural Models.
Schulam & Saria (2017) build upon work from Lok et al.
Arjas & Parner (2004) and use marked point processes and Gaussian processes to learn causal effects in continuous-time data.
These Bayesian non-parametric methods make strong assumptions about model structure and consequently cannot handle well heterogeneous treatment effects arising from baseline variables (Soleimani et al.,
; Schulam & Saria, 2017) and multiple treatment outcomes (Xu et al., 2016; Schulam & Saria, 2017).
The work most related to ours is the one of Lim et al. (2018) which improves on the standard MSMs by using recurrent neural networks to estimate the inverse probability of treatment weights (IPTWs).
Lim et al.
(2018) introduces Recurrent Marginal Structural Networks (RMSNs) which also use a sequence-to-sequence deep learning architecture to forecast treatment responses in a similar fashion to our model.
However, RMSNs require training additional RNNs to estimate the propensity weights and does not overcome the fundamental problems with IPTWs, such as the high-variance of the weights.
Conversely, CRN takes advantage of the recent advances in machine learning, in particular, representation learning to propose a novel way of handling time-varying confounders.
Balancing representations for treatment effect estimation.
Balancing the distribution of control and treated groups has been used for counterfactual estimation in the static setting.
The methods proposed in the static setting for balancing representations are based on using discrepancy measures in the representation space between treated and untreated patients, which do not generalize to multiple treatments (Johansson et al., 2016; Shalit et al., 2017; Li & Fu, 2017; Yao et al., 2018).
Moreover, due to the sequential assignment of treatments in the longitudinal setting, and due to the change of patient covariates over time according to previous treatments, the methods for the static setting are not directly applicable to the time-varying setting (Hernán et al., 2000; Mansournia et al., 2012).
P ROBLEM FORMULATION
Consider an observational dataset D = (cid:8) { x ( i ) t , a ( i ) t , y ( i ) t +1 } T ( i ) t =1 ∪{ v ( i ) } (cid:9) N i =1 consisting of information about N independent patients.
For each patient ( i ) , we observe time-dependent covariates
X ( i ) t ∈ X t , treatment received A ( i ) t ∈ { A 1 , . . .
A K } =
A and outcomes Y ( i ) t
+1 ∈
Y t +1 for T ( i ) discrete timesteps.
The patient can also have baseline covariates
V ( i ) ∈
V such as gender and genetic information.
Note that the outcome Y ( i ) t +1 will be part of the observed covariates
X ( i ) t +1 .
For simplicity, the patient superscript ( i ) will be omitted unless explicitly needed.
We adopt the potential outcomes framework proposed by (Neyman, 1923; Rubin, 1978) and extended by (Robins & Hernán, 2008) to account for time-varying treatments.
Let Y [¯ a ] be the potential outcomes, either factual or counterfactual, for each possible course of treatment ¯ a .
Let ¯
H t = ( ¯ X t , ¯ A t − 1 , V ) represent the history of the patient covariates ¯ X t =
( X 1 , . . .
, X t ) , treatment assignments ¯ A t =
( A 1 , . . . , A t ) and static features V .
We want to estimate:
[Equation]
where ¯ a ( t, t + τ − 1)
=
[ a t , . . .
a t + τ − 1 ] represents a possible sequence of treatments from timestep t just until before the potential outcome Y t + τ is observed.
We make the standard assumptions (Robins et al., 2000; Lim et al., 2018) needed to identify the treatment effects: consistency, positivity and no hidden confounders (sequential strong ignorability).
See Appendix B for more more details.
C OUNTERFACTUAL R ECURRENT N ETWORK
The observational data can be used to train a supervised learning model to forecast: E ( Y t + τ | ¯
A ( t, t + τ − 1)
=
¯ a ( t, t + τ − 1) , ¯ H t ) .
However, without adjusting for the bias introduced by timevarying confounders, this model cannot be reliably used for making causal predictions (Robins et al., 2000; Robins & Hernán, 2008; Schulam & Saria, 2017).
The Counterfactual Recurrent Network (CRN) removes this bias through domain adversarial training and estimates the counterfactual outcomes E ( Y t
+ τ [¯ a ( t, t + τ − 1)] | ¯ H t ) , for any intended future treatment assignment ¯ a ( t, t + τ − 1) .
Balancing representations.
The history ¯ H t = ( ¯ X t , ¯ A t − 1 , V ) of the patient contains the timevarying confounders ¯ X t which bias the treatment assignment A t ∈ { A 1 , . . .
A K } in the observational dataset.
Inverse probability of treatment weighting, as performed by MSMs, creates a pseudopopulation where the probability of treatment A t does not depend on the time-varying confounders (Robins et al., 2000).
In this paper, we propose instead building a representation of the history ¯ H t that is not predictive of the treatment A t .
This way, we remove the association between history, containing the time-varying confounders ¯ X t , and current treatment A t .
Robins (1999) shows that in this case, the estimation of counterfactual treatment outcomes is unbiased.
See Appendix C for details and for an example of a causal graph with time-dependent confounders.
Let Φ be the representation function that maps the patient history ¯ H t to a representation space R .
To obtain unbiased treatment effects, Φ needs to construct treatment invariant representations such that P (Φ( ¯ H t )
| A t =
A 1 )
= · · · = P (Φ( ¯ H t ) |
A t =
A K ) .
To achieve this and to estimate counterfactual outcomes under a planned sequence of treatments, we integrate the domain adversarial training framework proposed by Ganin et al.
and extended by Sebag et al.
to the multi-domain learning setting, into a sequence-to-sequence architecture.
In our case, the different treatments at each timestep are considered the different domains.
Note that the novelty here comes from the use of domain adversarial training to handle the bias from the time-dependent confounders, rather than the use of sequence-to-sequence models, which have already been applied to forecast treatment responses (Lim et al., 2018).
Figure 2 illustrates our model architecture.
Encoder.
The encoder network uses an RNN, with LSTM unit (Hochreiter & Schmidhuber, 1997), to process the history of treatments ¯ A t − 1 , covariates ¯ X t and baseline features V to build a treatment invariant representation Φ( ¯ H t ) , but also to predict one-step-ahead outcomes Y t +1 . To achieve this, the encoder network aims to maximize the loss of the treatment classiﬁer G a and minimize the loss
[Table]
sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> .
[Equation]
[Equation]
[Equation]
[Equation]
[Equation] null [Equation] [Equation]
[Equation]
>
[Equation]
>
[Equation]
null
[Equation]
null
[Equation]
(null
[Equation]
latexit
[Equation]
X
[Equation]
_base
[Equation]
null)</latexit
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
>
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Figure]
[Table]
="(null)">(null)</latexit> GRL ˆ Y t +2 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> ˆ Y t +3 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> ˆ Y t +1 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> ˆ Y t +2 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> ˆ A t +1 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="
[Table]
null
[Table]
null [Table] <
[Table]
sha [Table] null [Table]
null
[Table] < [Table] null
[Table]
null [Table] null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> a t + ⌧  1 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> a t + ⌧  2 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> ( ¯ H t + ⌧  1 ) <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> of the outcome predictor network G y .
This way, the balanced representation Φ( ¯ H t ) is not predictive of the assigned treatment A t , but is discriminative enough to estimate the outcome Y t +1 .
To train this model using gradient descent, we use the Gradient Reversal Layer (Ganin et al., 2016).
Decoder.
The decoder network uses the balanced representation computed by the encoder to initialize the state of an RNN that predicts the counterfactual outcomes for a sequence of future treatments.
During training, the decoder uses as input the outcomes from the observational data ( Y t +1 , . . .
Y t + τ − 1 ) , the static patient features V and the intended sequence of treatments ¯ a ( t, t + τ − 1) .
The decoder is trained in a similar way to the encoder to update the balanced representation and to estimate the outcomes.
During testing, we do not have access to ground-truth outcomes; thus, the outcomes predicted by the decoder ( ˆ Y t +1 , . . .
ˆ Y t + τ − 1 ) are auto-regressively used instead as inputs.
By running the decoder with different treatment settings, and by auto-regressively feeding back the outcomes, we can determine when to start and end different treatments, which is the optimal time to give the treatment and which treatments to give over time to obtain the best patient outcomes.
The representation Φ( ¯ H t ) is built by applying a fully connected layer, with Exponential Linear
Unit (ELU) activation to the output of the LSTM.
The treatment classiﬁer G a and the predictor network G y consist of a hidden layer each, also with ELU activation.
The output layer of G a uses softmax activation, while the output layer of G y uses linear activation for continuous predictions.
For categorical outcomes, softmax activation can be used.
We follow an approach similar to Lim et al.
and we split the encoder and decoder training into separate steps.
See Appendix E for details.
The encoder and decoder networks use variational dropout (Gal & Ghahramani, 2016)
such that the
CRN can also give uncertainty intervals for the treatment outcomes.
This is particularity important in the estimation of treatment effects, since the model predictions should only be used when they have high conﬁdence.
Our model can also be modiﬁed to allow for irregular samplings of observations by using a PhasedLSTM (Neil et al., 2016).
A DVERSARIALLY BALANCED REPRESENTATION OVER TIME
At each timestep t , let the K different possible treatments
A t ∈ { A 1 , . . .
A K } represent our domains.
As described in Section 4, to remove the bias from time-dependent confounders, we build a representation of history ¯ H t that is invariant across treatments: P (Φ( ¯ H t ) |
A 1 ) = · · · = P (Φ( ¯ H t ) | A K ) .
This requirement can be enforced by minimizing the distance in the distribution of Φ( ¯ H t ) between any two pairs of treatments.
Kifer et al. ; Ben-David et al. (2007), propose measuring the disparity between distributions based on their separability by a discriminatively-trained classiﬁer. Let the symmetric hypothesis class H consist of the set of symmetric multiclass classiﬁers, such as neural network architectures.
The H -divergence between all pairs of two distributions is deﬁned in terms of the capacity of the hypothesis class H to discriminate between examples from the multiple distributions. Empirically, minimizing the H− divergence involves building a representation where examples from the multiple domains are as indistinguishable as possible (Ben-David et al., 2007; Li et al., 2018; Sebag et al., 2019). Ganin et al. (2016) use this idea to propose an adversarial framework for domain adaptation involving building a representation which achieves maximum error on a domain classiﬁer and minimum error on an outcome predictor.
Similarly, in our case, we use domain adversarial training to build a representation of the patient history Φ( ¯ H t ) that is both invariant to the treatment given at timestep t , A t and that achieves low error in estimating the outcome Y t +1 . [Table] [Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table] [Equation] [Table] [Equation]
[Table]
[Equation] [Table] [Equation] [Table]
[Equation]
[Table] [Equation] [Table] [Equation]
[Table]
null [Equation] [Table] [Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> A
[Equation]
1 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)
[Equation]
/latexit>
[Equation]
latexit sha1_base
[Equation]
"(null)">(null) [Equation] /latexit
[Equation]
latexit sha1_base
[Equation]
"(null)"
[Equation]
(null)
[Equation]
/latexit>
X
[Equation]
[Equation]
"(null)"
[Equation]
[Equation] [Equation]
[Equation]
sha1_base
[Equation]
"(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
A t <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
L a <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> . . .
L y <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> @
L y @
✓ y <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> @
L y @
✓ r <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
Backpropagation @ L a @✓ a <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> [Table]
@ L a @✓ r <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
A t <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
Y t +1 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
GRL
V <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
Let G a (Φ( ¯ H t ); θ a ) be the treatment classiﬁer with parameters θ a and let G ja (Φ( ¯ H t ); θ a ) be the output corresponding to treatment A j .
Let G y (Φ( ¯ H t ); θ y ) be the predictor network with parameters θ y .
The representation function Φ is parameterized by the parameters θ r in the RNN: Φ( ¯ H t ; θ r ) .
Figure 3 shows the adversarial training procedure used.
For timestep t and patient ( i ) , let L ( i ) t,a ( θ r , θ a ) be the treatment (domain) loss and let L ( i ) t,y ( θ r , θ y ) the outcome loss, deﬁned as follows:
[Equation]
If the outcome is binary, the cross-entropy loss can be used instead for L t,y .
To build treatment invariant repre- sentations and to also estimate patient outcomes, we aim to maximize treatment loss and minimize outcome loss.
Thus, the overall loss L ( i ) t,y at timestep t is given by:
[Equation]
where the hyperparameter λ controls this trade-off between domain discrimination and outcome prediction.
We use the standard procedure for training domain adversarial networks from Ganin et al.
and we start off with an initial value for λ and use an exponentially increasing schedule during training.
To train the model using backpropagation, we use the Gradient Reversal Layer (GRL)
(Ganin et al., 2016).
For more details about the training procedure, see Appendix E.
By using the objective L ( i ) t ( θ r , θ y , θ a ) , we reach the saddle point (ˆ θ r , ˆ θ y , ˆ θ a ) that achieves the equilibrium between domain discrimination and outcome estimation.
[Equation]
The result stated in Theorem 1 proves that the treatment (domain) loss part of our objective (from equation 2) aims to remove the time-dependent confounding bias.
Theorem 1.
Let t ∈ { 1 , 2 , . . . } .
For each j = 1 , ..., K , let P j denote the distribution of ¯ H t conditional on A t =
A j and let P Φ j denote the distribution of Φ( ¯ H t ) conditional on A t =
A j .
Let
G ja denote the output of G a corresponding to treatment A j .
Then the minimax game deﬁned by
[Equation]
subject to
[Equation]
has a global minimum which is attained if and only if P Φ1 = P Φ2 = ...
= P Φ K , i.e. when the learned representations are invariant across all treatments.
Proof.
This result is a restatement of the one in Li et al.
For details, see the Appendix D.
A good representation allows us to obtain a low error in estimating counterfactuals for all treatments, while at the same time to minimize the H -divergence between induced marginal distributions of all the domains.
We use an algorithm that directly minimizes a combination of the H− divergence and the empirical training margin.
E XPERIMENTS
In real datasets, counterfactual outcomes and the degree of time-dependent confounding are not known (Schulam & Saria, 2017; Lim et al., 2018).
To validate the CRN 1 , we evaluate it on a
Pharmacokinetic-Pharmacodynamic model of tumour growth (Geng et al., 2017), which uses a stateof-the-art bio-mathematical model to simulate the combined effects of chemotherapy and radiotherapy in lung cancer patients.
The same model was used by Lim et al.
(2018) to evaluate RMSNs.
The volume of tumour t days after diagnosis is modelled as follows:
[Equation]
where K, ρ, β c , α r , β r , e t are sampled as described in Geng et al.
To incorporate heterogeneity in patient responses, the prior means for β c and α r are adjusted to create patient subgroups, which are used as baseline features.
The chemotherapy concentration C ( t ) and radiotherapy dose d ( t ) are modelled as described in Appendix F. Time-varying confounding is introduced by modelling chemotherapy and radiotherapy assignment as Bernoulli random variables, with probabilities p c and p r depending on the tumour diameter: p c ( t )
=
σ (cid:0) γ c D max ( ¯ D ( t ) − δ c ) (cid:1) and p r ( t ) =
σ (cid:0) γ r D max ( ¯ D ( t ) − δ r ) (cid:1) where ¯ D ( t ) is the average diameter over the last 15 days, D max = 13 cm, σ ( · ) is the sigmoid and δ c = δ r
= D max / 2 .
The amount of time-dependent confounding is controlled through γ c , γ r ; the higher γ (cid:63) is, the more important the history is in assigning treatments.
At each timestep, there are four treatment options: no treatment, chemotherapy, radiotherapy, combined chemotherapy and radiotherapy.
For details about data simulation, see Appendix F.
Benchmarks We used the following benchmarks for performance comparison: Marginal Structural
Models (MSMs) (Robins et al., 2000), which use logistic regression for estimating the IPTWs and linear regression for prediction (see Appendix G for details).
We also compare against the Recurrent
Marginal Structural Networks (RMSNs) Lim et al. (2018), which is the current state-of-the-art model in estimating treatment responses. RMSNs use RNNs to estimate the IPTWs and the patient outcomes (details in Appendix H).
To show that standard supervised learning models do not handle the timevarying confounders we compare against an RNN and a linear regression model, which receive as input treatments and covariates to predict the outcome (see Appendix I for details).
Our model architecture follows the description in Sections 4 and 5, with full training details and hyperparameter optimization in Appendix J. To show the importance of adversarial training, we also benchmark against CRN ( λ = 0 ) a model with the same architecture, but with λ = 0 , i.e our model architecture without adversarial training.
6. E VALUATE MODELS ON COUNTERFACTUAL PREDICTIONS
Previous methods focused on evaluating the error only for factual outcomes (observed patient outcomes)
(Lim et al., 2018).
However, to build decision support systems, we need to evaluate how well the models estimate the counterfactual outcomes, i.e patient outcomes under alternative treatment options.
The parameters γ c and γ r control the treatment assignment policy, i.e. the degree of time-dependent confounding present in the data.
We evaluate the benchmarks under different degrees of time-dependent confounding by setting γ = γ c = γ r .
For each γ we simulate apatients for training, 1000 for validation (hyperparameter tuning) and 1000 for out-of-sample testing.
For the patients in the test set, for each time t , we also simulate counterfactuals Y t +1 , represented by tumour volume V ( t + 1) , under all possible treatment options. [Figure]
Figure 4 (a) shows the normalized root mean squared error (RMSE) for one-step ahead estimation of counterfactuals with varying degree of time-dependent confounding γ .
The RMSE is normalized by the maximum tumour volume: V max = 1150 cm 3 .
The linear and MSM models provide a baseline for performance as they achieve the highest RMSE.
While the use of IPTW in MSMs helps when γ increases, using linear modelling has severe limitations.
When there is no time-dependent confounding, the machine learning methods achieve similar performance, close to 0.6% RMSE.
As the bias in the dataset increases, the harder it becomes for the RNN and the CRN ( λ = 0) to generalize to estimate outcomes of treatments not matching the training policy.
When γ = 10 , CRN improves by 48 .
1% on the same model architecture without domain adversarial training CRN ( λ = 0).
Our proposed model achieves the lowest RMSE across all values of γ .
Compared to RMSNs, CRN improves by ∼ 17% when γ > 6 .
To highlight the gains of our method even for smaller γ , Figure(b) shows the RMSE for ﬁve-step ahead prediction (with counterfactuals generated as described in
Section 6.2 and Appendix L).
RMSNs also use a decoder for sequence prediction.
However, RMSNs require training additional RNNs to estimate the IPTW, which are used to weight each sample during the decoder training.
For τ -step ahead prediction, IPTW involves multiplying τ weights which can result in high variance.
The results in Figure 4 (b) show the problems with using IPTW to handle the time-dependent confounding bias.
See Appendix K for more results on multi-step ahead prediction.
Balancing representation: To evaluate whether the CRN has indeed learnt treatment invariant represenations, for γ = 5 , we illustrate in Figure 5 the T-SNE embeddings of the balancing representations Φ( ¯ H t ) built by the CRN encoder for test patients.
We color each point by the treatment A t ∈ { no treatment , chemotherapy , radiotherapy , combined chemotherapy and radiotherapy } received at timestep t to highlight the invariance of Φ( ¯ H t ) across the different treatments.
In Figure 5(b), we show Φ( ¯ H t ) only for chemotherapy and radiotherapy for better understanding.
[Figure]
6. E VALUATE RECOMMENDING THE RIGHT TREATMENT AND TIMING OF TREATMENT
Evaluating the models just in terms of the RMSE on counterfactual estimation is also not enough for assessing their reliability when used as part of decision support systems.
In this section we assess how well the models can select the correct treatment and timing of treatment for several forecasting horizons τ .
We generate test sets consisting of 1000 patients where for each horizon τ and for each time t in a patient’s trajectory, there are τ options for giving chemotherapy at one of t, . . .
t + τ −and τ options for giving radiotherapy at one of t, . . .
t + τ − 1 .
At the rest of the future timesteps, no treatment is applied.
These 2 τ treatment plans are assessed in terms of the tumour volume outcome Y t + τ .
We select the treatment (chemotherapy or radiotherapy) that achieves lowest Y t + τ , and within the correct treatment the timing with lowest Y t + τ . We also compute the normalized RMSE for [Table] predicting Y t + τ .
See Appendix L for more details about the test set.
The models are evaluated forsettings of γ c and γ r .
Table 1 shows the results for this evaluation set-up.
The treatment accuracy denotes the percentage of patients for which the correct treatment was selected, while the treatment timing accuracy is the percentage for which the correct timing was selected.
Note that when γ c = 0 and γ r = 5 , RMSN and MSM select the wrong treatment timing for projection horizons τ > 4 .
CRN performs similarly among the different policies present in the observational data and achieve the lowest RMSE and highest accuracy in selecting the correct treatment and timing of treatment.
In Appendix M we also show the applicability of the CRN in more complex medical scenarios involving real data.
We provide experimental results based on the Medical Information Mart for
Intensive Care (MIMIC III) database (Johnson et al., 2016) consisting of electronic health records from patients in the ICU.
C ONCLUSION
Despite its wide applicability, the problem of causal inference for time-dependent treatments has been relatively less studied compared to problem of causal inference in the static setting.
Both new methods and theory are necessary to be able to harness the full potential of observational data for learning individualized effects of complex treatment scenarios.
Further work in this direction is needed for proposing alternative methods for handling time-dependent confounders, for modelling combinations of treatments assigned over time or for estimating the individualized effects of time-dependent treatments with associated dosage.
In this paper, we introduced the Counterfactual Recurrent Network (CRN), a model that estimates individualized effects of treatments over time using a novel way of handling the bias from timedependent confounders through adversarial training.
Using a model of tumour growth, we validated
CRN in realistic medical scenarios and we showed improvements over existing state-of-the-art methods.
We also showed the applicability of the CRN a real dataset consiting of patient electronic health records.
The counterfactual predictions of CRN have the potential to be used as part of clinical decision support systems to address relevant medical challenges involving selecting the best treatments for patients over time, identify optimal treatment timings but also when the treatment is no longer needed.
In future work, we will aim to build better balancing representations and to provide theoretical guarantees for the expected error on the counterfactuals.
A CKNOWLEDGMENTS
We would like to thank the reviewers for their valuable feedback.
The research presented in this paper was supported by The Alan Turing Institute, under the EPSRC grant EP/N510129/1 and by the US
Ofﬁce of Naval Research (ONR)
A PPENDIX A E XTENDED RELATED WORK
Causal inference in the static setting: A large number of methods have been proposed to learn treatment effects from observational data in the static setting.
In this case, it is needed to adjust for the selection bias; bias caused by the fact that, in the observational dataset, the treatment assignments depend on the patient features.
Several ways of handling the selection bias involve using propensity matching (Austin, 2011; Imai & Ratkovic, 2014; Abadie & Imbens, 2016), building representations where treated and un-treated populations had similar distributions (Johansson et al., 2016; Shalit et al., 2017; Li & Fu, 2017; Yao et al., 2018) or performing propensity-aware hyperparameter tuning (Alaa & van der Schaar, 2017; 2018).
However, these methods for the static setting cannot be extended directly to time-varying treatments (Hernán et al., 2000; Schisterman et al., 2009).
Learning optimal policies: A related problem to ours involves learning the optimal treatment policies from logged data (Swaminathan & Joachims, 2015a;b; Atan et al., 2018).
That is, learning the treatment option that would give the best reward.
Note the difference to the causal inference setting considered in this paper, where the aim is to learn the counterfactual patient outcomes under all possible treatment options.
Learning all of the counterfactual outcomes is a harder problem and can also be used for ﬁnding the optimal treatment.
A method for learning optimal policies, proposed by Atan et al.
(2018) uses domain adversarial training to build a representation that is invariant to the following two domains: observational data and simulated randomized clinical trial data, where the treatments have equal probabilities.
Atan et al.
(2018) only considers the static setting and aims to choose the optimal treatment instead of estimating all of the counterfactual outcomes.
In our paper the aim is to eliminate the bias from the time-dependent confounders and reliably estimate all of the potential outcomes ; thus, at each timestep t we build a representation that is invariant to the treatment.
Off-policy evaluation in reinforcement learning: In reinforcement learning, a similar problem to ours is off-policy evaluation, which uses retrospective observational data, also known as logged bandit feedback (Hoiles & Van Der Schaar, 2016;
P˘aduraru et al., 2013; Doroudi et al., 2017).
In this case, the retrospective observational data consists of sequences of states, actions and rewards which were generated by an agent operating under an unknown policy.
The off-policy evaluation methods aim to use this data to estimate the expected reward of a target policy.
These methods use algorithms based on importance sampling (Precup, 2000; Thomas et al., 2015; Guo et al., 2017), action-value function approximation (model based)
(Hallak et al., 2015) or doubly robust combination of both approaches (Jiang & Li, 2015).
Nevertheless, these methods focus on obtaining average rewards of policies, while in our case the aim is to estimate individualized patient outcomes for future treatments.
B A SSUMPTIONS
The standard assumptions needed for identifying the treatment effects are (Robins & Hernán, 2008;
Lim et al., 2018; Schulam & Saria, 2017):
Assumption 1: Consistency .
If A t = a t for a given patient, then the potential outcome for treatment a t is the same as the observed (factual) outcome: Y t +1 [ a t ] =
Y t +1 .
Assumption 2: Positivity (Overlap) (Imai & Van Dyk, 2004): If P ( ¯ A t − 1 = ¯ a t − 1 , ¯ X t = ¯ x t ) (cid:54) =
then P ( A t = a t | ¯ A t − 1 = ¯ a t − 1 , ¯ X t
= ¯ x t ) >
for all ¯ a t .
Assumption 3: Sequential strong ignorability.
Y t +1 [ a t ] ⊥⊥ A t | ¯ A t − 1 , ¯ X t , ∀ a t ∈ A , ∀ t.
Assumption 2 means that, for each timestep, each treatment has non-zero probability of being assigned.
Assumption 3 means that there are no hidden confounders, that is, all of covariates affecting both the treatment assignment and the outcomes are present in the the observational dataset.
Note that while assumption 3 is standard across
C T IME - DEPENDENT C ONFOUNDING
Figure 6 illustrates the causal graphs for a time-varying exposures with 2-steps (Robins et al., 2000).
In Figure 6 (a), the covariate X is a time-dependent confounder because it affects the treatment assignments and at the same time, its value is changed by past treatments (Mansournia et al., 2017), as illustrated by the red arrows.
Thus, the treatment probabilities at each time t depend on the history of covariate X and past treatments.
Note that U
and U 1 are hidden variables which only affect the covariates, i.e. they do not have arrows into the treatments.
Thus, the no hidden confounders assumption (Assumption 3) is satisﬁed.
Figure 6 (a) and (b) illustrate the two cases when there is no bias from time-dependent confounding.
In Figure 6 (a) the treatment probabilities are independent, while in Figure 6 (b) they depend on past treatments.
[Equation]
[Figure]
[Equation]
latexit sha1_
[Equation]
(null)
[Equation]
(null)
[Equation]
/latexit
[Equation]
latexit
[Equation]
[Equation]
latexit
[Equation]
[Table]
[Equation]
(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
U 0 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
U 1 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
Y 2 <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit> <latexit sha1_base64="(null)">(null)</latexit>
[Figure]
Marginal Structural Models Robins et al.
To remove the association between timedependent confounders and time-varying treatments, Marginal Structural Models propose using inverse probability of treatment weighting (IPTW).
Without loss of generality, consider the use of
MSMs with univariate treatments, baseline variables and outcomes.
The outcome after t timesteps is parametrized as follows: E [ Y t +1 | a 1 , . . .
a t , V ] =
g ( a 1 , . . .
a n , V ; θ ) , where g ( · ) is usually a linear function with parameters θ .
To remove the bias from the time-dependent confounders present in the observational dataset, in the regression model g ( · ) MSMs weights each patients using either stabilized weights:
[Equation]
or unstabilized weights:
[Equation]
where f ( · ) represents the conditional probability mass function for discrete treatments.
Inverse probability of treatment weighting (IPTW) creates a pseudo-population where each member consists of themselves and W − 1 (or SW − 1 ) copies added though weighting.
In this pseudopopulation, Robins Robins (1999) shows that ¯ X t does not predict treatment A t , thus removing the bias from time-dependent confounders.
When using unstabilized weights W , the causal graph in the pseudo-population is the one in Figure(a) where P ( A t | ¯ X t , ¯ A t − 1 , V )
=
P ( A t ) .
On the other hand, when using stabilized weights SW , causal graph in the pseudo-population is the one in Figure 6 (b) where P ( A t | ¯ X t , ¯ A t − 1 , V ) =
P ( A t | ¯ A t − 1 ) .
Counterfactual Recurrent Networks .
Instead of using IPTW, we proposed building a representation of ¯ X t , ¯ A t − 1 , V that is not predictive of treatment A t .
At timestep t , we have k different possible treatments
A t ∈ { A 1 , . . .
A K } .
We build a representation of the history and covariates and treatments that has the same distribution across the different possible treatments: P (Φ( ¯ X t , ¯ A t − 1 , V )
|
A t =
A 1 )
= · · · = P (Φ( ¯ X t , ¯ A t − 1 , V ) |
A t =
A K ) .
By breaking the association between past exposure and current treatments A t , we satisfy the causal graph in Figure 6 (a) and thus we remove the bias from time-dependent confounders.
D P ROOF OF T HEOREM
We ﬁrst prove the following proposition.
Proposition 1.
For ﬁxed Φ , let x (cid:48) =
Φ(¯ h t ) .
Then the optimal prediction probabilities of G a are given by
[Equation]
Proof.
For ﬁxed Φ , the optimal prediction probabilities are given by
[Equation]
subject to
[Equation]
Maximising the value function pointwise and applying Lagrange multiplies, we get
[Equation]
Setting the derivative (w.r.t.
G ja ∗ ( x [Equation] to 0 and solving for G ja ∗ ( x (cid:48) )
we get
[Equation]
(13) where λ can now be solved for using the constraint to be λ = − (cid:80)
Ki
=1 P Φ i ( x (cid:48) ) .
This gives the result.
Proof.
(of Theorem 1 )
By substituting the expression from Proposition 1 into the minimax game deﬁned in Eq.
6, the objective for Φ becomes
[Equation]
We then note that
[Equation]
where KL ( ·||· ) is the Kullback-Leibler divergence and JSD ( · , ..., · ) is the multi-distribution Jensen- Shannon Divergence (Li et al., 2018).
Since K log K is a constant and the multi-distribution JSD is non-negative and
if and only if all distributions are equal, we have that P Φ1 = ...
=
P Φ K .
E T RAINING PROCEDURE FOR CRN
Let D =
(cid:110) {
x ( i ) t , a ( i ) t , y ( i ) t +1 } T ( i ) t =1 ∪ { v ( i ) } (cid:111) N i
=1 be an observational dataset consisting of information about N independent patients that we use to train CRN.
The encoder and decoder networks part of
CRN are trained into two separate steps.
To begin with, the encoder is trained to built treatment invariant representations of the patient history and to perform one-step ahead prediction.
After the encoder is optimized, we use it to compute the balancing representation br ( i ) t for each timestep in the trajectory of patient ( i ) .
To train the decoder, we modify the training dataset as follows.
For each patient ( i ) , we split their trajectory into shorter sequences of the τ max timesteps of the form:
[Equation]
for l = 1 , . . .
T ( i ) − τ max .
Thus, each patients contributes with T ( i ) − τ max examples in the dataset for training the decoder.
The different sequences obtained for all patents are randomly grouped into minibatches and used for training.
The pseudocode in Algorithm 1 shows the training procedure used for the encoder and decoder networks part of CRN.
The model was implemented in TensorFlow and trained on an NVIDIA Tesla
K80 GPU.
The Adam optimizer (Kingma & Ba, 2014) was used for training and both the encoder and the decoder are trained for 100 epochs.
Input: Training data: D = (cid:110) { x ( i ) t , a ( i ) t , y ( i ) t +1 } T ( i ) t =1 ∪ v ( i ) (cid:111) N i
=
(1) Encoder optimization : parameters θ E,r , θ E,a , θ E,y .
Learning rate: µ for p
= 1 , . . , max epochs do λ p = 1 + exp( − 10 · p ) −for Batch B = (cid:110) { x ( i ) t , a ( i ) t , y ( i ) t +1 } T ( i ) t =0 ∪ v ( i ) (cid:111) |B| i =1 in epoch do
Compute L B E,a ( θ E,r , θ E,a ) = 1 |B| (cid:80) i ∈B (cid:80) T ( i ) t =1 L ( i ) t,a ( θ E,r , θ E,a )
Compute L B E,y ( θ E,r , θ E,y )
= 1 |B| (cid:80) i ∈B (cid:80) T ( i ) t =1 L ( i ) t,y ( θ E,r , θ E,y )
θ E,r ← θ E,r − µ (cid:18)
∂ L B E,y ( θ E,r ,θ E,y )
∂θ E,r − λ p ∂ L B E,a ( θ E,r ,θ E,a ) ∂θ E,r (cid:19) θ E,y ← θ E,y − µ ∂ L B E,y
( θ E,r ,θ E,y )
∂θ E,y θ E,a ← θ E,a − µ ∂ L B E,a ( θ E,r ,θ E,a ) ∂θ E,a end for end for (2) Compute the encoder balanced representation and use it to initialize the decoder hidden state.
for i = 1 , ..., N do for t = 1 , . .
, T ( i ) do br
[Equation]
encoder
[Equation]
; θ
[Equation]
) end for end for (3) Split dataset in sequences of τ max timesteps :
[Equation]
(4) Optimize decoder : parameters θ D,r , θ D,a , θ D,y Learning rate: µ for p = 1, ..., max epochs do λ p = 1 + exp( − 10 · p ) −for Batch B = (cid:110) br ( i ) l ∪ { y ( i ) l + t , a ( i ) l +
[Equation]
, y ( i ) l + t +1 }
[Equation]
max t =
[Equation]
{ v ( i ) } (cid:111) |B| i =1 in epoch do
Compute L B D,a ( θ D,r , θ D,a ) = 1 |B| (cid:80) i ∈B (cid:80) τ max t =1 L ( i ) t,a ( θ D,r , θ D,a )
Compute L B D,y ( θ D,r , θ D,y )
= 1 |B| (cid:80) i ∈B (cid:80) τ max t =1 L ( i ) t,y ( θ D,r , θ D,y )
θ D,r ← θ D,r − µ (cid:18) ∂
L B D,y ( θ D,r ,θ D,y )
∂θ D,r − λ p ∂ L B D,a ( θ D,r ,θ D,a ) ∂θ D,r (cid:19) θ D,y ← θ D,y − µ ∂ L B D,y ( θ D,r ,θ D,y )
∂θ D,y θ D,a ← θ D,a −
[Table]
end for end for
Output: Trained CRN encoder (parameters θ E,r , θ E,a , θ E,y ) and trained CRN decoder (parameters θ D,r , θ D,a , θ D,y . )
F P HARMACOKINETIC -P HARMACODYNAMIC M ODEL OF TUMOUR GROWTH
To evaluate the CRN on counterfactual estimation, we need access to the data generation mechanism to build a test set that consists of patient outcomes under all possible treatment options.
For this purpose, we use the state-of-the-art pharmacokinetic-pharmacodynamic (PK-PD) model of tumour growth proposed by Geng et al.
and also used by Lim et al.
(2018) for evaluating RMSMs.
The PK-PD model characterizes patients suffering from non-small cell lung cancer and models the evolution of their tumour under the combined effects of chemotherapy and radiotherapy.
In addition, the model includes different distributions of tumour sizes based on the cancer stage at diagnosis.
Model
of
tumour growth
The volume of tumour t days after diagnosis is modelled as follows:
[Equation]
where the parameters K, ρ, β c , α r , β r are sampled from the prior distributions described in (Geng et al., 2017) and e t ∼ N (0 , 0 .
01 2 ) is a noise term that accounts for randomness in the tumour growth.
To incorporate heterogeneity among patient responses, due to, for instance, gender or genetic factors
Bartsch et al.
(2007), the prior means for β c and α r are adjusted to create three patient subgroups
S ( i ) ∈ { 1 , 2 , 3 } as described in Lim et al.
This way, we incorporate in the model of tumour growth speciﬁc characteristics that affect the patient’s individualized response to treatments.
Thus, the prior mean µ β c of β c and the prior mean µ α r of α r are augmented as follows.
[Equation]
where µ β c and µ α r are the mean parameters from Geng et al.
(2017) and µ (cid:48)
β c ( i ) and µ (cid:48)
α r ( i ) are the parameters used in the data simulation.
The patient subgroup S ( i ) ∈ { 1 , 2 , 3 } is used as baseline features.
The chemotherapy drug concentration follows an exponential decay with half life of 1 day:
[Equation]
where ˜ C ( t ) = 5 .
mg/m 3 of Vinblastine if chemotherapy is given at time t .
d ( t ) = 2 .
Gy fractions of radiotherapy if the radiotherapy treatment is applied at timestep t .
Time-varying confounding is introduced by modelling chemotherapy and radiotherapy assignment as
Bernoulli random variables, with probabilities p c and p r depending on the tumour diameter:
[Equation]
where ¯ D ( t ) is the average tumour diameter over the last 15 days, D max = 13 cm is the maximum tumour diameter and σ ( · ) is the sigmoid activation function.
The parameters δ c and δ r are set to δ c = δ r =
D max / 2 such that there is 0 .
5 probability of receiving treatment when tumour is half of its maximum size.
γ c , γ r control the amount of time-dependent confounding; the higher γ (cid:63) is, the more important the history of tumour diameter is in assigning treatments.
Thus, at each timestep, there are four treatment options options: no treatment ( A 1 ), chemotherpy ( A 2 ), radiotherapy ( A 3 ), combined chemotherapy and radiotherapy ( A 4 ).
Since the work most relevant to ours is the one of Lim et al.
we used the same data simulation and same settings for γ = γ c = γ r as in their case.
When γ = 0 , there is no time-dependent confounding and the treatments are randomly assigned.
By increasing γ we increase the inﬂuence of the volume size history (encoded in ¯ D ( t ) ) on the treatment probability.
For example, assume ¯ D ( t )
= 3 D max .
From equation (7), the probability of chemotherapy in this case is p c ( t ) =
σ ( γ c D max ( ¯ D ( t ) −
D max 2 ))
=
σ (0 .
25 γ c ) , where σ ( · ) is the sigmoid function.
When γ = 1 , p c ( t ) = 0 . 56 , when γ = 5 , p c ( t )
= 0 .
77 and when γ = 10 , p c ( t ) = 0 .
92 in this example.
γ can be increased further to increase the bias.
However, the values used in the experiments evaluate the model on a wide range of settings for the time-dependent confounding bias.
G M ARGINAL S TRUCTURAL M ODELS
Marginal Structural Models (Robins et al., 2000; Hernán et al., 2001) have been widely used in epidemiology and as part of follow up studies.
In our case, we would like to estimate the effects of a sequence of treatments in the future given the current patient history:
[Equation]
where g is a generic function and ¯ a ( t, t + τ − 1)
=
[ a t , . . .
a t + τ − 1 ] represents a possible sequence of treatments from timestep t just until before the potential outcome Y t + τ is observed.
After removing the bias form time-dependent confounders, E ( Y t + τ | ¯ A ( t, t + τ − 1) =
¯ a ( t, t + τ − 1) , ¯ H t ) =
E ( Y t + τ [¯ a ( t, t + τ − 1)] .
Note that for implementing MSMs, we encode the treatments at timestep t in the model of tumour growth as A t =
[ A t,c , A t,d ] to indicate the binary application of chemotherapy and radiotherapy.
In order to remove the time-dependent confounding bias and estimate future outcomes, we use the stabilized weights of MSMs to weight each patient in the dataset:
[Equation]
[Equation]
where f ( · ) represents the conditional probability mass function for discrete treatments.
We adopt the implementation in (Hernán et al., 2001;
Howe et al., 2012; Lim et al., 2018) for MSMs and use logistic regression for estimating the propensity weights as follows:
[Equation]
[Equation] where ω (cid:63) , φ (cid:63) and w (cid:63) are regression coefﬁcients, k ∈ { c, d } indicates the chemotherapy or radiother-
apy treatments and σ ( · ) is the sigmoid function.
For predicting the outcome, the following regression model is used, where each individual patient is weighted by its propensity score:
[Equation]
[Equation] where β (cid:63) and l (cid:63) are regression coefﬁcients.
MSMs do not require hyperparameter tuning so we use the patients from both the train and validation sets for training.
H R ECURRENT M ARGINAL S TRUCTURAL N ETWORKS
MSMs are very sensitive to model mis-speciﬁcation in computing the propensity weights and estimating the outcomes.
Recurrent Marginal Structural Models (RMSNs) (Lim et al., 2018) overcome this problem by using recurrent neural networks to estimate the propensity scores and to build the outcome model.
RNNs are more robust to changes in the treatment assignment policy.
RMSNs were
For implementing RMSNs, we also encode the treatments at timestep t in the model of tumour growth as A t =
[ A t,c , A t,d ] to indicate the binary application of chemotherapy and radiotherapy.
The propensity weights are estimated using recurrent neural networks as follows:
[Equation]
[Equation]
For predicting one-step-ahed outcome, R-MSNs use an encoder network:
[Equation] [Equation]
where in the loss function, each patient is weighted by their stabilized IPTW.
For estimating the treatment responses for a sequence of treatments in the future, RMSNs use a decoder network:
[Equation]
See Lim et al.
(2018) for more details about the R-MSNs model architecture and training procedure of the propensity weights, encoder and decoder networks.
Tables 2 and 3 show the hyperparameter search ranges used to optimize this model for evaluation in our paper.
The hyperparameters were selected in the same way as proposed by Lim et al.
(2018), based on the error on the factual outcomes in the validation dataset.
All of the models are trained using Adam optimizer for 100 epochs.
[Table] [Table]
I B ASELINE RNN AND LINEAR MODEL
For the baseline linear model, we ﬁt the same regression model used for Marginal Structural Networks, but without using the IPTW.
The baseline RNN uses an LSTM unit and, at each timestep, receives as input the current treatment, the patient covariates and the patient static features to perform one-stepahead prediction.
To have a model of similar capacity to the CRN (similar number of parameters), we add a fully connected layer on top of the output of the LSTM unit in order to obtain the outcomes.
Table 4 shows the hyperparameter search range used to optimize this model.
The hyperparameters were selecting according to the error on the factual outcomes in the validation set.
We train the baseline RNN using the Adam optimizer for 100 epochs.
[Table]
J H YPERPARAMETER OPTIMIZATION FOR CRN
As described in Appendix C
[Table]
the dataset for training the decoder are used by splitting the sequences of the patients in the training set.
This creates a larger dataset for training (where each patient ( i ) contributes T ( i ) − τ max times to the dataset) which requires a different hyperparameter search range.
Moreover, the balancing representations computed by the encoder are used to initialize the state of the RNN for the decoder.
Thus, the decoder RNN size is equal to the size of the balancing representation size of the encoder.
Table 5 shows the hyperparameter search ranges for the encoder and decoder networks in CRN.
We selected hyperparameters based on the error of the model on the factual outcomes in the validation dataset.
All models are trained for 100 epochs.
In addition
[Table]
Tables 6 and 7 illustrate the optimal hyperparameters chosen
[Table] [Table]
[Table]
are applied in the model of tumour growth.
The parameters γ c and γ r measure the degree of time-dependent confounding applied.
When γ c and γ r are set to the same value, we denote this with γ (cid:63)
[Table]
K F ULL RESULTS FOR COUNTERFACTUAL PREDICTION K. M ULTI - STEP AHEAD PREDICTION OF COUNTERFACTUALS
Figure 7 shows the normalized RMSE for multiple step-ahead prediction of counterfactuals.
The
RMSE is normalized by the maximum tumour volume: V max = 1150 cm 3 .
The counterfactuals in this case are generated as described in Section 6.3 and
Appendix I.
We notice that performance gains of
CRN compared to RMSN increase with the number of future timesteps for which the counterfactuals are estimated.
[Figure]
K. D ETAILED RESULTS FOR THE COUNTERFACTUAL PREDICTIONS
Tables 8 and 9 show detailed results for the counterfactual predictions.
[Table] [Table]
L T EST SET GENERATION FOR EVALUATING TIMING OF TREATMENT
In order to evaluate how well the models select the correct treatment and timing of treatment we simulate counterfactual outcomes as follows.
We generate 1000 test samples using the model of tumour growth described in Section 6.
Let ¯ H t be the current history of the patient and let τ be a future time horizon.
For each timestep in the future, we have 4 treatment options at: no treatment ( A 0 ), chemotherapy ( A 1 ), radiotherapy ( A 2 ), chemotherapy and radiotherapy.
( A 3 ).
Using the model of tumour growth where the outcome Y t + τ is given by the volume of the tumour, we generate the following 2 τ counterfactuals:
Chemotherapy application
[Equation]
Radiotherapy application
[Equation]
[Equation]
We perform this for each patient in the test set and at each time t in the history.
For instance, for a patient with 50 timesteps in the model of tumour growth and for time horizon τ = 3 , we generate 2 · 3 · 50 = 300 counterfactuals.
Using the true generated couterfactual data, we select the treatment that has the lowest Y t + τ among the τ options generated for each treatment.
Then, we select the time of applying treatment (among t, t +1 , . . .
t + τ − 1 ) that resulted in the lowest Y t + τ .
For each model, we generate the counterfactuals under the same treatment plans and patient histories.
Then, we perform the selection of treatment and timing of treatment in the same way and we compare these with the true ones.
Note that in order to account for numerical instability (two outcomes Y t + τ having very similar values), we consider two outcomes the same if they are within (cid:15)
= 0 .
001 of each other.
M R ESULTS ON FACTUAL PREDICTION ON MIMIC III
Using the Medical Information Mart for Intensive Care (MIMIC III) (Johnson et al., 2016) database consisting of electronic health records from patients in the ICU, we also show how the CRN can be used on a real medical dataset.
From MIMIC III we extracted the patients on antibiotics, with trajectories up to 30 timesteps, thus obtaining a dataset with 3487 patients.
For each patient, we extracted 25 patient covariates including lab tests and vital signs measured over time, as well as static patient features such as age and gender.
We used a binary treatment at each timestep indicating whether the patient was administered antibiotics or not.
Note that for the longitudinal covariates we used aggregate value for each day since the
ICU admission.
The reason for this is because antibiotic treatment is decided daily for the patient.
We split the dataset into 2826 / 313 / 348 patients for training, validation and testing respectively.
We performed hyperparameter optimization on the validation patient set, using the search ranges in Table 5 and we again selected hyperparameters based on the error on the factual outcomes.
We estimate the individualized effect of antibiotics assigned over time on the patient’s white blood cell count.
A high white blood cell count is associated with severe illness and poor outcome for ICU patients (Waheed et al., 2003).
Antibiotic administration in the ICU aims to reduce the white blood cell count.
However, the effectiveness of the antibiotics treatment in reducing the white blood cell count is highly dependent on the time they are administered with respect to the history of the patient covariates.
In this context we again have time-dependent confounders: the patient features change over time and are affected by the previous administration of antibiotics.
Moreover, the history of the patient features also determines antibiotics administration and affects future patient outcomes (De Bus et al., 2018; Ali et al., 2019).
In Table 10 we report the root mean squared error for factual prediction of the patients’ white blood cell count for multiple prediction horizons τ .
Note that for this dataset we do not have access to counterfactual data, which is why we report error on factual predictions.
for τ -step-ahead prediction of factual outcomes on MIMIC III
[Table]
We notice that CRN also achieves better performance than RMSN in estimating factual outcomes in a real-world dataset containing electronic health records.
In this context, where couterfactual data is not available, domain expert knowledge is required to validate the model’s counterfactual predictions under other antibiotic treatment alternatives.
This further medical validation is outside the scope of this paper.