Learned Lossless Image Compression With Combined Autoregressive Models And Attention Modules

Ran Wang, Jinming Liu, Heming Sun, Jiro KattoarXiv 2022 · OpenReview

Abstract

Lossless image compression is an essential research field in image compression. Recently, learning-based image compression methods achieved impressive performance compared with traditional lossless methods, such as WebP, JPEG2000, and FLIF. However, there are still many impressive lossy compression methods that can be applied to lossless compression. Therefore, in this paper, we explore the methods widely used in lossy compression and apply them to lossless compression. Inspired by the impressive performance of the Gaussian mixture model (GMM) shown in lossy compression, we generate a lossless network architecture with GMM. Besides noticing the successful achievements of attention modules and autoregressive models, we propose to utilize attention modules and add an extra autoregressive model for raw images in our network architecture to boost the performance. Experimental results show that our approach outperforms most classical lossless compression methods and existing learning-based methods.

Introduction

Lossless image compression is a "perfect reconstruction" challenge where every single bit of the original image must be recoverable. While traditional methods like PNG or JPEG2000 are ubiquitous, they rely on hand-crafted algorithms that struggle to capture the complex, high-level spatial correlations found in modern imagery. This paper bridges the gap between lossy and lossless image compression by adapting high-performance components from lossy models—specifically Gaussian Mixture Models (GMMs) and attention modules—to more accurately predict pixel values and reduce the required storage bits.

Methods

The proposed architecture is built upon a convolutional autoencoder, enhanced by three key innovations designed to improve coding efficiency:

  1. Gaussian Mixture Model (GMM): Instead of assuming a simple distribution for latent features, the model employs a GMM to represent complex and nuanced data distributions.
  2. Attention Modules: Simplified attention mechanisms are incorporated into the encoder and decoder, allowing the network to focus its bit-budget on the most informative parts of the image.
  3. Dual Autoregressive Modeling: Beyond the standard context model for latent representations, the authors add a second autoregressive layer (a masked convolution) directly on the reconstructed image. This layer predicts current pixels based on previously decoded ones, capturing local spatial redundancies that global representations might miss.
The complete architecture of the proposed lossless image compression model, featuring dual context models and arithmetic coding blocks.

Datasets and Evaluation

The model was trained on 40,000 patches (256×256) from the ImageNet dataset. While ImageNet is a standard computer vision source, it provides a robust general-purpose foundation for training. Performance was evaluated across three benchmark datasets:

  • CLICP and CLICM: From the Challenge on Learned Image Compression.
  • DIV2K: A high-quality dataset typically used for image restoration and super-resolution.

Key Insights and Results

The primary finding is that architectural components typically optimized for lossy compression, such as GMMs and attention, are equally potent in lossless scenarios. The addition of the masked autoregressive layer provides a substantial performance jump by reducing uncertainty in local spatial contexts.

Comparison of various architectural configurations (a-e) used to evaluate the impact of different components like GMM priors and hyper-encoders.

Performance is measured in bits per sub-pixel (bpsp), where lower values indicate better compression:

  • Vs. Traditional Methods: The proposed method outperformed PNG by 40-48% and beat JPEG2000 and WebP by approximately 5-8%.
  • Vs. Learned Methods: It outperformed L3C, a popular hierarchical model, by about 5.2% on DIV2K.
  • The "FLIF" Exception: The model was slightly outperformed by FLIF, highlighting that specialized hand-crafted logic still holds a narrow lead in certain domains.

Conclusion and Future Work

While the model achieves state-of-the-art results, it faces challenges regarding computational complexity, as autoregressive models require sequential pixel processing during decoding. Future work may explore more diverse training datasets and different context model architectures to capture wider global-scope spatial correlations or cross-channel relationships.

Summary updated

Abstract

Lossless image compression is an essential research field in image compression. Recently, learning-based image compression methods achieved impressive performance compared with traditional lossless methods, such as WebP, JPEG2000, and FLIF. However, there are still many impressive lossy compression methods that can be applied to lossless compression. Therefore, in this paper, we explore the methods widely used in lossy compression and apply them to lossless compression. Inspired by the impressive performance of the Gaussian mixture model (GMM) shown in lossy compression, we generate a lossless network architecture with GMM. Besides noticing the successful achievements of attention modules and autoregressive models, we propose to utilize attention modules and add an extra autoregressive model for raw images in our network architecture to boost the performance. Experimental results show that our approach outperforms most classical lossless compression methods and existing learning-based methods.
BibTeX
@misc{wang2022learned,
  author = {Ran Wang and Jinming Liu and Heming Sun and Jiro Katto},
  title = {{Learned Lossless Image Compression With Combined Autoregressive Models And Attention Modules}},
  year = {2022},
  eprint = {2208.13974},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.13974},
}
Figure