Lossy Compression with Gaussian Diffusion

Lucas Theis, Tim Salimans, Matthew Douglas Hoffman, Fabian MentzerICLR 2022

Abstract

We consider a novel lossy compression approach based on unconditional diffusion generative models, which we call DiffC. Unlike modern compression schemes which rely on transform coding and quantization to restrict the transmitted information, DiffC relies on the efficient communication of pixels corrupted by Gaussian noise. We implement a proof of concept and find that it works surprisingly well despite the lack of an encoder transform, outperforming the state-of-the-art generative compression method HiFiC on ImageNet 64x64. DiffC only uses a single model to encode and denoise corrupted pixels at arbitrary bitrates. The approach further provides support for progressive coding, that is, decoding from partial bit streams. We perform a rate-distortion analysis to gain a deeper understanding of its performance, providing analytical results for multivariate Gaussian data as well as theoretic bounds for general distributions. Furthermore, we prove that a flow-based reconstruction achieves a 3 dB gain over ancestral sampling at high bitrates.

Introduction

Traditional lossy compression standards like JPEG or BPG are optimized to minimize mathematical distortion, such as Mean Squared Error (MSE). While effective at preserving signal accuracy, these methods often introduce blurry or blocky artifacts at low bitrates, degrading perceptual quality. Recent advancements in generative compression aim to achieve "perfect realism"—reconstructing images that are perceptually indistinguishable from real ones, even if some fine-grained details are synthesized.

Most modern neural codecs utilize complex transform coding and quantization, often requiring separate models for different target bitrates. This paper introduces DiffC, a novel approach that leverages the generative power of diffusion models to bypass traditional transforms and handle compression directly through noise communication.

Methods

DiffC replaces the standard compression pipeline with a diffusion-based process that utilizes shared randomness between the encoder and decoder.

  1. Encoding via Noise: Instead of mapping pixels to a latent space, the encoder adds isotropic Gaussian noise to the image.
  2. Reverse Channel Coding: The noisy image is communicated efficiently by sending a sample from the noisy distribution. This technique leverages "shared randomness"—a pseudo-random seed known to both parties—to bypass the bitrate limits of deterministic encoders.
  3. Decoding via Denoising: The receiver uses an unconditionally trained diffusion model to denoise the received data.
Schematic of the DiffC compression pipeline showing encoding via noise and decoding via denoising.

The study explores two reconstruction methods: DiffC-A (Ancestral), which uses stochastic sampling, and DiffC-F (Flow-based), which employs a deterministic probability flow ODE for reconstruction.

Key Insights

  • The Power of Randomness: By using shared noise, DiffC can achieve high realism at bitrates where traditional deterministic methods typically fail.
  • Optimality of Isotropic Noise: Simple, uniform Gaussian noise was found to perform remarkably close to the theoretical optimum for natural images, simplifying the encoding process.
  • Flow-based Advantage: A theoretical and empirical finding of the paper is that flow-based reconstruction (DiffC-F) provides a 3 dB gain in Signal-to-Noise Ratio (SNR) over ancestral sampling at high bitrates.
  • Unified Model: A single DiffC model can handle any bitrate simply by changing the amount of noise added at the start, eliminating the need for multiple bitrate-specific models.

Key Results

Evaluations on the ImageNet 64x64 dataset demonstrate that DiffC-F significantly outperforms HiFiC, the previous state-of-the-art GAN-based codec, in terms of realism (FID scores).

Visual comparison of DiffC-F/A against HiFiC, BPG, and JPEG at low bitrates.

Quantitatively, DiffC-F achieved a PSNR approximately 2.4 dB higher than DiffC-A at high bitrates, validating the predicted 3 dB theoretical advantage. Qualitatively, DiffC avoids the "waxy" textures common in GAN-based methods, maintaining sharp and perceptually pleasing reconstructions even at extremely low bitrates (~0.2 bpp). Furthermore, the iterative nature of diffusion allows for natural progressive coding, where coarse versions of the image can be decoded from partial bitstreams.

Conclusion and Future Work

While DiffC sets a new frontier in realistic compression, it faces challenges regarding computational speed and coding complexity. Diffusion models require multiple neural network evaluations for decoding, and the current implementation of reverse channel coding is mathematically elegant but computationally intensive. Future research may involve applying DiffC within a latent space (similar to Latent Diffusion Models) to enhance speed while preserving its superior generative performance.

Summary updated

BibTeX
@inproceedings{theis2022lossy,
  author = {Lucas Theis and Tim Salimans and Matthew Douglas Hoffman and Fabian Mentzer},
  title = {{Lossy Compression with Gaussian Diffusion}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=FiEg5x7n5h},
}
Figure