Exploring the rate-distortion-complexity optimization in neural image compression

Yixin Gao, Runsen Feng, Zongyu Guo, Zhibo Chen

TL;DR

This paper introduces a systematic framework for Rate-Distortion-Complexity (RDC) optimization in neural image compression. By integrating a learnable, content-adaptive mask that decides which pixels require expensive autoregressive decoding, the authors created a single "variable-complexity" codec that allows users to precisely trade off decoding speed for image quality.

What Problem Does This Paper Address?

Neural image codecs have recently surpassed traditional standards like JPEG and HEVC in terms of compression efficiency (Rate-Distortion performance). However, their "Achilles' heel" is decoding speed. To achieve high performance, many models use autoregressive context models, which predict pixels based on previously decoded ones. Because this process is inherently serial, it can make decoding 50 times slower than simpler models, hindering real-world use on mobile devices or high-resolution imagery.

Existing research usually treats complexity as an afterthought. This paper addresses the lack of a formal optimization goal that includes computational complexity alongside bit-rate and distortion, aiming to give developers a "knob" to turn based on their hardware's latency requirements.

Methods

The authors propose three major innovations to tackle the RDC trade-off:

  1. Quantifying Complexity ($C_e$): They define decoding complexity as the fraction of latent representation points that are processed using the serial autoregressive model. An all-zero mask ($C_e=0$) represents fast, parallel decoding, while an all-one mask ($C_e=1$) represents high-quality, slow serial decoding.
  2. The Mask-Guided Model: The architecture uses a learnable binary mask $M$. This mask acts as a gatekeeper: it identifies "difficult" areas (like complex textures or edges) that need the autoregressive model and "easy" areas (like flat skies) that can be decoded in parallel using only a hyperprior.
  3. Variable-Complexity Training: To avoid training dozens of separate models for different speeds, they developed a two-stage training strategy.
  4. Stage 1: The model is pre-trained with random masks to make it robust to any complexity level.
  5. Stage 2: The model learns to generate content-adaptive masks by optimizing a combined loss function: $\mathcal{L} = R + \lambda_D D + \lambda_C C_e$. Here, $\lambda_C$ is the "complexity pressure" that forces the model to be selective about which pixels it treats with high complexity.
  6. Conditional Transforms: They use Spatial Feature Transform (SFT) layers to modulate the network's features based on a user-defined complexity level $l$, allowing one set of weights to handle multiple performance targets.

Datasets

  • Training: The model was trained on the COCO 2017 dataset, using $256 \times 256$ crops.
  • Evaluation: Performance was tested on two standard benchmarks:
  • Kodak: 24 images ($768 \times 512$), a staple for image compression research.
  • Tecnick: 100 high-resolution images ($1200 \times 1200$).
  • Baselines: The authors compared their results against traditional codecs (BPG, VTM-18.2) and established neural models (Minnen2018, Cheng2020).

Key Insights and Ideas

  • The "25% Rule": One of the most striking findings is that using the complex autoregressive model on just 25% of the pixels ($C_e=0.25$) captures nearly half of the total performance gain possible. This suggests that most of an image's spatial redundancy is concentrated in specific areas.
  • Content-Awareness is Key: The learned masks prioritize object edges and busy textures for serial decoding. Handcrafted masks (like simple checkerboards) perform significantly worse because they don't respect the actual information density of the image.
  • Single Model Flexibility: By using conditional transform modules, the authors proved that a single neural network can effectively navigate the entire RDC frontier, eliminating the need to store different model weights for different devices.

Key Results

  • Adjustable Speed: On the Kodak dataset, the model can vary its decoding time from 176ms (fastest) to 7283ms (highest quality) per image.
  • Efficiency Gains: The variable-complexity model achieves a BD-rate saving of about 6% as it moves from its lowest to highest complexity setting.
  • Competitive Performance: At its highest complexity setting, the model matches or exceeds state-of-the-art (SOTA) neural codecs like Cheng2020, while providing a much faster fallback option that still beats traditional BPG compression.

Limitations and Future Work

  • Mask Generation Overhead: Even at the lowest complexity setting ($C_e=0$), the model is about 1.5x slower than a pure "hyperprior-only" model. This is due to the fixed overhead of generating the mask and the conditional transform layers.
  • Binary Constraints: The current mask is binary (on/off). Future work could explore multi-level complexity masks or different types of entropy models (like channel-wise autoregression) to provide even finer control.
  • Hardware Specifics: The paper measures complexity via "sequential coding frequency," but actual wall-clock time varies by hardware (CPU vs. GPU). Future iterations might benefit from hardware-aware optimization.

Summary updated

BibTeX
@article{gao2024exploring,
  author = {Yixin Gao and Runsen Feng and Zongyu Guo and Zhibo Chen},
  title = {{Exploring the rate-distortion-complexity optimization in neural image compression}},
  journal = {J. Vis. Commun. Image Represent.},
  year = {2024},
  url = {https://openreview.net/forum?id=TswG1YQ0SU},
}
Figure