TL;DR
This paper introduces Long-Range Zero-Shot Generative Deep Network Quantization (LRQ), a novel method for compressing deep neural networks without access to original training data. LRQ tackles limitations in existing zero-shot quantization by incorporating a "long-range generator" to capture global image features and an "adversarial margin add" module to enhance feature diversity, leading to significantly improved quantization performance.
What Problem Does This Paper Address?
Deploying large deep neural networks (DNNs) on resource-constrained edge devices is a major challenge due to their high computational and memory demands. Model compression techniques like quantization aim to reduce these demands. Quantization converts floating-point weights and activations to lower-bit representations, accelerating inference and reducing memory footprint.
A key challenge in quantization is obtaining sufficient data for fine-tuning. Quantization-Aware Training (QAT) offers high accuracy but requires extensive original data and significant computational resources. Post-Training Quantization (PTQ) is more efficient but often suffers from accuracy degradation. Zero-Shot Quantization (ZSQ) aims to bridge this gap by quantizing models without any original data, typically by synthesizing data. However, existing ZSQ methods struggle to achieve performance comparable to PTQ, primarily due to two limitations:
- Limited Data Diversity: Generators used in ZSQ often lack the ability to capture long-range dependencies in images, leading to synthetic data with insufficient diversity and global feature representation. This results in quantized models that perform poorly, especially when dealing with occluded objects.
- Weak Intra-Class Heterogeneity: Synthetic data generated by current methods can be too homogeneous within a class. When a model is fine-tuned on such data, its generalization ability to real-world data is limited.
This paper addresses these limitations by proposing LRQ, a ZSQ method designed to generate more diverse synthetic data by capturing long-range information and enhancing intra-class feature separation.
Methods
LRQ comprises three main components:
- Long-Range Generator (LRG): This novel generator is designed to learn long-range dependencies in images, which is crucial for generating diverse synthetic data. It incorporates a "long-range attention" mechanism that combines:
- Spatial Local Convolution (SLConv): Captures local spatial information for refining image textures.
- Spatial Long-range Convolution (SLRConv): Uses dilated convolutions to expand the receptive field and process long-range dependencies.
-
Channel Convolution (CConv): Reduces channel dimensions for efficiency and enables cross-channel information learning. This attention mechanism allows the generator to capture global features more effectively than standard convolutional kernels with limited receptive fields.
-
Adversarial Margin Add (AMA) Module: To address the issue of weak intra-class heterogeneity, AMA enhances the separation between feature vectors and their respective class centers. It achieves this by introducing an additive angular margin penalty in the cosine similarity calculation. This forces the intra-class angular enlargement, increasing the intra-class distance. This process creates an adversarial effect, increasing the difficulty of the loss function's convergence, which paradoxically benefits performance by promoting better feature discrimination.
- Decoupled Knowledge Distillation (DKD): To further improve the quantization process and transfer knowledge from the full-precision model, LRQ employs DKD. Unlike traditional knowledge distillation, DKD reformulates the loss function to consider both the similarity between teacher and student probabilities for the target class (LTCKD) and for non-target classes (LNCKD). This approach helps the quantized model learn knowledge that preserves intra-class heterogeneity.
The overall training process involves data generation using LRG and AMA, followed by network fine-tuning using a combination of cross-entropy loss and DKD.
Datasets
The paper evaluates LRQ on the following datasets:
- ImageNet: Used for training and evaluating quantized models (ResNet-18, MobileNetV1, MobileNetV2).
- CIFAR-10/100: Used for evaluating quantized ResNet-20 models, particularly at ultra-low precisions (4-bit and 3-bit).
No new benchmarks were introduced.
Key Insights and Ideas
- Long-Range Dependencies are Crucial for ZSQ Data Diversity: The paper highlights that standard generators in ZSQ fail to capture global image context, leading to limited synthetic data diversity. LRQ's long-range attention mechanism directly addresses this by enabling generators to learn these crucial long-range relationships.
- Adversarial Training for Feature Separation: The AMA module's approach of increasing the difficulty of convergence by enforcing an angular margin is a clever way to promote intra-class heterogeneity. This adversarial process, though counter-intuitive to standard optimization, leads to better feature discrimination.
- Decoupled Knowledge Distillation Enhances Heterogeneity Transfer: DKD's ability to separately consider target and non-target class probabilities is shown to be more effective than standard KD for transferring the learned intra-class heterogeneity from the teacher model to the student.
- Visualizations Confirm Improved Feature Separation: t-SNE visualizations of feature embeddings clearly demonstrate that LRQ achieves better inter-class separation compared to other ZSQ methods.
Key Results
- State-of-the-Art Performance: LRQ consistently outperforms existing ZSQ methods across various networks and datasets.
- ImageNet Results:
- On ResNet-18 (4-bit quantization), LRQ achieves 67.19% accuracy, a significant improvement over IntraQ (66.47%).
- On MobileNetV1 (4-bit quantization), LRQ achieves 56.87% accuracy, a 5.48% improvement over IntraQ.
- On MobileNetV2 (4-bit quantization), LRQ achieves 65.62% accuracy.
- CIFAR-10/100 Results:
- On ResNet-20 (3-bit quantization on CIFAR-10), LRQ achieves 83.28% accuracy, a 6.21% improvement over IntraQ.
- On ResNet-20 (4-bit quantization on CIFAR-100), LRQ achieves 65.67% accuracy.
- Ablation Studies: The study confirms that each component of LRQ (LRG, AMA, DKD) contributes to performance improvement, with LRG showing the most significant impact individually. The combination of all components yields the best results.
Limitations and Future Work
- Hyperparameter Sensitivity: The paper notes that the performance is influenced by hyper-parameters like K, m, and λ, and an ablation study was conducted to find optimal values. However, the sensitivity to these parameters in different scenarios might be a limitation.
- Future Work: The authors suggest exploring more effective ways to further improve the diversity of synthetic data and intra-class heterogeneity. They also mention quantizing deep low-level vision models for deployment on edge devices as an interesting future research direction.
Summary updated