arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2303.13005cs.CV
收藏

从知识蒸馏到自知识蒸馏:一种采用归一化损失和定制软标签的统一方法

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

Tsinghua Shenzhen International Graduate School(清华大学深圳国际研究生院);International Digital Economy Academy (IDEA)(国际数字经济研究院);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所)

Zhendong Yang, Ailing Zeng, Zhe Li, Tianke Zhang, Chun Yuan, Yu Li

AI总结:

本文提出统一 KD 与自 KD 的 NKD 损失及 USKD 定制软标签框架,在 ImageNet 等基准上显著提升 CNN 与 ViT 性能。

摘要:

知识蒸馏(KD)使用教师模型的预测 logits 作为软标签来指导学生模型,而自知识蒸馏(self-KD)不需要真实教师模型来提供软标签。本工作通过将通用 KD 损失分解并重组为归一化 KD(NKD)损失,以及针对目标类别(图像类别)和非目标类别的定制软标签,统一了这两项任务的形式化表述;该方法名为 Universal Self-Knowledge Distillation(USKD)。我们分解 KD 损失后发现,其中的非目标损失会迫使学生模型的非目标 logits 与教师模型的相匹配,但两组非目标 logits 的总和不同,导致它们无法完全一致。NKD 对非目标 logits 进行归一化,使它们的总和相等。它可普遍用于 KD 和自 KD,从而在蒸馏损失中更好地利用软标签。USKD 无需教师模型即可为目标类别和非目标类别生成定制软标签。它将学生模型的目标 logit 平滑为软目标标签,并利用中间特征的秩,结合 Zipf 定律生成软非目标标签。对于有教师模型的 KD,我们的 NKD 在 CIFAR-100 和 ImageNet 数据集上取得了最先进性能;在使用 ResNet-34 教师模型时,将 ResNet18 的 ImageNet Top-1 准确率从 69.90% 提升至 71.96%。对于无教师模型的自 KD,USKD 是首个能够有效应用于 CNN 和 ViT 模型的自 KD 方法,并且带来的额外时间和内存成本可以忽略不计,同时取得了新的最先进结果,例如在 ImageNet 上分别为 MobileNet 和 DeiT-Tiny 带来 1.17% 和 0.55% 的准确率提升。我们的代码可在 https://github.com/yzd-v/cls_KD 获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑