Abstract
Estimating counterfactual outcomes over time has the potential to unlock personalized healthcare by assisting decision-makers to answer "what-if" questions. Existing causal inference approaches typically consider regular, discrete-time intervals between observations and treatment decisions and hence are unable to naturally model irregularly sampled data, which is the common setting in practice. To handle arbitrary observation patterns, we interpret the data as samples from an underlying continuous-time process and propose to model its latent trajectory explicitly using the mathematics of controlled differential equations. This leads to a new approach, the Treatment Effect Neural Controlled Differential Equation (TE-CDE), that allows the potential outcomes to be evaluated at any time point. In addition, adversarial training is used to adjust for time-dependent confounding which is critical in longitudinal settings and is an added challenge not encountered in conventional time-series. To assess solutions to this problem, we propose a controllable simulation environment based on a model of tumor growth for a range of scenarios with irregular sampling reflective of a variety of clinical scenarios. TE-CDE consistently outperforms existing approaches in all simulated scenarios with irregular sampling.
Introduction
In personalized medicine, clinicians often face "what-if" scenarios: What would happen to this patient if I changed their treatment dose today versus next week? Answering these counterfactual questions requires modeling the longitudinal effects of treatments. However, real-world medical data is inherently "messy." Patients miss appointments, sicker patients are monitored more frequently, and lab tests are ordered at arbitrary times, leading to irregularly sampled data.
Existing longitudinal causal inference models, such as the Counterfactual Recurrent Network (CRN), generally assume that data arrives at regular, discrete intervals. These models struggle with the arbitrary observation patterns found in clinical practice. Furthermore, these scenarios suffer from time-dependent confounding: a patient’s past health state influences treatment decisions, which in turn affects future health. Standard models often fail to account for the bias introduced by these shifting treatment policies. To bridge this gap, we propose treating a patient's health trajectory as a continuous-time process.
Methods: The TE-CDE Framework
We introduce the Treatment Effect Neural Controlled Differential Equation (TE-CDE). Unlike standard Neural ODEs, where the trajectory is determined solely by the initial state, Neural CDEs are "driven" by an external path—in this case, the incoming stream of covariates and treatments. This allows the model to update its latent state $Z_t$ continuously as new data arrives.
Encoder-Decoder Architecture
The framework utilizes a dual-CDE structure:
- Encoder: A CDE that ingests historical observations (covariates and treatments) to build a continuous latent representation of the patient's state.
- Decoder: Another CDE that takes a hypothesized future treatment plan and evolves the latent state to predict potential outcomes at any future time point.
Adjusting for Confounding
To handle time-dependent confounding, we employ Domain Adversarial Training. A discriminator attempts to predict the treatment assigned from the latent state $Z_t$, while the encoder is trained to make $Z_t$ "treatment-invariant." This minimax game ensures the model learns a balanced representation that is not biased by the specific treatment policy used in the training data. Additionally, the model incorporates "sampling counts" as an input feature, recognizing that the frequency of observations often serves as a proxy for patient severity.
Experimental Evaluation
Evaluating counterfactual models is challenging because the "road not taken" is never observable in real-world data. To address this, we utilized a sophisticated Pharmacokinetic-Pharmacodynamic (PK-PD) model of lung cancer to generate ground-truth outcomes for any treatment schedule. We used a Hawkes process to simulate realistic, irregular clinical observation timestamps.
We also validated the model on the MIMIC-III ICU dataset to assess performance on factual (observed) outcome prediction, specifically tracking white blood cell counts in response to antibiotics.
Key Results
- Superior Accuracy: TE-CDE consistently outperformed state-of-the-art discrete models like CRN and RMSN. In scenarios with high time-dependent confounding, TE-CDE achieved a 36% reduction in Root Mean Square Error (RMSE) compared to the next best method.
- Robust Decision Support: When used to select the optimal treatment to minimize tumor size, TE-CDE was significantly more accurate than benchmarks, with the performance gap widening as confounding increased.
- Data Efficiency: TE-CDE proved more robust to small datasets. With only 1,000 training samples, its performance degradation was minimal compared to RNN-based models, suggesting that the continuous-time prior effectively regularizes the learning of dynamics.
- Uncertainty Awareness: By implementing MC-Dropout, TE-CDE can flag uncertain predictions. Deferring the most uncertain 10% of cases to a human clinician drastically improved overall system accuracy.
Conclusion
By modeling the underlying continuous process rather than discrete time steps, TE-CDE avoids the need for interpolation or imputation of missing data. While training Neural CDEs is more computationally intensive than standard backpropagation, the gains in accuracy and the ability to handle irregular sampling make it a powerful tool for clinical decision support. Future work will explore more complex "informative sampling" mechanisms where the act of measurement itself might affect the patient's state.
Summary updated