Comprehensive Comparisons of Uniform Quantization in Deep Image Compression

Koki Tsubota, Kiyoharu AizawaIEEE Access 2023 · DOI · OpenReview

Abstract

In deep image compression, uniform quantization is applied to latent representations obtained by using an auto-encoder architecture for reducing bits and entropy coding. Quantization is a problem encountered in the end-to-end training of deep image compression. Quantization's gradient is zero, and it cannot backpropagate meaningful gradients. Many methods have been proposed to address the approximations of quantization to obtain gradients. However, there have not been equitable comparisons among them. In this study, we comprehensively compare the existing approximations of uniform quantization. Furthermore, we evaluate possible combinations of quantizers for the decoder and the entropy model, as the approximated quantizers can be different for them. We conduct experiments using three network architectures on two test datasets. The experimental results reveal that the best approximated quantization differs by the network architectures, and the best approximations of the three are different from the original ones used for the architectures. We also show that the combination of quantizers that uses universal quantization for the entropy model and differentiable soft quantization for the decoder is a comparatively good choice for different architectures and datasets.

Introduction

Deep image compression has emerged as a powerful alternative to traditional codecs like JPEG and HEVC. These systems typically utilize an autoencoder framework where an image is transformed into a latent representation, quantized, and then entropy-coded. While the encoder and decoder are differentiable neural networks, the quantization step—essential for actual data reduction—is inherently non-differentiable. This creates a significant hurdle for end-to-end training via backpropagation.

The Challenge of Quantization in Training

Quantization involves rounding continuous values to the nearest integer. Mathematically, this is a step function with a derivative of zero almost everywhere and undefined at the steps. Consequently, gradients cannot flow through the quantizer to update the encoder's weights. To circumvent this, researchers employ various differentiable approximations or "proxies" during the training phase.

Historically, different landmark papers have adopted different proxies—such as adding uniform noise or using straight-through estimators—often without a rigorous comparison of their relative effectiveness. Furthermore, most existing models use the same proxy for both the entropy model (which estimates bitrate) and the decoder (which reconstructs the image), despite these components having fundamentally different requirements.

Decoupled Quantization Framework

A key contribution of this research is the systematic evaluation of decoupled quantizers. The authors propose that the entropy model and the decoder can benefit from different approximation techniques. The entropy model requires a smooth approximation to minimize the "entropy estimation gap," while the decoder needs a proxy that closely mimics actual rounding to reduce the "discrete gap" in reconstruction.

Proposed deep image compression framework with decoupled quantizers for the entropy model and the decoder.

As shown in the figure above, the latent representation y is branched into two paths during training. One path uses a quantizer $q^{ent}$ for the entropy model, and the other uses $q^{dec}$ for the decoder. This decoupling allows for fine-tuning the training process to better satisfy the distinct objectives of bitrate estimation and image reconstruction.

Experimental Methodology

The study evaluated seven prominent quantization approximation methods:

  • AUN-Q (Additive Uniform Noise): The standard approach in many early models.
  • STE-Q (Straight-Through Estimator): Uses rounding in the forward pass and identity in the backward pass.
  • U-Q (Universal Quantization): A noise-based method that subtracts the same noise added before rounding.
  • SGA-Q (Stochastic Gumbel Annealing): A probabilistic approach.
  • STH-Q (Soft-then-Hard): Gradually transitions from soft to hard quantization.
  • DS-Q (Differentiable Soft Quantization): Uses hyperbolic tangent functions to approximate the rounding step.
  • SRA-Q (Stochastic Rounding with Annealing): Employs stochastic rounding with a decreasing temperature parameter.

The researchers tested 37 different combinations of these proxies across three major architectures: Ballé17, Ballé18, and Cheng20. Training was conducted on a subset of ImageNet, and evaluation was performed on the Kodak and CLIC 2020 datasets.

Key Results and Insights

The performance was measured using the Bjøntegaard Delta rate (BD-rate), where a lower percentage indicates better compression efficiency for a given quality level.

Suboptimal Defaults

The experiments revealed that the default quantization methods used in the original publications of Ballé17, Ballé18, and Cheng20 were suboptimal. By simply optimizing the choice of quantizer proxies, the authors achieved significant BD-rate improvements:

  • Ballé17: 9.38% improvement.
  • Ballé18: 6.94% improvement.
  • Cheng20: 3.15% improvement.

The Optimal Combination

While the absolute best combination varied slightly by architecture, a clear trend emerged. Noise-based methods like Universal Quantization (U-Q) were generally superior for the entropy model, as they provide a smoother landscape for probability estimation. Conversely, rounding-based methods like Differentiable Soft Quantization (DS-Q) performed better for the decoder by providing a more accurate proxy for the final discrete reconstruction. The combination of U-Q for entropy and DS-Q for the decoder was identified as a robust and high-performing choice across various settings.

Limitations and Future Work

Despite the performance gains, methods like DS-Q and SGA-Q introduce additional complexity through hyperparameter annealing, which requires careful tuning during training. Furthermore, the optimal choice of quantizer remains somewhat dependent on the specific network architecture. Future research could explore more automated ways to select these proxies or investigate the interplay between uniform and non-uniform quantization in a similar decoupled framework.

Conclusion

This comprehensive study demonstrates that the choice of quantization approximation is a critical yet often overlooked factor in the performance of deep image compression models. By decoupling the quantizers for the entropy model and the decoder, researchers can unlock substantial gains in compression efficiency without increasing model complexity. These findings suggest that future work in learned compression should carefully consider the "two-headed" nature of the quantization problem during the training phase.

Summary updated

Abstract

In deep image compression, uniform quantization is applied to latent representations obtained by using an auto-encoder architecture for reducing bits and entropy coding. Quantization is a problem encountered in the end-to-end training of deep image compression. Quantization’s gradient is zero, and it cannot backpropagate meaningful gradients. Many methods have been proposed to address the approximations of quantization to obtain gradients. However, there have not been equitable comparisons among them. In this study, we comprehensively compare the existing approximations of uniform quantization. Furthermore, we evaluate possible combinations of quantizers for the decoder and the entropy model, as the approximated quantizers can be different for them. We conduct experiments using three network architectures on two test datasets. The experimental results reveal that the best approximated quantization differs by the network architectures, and the best approximations of the three are different from the original ones used for the architectures. We also show that the combination of quantizers that uses universal quantization for the entropy model and differentiable soft quantization for the decoder is a comparatively good choice for different architectures and datasets.
BibTeX
@inproceedings{tsubota2023comprehensive,
  author = {Koki Tsubota and Kiyoharu Aizawa},
  title = {{Comprehensive Comparisons of Uniform Quantization in Deep Image Compression}},
  booktitle = {IEEE Access},
  year = {2023},
  doi = {10.48550/arxiv.2303.00587},
}
Figure