Introduction
Deep Neural Networks (CNNs) have become indispensable for computer vision tasks but remain notoriously power-hungry, posing significant challenges for deployment on mobile and embedded devices. Quantization—representing weights and activations with low-bit integers instead of 32-bit floats—is a primary strategy for model compression. However, traditional quantization methods are static, applying the same bit-width configuration to every image regardless of its complexity. This "one-size-fits-all" approach is inherently inefficient: a simple, clear image requires less precision than a cluttered or blurry one.
The DQNet Framework
To address this inefficiency, this research introduces the Dynamic Quantized Network (DQNet). DQNet moves beyond static constraints by dynamically adjusting the quantization bit-width for every individual image during inference.
Architecture
The framework consists of two primary components:
- The Bit-Controller: A lightweight sub-network that analyzes the input image to predict optimal bit-widths for each layer in the main network. To minimize overhead, the controller typically shares initial layers with the backbone network.
- Dynamic Quantization Scheme: The controller outputs logits for various bit-width candidates (e.g., 2 to 5 bits).
Training and Optimization
Since selecting discrete bit-widths is a non-differentiable operation, DQNet utilizes the Gumbel-softmax trick to enable end-to-end training of both the controller and the main network. Furthermore, a "Bit-FLOPs" constraint is integrated into the loss function, penalizing excessive computational costs and incentivizing the controller to allocate higher precision only when necessary for accuracy.
Experimental Results
DQNet was evaluated on the CIFAR-10 and ImageNet benchmarks, demonstrating superior performance over static methods like PACT and DoReFa, as well as advanced mixed-precision search techniques.
- CIFAR-10: Using ResNet-20, DQNet achieved 92.01% accuracy with only 0.98G Bit-FLOPs, notably outperforming the full 32-bit floating-point baseline (91.6%).
- ImageNet: On ResNet-50, DQNet reduced computational requirements by 35% compared to the PACT framework while slightly improving Top-1 accuracy (76.94% vs 76.7%).
Key Insights: Content-Driven Precision
A significant advantage of DQNet is its ability to perform instance-aware quantization. Qualitative analysis reveals that the Bit-Controller naturally learns to assign lower precision to images with simple textures or centered objects, while reserving high-bit precision for complex scenes with cluttered backgrounds or occlusions.
Crucially, DQNet avoids the "big storage" pitfall of multi-precision models. Instead of storing multiple weight versions, it stores only the highest bit-width weights and derives lower-precision versions on the fly through further quantization.
Conclusion and Future Work
DQNet demonstrates that model complexity should be a dynamic function of input data. While current general-purpose hardware may not yet fully exploit layer-by-layer bit-width switching, the theoretical gains in Bit-FLOPs suggest significant potential for custom ASICs and FPGAs. Future research may extend this instance-aware logic to other compression domains, such as dynamic pruning and channel scaling.
Summary updated