An Expectation-Maximization Algorithm for Training Clean Diffusion Models from Corrupted Observations

WeiminBai, Yifei Wang, Wenzheng Chen, He Sun

Training high-quality diffusion models (DMs) typically requires massive datasets of pristine, clean images—a luxury many scientific fields simply do not have. EMDiffusion breaks this "clean data bottleneck" by utilizing an Expectation-Maximization (EM) framework. By iteratively reconstructing clean images from corrupted observations and retraining the model on those reconstructions, EMDiffusion achieves state-of-the-art results in inpainting, denoising, and deblurring, even when initialized with as few as 10 clean images.

The "Clean Data" Bottleneck

Diffusion models are the current gold standard for generative modeling and solving inverse problems (like restoring a blurry photo). However, they suffer from a "chicken-and-egg" dilemma: to solve an inverse problem effectively, you need a DM trained on a large-scale clean dataset. In fields like medical imaging (e.g., CT scans) or microscopy (e.g., cryo-EM), clean data is often impossible to obtain; researchers only have access to "corrupted" observations that are noisy, blurry, or incomplete.

Existing methods for training on corrupted data often struggle. Some are limited to specific types of corruption, like masking, while others produce overly smooth results or require a pre-trained model to start. EMDiffusion asks a fundamental question: Can we train a powerful diffusion model from scratch using primarily corrupted data?

The EMDiffusion Framework

To solve this, the authors propose treating the underlying clean images as "latent variables" within an Expectation-Maximization (EM) framework.

The EMDiffusion framework alternates between E-steps (reconstructing images) and M-steps (updating model weights).

The process is broken down into three main phases:

  1. Initialization: The model starts by training a "vague" diffusion model on a tiny set of clean images (as few as 10–50). This provides a basic manifold for the model to start from.
  2. E-Step (Expectation): Using the current, imperfect diffusion model, the system performs Adaptive Diffusion Posterior Sampling (DPS) to reconstruct clean images from the large-scale corrupted dataset.
  3. M-Step (Maximization): The diffusion model's weights are updated by training it on the newly reconstructed "clean" images from the E-step using standard denoising score matching.

The algorithm alternates between these steps. As the reconstructions get cleaner, the model gets smarter, which in turn makes the next round of reconstructions even better.

Key Insights and Mechanisms

The Power of $\lambda$: To prevent the model from collapsing into the few images it saw during initialization, the authors introduce a hyperparameter $\lambda$ that balances the "prior" (what the model thinks an image looks like) and the "likelihood" (consistency with the corrupted observation).

Effect of the hyperparameter $\lambda$ on image reconstruction from masked observations.

In the early stages, the diffusion prior is weak and biased. By heavily weighting the data likelihood (high $\lambda$), the E-step forces the reconstructions to stay true to the observations rather than just hallucinating the few clean images seen during initialization. The system automatically tunes $\lambda$ to minimize data loss.

Robustness to Initialization: Surprisingly, the initial clean images do not even have to come from the same distribution. The authors found that a model initialized on CelebA faces could still successfully learn to reconstruct CIFAR-10 objects.

Phase-Based Training: The authors found that "forgetting" is useful. In later stages of training, they reset the model weights and retrain from scratch on the latest reconstructions to remove the "memory" of the noisy, low-quality samples from early iterations.

Experimental Results

The researchers evaluated EMDiffusion on two standard benchmarks: CIFAR-10 (50,000 object images) and CelebA (30,000 human faces). For each task, they used only 50 clean images for initialization and 5,000 corrupted images for the iterative EM training.

EMDiffusion consistently outperformed existing baselines like SURE-Score and AmbientDiffusion across three major tasks:

  • Inpainting (60% pixels masked): On CIFAR-10, EMDiffusion achieved a PSNR of 24.70, significantly higher than AmbientDiffusion (20.57) and SURE-Score (15.75). It nearly matched the performance of a model trained on a 100% clean dataset (25.44).
  • Denoising: It achieved a PSNR of 23.16 on CIFAR-10, outperforming SURE-Score (22.42).
  • Deblurring: On CelebA, it reached a PSNR of 23.74, whereas SURE-Score trailed at 22.07.
  • Generative Quality: The Fréchet Inception Distance (FID)—a measure of how realistic generated images look—was dramatically better. For inpainting, EMDiffusion hit an FID of 21.08, while AmbientDiffusion was at 28.88 and SURE-Score was at a much poorer 220.01.

Limitations and Future Work

While powerful, EMDiffusion has a few hurdles. First, the algorithm currently requires a known and differentiable forward model (i.e., you must know exactly how the image was blurred or masked). Second, alternating between posterior sampling (E-step) and model training (M-step) is computationally expensive compared to standard training. Finally, the approximation used in the E-step (Tweedie’s formula) can sometimes introduce sharp artifacts, which might affect the FID score in tasks like deblurring.

Future work will likely focus on extending the method to handle unknown forward models or unknown noise statistics, making it even more applicable to "in-the-wild" scientific data.

Summary updated

BibTeX
@inproceedings{weiminbai2024expectation,
  author = {WeiminBai and Yifei Wang and Wenzheng Chen and He Sun},
  title = {{An Expectation-Maximization Algorithm for Training Clean Diffusion Models from Corrupted Observations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=jURBh4V9N4},
}
Figure