Skip to main content
QUICK REVIEW

[Paper Review] Compressing Images by Encoding Their Latent Representations with Relative Entropy Coding

Gergely Flamich, Marton Havasi|arXiv (Cornell University)|Oct 2, 2020
Generative Adversarial Networks and Image SynthesisComputer Science18 citations
TL;DR

This paper proposes Relative Entropy Coding (REC), a novel method for lossless and lossy image compression that directly encodes latent representations of Variational Autoencoders (VAEs) using index-based importance sampling, achieving codelengths close to the relative entropy between posterior and prior distributions. Unlike prior bits-back methods, REC eliminates auxiliary bits, works efficiently on single images, and operates in continuous latent spaces without quantization, outperforming existing methods on lossless benchmarks and matching state-of-the-art performance on lossy compression with PSNR and MS-SSIM metrics.

ABSTRACT

Variational Autoencoders (VAEs) have seen widespread use in learned image compression. They are used to learn expressive latent representations on which downstream compression methods can operate with high efficiency. Recently proposed 'bits-back' methods can indirectly encode the latent representation of images with codelength close to the relative entropy between the latent posterior and the prior. However, due to the underlying algorithm, these methods can only be used for lossless compression, and they only achieve their nominal efficiency when compressing multiple images simultaneously; they are inefficient for compressing single images. As an alternative, we propose a novel method, Relative Entropy Coding (REC), that can directly encode the latent representation with codelength close to the relative entropy for single images, supported by our empirical results obtained on the Cifar10, ImageNet32 and Kodak datasets. Moreover, unlike previous bits-back methods, REC is immediately applicable to lossy compression, where it is competitive with the state-of-the-art on the Kodak dataset.

Motivation & Objective

  • To address the inefficiency of existing bits-back methods for single-image lossless compression, which require auxiliary bits and degrade performance on isolated images.
  • To enable direct, efficient compression of continuous latent representations in VAEs without quantization, which hinders training and model scalability.
  • To develop a method that achieves codelengths close to the relative entropy between posterior and prior distributions for single images, enabling high-efficiency lossless and lossy compression.
  • To demonstrate that REC can be applied to off-the-shelf VAEs with continuous latent spaces, removing the need for non-differentiable quantization steps.

Proposed method

  • REC encodes a latent sample z ~ q(z|x) using its index i in a shared sequence of prior samples z₁, z₂, ..., zₙ ~ p(z), generated via a pseudo-random number generator with a shared seed.
  • The codelength of index i approximates the relative entropy KL[q(z|x) || p(z)] by leveraging importance sampling, where the probability of selecting index i is proportional to the posterior density q(zᵢ|x).
  • The receiver recovers z by reconstructing the i-th prior sample using the same shared random sequence, ensuring correct decoding without additional transmission.
  • Residuals are encoded separately using entropy coding (e.g., arithmetic coding) with codelength -log P(x|z), resulting in a total codelength close to the negative ELBO in expectation.
  • The method is implemented as index coding (iREC), which uses a fixed-size buffer of prior samples and dynamically selects the most likely zᵢ based on posterior density.
  • iREC avoids quantization by operating directly on continuous latent variables, enabling end-to-end training of VAEs without differentiability issues.

Experimental results

Research questions

  • RQ1Can a lossless compression method achieve codelengths close to the relative entropy between posterior and prior distributions for single images without requiring auxiliary bits?
  • RQ2Can a continuous latent space be used for image compression without introducing non-differentiable quantization steps during training?
  • RQ3Can REC be extended to lossy compression and achieve competitive performance with state-of-the-art learned compression methods?
  • RQ4Does the absence of auxiliary bits in REC significantly improve compression efficiency for single images compared to existing bits-back methods?

Key findings

  • iREC achieves lossless compression performance that significantly outperforms existing bits-back methods on single-image benchmarks, eliminating the need for auxiliary bits.
  • On the Cifar10, ImageNet32, and Kodak datasets, iREC achieves codelengths close to the theoretical lower bound given by the relative entropy, with no auxiliary overhead.
  • For lossy compression, iREC matches or exceeds the performance of state-of-the-art learned compression methods on both PSNR and MS-SSIM metrics, particularly on the Kodak dataset.
  • The method operates directly on continuous latent spaces, avoiding quantization and enabling training of VAEs without differentiability issues, which improves model scalability.
  • iREC maintains high efficiency even when the VAE has pruned or redundant latent dimensions, as the codelength depends only on relative entropy, not on the number of dimensions.
  • The compression speed remains a current limitation, though the authors note it as a target for future optimization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.