Bayesian Image Reconstruction using Deep Generative Models

Razvan V. Marinescu, Daniel Moyer, Polina Golland

Abstract

Machine learning models are commonly trained end-to-end in a supervised setting using paired data. However, these approaches are brittle to distribution shifts and often require retraining for every new corruption type. In this work, we introduce Bayesian Reconstruction through Generative Models (BRGM), a framework that leverages pre-trained generative models (e.g., StyleGAN2) as powerful image priors. By applying Bayes' theorem, BRGM uses a single fixed generator to solve diverse restoration tasks like super-resolution and in-painting across face and medical imaging datasets. Our approach yields performance competitive with task-specific state-of-the-art methods while offering superior generalizability without task-specific training.

Introduction: The Limitations of Supervised Reconstruction

Traditional deep learning for image reconstruction typically relies on training models to directly invert specific corruptions. While effective, this end-to-end supervised approach has significant drawbacks. First, it is brittle; a model trained on one type of blur or noise often fails when faced with a different degradation. Second, in ill-posed problems where many high-resolution images could map to the same low-resolution input, these models often produce a blurry "average" rather than a sharp, realistic reconstruction.

Traditional end-to-end supervised approach for image reconstruction.

The BRGM Framework

BRGM shifts the paradigm by treating reconstruction as a Bayesian inference problem. Instead of learning an inverse mapping, we utilize a high-quality, pre-trained generator $G$ and keep its weights fixed. The generator acts as a learned prior, representing the manifold of realistic images.

The proposed BRGM framework leveraging a pre-trained generator and known corruption models.

To reconstruct an image, we optimize for the latent vector $w$ that, when passed through the generator, produces an image $G(w)$ that matches the corrupted input $I$ after applying a known forward corruption model $f$ (e.g., downsampling).

Key Methodological Components

  • MAP Estimation and Variational Inference: We estimate the Maximum A-Posteriori (MAP) latent vector and use Variational Inference to approximate the posterior distribution. This allows BRGM to sample multiple plausible solutions, providing a way to quantify uncertainty—a critical feature for medical applications.
  • Latent Space Priors: We introduce a colinearity loss to ensure latent vectors across different layers of the generator remain consistent, which prevents visual artifacts and improves stability.
  • Likelihood Model: The optimization uses a combination of pixel-wise $L_2$ loss and a perceptual VGG loss to ensure the output is both accurate to the input and visually convincing.

Experimental Results

We evaluated BRGM on three diverse datasets: FFHQ (faces), MIMIC III (chest X-rays), and a large collection of brain MRI scans.

  • Zero-Shot Versatility: Without any task-specific training, BRGM achieved results competitive with state-of-the-art supervised models like ESRGAN.
  • Low-Resolution Performance: BRGM significantly outperformed other methods at extreme 16x16 resolutions, where the generative prior is most critical for "hallucinating" missing details.
  • Medical Utility: Reconstructions of chest X-rays were shown to preserve clinically relevant features, maintaining high accuracy when processed by downstream diagnostic models.

Conclusion

BRGM demonstrates that pre-trained generative models can serve as robust, universal priors for image reconstruction. While the method is currently slower than feed-forward models due to the inference-time optimization, its ability to generalize across tasks and provide uncertainty estimates makes it a powerful tool for complex imaging domains.

Summary updated

BibTeX
@inproceedings{marinescu2021bayesian,
  author = {Razvan V. Marinescu and Daniel Moyer and Polina Golland},
  title = {{Bayesian Image Reconstruction using Deep Generative Models}},
  booktitle = {DGMs Applications @ NeurIPS},
  year = {2021},
  url = {https://openreview.net/forum?id=P5y8Ux34Exj},
}
Figure