DynaQuant: Dynamic Mixed-Precision Quantization for Learned Image Compression

Youneng Bao, Yulong Cheng, Yiping Liu, Yichen Yang, Peng Qin, Mu Li, Yongsheng Liang

TL;DR

DynaQuant is a new framework that makes high-performance Learned Image Compression (LIC) efficient enough for mobile and edge devices. By dynamically adjusting both quantization parameters and bit-widths for every individual image, it achieves visual quality comparable to full-precision models while delivering a massive 5× speedup and significantly reducing memory usage.

What Problem Does This Paper Address?

Learned Image Compression (LIC) models—which use deep neural networks instead of hand-crafted math—now consistently outperform traditional standards like JPEG and BPG. However, these models are computationally "heavy." They require massive amounts of memory and processing power, making them difficult to run in real-time on smartphones or drones.

The standard solution is quantization: converting 32-bit floating-point numbers into smaller integers (like 8-bit). But most existing methods use a "one-size-fits-all" approach, applying the same bit-width to every layer and every image. This is suboptimal because:

  1. Content Dynamics: Different images have vastly different statistical distributions.
  2. Layer Sensitivity: Some layers in a network are highly sensitive to noise, while others are robust. A static approach either wastes bits on robust layers or destroys quality in sensitive ones.

Methods

DynaQuant introduces a two-level dynamic approach to bridge the gap between efficiency and high-fidelity reconstruction:

  1. Dynamic Parameter Adaptation (DPA): Instead of using fixed scaling factors for quantization, DynaQuant learns per-channel parameters that adapt to the input features. To train this effectively, the authors replaced the standard "Straight-Through Estimator" (STE)—which provides a coarse gradient—with a Distance-aware Gradient Modulator (DGM). DGM provides a more precise learning signal by focusing updates on values near quantization "decision boundaries."
  2. Dynamic Bit-Width Selector (DBWS): This is a lightweight sub-network that acts like a "brain" for the main model. It looks at the input image and decides on-the-fly which bit-precision (e.g., 6, 8, or 10 bits) to assign to each layer.
  3. Differentiable Training: To make the discrete choice of bit-widths trainable, the authors used the Gumbel-Softmax trick. This allows the model to learn the optimal balance between image quality (Rate-Distortion) and computational cost (average bit-width) in a single end-to-end process.

Datasets

The authors evaluated DynaQuant on three benchmark datasets widely used in the compression community:

  • Kodak: A classic set of 24 images used for standard evaluation.
  • JPEG-AI: A modern dataset designed for evaluating AI-based codecs.
  • CLIC: High-resolution images from the Challenge on Learned Image Compression.

Key Insights and Ideas

  • The "Edge" Matters: The authors found that "edge" layers (the very first and very last layers of the network) often act as bottlenecks and require higher precision (e.g., 10-bit) compared to intermediate layers.
  • Beyond STE: The standard way of training quantized networks (STE) assumes all errors are equal. DynaQuant’s DGM insight is that the model should care more about values that are "on the fence" between two integers, leading to much more stable training for high-fidelity tasks.
  • Synergy of Levels: The paper demonstrates that dynamic parameters and dynamic bit-widths are synergistic. Combining them (DPA + DQ) outperforms the sum of their individual parts, allowing for lower average bit-widths without sacrificing PSNR (image quality).

Key Results

  • Speed & Efficiency: DynaQuant achieved approximately 5× speedup across various baseline models (Cheng2020, ELIC, and Ballé2018).
  • Model Compression: For the ELIC model, DynaQuant reduced the model size from 137.11 MB down to 29.78 MB with minimal impact on quality.
  • Rate-Distortion Performance: The "DQ-Cheng" variant achieved a BD-Rate (a measure of compression efficiency) that closely tracks the full-precision baseline, proving that you don't need 32-bit floats to get state-of-the-art results.

Limitations and Future Work

While DynaQuant provides a significant leap in efficiency, the authors note a few areas for improvement:

  • Hardware Specifics: The current model optimizes for "average bit-width" as a proxy for speed. However, actual hardware latency can vary based on specific chip architectures (NPU vs. GPU). The authors suggest incorporating hardware-specific latency models into the loss function in the future.
  • Maximum Acceleration Trade-off: At the absolute highest levels of acceleration (very low bit-widths), there is still a slight performance gap compared to full-precision models that hasn't been entirely closed yet.

Summary updated

BibTeX
@inproceedings{bao2026dynaquant,
  author = {Youneng Bao and Yulong Cheng and Yiping Liu and Yichen Yang and Peng Qin and Mu Li and Yongsheng Liang},
  title = {{DynaQuant: Dynamic Mixed-Precision Quantization for Learned Image Compression}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i17.38464},
}
Figure