CSDI: Conditional Score-based Diffusion Models for Probabilistic Time Series Imputation

Yusuke Tashiro, Jiaming Song, Yang Song, Stefano Ermon

Missing values in multivariate time series data are a pervasive problem across domains like healthcare and environmental monitoring. Sensors fail, human errors occur, and data is frequently lost. Accurately estimating these missing values—a process known as imputation—is critical for downstream analysis.

Presented at NeurIPS 2021, CSDI (Conditional Score-based Diffusion models for Imputation) introduces a powerful new framework for filling in the "blanks" in multivariate time series data. By utilizing a novel 2D attention mechanism and a self-supervised training strategy, CSDI outperforms existing probabilistic methods by 40-65% and sets a new state-of-the-art for deterministic imputation.

The Challenge of Time Series Imputation

Multivariate time series track multiple variables over time, such as a patient's vital signs in an ICU or air quality sensors across a city. Traditional imputation methods often rely on autoregressive models, which predict the next step based on the previous ones. However, these models struggle to capture complex, non-linear correlations across different variables and time steps simultaneously.

Recently, generative models like Diffusion Models have shown incredible promise in creating images and audio. Yet, applying them to imputation has typically been an "afterthought." Researchers often take a model trained to generate data from scratch and try to force it to respect observed values during inference. This unconditional training approach leads to sub-optimal results because the model isn't explicitly built to exploit the specific relationships between the observed data and the missing gaps.

Methods: The CSDI Approach

CSDI shifts the paradigm by training the diffusion model to be inherently conditional. The framework relies on three core innovations:

1. Conditional Diffusion

Unlike standard diffusion models that turn an entire data sample into noise, CSDI only applies the forward diffusion process (adding noise) to the missing values (the imputation targets). The observed values remain "clean" and act as a continuous guide for the denoising process.

Conditional Diffusion Process

By letting the model "see" the observed data during every step of training, it learns to use those observations as anchors, effectively learning the conditional distribution rather than approximating a posterior from a pre-trained prior.

2. 2D Attention Mechanism

To handle the complex structure of multivariate time series, CSDI implements a 2D Transformer architecture. In each residual layer, the model performs two types of attention:

  • Temporal Attention: Learns dependencies across different time points for a single feature.
  • Feature Attention: Learns dependencies between different features at a single time point. This allows the model to exploit cross-feature correlations—for example, recognizing that if a patient's blood pressure drops, their heart rate might change in a predictable way.

3. Self-Supervised Training

To train the model when ground-truth missing values aren't known, the authors employ a self-supervised masking strategy. They take fully observed sections of data, artificially "mask" some values to create targets, and train the model to recover them using the remaining observed data.

Key Results and Performance

The authors evaluated CSDI on several diverse benchmarks, including the PhysioNet Challenge 2012 dataset (healthcare) and a Beijing PM2.5 dataset (environmental).

CSDI vs GP-VAE on Healthcare and Air Quality Datasets

The results demonstrate significant improvements over existing baselines:

  • Probabilistic Imputation: CSDI improved the Continuous Ranked Probability Score (CRPS)—a measure of how well a model captures uncertainty—by 40-65% over top-tier baselines like GP-VAE.
  • Deterministic Imputation: When used to provide a single "best guess" (the median of generated samples), CSDI reduced the Mean Absolute Error (MAE) by 5-20% compared to state-of-the-art deterministic models like BRITS and GLIMA.
  • Robustness: CSDI maintained high performance even when up to 90% of the data was missing, whereas competing models degraded significantly.

Furthermore, CSDI proved highly versatile. The authors demonstrated that "forecasting" is simply a special case of imputation where all missing values lie in the future, allowing CSDI to compete with specialized forecasting models without altering its core architecture.

Limitations and Future Work

While highly accurate, CSDI shares the computational cost inherent to all diffusion models. Generating a sample requires multiple iterative steps (e.g., 50 steps in this study), making it slower than "one-shot" models like RNNs. Future work could explore ODE solvers to accelerate this process. Additionally, while the imputation accuracy is vastly improved, further research is needed to quantify how this enhanced data quality impacts downstream clinical or operational tasks.

Overall, CSDI presents a highly effective, generalized framework that successfully adapts the power of score-based diffusion to the nuanced challenges of time series imputation.

Summary updated

BibTeX
@inproceedings{tashiro2021csdi,
  author = {YUSUKE TASHIRO and Jiaming Song and Yang Song and Stefano Ermon},
  title = {{CSDI: Conditional Score-based Diffusion Models for Probabilistic Time Series Imputation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=VzuIzbRDrum},
}
Figure