Accelerating Diffusion Sampling with Classifier-based Feature Distillation

Wujie Sun, Defang Chen, Can Wang, Deshi Ye, Yan Feng, Chun Chen

TL;DR

Diffusion models produce stunning images but are notoriously slow to sample. This paper introduces Classifier-based Feature Distillation (CFD), a method that accelerates sampling by teaching a "student" model to match the high-level semantic features of a "teacher" model rather than just raw pixels. This approach allows for high-quality image generation in as few as 1 to 4 steps, significantly outperforming previous state-of-the-art acceleration techniques like Progressive Distillation.

What Problem Does This Paper Address?

While Diffusion Models (like Stable Diffusion or DDPM) have surpassed GANs in image quality, their main drawback is inference speed. Generating a single image typically requires hundreds or thousands of iterative denoising steps.

Existing solutions like Progressive Distillation (PD) attempt to solve this by training a student model to perform in one step what a teacher model does in two. However, PD relies on "pixel-level alignment"—forcing the student to match the teacher's output pixel-by-pixel. The authors argue that at very low step counts (e.g., 1–4 steps), pixel-level matching is too rigid and difficult for the model to learn, often resulting in blurry or inconsistent images.

Methods

The authors propose moving from pixel-matching to feature-matching. Their core contribution consists of two parts:

  1. Classifier-based Feature Distillation (CFD): Instead of comparing raw images, the authors pass the outputs of both the teacher and student through a pre-trained image classifier (like ResNet or DenseNet). They then minimize the KL-divergence between the high-level feature distributions of the two models.
  2. Sharpening: They apply a "temperature" parameter to the teacher’s feature distribution. This "sharpens" the target, forcing the student to focus on the most salient, important structural features of the image.
  3. Dataset Independence: Crucially, the classifier used for feature extraction doesn't necessarily need to be trained on the same dataset as the diffusion model, making the tool widely applicable.
  4. Regularized CFD (RCFD): If a classifier trained on the specific target dataset is available, the authors add two "dataset-oriented" losses:
  5. Entropy Loss: Encourages the model to produce clear, confident objects (reducing blur).
  6. Diversity Loss: Ensures the model generates a balanced variety of classes, preventing "mode collapse" where the model only generates a few types of images.

Datasets

The primary evaluation was conducted on CIFAR-10, a standard benchmark for image generation. The authors used pre-trained ResNet18, ResNet50, and DenseNet201 architectures as the classifiers for the distillation process. They also tested the robustness of the method by using an ImageNet-trained classifier to distill a model for CIFAR-10.

Key Insights and Ideas

  • Semantic over Spatial: By focusing on high-level features (the "essence" of a car or a cat) rather than specific pixel values, the student model has more flexibility to find an efficient path to a high-quality image in fewer steps.
  • Surpassing the Teacher: Surprisingly, the authors found that with the right temperature settings, the student model can actually achieve better Fréchet Inception Distance (FID) scores than its teacher. This suggests that feature distillation can act as a form of refinement.
  • Universal Features: The fact that an ImageNet-trained classifier can successfully distill a CIFAR-10 model suggests that the "features" learned by deep classifiers are universal enough to guide diffusion models across different domains.

Key Results

The proposed RCFD method set new benchmarks for fast diffusion sampling on CIFAR-10:

  • 1-Step Sampling: Achieved an FID of 8.92, nearly doubling the performance of standard Progressive Distillation (FID 15.06).
  • 4-Step Sampling: Achieved an FID of 3.80. To put this in perspective, the original DDIM model requires 1024 steps to reach a similar FID (3.78). RCFD achieves the same quality roughly 250 times faster.
  • Inception Score (IS): The RCFD-DenseNet201 model consistently produced higher Inception Scores across 1, 2, and 4 steps compared to all other tested acceleration methods, indicating better image variety and object clarity.

Limitations and Future Work

  • Hyperparameter Sensitivity: The authors noted that adding dataset-oriented losses (entropy and diversity) makes the model harder to tune. For their most complex classifier (DenseNet201), they actually omitted these extra losses because the basic CFD was already so effective.
  • Computational Cost of Training: While sampling is much faster, the training phase requires running images through a large classifier multiple times, which adds computational overhead during the distillation process.
  • Scaling to Larger Resolutions: The paper focuses on CIFAR-10 (32x32). While the authors suggest the method is applicable to larger datasets like CelebA or LSUN, the paper does not provide extensive benchmarks for high-resolution image generation.

Summary updated

BibTeX
@inproceedings{sun2023accelerating,
  author = {Wujie Sun and Defang Chen and Can Wang and Deshi Ye and Yan Feng and Chun Chen},
  title = {{Accelerating Diffusion Sampling with Classifier-based Feature Distillation}},
  booktitle = {ICME},
  year = {2023},
  doi = {10.1109/icme55011.2023.00144},
}
Figure