Conditional Hallucinations for Image Compression

Till Aczel, Roger Wattenhofer

TL;DR

Modern generative image compression models face a difficult dilemma: blur out complex textures or "hallucinate" realistic details that can accidentally alter semantic meaning (like text or small faces). This paper introduces ConHa (Conditionally Hallucinating compression), a model that uses a human-preference classifier to dynamically adjust the level of hallucination based on local image content. By automatically balancing distortion and perception, ConHa consistently outperforms state-of-the-art compression methods in human user studies.

What Problem Does This Paper Address?

Lossy image compression traditionally optimizes the trade-off between bit-rate and distortion (e.g., using Mean Squared Error). However, minimizing pure pixel-wise distortion often results in blurry textures like grass, water, or fabric. To fix this, state-of-the-art learned compression models incorporate Generative Adversarial Networks (GANs) to optimize the rate-distortion-perception trade-off, forcing the model to generate realistic, "in-distribution" details.

The catch is that these generative models often hallucinate details where they shouldn't. While hallucinating texture on a lawn looks great, hallucinating artifacts on small text, straight lines, or distant human faces can completely destroy semantic meaning and readability. Existing models apply a fixed global weight to this perceptual realism, failing to adapt to the diverse content found within a single image.

Example of how hallucinations degrade text but improve texture like grass.

Methods

The authors propose ConHa, which automates the balancing act between avoiding hallucinations and generating realistic textures through a two-stage approach:

  1. Hallucination-Distribution Preference Model ($M_P$): The authors trained a binary classifier (using a frozen ResNet50 backbone followed by custom $1 \times 1$ convolutional blocks and an MLP) on human preference data. Given an uncompressed image patch, $M_P$ predicts a weight $w \in [0, 1]$ indicating whether humans prefer an MSE-optimized reconstruction (low hallucination) or a GAN-optimized reconstruction (high realism/hallucination).
  2. Content-Dependent Loss Function: During the training of the compression model (built on top of the HiFiC architecture), the standard perceptual loss weight $\beta$ is dynamically scaled by the preference model's prediction ($w$). The modified loss function becomes: $$\mathcal{L}_{wrdp} = \mathbb{E} [\lambda r(y) + d(x, x') + \beta w (d_{LPIPS}(x, x') - \log(D(x', y)))]$$ This forces the compression model to adapt its reconstruction strategy locally: minimizing hallucinations for text/faces and allowing generative details for textures.

Datasets

  • DIV2K: Used to train the preference model $M_P$, utilizing 5,408 human pairwise preference labels collected via a custom web application.
  • Vimeo90K: Used to train the core compression models due to accessibility constraints over HiFiC's proprietary dataset.
  • CLIC 2024, CLIC 2020, and Kodak: Used for evaluation. The primary user study evaluation was conducted on the CLIC 2024 image test set, which contains 32 diverse, high-resolution images.

Key Insights and Ideas

  • Content-Aware Realism: Human tolerance for generative "hallucinations" is highly semantic. Blurring a blue sky or hallucinating grass blades is acceptable, but altering text or facial features is jarring.
  • Local Context Rules: Even though the preference weight $w$ is computed globally per patch during training, during inference, the model naturally varies hallucination levels within different regions of a single image based on its limited convolutional context window.
  • The Failure of Automated Metrics: Standard metrics like PSNR, MS-SSIM, LPIPS, and FID fail to capture the subtle, content-dependent success of ConHa. ConHa achieves comparable or slightly worse automated scores than baselines but clearly wins in human preference because it puts the details exactly where humans want them.

Key Results

  • Human Evaluation (Elo Ratings): The authors conducted a user study with 40 participants making 1,531 pairwise comparisons on the CLIC 2024 dataset. ConHa consistently achieved higher median bootstrapped Elo scores than the previous state-of-the-art generative model (HiFiC) across low, medium, and high bitrates.
Bootstrapped Elo Scores showing ConHa outperforming baselines across all bitrates.
  • Qualitative Superiority: As shown in qualitative analysis, ConHa successfully preserves sharp, legible text and clean edges while simultaneously rendering realistic textures for pavement or background elements, acting as a perfect middle ground between blurry MSE models and over-hallucinating GAN models.
Qualitative comparison showing ConHa balancing text clarity and texture realism.

Limitations and Future Work

  • Architectural Dependency: ConHa builds directly on top of existing VAE and GAN-based frameworks (specifically HiFiC); its performance is bound by the limitations of these underlying architectures.
  • Metric Obsolescence Risk: The authors note that their approach is highly reliant on human user studies because current automated distortion metrics cannot capture these semantic nuances. If future automated metrics evolve to inherently understand human aesthetic and semantic preferences, this explicit two-stage balancing method might become obsolete.
  • Preference Variance: Human preferences between compression styles don't always vary drastically for every single image type, meaning the performance gain is highly dependent on the diversity of the image content.

Summary updated

BibTeX
@inproceedings{aczel2025conditional,
  author = {Till Aczel and Roger Wattenhofer},
  title = {{Conditional Hallucinations for Image Compression}},
  booktitle = {DCC},
  year = {2025},
  doi = {10.1109/dcc62719.2025.00043},
}
Figure