Abstract
Data-free quantization aims to achieve model quantization without accessing any authentic sample. It is significant in an application-oriented context involving data privacy. Converting noise vectors into synthetic samples through a generator is a popular data-free quantization method, which is called generative data-free quantization. However, there is a difference in attention between synthetic samples and authentic samples. This is always ignored and restricts the quantization performance. First, since synthetic samples of the same class are prone to have homogenous attention, the quantized network can only learn limited modes of attention. Second, synthetic samples in eval mode and training mode exhibit different attention. Hence, the batch-normalization statistics matching tends to be inaccurate. ACQ is proposed in this paper to fix the attention of synthetic samples. An attention center position-condition generator is established regarding the homogenization of intra-class attention. Restricted by the attention center matching loss, the attention center position is treated as the generator's condition input to guide synthetic samples in obtaining diverse attention. Moreover, we design adversarial loss of paired synthetic samples under the same condition to prevent the generator from paying overmuch attention to the condition, which may result in mode collapse. To improve the attention similarity of synthetic samples in different network modes, we introduce a consistency penalty to guarantee accurate BN statistics matching. The experimental results demonstrate that ACQ effectively improves the attention problems of synthetic samples. Under various training settings, ACQ achieves the best quantization performance. For the 4-bit quantization of Resnet18 and Resnet50, ACQ reaches 67.55% and 72.23% accuracy, respectively.
Introduction
Deep learning models are increasingly deployed on edge devices, necessitating quantization—the process of converting 32-bit floating-point parameters into low-bit integers. While effective, high-quality quantization typically requires access to the original training data for calibration. In privacy-sensitive domains like healthcare or finance, this data is often unavailable. Data-Free Quantization (DFQ) addresses this by using a generator to create synthetic images.
However, current DFQ methods suffer from an "attention gap." Synthetic images often exhibit intra-class homogenization, where the model's internal attention maps for a specific class (e.g., "Golden Retriever") always focus on the same spatial location. Furthermore, mode differentiation causes synthetic data to behave inconsistently between training and evaluation modes, leading to inaccurate Batch Normalization (BN) statistics and degraded performance.
Methodology
ACQ (Attention Correction Quantization) introduces three core strategies to align synthetic data attention with that of real-world samples:
- Attention Center Position-Conditioning: The generator is provided with a specific coordinate (attention center) as input. This forces the generator to place class-specific features in diverse locations across the image, breaking the pattern of repetitive attention.
- Coarse-grained Attention Center Matching ($L_{CACM}$): This loss function ensures the model's actual attention map aligns with the requested coordinate. By using a coarse-grained approach, the generator can learn to shift focus without being over-constrained by pixel-level details.
- Adversarial Loss ($L_{AD}$): To prevent mode collapse—where the generator ignores the noise vector and produces identical images for a given coordinate—an adversarial loss is applied to paired synthetic samples. This encourages the generator to produce diverse visual outputs even under the same positional constraints.
- Consistency Penalty: This ensures that the model produces stable attention maps and classifications regardless of whether it is in training or evaluation mode, leading to more reliable BN statistics.
Experimental Results
The researchers evaluated ACQ on standard benchmarks including ImageNet2012, CIFAR-10, and CIFAR-100 across various architectures like ResNet and MobileNetV2. ACQ consistently outperformed previous state-of-the-art methods, particularly at low bit widths.
- ImageNet Performance: For 4-bit quantization, ACQ achieved 67.55% accuracy on ResNet18 and 72.23% on ResNet50, representing a significant improvement over baseline generative DFQ methods.
- Near-Lossless 5-bit: At 5-bit quantization, the accuracy drop compared to full-precision models was less than 1% for several architectures.
- BNS Error Reduction: ACQ reduced Batch Normalization Statistic (BNS) errors by nearly 60% compared to the GDFQ baseline, confirming that the consistency penalty successfully bridges the gap between training and deployment modes.
Conclusion
ACQ demonstrates that the internal "perspective" of a model—its attention maps—is a critical factor in successful data-free quantization. By correcting attention homogenization and mode differentiation, ACQ allows generators to produce synthetic data that more effectively mimics the properties of real datasets. Future work may extend these attention-correction techniques to more complex tasks like object detection and semantic segmentation, where spatial diversity is paramount.
Summary updated