Blind Image Restoration with Flow Based Priors

Leonhard Helminger, Michael Bernasconi, Abdelaziz Djelouah, Markus H. Gross, Christopher SchroersarXiv 2020

Abstract

Image restoration has seen great progress in the last years thanks to the advances in deep neural networks. Most of these existing techniques are trained using full supervision with suitable image pairs to tackle a specific degradation. However, in a blind setting with unknown degradations this is not possible and a good prior remains crucial. Recently, neural network based approaches have been proposed to model such priors by leveraging either denoising autoencoders or the implicit regularization captured by the neural network structure itself. In contrast to this, we propose using normalizing flows to model the distribution of the target content and to use this as a prior in a maximum a posteriori (MAP) formulation. By expressing the MAP optimization process in the latent space through the learned bijective mapping, we are able to obtain solutions through gradient descent. To the best of our knowledge, this is the first work that explores normalizing flows as prior in image enhancement problems. Furthermore, we present experimental results for a number of different degradations on data sets varying in complexity and show competitive results when comparing with the deep image prior approach.

Introduction: The Challenge of Blind Restoration

Image restoration—the process of recovering a clean image from a blurry, noisy, or corrupted version—is a fundamental task in computer vision. While supervised deep learning models excel at specific tasks like denoising or super-resolution, they are often brittle. A model trained to remove Gaussian noise typically fails when faced with JPEG artifacts or scratches. This necessitates "blind" restoration, where the degradation type is unknown at test time.

Effective blind restoration relies on a strong image prior—a mathematical representation of what constitutes a "natural" image. Traditional priors, such as Total Variation, are often too simplistic for complex textures. Recent alternatives like the Deep Image Prior (DIP) leverage the inductive bias of convolutional architectures but can be slow and difficult to optimize. This research proposes a middle ground: using Normalizing Flows to learn a flexible, probabilistic prior that guides the restoration process.

Methodology: Normalizing Flows as Generative Priors

The core innovation lies in using Normalizing Flows (specifically the Glow architecture) as the image prior within a Maximum A Posteriori (MAP) framework.

1. Exact Likelihood and Bijectivity

Unlike GANs or VAEs, Normalizing Flows provide a bijective (invertible) mapping between the image space and a latent space. This allows for the computation of the exact probability $p(x)$ of an image. The restoration task is formulated as finding an image that maximizes the posterior—balancing fidelity to the corrupted input with the learned prior probability of being a "real" image.

2. Latent Space Optimization

Optimization is performed via gradient descent in the flow's latent space ($u$) rather than directly in pixel space. Since the flow maps complex natural images to a simple Gaussian distribution, the latent space is smoother and better suited for optimization, avoiding the "spiky" landscape of pixel-based distributions.

3. Multi-scale Strategy and Regularization

The model employs a coarse-to-fine strategy, starting optimization at low resolutions to capture global structure before refining details. To ensure stability, the authors introduced two specific losses:

  • Latent-Noise Loss ($\mathcal{L}_{ln}$): Ensures robustness by penalizing wild image changes resulting from small latent space perturbations.
  • Auto-Encoder Loss ($\mathcal{L}_{ae}$): Encourages the lowest latent levels to preserve essential image structure.

Experimental Setup

The approach was evaluated across three datasets of increasing complexity:

  • MNIST: Initial proof-of-concept for basic degradations.
  • Sprites: Synthetic character dataset used to validate the impact of the proposed regularization losses.
  • DIV2K: High-resolution natural images. The prior was trained on $64 \times 64$ patches, allowing it to generalize to images of any size by learning local natural image statistics.

Results and Discussion

The flow-based prior was compared against the state-of-the-art Deep Image Prior (DIP).

Quantitative Performance

On the DIV2K dataset, the proposed method significantly outperformed DIP in PSNR for JPEG artifact removal (30.29 vs 27.91) and for scenarios involving multiple combined degradations (29.87 vs 25.96).

Qualitative Comparison

Qualitative comparison of image restoration results on the DIV2K dataset showing superior reconstruction of text and facial features compared to DIP. Source, p. 2

Qualitative comparison of image restoration results on the DIV2K dataset showing superior reconstruction of text and facial features compared to DIP.

As shown in the figure above, the flow-based prior produces visually superior results. It excels at reconstructing semantic structures, such as sharp text on aircraft and realistic facial features (e.g., teeth), where DIP often introduces "checkerboard" artifacts or excessive blurring.

Versatility

A key advantage is the model's "blindness." A single trained model can simultaneously handle denoising, inpainting, and JPEG deblocking without task-specific retraining. It simply pushes the corrupted image back toward the manifold of "clean" images.

Conclusion and Future Work

While powerful, the method has limitations. The patch-based training ($64 \times 64$) limits its ability to perform large-scale "global" inpainting, as it lacks the context to fill holes larger than its patch size. Additionally, like DIP, the iterative optimization at test time is computationally intensive compared to feed-forward networks. Future work will explore incorporating larger global context and more advanced flow architectures to address these challenges.

Reference: Helminger, L., Bernasconi, M., Djelouah, A., Gross, M., & Schroers, C. (2020). Blind Image Restoration with Flow Based Priors. arXiv:2009.04583.

Summary updated

BibTeX
@misc{helminger2020blind,
  author = {Leonhard Helminger and Michael Bernasconi and Abdelaziz Djelouah and Markus H. Gross and Christopher Schroers},
  title = {{Blind Image Restoration with Flow Based Priors}},
  year = {2020},
  eprint = {2009.04583},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.04583},
}
Figure