Abstract
Data-Free Knowledge Distillation (DFKD) aims to transfer knowledge from a complex teacher model to a compact student model without access to the original training data. A primary challenge in DFKD is "mode collapse," where the inversion process generates repetitive, low-diversity samples that fail to represent the full data distribution. This paper introduces Contrastive Model Inversion (CMI), a framework that treats data synthesis as a contrastive learning task. By maximizing instance discrimination and utilizing a memory bank of previously generated samples, CMI produces diverse, high-quality datasets that significantly improve student model accuracy across multiple benchmarks.
Introduction
Knowledge Distillation (KD) is a cornerstone technique for model compression, enabling the deployment of deep learning models on resource-constrained devices. However, the requirement for original training data often poses a barrier due to privacy regulations or logistical constraints. Data-Free Knowledge Distillation (DFKD) circumvents this by synthesizing proxy data through model inversion.
Existing inversion methods often suffer from mode collapse, where the generator converges to a narrow subset of the data distribution. This lack of diversity limits the student's ability to learn the teacher's complex decision boundaries. Contrastive Model Inversion (CMI) addresses this by explicitly rewarding data diversity through a contrastive objective, ensuring that each synthetic image is distinct from others in the generated pool.
Methodology
The CMI framework shifts the objective of data synthesis from simple model-fitting to maximizing instance discrimination.
Contrastive Learning and Instance Discrimination
The core of CMI is a contrastive loss applied during the generation phase. For each synthetic image, the system generates multiple views (e.g., different crops). The objective is to minimize the distance between representations of the same image while maximizing the distance between different synthetic images. This forces the generator to explore a wider variety of features to make each instance unique.
Memory Bank and Case-by-Case Generation
To prevent the model from repeating itself over time, CMI employs a Memory Bank that stores features of images generated in previous batches. New samples are contrasted against these stored representations, effectively instructing the generator: "Don't repeat yourself." Furthermore, CMI utilizes Case-by-Case Generation, re-initializing the generator for every batch to avoid global optimization ruts and encourage broader exploration of the feature space.
Decision Adversarial Distillation (DAD)
During the distillation phase, CMI uses Decision Adversarial Distillation (DAD). This method identifies "boundary samples"—images where the teacher and student models are close to a disagreement—and uses them to refine the student's decision boundaries more precisely.
Experimental Results
The effectiveness of CMI was evaluated on CIFAR-10, CIFAR-100, and Tiny-ImageNet datasets using various architectures, including ResNet, VGG, and WideResNet.
Quantitative Performance
CMI consistently outperforms existing DFKD methods. On the CIFAR-100 benchmark, CMI achieved a student accuracy of 77.04%, which is remarkably close to the teacher's 78.05% and significantly higher than previous methods like ADI (61.32%).
Qualitative Analysis and Diversity
Visual inspection of the generated images reveals that CMI recovers fine-grained structural details—such as the eyes of a frog or the distinct silhouette of a bird—that are typically lost in other inversion techniques. This visual realism is reflected in lower Frechet Inception Distance (FID) scores, indicating a distribution closer to real-world data.
Conclusion
Contrastive Model Inversion (CMI) provides a robust solution to the mode collapse problem in data-free knowledge distillation. By integrating contrastive learning into the inversion process, CMI ensures the generation of diverse and informative proxy datasets. While the method introduces additional computational overhead due to frequent generator re-initialization, the substantial gains in student accuracy and data quality make it a state-of-the-art approach for privacy-preserving model compression.
Summary updated