Test-time adaptation for image compression with distribution regularization

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

Introduction

Learned Image Compression (LIC) has recently achieved performance levels that surpass traditional codecs like JPEG and VVC. However, these deep learning-based models typically rely on the assumption that training (source) and testing (target) data share the same statistical distribution. When a model trained on natural images encounters "cross-domain" content—such as screen content, pixel art, or medical imagery—its internal entropy models become inaccurate. This domain shift leads to a mismatch where the model consumes excessive bits to describe data that falls outside its learned expectations.

Existing solutions utilize Test-Time Adaptation (TTA), where the encoder iteratively refines the latent representation for a specific image. While methods like Hybrid Latent Refinement (HLR) improve image quality, they often trigger a "rate explosion" in cross-domain scenarios, where the bitrate increases disproportionately to the quality gains. This paper introduces a distribution regularization term to stabilize this rate-distortion trade-off.

Methodology: Distribution Regularization

The authors propose a new objective function for latent refinement that incorporates Distribution Regularization ($\mathcal{L}_{DR}$). The core insight is that vanilla refinement methods push latent variables into regions that the entropy model finds highly improbable, causing the bitrate to skyrocket.

Comparison of test-time training loops for BLR, HLR, and the proposed method.

To bridge the gap between refined latents and the hyperprior distribution, the method employs Dropout Variational Inference (DVI). By performing Monte Carlo sampling—running the hyperprior model multiple times with dropout enabled—the encoder estimates the mean and variance of the posterior distribution. A regularization term is then added to the standard Rate-Distortion loss, penalizing latent variables that drift too far from this estimated distribution. This ensures the refined latents remain "easy to code" for the entropy model without requiring any changes to the pre-trained decoder.

Experimental Results

The proposed method was evaluated across one in-domain dataset (Kodak) and five cross-domain datasets, including screen content (SIQAD, SCID, CCT), pixel art, and paintings (DomainNet).

Rate-Distortion curves on the SCID (Screen Content) dataset, showing the proposed method's superior efficiency.

Key Findings

  • BD-Rate Savings: On the AR-CM backbone, the proposed method achieved an average 27.00% BD-rate saving across all datasets, significantly outperforming HLR (21.36%).
  • Cross-Domain Performance: The gains were most pronounced on specialized content, such as the Pixel (gaming) dataset (35.89% savings) and SIQAD (24.71%).
  • Consistency: Unlike previous TTA methods that occasionally performed worse than simple refinement on certain datasets (e.g., SCID), the distribution regularization provided consistent improvements across every tested domain.
  • Visual Quality: Qualitative results indicate that the method preserves sharp edges and fine textures—critical for text and medical images—more effectively than baseline models at comparable bitrates.

Conclusion

By treating the hyperprior as a probabilistic model rather than a deterministic one, the proposed distribution regularization prevents the rate explosion common in test-time adaptation. While the iterative optimization adds a mild computational overhead (approximately 2 seconds per image), it offers a robust, plug-and-play solution for deploying learned compression models across diverse, real-world data distributions without modifying the decoder architecture.

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