Sampling to Distill: Knowledge Transfer from Open-World Data

Yuzheng Wang, Zhaoyu Chen, Jie Zhang, Dingkang Yang, Zuhao Ge, Yang Liu, Siao Liu, Yunquan Sun, Wenqiang Zhang, Lizhe Qi

TL;DR

This paper introduces Open-world Data Sampling Distillation (ODSD), a novel approach to Data-Free Knowledge Distillation (DFKD) that bypasses the need for computationally expensive data generation modules. By intelligently sampling from readily available open-world unlabeled data and employing a denoising contrastive relational distillation strategy, ODSD achieves state-of-the-art performance while significantly reducing computational costs.

What Problem Does This Paper Address?

The paper tackles the challenge of Data-Free Knowledge Distillation (DFKD). In DFKD, the goal is to train a smaller, more efficient "student" model using knowledge from a larger, pre-trained "teacher" model, without access to the original training data. This is crucial for scenarios where data privacy, storage limitations, or proprietary concerns prevent direct data access.

Existing DFKD methods primarily fall into two categories:

  1. Generation-based: These methods synthesize "pseudo-data" using generative models (like GANs) to mimic the original data distribution. However, training these generators is computationally intensive, and the generated data often suffers from a "domain shift" compared to the original data, leading to unreliable knowledge transfer.
  2. Sampling-based: These methods sample from readily available unlabeled open-world data. While more efficient than generation-based methods, prior sampling approaches often rely on simple confidence ranking, leading to imbalanced class sampling and failing to capture complex inter-sample relationships, thus limiting student performance.

The core problem ODSD addresses is the inefficiency and sub-optimal performance of existing DFKD methods, particularly the high computational cost of data generation and the limitations in effectively utilizing unlabeled open-world data.

Methods

ODSD comprises two main stages:

  1. Adaptive Prototype Sampling (APS): This module intelligently selects unlabeled data from the open-world dataset to create a substitute dataset that closely resembles the original data's distribution. It achieves this by considering three key factors:
  2. Data Confidence Score: Measures how confident the teacher model is in its prediction for a given unlabeled sample.
  3. Data Outlier Score: Identifies and excludes samples that are misclassified or lie far from the typical distribution within a predicted class, mitigating noise.
  4. Class Density Score: Ensures a balanced representation of classes in the sampled data, preventing over-sampling of common classes and under-sampling of rare ones.
  5. Denoising Contrastive Relational Distillation (DCRD): This stage distills knowledge from the teacher to the student using the sampled data. It introduces two novel components:
  6. Spatial Mapping Denoise: A module that learns a low-dimensional representation of teacher and student predictions. By comparing these low-dimensional representations, it aims to mitigate the impact of label noise inherent in unlabeled data.
  7. Contrastive Relational Distillation: This component goes beyond simple imitation by building structured relationships. It incorporates:
  8. Instance Invariant Loss: Encourages consistency in predictions for augmented versions of the same data sample, making the student robust to variations.
  9. Teacher-Student Contrastive Loss: Aligns the structured representations of the teacher and student, promoting consistent learning and deeper understanding.

The overall distillation loss combines the standard knowledge distillation loss with the denoising and contrastive relational losses.

Datasets

The paper evaluates ODSD on several standard datasets for classification and semantic segmentation:

  • Classification: CIFAR-10, CIFAR-100, ImageNet.
  • Semantic Segmentation: NYUv2.

For each of these, they use corresponding open-world unlabeled datasets for sampling, as detailed in Table I.

Key Insights and Ideas

  • Open-world data is a valuable, underutilized resource for DFKD: Instead of generating data, intelligently sampling from readily available unlabeled data can be highly effective and cost-efficient.
  • Distribution similarity is key: The APS module's success hinges on its ability to bridge the domain gap between open-world data and the original (unseen) data distribution.
  • Beyond imitation: Simple imitation of teacher outputs is insufficient. Capturing inter-sample relationships and structured knowledge is crucial for robust student learning.
  • Denoising is essential for unlabeled data: The DCRD's denoising component directly addresses the inherent label noise in open-world data, improving distillation reliability.
  • Contrastive learning can enhance DFKD: Integrating contrastive principles helps the student learn more discriminative and robust representations.

Key Results

  • State-of-the-art performance: ODSD achieves superior accuracy across CIFAR-10, CIFAR-100, and ImageNet datasets compared to existing DFKD methods, including both generation-based and sampling-based approaches.
  • Significant improvements on ImageNet: ODSD shows substantial gains, with up to 9.59% accuracy improvement in cross-backbone scenarios.
  • Reduced computational costs: ODSD avoids the overhead of training generative models, leading to significantly lower FLOPs and parameters compared to generation-based methods (Table IV).
  • Efficient sampling: The APS module is shown to be more effective than random sampling or the DFND sampling method, leading to better distillation results (Table V).
  • Effective for semantic segmentation: ODSD also demonstrates strong performance on the NYUv2 dataset for semantic segmentation, outperforming baselines.
  • Diagnostic studies confirm component effectiveness: Ablation studies show that each component of ODSD (confidence, outlier, density scores for sampling, and denoising/contrastive losses for distillation) contributes positively to the overall performance.

Limitations and Future Work

  • Computational cost of sampling: While significantly cheaper than generation, the APS module still incurs some computational cost for sampling, especially on very large datasets.
  • Teacher dependency: Like all DFKD methods, ODSD's performance is still fundamentally dependent on the quality of the teacher model.
  • Future Work: The paper suggests that future work could explore more advanced structured knowledge representations and further investigate the interplay between sampling strategies and distillation objectives. The authors also highlight the potential for ODSD in other domains beyond computer vision.

Summary updated

BibTeX
@inproceedings{wang2023sampling,
  author = {Yuzheng Wang and Zhaoyu Chen and Jie Zhang and Dingkang Yang and Zuhao Ge and Yang Liu and Siao Liu and Yunquan Sun and Wenqiang Zhang and Lizhe Qi},
  title = {{Sampling to Distill: Knowledge Transfer from Open-World Data}},
  booktitle = {ACM Multimedia},
  year = {2023},
}
Figure