Test-time Adaptation for Image Compression with Distribution Regularization

Kecheng Chen, Pingping Zhang, Tiexin Qin, Shiqi Wang, Hong Yan, Haoliang Li

Introduction

Learned Image Compression (LIC) models—which utilize deep neural networks to compress image data—typically operate under the assumption that the images encountered during testing will share the same distribution as the training data. However, when a "domain shift" occurs—such as applying a model trained on natural landscapes to compress computer screenshots or medical X-rays—compression performance often plummets.

To mitigate this, researchers employ Test-Time Adaptation (TTA), a technique that dynamically adjusts the compressed data (latents) or the decoder's parameters for a specific image during inference. While TTA is promising, existing methods harbor a critical flaw when applied across domains.

The Problem: The "HLR" Trap

A common TTA approach is "Hybrid Latent Refinement" (HLR). While HLR successfully enhances the visual quality (distortion) of the reconstructed image, it frequently and inadvertently inflates the file size (bitrate) in cross-domain scenarios.

Comparison of Bits per pixel (Bpp) and PSNR across different adaptation methods.

This phenomenon occurs because the aggressive optimization process pushes the latent variables into a state that the pre-trained probability models (used for entropy coding) no longer accurately recognize. This "mismatch" breaks the mathematical assumptions required for efficient bit-counting, leading to a net loss in compression efficiency. Essentially, HLR optimizes so aggressively for image quality that it wastes bits.

Proposed Method: Distribution Regularization

To resolve this underlying mismatch, the authors propose a novel optimization objective for latent refinement that incorporates a Distribution Regularization term.

Architectural comparison of Baseline Latent Refinement (BLR), Hybrid Latent Refinement (HLR), and the proposed method featuring a new regularization loop.

The methodology is built on several key pillars:

  • Theoretical Analysis of Marginalization: The authors provide a mathematical proof demonstrating that the bitrate increase in cross-domain tasks stems from a "marginalization approximation" error. The joint probability of the latent variables and their "side information" (hyperprior) drifts away from the optimal distribution.
  • Bayesian Approximation via Dropout: To correct this drift without introducing new neural network architectures, the method employs Dropout Variational Inference (DVI). By keeping "dropout" layers active during the adaptation phase, a deterministic pre-trained model can be treated as a probabilistic one, allowing for complex probability estimation at zero structural cost.
  • Distribution Regularization: A new loss term is introduced to force the refined side information to remain consistent with the posterior distribution of the refined latents. This ensures that the "refined" data remains highly compressible by the entropy coder.
  • Plug-and-Play Integration: Importantly, this method does not replace existing TTA frameworks. It acts as a loss function "plug-in" that can be seamlessly integrated into existing state-of-the-art adaptation methods to provide incremental benefits.

Key Results and Performance

The authors evaluated their distribution regularization technique across a wide variety of in-domain (Kodak) and cross-domain scenarios, including screen content (SIQAD, SCID, CCT), gaming/pixel art, artistic paintings (DomainNet), and medical images.

  • Superior Efficiency: When applied to the AR-CM backbone, the proposed method achieved an impressive average 27.00% BD-rate saving across cross-domain datasets. This significantly outperforms standard baseline latent refinement (BLR at -21.41%) and hybrid refinement (HLR at -21.36%).
  • Cross-Domain Consistency: While vanilla HLR actually increased the bitrate on certain datasets (like SCID), the proposed distribution regularization consistently delivered efficiency gains across every tested dataset.
  • Qualitative Improvements: Visually, the proposed method preserves much sharper text in screen content and better texture in medical images compared to baseline adaptation methods.

Limitations and Future Work

Like all latent refinement methods, this approach requires an iterative optimization process (gradient descent) for every single image at test time. While the authors note that the computational overhead of their Bayesian sampling is "mild," it remains significantly slower than a standard, single-pass "forward" compression. Future research directions may focus on developing more efficient optimization algorithms or leveraging more powerful server-side hardware to reduce the time required for adaptation.

Summary updated

BibTeX
@inproceedings{chen2025test,
  author = {Kecheng Chen and Pingping Zhang and Tiexin Qin and Shiqi Wang and Hong Yan and Haoliang Li},
  title = {{Test-time Adaptation for Image Compression with Distribution Regularization}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=bsnRUkVn63},
}
Figure