Abstract
Deep learning based image compression has recently witnessed exciting progress and in some cases even managed to surpass transform coding based approaches that have been established and refined over many decades. However, state-of-the-art solutions for deep image compression typically employ autoencoders which map the input to a lower dimensional latent space and thus irreversibly discard information already before quantization. Due to that, they inherently limit the range of quality levels that can be covered. In contrast, traditional approaches in image compression allow for a larger range of quality levels. Interestingly, they employ an invertible transformation before performing the quantization step which explicitly discards information. Inspired by this, we propose a deep image compression method that is able to go from low bit-rates to near lossless quality by leveraging normalizing flows to learn a bijective mapping from the image space to a latent representation. In addition to this, we demonstrate further advantages unique to our solution, such as the ability to maintain constant quality results through re-encoding, even when performed multiple times. To the best of our knowledge, this is the first work to explore the opportunities for leveraging normalizing flows for lossy image compression.
Introduction
Traditional image compression standards like JPEG and BPG rely on invertible transforms (such as the Discrete Cosine Transform) followed by a quantization step. In contrast, modern deep learning-based compression typically utilizes Variational Autoencoders (VAEs). While VAEs have achieved impressive results, they possess a fundamental architectural bottleneck: the dimensionality reduction step irreversibly discards information before quantization even occurs. This creates an inherent "quality ceiling" and leads to significant degradation when an image is repeatedly re-encoded.
This paper introduces a novel approach using Normalizing Flows to create a fully invertible, bijective mapping between the image space and the latent representation. By ensuring that no information is lost during the transformation itself, the model allows for a single architecture to scale from low bitrates to near-lossless quality, while also solving the long-standing problem of generation loss in neural codecs.
Methodology
Bijective Architecture
The core of the proposed method is a hierarchical normalizing flow based on the RealNVP architecture. It employs a series of "squeeze" operations, additive coupling layers, and factor-out layers. Unlike autoencoders, these flows are mathematically designed to be two-way and fully invertible. This means the latent representation contains the exact same amount of information as the original image pixels before the quantization step is applied.
Compression Pipeline
- Transformation: The image is mapped to a latent space via the normalizing flow.
- Quantization: The latents are rounded to discrete values. This is the only stage where information is lost. During training, "universal quantization" (adding uniform noise) is used to maintain differentiability.
- Entropy Coding: The quantized values are compressed using an arithmetic coder. To optimize bitrate, the model uses a probability threshold; if the predicted mean of a latent value is highly certain, the value is not transmitted, and the decoder simply reconstructs the mean.
Key Advantages and Results
Overcoming the Quality Ceiling
Because the transformation is bijective, the model does not have a fixed bottleneck. By simply decreasing the quantization step size, the model can achieve near-lossless reconstructions with extremely high PSNR values. This allows a single trained model to cover a much wider range of the rate-distortion curve than traditional fixed-bottleneck autoencoders.
Stability Under Repeated Re-encoding
A unique benefit of this approach is its stability during sequential re-encoding. In many media pipelines, images are compressed, edited, and re-saved multiple times. In standard VAE-based models, errors compound with each iteration, leading to severe artifacts and color shifts. Because the flow-based model maps quantized latents back to the image space bijectively, the degradation effectively stops after the first compression.
As shown in the comparison above, after 12 iterations (N=12), the baseline autoencoder exhibits massive structural breakdown and color distortion in both the lifebuoy and fence regions. The proposed normalizing flow model, however, remains visually indistinguishable from the first iteration.
Progressive Transmission
The hierarchical "factor-out" structure naturally supports progressive loading. A decoder can receive the base layers for a low-resolution preview and then progressively receive higher-frequency latent layers to refine the image to full quality without needing to download a separate file.
Conclusion
By replacing the traditional autoencoder bottleneck with a bijective normalizing flow, this work demonstrates a more flexible and robust framework for neural image compression. While current flow-based models face challenges in the extremely low-bitrate regime compared to highly specialized VAEs, their ability to reach near-lossless quality and eliminate re-encoding artifacts represents a significant step forward for practical deep learning codecs.
Summary updated