Conditional pseudo-supervised contrast for data-Free knowledge distillation

Renrong Shao, Wei Zhang, Jun Wang

Abstract

Data-Free Knowledge Distillation (DFKD) facilitates the compression of large-scale Deep Convolutional Neural Networks (DCNNs) into lightweight student models without requiring access to original training datasets. Traditional DFKD approaches often struggle with "mode collapse" and the generation of ambiguous, low-quality synthetic samples. This paper introduces CPSC-DFKD, a novel framework that leverages category-conditional generation and pseudo-supervised contrastive learning. By treating the teacher and student models as distinct "views" of synthetic data, CPSC-DFKD significantly improves the diversity and representational quality of generated images. Our method achieves state-of-the-art accuracy on CIFAR-10, CIFAR-100, and Tiny-ImageNet benchmarks.

Introduction

The deployment of DCNNs on resource-constrained mobile and edge devices is hindered by their high computational and memory requirements. Knowledge Distillation (KD) addresses this by transferring knowledge from a "cumbersome" teacher model to a "lightweight" student model. However, standard KD relies on the original training data, which may be unavailable due to privacy regulations or logistical constraints.

Data-Free Knowledge Distillation (DFKD) circumvents this by using a generator to synthesize data. Nonetheless, existing DFKD methods frequently produce blurry, class-ambiguous samples that fail to capture fine-grained category differences.

Comparison of data sources for knowledge distillation: (a) human labels, (b) standard generator, and (c) the proposed condition generator.

As shown in Figure 1, while standard generators (b) produce unlabeled and often ambiguous samples, our proposed condition generator (c) synthesizes category-specific images, providing a pseudo-supervised signal that guides the distillation process more effectively.

Methodology

The CPSC-DFKD framework introduces three key technical innovations to enhance the quality of synthetic data and the efficiency of knowledge transfer.

1. Category-Conditional Generation

Instead of generating images from unstructured noise, CPSC-DFKD conditions the generator on specific class labels. This transforms the distillation process from an unsupervised task into a pseudo-supervised one, ensuring that the student model learns from class-consistent synthetic samples.

2. Categorical Feature Embedding (CFE) Blocks

Standard Batch Normalization (BN) in generators can "smear" class-specific distributions by calculating statistics across heterogeneous batches. We replace BN with Categorical Feature Embedding (CFE) blocks. These blocks utilize category-dependent mappings to capture the unique stylistic and distributional features of individual classes, leading to higher-fidelity image generation.

3. Pseudo-Supervised Contrastive Learning

We propose a novel contrastive learning setup where the Teacher and Student models serve as two different views of the same synthetic image.

The architecture of the CPSC-DFKD framework, highlighting the condition generator, CFE layers, and the multi-loss optimization strategy.

As illustrated in Figure 2, the framework optimizes several losses simultaneously. The Supervised Contrastive Loss ($L_{SCL}$) pulls representations of the same synthetic image from both models closer while pushing away representations of different images. This forces the generator to produce diverse, feature-rich samples that are recognizable to both architectures.

Experimental Results

CPSC-DFKD was evaluated on CIFAR-10, CIFAR-100, and Tiny-ImageNet using various architectures (e.g., ResNet, VGG, MobileNet).

  • Accuracy Boost: On CIFAR-100, distilling from WRN-40-2 to WRN-16-2, CPSC-DFKD achieved 69.03% accuracy, outperforming previous state-of-the-art methods like CMI (68.72%).
  • Visual Clarity: Qualitative analysis shows that CPSC-DFKD produces visually distinguishable objects (e.g., dogs, trees) compared to the unrecognizable noise of earlier methods.
  • FID Scores: The method achieved a significantly lower Frechet Inception Distance (FID) on CIFAR-100 (79.99), indicating superior synthetic image realism compared to ADI (98.54) and DFQ (89.72).

Conclusion and Limitations

CPSC-DFKD advances data-free model compression by integrating conditional generation with contrastive learning. While it sets new performance benchmarks, limitations remain. The simultaneous training of a generator and student is computationally intensive. Furthermore, the reliance on Batch Normalization statistics makes the current framework less applicable to architectures like Vision Transformers (ViTs). Future work will explore scaling to higher resolutions and adapting the method for non-CNN architectures.

Summary updated

BibTeX
@article{shao2023conditional,
  author = {Renrong Shao and Wei Zhang and Jun Wang},
  title = {{Conditional pseudo-supervised contrast for data-Free knowledge distillation}},
  journal = {Pattern Recognition},
  year = {2023},
  doi = {10.1016/j.patcog.2023.109781},
}
Figure