TL;DR
This paper introduces Flexible Mixed Precision Quantization (FMPQ), a novel quantization strategy for Learned Image Compression (LIC) models that assigns layer-specific bit-widths based on how much they impact rate-distortion (RD) loss. Paired with an efficient adaptive search algorithm to find the optimal bit distribution for a target model size, FMPQ significantly outperforms traditional uniform 8-bit quantization, delivering notable bitrate savings without expanding the model's storage footprint.
What Problem Does This Paper Address?
Learned Image Compression (LIC) models based on deep neural networks routinely outperform classical codecs like JPEG and BPG. However, this superior performance comes at a steep cost: these models typically contain 200 to 400 million parameters, making them too memory-intensive for resource-constrained edge devices.
While network quantization (e.g., converting 32-bit floating-point weights to 8-bit integers) reduces memory usage, standard approaches apply a uniform bit-width across the entire network. This is highly sub-optimal. Different layers in a neural network exhibit varying sensitivities to quantization; some layers can be aggressively compressed to low bit-widths with minimal impact, while others act as information bottlenecks and require higher precision to maintain image quality.
Methods
The authors propose a training-free bit-assignment scheme coupled with an adaptive search loop to discover the ideal mixed-precision configuration for a target model size.
- Flexible Mixed Precision Quantization (FMPQ): Instead of using proxy metrics like weight entropy, FMPQ measures the sensitivity of each layer $n$ by calculating its fractional change in rate-distortion loss ($\zeta_n(b)$) when quantized to a candidate bit-width $b$. A threshold parameter, $\beta$, defines the maximum tolerable distortion. The algorithm iterates backwards from maximum precision ($b_{max}$) to find the lowest bit-width that satisfies $\zeta_n(b) < \beta$.
- Adaptive Search Algorithm: Manually tuning $\beta$ to hit a specific target model size via exhaustive search is computationally brutal. The authors introduce a variable-step search algorithm that dynamically adjusts the increment size of $\beta$ based on how close the current compressed model size is to the target compression ratio ($CR_{target}$).
- Quantization-Aware Training (QAT): Once the layer-wise bit-widths are locked in, the model undergoes fine-tuning. The optimization function relies strictly on the end-to-end RD-loss, utilizing channel-wise quantization for weights and dynamic quantization for activations. A leaky-clip module is implemented to prevent vanishing gradients caused by standard clipping functions.
Datasets
- Training & Calibration: The models were trained and fine-tuned using the COCO dataset. A tiny subset of just 16 images from COCO was used as the calibration dataset ($D_{calib}$) to compute the layer sensitivities.
- Evaluation: The final rate-distortion performance was evaluated across three standard image compression benchmarks: Kodak, Tecnick, and CLIC.
Key Insights and Ideas
- Optimize for the End Metric, Not Proxies: Prior mixed-precision works often allocate bits by estimating weight entropy. The authors demonstrate that directly evaluating the target metric—Rate-Distortion loss—yields a much more accurate representation of a layer's true sensitivity.
- Mapping the Bottlenecks: By analyzing the resulting bit-distributions, the authors revealed exactly which parts of an LIC architecture are most fragile. As shown in Figure 3, the main encoder/decoder path requires significantly higher precision (8-9 bits) than the hyper-prior path. Specifically, the final layer of the encoder (the latent representation bottleneck) and the final layer of the decoder (responsible for generating the clean output image) are highly sensitive and demand maximum bit-widths.
Key Results
- BD-Rate Improvements: Compared to standard 8-bit Fixed Precision Quantization (FPQ), FMPQ achieved significant BD-Rate reductions (bitrate savings at equivalent quality) on the Kodak dataset:
- Scale Hyperprior: 0.96% BD-Rate reduction
- Mean Scale Hyperprior: 2.34% BD-Rate reduction
- Cheng Anchor 2020: 1.16% BD-Rate reduction
- Massive Search Speedups: The adaptive search algorithm converged up to 8× faster than an exhaustive search. For a target compression ratio of 0.75, the adaptive search saved over 3 hours of compute time while arriving at the same optimal bit distribution.
- Baseline Comparisons: FMPQ outperformed several existing quantized LIC baselines, showing a massive 25.49% BD-Rate gain over fixed-point inference methods like Hong et al. under similar model size constraints.
Limitations and Future Work
While FMPQ consistently outperforms fixed-precision methods, it showed a slight performance deficit (a 1.74% BD-Rate drop) compared to the specialized Quantization-Aware Training method by Jeon et al. However, the authors defend this by noting that their evaluation spans six distinct networks (representing six quality levels), whereas the competing method only optimized across four.
Future extensions of this work could look into deploying these mixed-precision configurations onto actual hardware accelerators to measure real-world latency and power consumption improvements.
Summary updated