Learned Compression of Encoding Distributions

Mateen Ulhaq, Ivan V. Bajic

In the world of AI-driven image compression, we often talk about "learning" the best way to represent data. However, a sneaky efficiency killer called the amortization gap often lingers in even the most advanced models. A new paper from researchers at Simon Fraser University, titled "Learned Compression of Encoding Distributions," proposes a clever, low-cost way to bridge this gap.

TL;DR

The authors propose a method to dynamically adapt the probability distributions used in entropy coding to match the specific characteristics of each input image. By compressing and transmitting these custom distributions as side information, they achieve a 7.10% bitrate reduction on the Kodak dataset with a fraction of the computational cost of existing methods.

What Problem Does This Paper Address?

Most learned image compression models rely on an "entropy bottleneck." This component uses a probability distribution to encode "latents" (the compressed representation of an image).

The problem? Standard models typically use a static distribution learned during training. This distribution is "average-optimal"—it tries to be a "jack of all trades" for every possible image. In reality, the distribution of data for a specific image (e.g., a picture of a blue sky vs. a busy forest) varies wildly. This mismatch between the static "average" distribution and the actual "instance-specific" distribution is known as the amortization gap.

While existing solutions like the "scale hyperprior" help by predicting distribution parameters spatially, they are often computationally expensive and assume the data follows a specific shape (like a Gaussian curve).

Methods

The authors introduce an Adaptive Entropy Bottleneck. Instead of relying on a fixed distribution, the model performs the following steps for each input image:

  1. Histogram Estimation: It calculates a 1D histogram of the latent representation for each channel. To keep this process "differentiable" (so the AI can learn from it), they use Kernel Density Estimation (KDE) with a triangular kernel and a Straight-Through Estimator (STE).
  2. Distribution Compression: This histogram is treated as data itself. It is passed through a tiny five-layer convolutional neural network (an analysis transform $h_{a,q}$) to create a very small bitstream of side information.
  3. Reconstruction: The decoder receives this side information and uses a synthesis transform ($h_{s,q}$) to reconstruct the custom encoding distribution ($\hat{p}$).
  4. Efficient Coding: The actual image latents are then decompressed using this tailored distribution rather than a generic one.

The key innovation here is shifting the complexity from the spatial domain (processing every pixel) to the histogram domain. By collapsing spatial dimensions into a 1D histogram first, the subsequent convolutions are incredibly lightweight.

Datasets

  • Training: The model was trained using 256 × 256 image patches from the Vimeo-90K triplet dataset.
  • Evaluation: Performance was measured on the Kodak test dataset, a standard benchmark containing 24 high-quality images.

Key Insights and Ideas

  • The "Aha" Moment: You don't necessarily need complex spatial modeling to improve entropy estimates. Simply knowing the global distribution of values within a specific image channel provides a massive boost in efficiency.
  • Optimization Intuition: The authors derived that the gradient of the rate cost is proportional to the difference in code lengths between neighboring bins in the histogram. This provides a clear mathematical link between how the model adjusts its weights and Shannon’s measure of entropy.
  • Computational "Free Lunch": Because the method operates on 1D histograms rather than 2D feature maps, it avoids the heavy Multiply-Accumulate (MAC) operations that plague other side-information methods.

Key Results

  • Rate Savings: The method achieved a -7.10% Bjøntegaard-Delta (BD)-rate gain over the standard fully-factorized architecture. This means it can represent the same image quality using 7.1% fewer bits.
  • Near-Theoretical Performance: The authors calculated that the maximum possible gain from perfectly closing the amortization gap was 8.21%. Their method captured the vast majority of that potential.
  • Extreme Efficiency: Compared to the popular "scale hyperprior" method, this approach uses 96–99% fewer MACs per pixel and roughly 96% fewer parameters. This makes it highly suitable for mobile or edge devices where power and compute are limited.

Limitations and Future Work

While the results are impressive, the authors note a few areas for growth:

  • End-to-End Training: In this study, the base compression model was kept frozen while the distribution compressor was trained. The authors found that training everything together from scratch currently leads to some instability, which they aim to solve.
  • Beyond Fully-Factorized Models: The current work focuses on the simplest entropy model. The next step is applying this "distribution correction" to more complex models, such as those using Gaussian Mixture Models (GMMs), to see if the gains stack.
  • Dynamic Rate Control: Future versions could adaptively decide how many bits to spend on the side information based on how much it actually helps compress the specific image at hand.

Summary updated

BibTeX
@inproceedings{ulhaq2024learned,
  author = {Mateen Ulhaq and Ivan V. Bajic},
  title = {{Learned Compression of Encoding Distributions}},
  booktitle = {ICIP},
  year = {2024},
  url = {https://openreview.net/forum?id=WptihQBCfO},
}
Figure