FreeKD: Knowledge Distillation via Semantic Frequency Prompt
作者: Yuan Zhang, Tao Huang, Jiaming Liu, Tao Jiang, Kuan Cheng, Shanghang Zhang
分类: cs.CV
发布日期: 2023-11-20 (更新: 2024-05-22)
备注: Accepted by CVPR 2024
💡 一句话要点
提出FreeKD以解决知识蒸馏中的特征图失真问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 知识蒸馏 频率域 特征图 深度学习 计算机视觉 密集预测 模型鲁棒性
📋 核心要点
- 现有知识蒸馏方法在空间域的下采样导致特征图失真,影响学生模型的学习效果。
- 提出频率提示和像素级频率掩码,帮助学生模型更好地定位和模仿教师模型中的重要信息。
- FreeKD在COCO2017和Cityscapes数据集上分别提升了3.8 AP和4.55 mIoU,显示出其优越性和鲁棒性。
📝 摘要(中文)
知识蒸馏(KD)已成功应用于多种任务,主流方法通常通过空间模仿损失来提升学生模型。然而,教师模型在空间域的连续下采样会导致特征图的失真,妨碍学生模型分析需要模仿的具体信息,从而导致准确率下降。为了解决这一问题,本文将注意力转向频率域,提出了FreeKD方法,通过频率提示吸收语义频率上下文,并生成像素级频率掩码以定位感兴趣的像素。此外,采用位置感知的关系频率损失为密集预测任务提供高阶空间增强。实验表明,FreeKD在密集预测任务上显著优于基于空间的蒸馏方法,并在大规模视觉模型上验证了其通用性。
🔬 方法详解
问题定义:本文旨在解决知识蒸馏过程中教师模型特征图失真导致的学生模型学习效果下降的问题。现有方法主要依赖空间模仿损失,未能有效处理频率域信息的利用。
核心思路:通过将注意力转向频率域,提出频率提示(Frequency Prompt)来吸收语义频率上下文,并生成像素级频率掩码,以帮助学生模型更好地识别和模仿教师模型中的重要特征。
技术框架:整体架构包括教师模型的频率提示模块和学生模型的频率蒸馏过程。频率提示模块在微调阶段吸收语义信息,而在蒸馏阶段生成频率掩码以定位感兴趣的像素。
关键创新:最重要的创新在于引入频率提示和位置感知的关系频率损失,这与传统的空间模仿损失方法本质上不同,能够更有效地利用频率域信息。
关键设计:在损失函数中引入位置感知的关系频率损失,确保不同频率带内的像素对模型性能的贡献得到合理评估和利用。
🖼️ 关键图片
📊 实验亮点
实验结果显示,FreeKD在COCO2017数据集上提升了3.8 AP,在Cityscapes数据集上提升了4.55 mIoU,显著优于传统的空间蒸馏方法,且在大规模视觉模型上验证了其通用性,展示了良好的鲁棒性。
🎯 应用场景
该研究的潜在应用领域包括计算机视觉中的目标检测、语义分割等密集预测任务。通过提升学生模型的学习效果,FreeKD能够在实际应用中提高模型的准确性和鲁棒性,具有重要的实际价值和未来影响。
📄 摘要(原文)
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).