FreeKD: Knowledge Distillation via Semantic Frequency Prompt

Yuan Zhang, Tao Huang, Jiaming Liu, Tao Jiang, Kuan Cheng +1 more
11/1/2023

No official code found. Best implementation: Gumpest/FreeKD (50 stars, Apache-2.0, last commit 2024-04-20).

Abstract

Knowledge distillation (KD) has been applied to various tasks successfully, and mainstream methods typically boost the student model via spatial imitation losses. However, the consecutive downsamplings induced in the spatial domain of teacher model is a type of corruption, hindering the student from analyzing what specific information needs to be imitated, which results in accuracy degradation. To better understand the underlying pattern of corrupted feature maps, we shift our attention to the frequency domain. During frequency distillation, we encounter a new challenge: the low-frequency bands convey general but minimal context, while the high are more informative but also introduce noise. Not each pixel within the frequency bands contributes equally to the performance. To address the above problem: (1) We propose the Frequency Prompt plugged into the teacher model, absorbing the semantic frequency context during finetuning. (2) During the distillation period, a pixel-wise frequency mask is generated via Frequency Prompt, to localize those pixel of interests (PoIs) in various frequency bands. Additionally, we employ a position-aware relational frequency loss for dense prediction tasks, delivering a high-order spatial enhancement to the student model. We dub our Frequency Knowledge Distillation method as FreeKD, which determines the optimal localization and extent for the frequency distillation. Extensive experiments demonstrate that FreeKD not only outperforms spatial-based distillation methods consistently on dense prediction tasks (e.g., FreeKD brings 3.8 AP gains for RepPoints-R50 on COCO2017 and 4.55 mIoU gains for PSPNet-R18 on Cityscapes), but also conveys more robustness to the student. Notably, we also validate the generalization of our approach on large-scale vision models (e.g., DINO and SAM).

View on arXivView PDF

Code Implementations(1)

Gumpest/FreeKDCommunity100%
Apache-2.0

[CVPR'24] Official implementation of paper "FreeKD: Knowledge Distillation via Semantic Frequency Prompt".

506Shell, PythonMar 21, 20242 years agoApache-2.0
frequency-promptknowledge-distillation

Cite this paper

@article{zhang2023freekd,
  title  = {FreeKD: Knowledge Distillation via Semantic Frequency Prompt},
  author = {Yuan Zhang and Tao Huang and Jiaming Liu and Tao Jiang and Kuan Cheng and Shanghang Zhang},
  year   = {2023},
  eprint = {2311.12079},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2311.12079},
  journal = {CVPR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.12079.svg)](https://codeofpaper.com/paper/2311.12079)

Discussion