[Paper Review] Image Compression with Product Quantized Masked Image Modeling
This paper proposes PQ-MIM, a novel image compression framework that combines product quantization with masked image modeling to achieve state-of-the-art rate-distortion performance. By replacing scalar quantization with product quantization and using a transformer-based conditional entropy model to exploit spatial dependencies in latent codes, PQ-MIM achieves competitive PSNR and superior perceptual quality (FID, KID) compared to HiFiC, while enabling hybrid compression-generation operation with no fine-tuning.
Recent neural compression methods have been based on the popular hyperprior framework. It relies on Scalar Quantization and offers a very strong compression performance. This contrasts from recent advances in image generation and representation learning, where Vector Quantization is more commonly employed. In this work, we attempt to bring these lines of research closer by revisiting vector quantization for image compression. We build upon the VQ-VAE framework and introduce several modifications. First, we replace the vanilla vector quantizer by a product quantizer. This intermediate solution between vector and scalar quantization allows for a much wider set of rate-distortion points: It implicitly defines high-quality quantizers that would otherwise require intractably large codebooks. Second, inspired by the success of Masked Image Modeling (MIM) in the context of self-supervised learning and generative image models, we propose a novel conditional entropy model which improves entropy coding by modelling the co-dependencies of the quantized latent codes. The resulting PQ-MIM model is surprisingly effective: its compression performance on par with recent hyperprior methods. It also outperforms HiFiC in terms of FID and KID metrics when optimized with perceptual losses (e.g. adversarial). Finally, since PQ-MIM is compatible with image generation frameworks, we show qualitatively that it can operate under a hybrid mode between compression and generation, with no further training or finetuning. As a result, we explore the extreme compression regime where an image is compressed into 200 bytes, i.e., less than a tweet.
Motivation & Objective
- To bridge the methodological gap between neural image compression and image generation by unifying vector quantization and masked image modeling.
- To address the limitations of scalar quantization in neural compression by introducing product quantization for scalable rate-distortion performance.
- To reduce entropy coding cost by modeling spatial dependencies in quantized latent codes using a masked image modeling approach.
- To enable a hybrid compression-generation mode without additional training, leveraging the generative capacity of the model.
Proposed method
- Replace standard vector quantization in VQ-VAE with product quantization (PQ), enabling a wider range of rate-distortion trade-offs with efficient codebook learning.
- Design a multi-stage masked image modeling (MIM) framework where each stage conditions on progressively more observed patches to reduce conditional entropy.
- Use a vision transformer to estimate the conditional distribution of latent codes, which is symmetrically applied at both encoder and decoder for entropy coding.
- Apply quincunx or confidence-based patch masking policies to determine which patches are observed at each stage, optimizing rate reduction.
- Train the model with a combination of reconstruction loss, perceptual loss, and adversarial loss to improve visual quality.
- Enable hybrid operation by reusing the MIM model for inpainting missing patches, demonstrating compatibility with image generation.
Experimental results
Research questions
- RQ1Can product quantization in a VQ-VAE framework provide a scalable and effective alternative to scalar quantization in neural image compression?
- RQ2How can masked image modeling be adapted to improve entropy coding in latent space by exploiting spatial dependencies between patches?
- RQ3To what extent can a compression model trained with perceptual objectives outperform existing baselines in terms of FID and KID metrics?
- RQ4Can a single model operate effectively in both compression and generation modes without fine-tuning?
- RQ5How effective is the model in extreme compression regimes, such as below 0.6 bits per pixel?
Key findings
- PQ-MIM achieves competitive PSNR and MS-SSIM performance compared to strong neural compression baselines, including hyperprior methods.
- When trained with perceptual and adversarial losses, PQ-MIM outperforms HiFiC in FID and KID metrics, indicating superior perceptual quality.
- The model reduces bit-rate significantly through MIM-based entropy modeling, with quincunx masking policy achieving strong rate savings even with only five steps.
- PQ-MIM demonstrates strong inpainting capability, reconstructing images with up to 50% of patches missing, preserving structural and semantic details.
- The model operates in a hybrid compression-generation mode, enabling reconstruction of missing or corrupted patches without additional training.
- Increasing model capacity from XCiT-T6 (3.5M params) to XCiT-L6 (47M params) improves performance by approximately +0.8 dB in PSNR.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.