Skip to main content
QUICK REVIEW

[Paper Review] From Knowledge Distillation to Self-Knowledge Distillation: A Unified Approach with Normalized Loss and Customized Soft Labels

Zhendong Yang, Ailing Zeng|arXiv (Cornell University)|Mar 23, 2023
Advanced Neural Network ApplicationsComputer Science5 citations
TL;DR

This paper proposes a unified framework for knowledge distillation (KD) and self-knowledge distillation (self-KD) by introducing Normalized Knowledge Distillation (NKD) and Universal Self-Knowledge Distillation (USKD). NKD normalizes non-target logits to improve soft label utilization, while USKD generates customized soft labels for both target and non-target classes using student features and Zipf's law, enabling state-of-the-art performance on CNNs and ViTs with minimal computational overhead.

ABSTRACT

Knowledge Distillation (KD) uses the teacher's prediction logits as soft labels to guide the student, while self-KD does not need a real teacher to require the soft labels. This work unifies the formulations of the two tasks by decomposing and reorganizing the generic KD loss into a Normalized KD (NKD) loss and customized soft labels for both target class (image's category) and non-target classes named Universal Self-Knowledge Distillation (USKD). We decompose the KD loss and find the non-target loss from it forces the student's non-target logits to match the teacher's, but the sum of the two non-target logits is different, preventing them from being identical. NKD normalizes the non-target logits to equalize their sum. It can be generally used for KD and self-KD to better use the soft labels for distillation loss. USKD generates customized soft labels for both target and non-target classes without a teacher. It smooths the target logit of the student as the soft target label and uses the rank of the intermediate feature to generate the soft non-target labels with Zipf's law. For KD with teachers, our NKD achieves state-of-the-art performance on CIFAR-100 and ImageNet datasets, boosting the ImageNet Top-1 accuracy of ResNet18 from 69.90% to 71.96% with a ResNet-34 teacher. For self-KD without teachers, USKD is the first self-KD method that can be effectively applied to both CNN and ViT models with negligible additional time and memory cost, resulting in new state-of-the-art results, such as 1.17% and 0.55% accuracy gains on ImageNet for MobileNet and DeiT-Tiny, respectively. Our codes are available at https://github.com/yzd-v/cls_KD.

Motivation & Objective

  • To improve the utilization of soft labels in knowledge distillation by reformulating the KD loss.
  • To unify KD and self-KD through a common loss framework that enhances soft label alignment.
  • To develop a general, efficient method for generating customized soft labels in self-KD without requiring a teacher model.
  • To enable effective self-KD for both CNN and Vision Transformer (ViT) architectures.
  • To achieve state-of-the-art performance with minimal inference and training overhead.

Proposed method

  • Decomposes the standard KD loss into target loss (similar to cross-entropy) and non-target loss in cross-entropy form.
  • Proposes Normalized KD (NKD) by normalizing the sum of non-target logits to equalize the teacher and student distributions.
  • Introduces Universal Self-Knowledge Distillation (USKD) to generate soft labels without a teacher using the student’s own feature statistics.
  • Uses the student’s target logit, squared and smoothed, as the soft target label for improved generalization.
  • Applies Zipf’s law to the rank of intermediate features to generate soft non-target labels based on similarity.
  • Combines weak and final logits with normalization to determine the ranking of non-target classes for label generation.

Experimental results

Research questions

  • RQ1How can the standard KD loss be reformulated to improve soft label utilization in distillation?
  • RQ2Can non-target logits be normalized to better align student and teacher distributions in KD?
  • RQ3Can effective soft labels be generated for self-KD without a teacher model, especially for ViT architectures?
  • RQ4What is the impact of different smoothing strategies on the student’s target logit for self-KD?
  • RQ5How does the choice of feature rank (weak vs. final logit) affect the performance of soft non-target label generation?

Key findings

  • NKD achieves state-of-the-art performance on CIFAR-100 and ImageNet, boosting ResNet18 accuracy from 69.90% to 71.96% with a ResNet-34 teacher.
  • USKD sets a new state-of-the-art for self-KD on ImageNet, achieving a 1.17% accuracy gain on MobileNet and 0.55% on DeiT-Tiny.
  • The method of smoothing the student’s target logit as $S_t + V_t - \text{mean}(S_t)$ yields a 0.86% accuracy improvement over baseline.
  • Combining normalized weak and final logits for rank assignment in non-target label generation achieves the best performance, with a 0.09% gain over using only final logits.
  • USKD requires negligible additional time and memory, making it practical for real-world deployment.
  • The approach is effective across both CNN and ViT models, overcoming limitations of prior self-KD methods that were restricted to CNNs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.