arXiv:2411.15239cs.CV2024-11

通过保持特征夹角提升学生模型的泛化与鲁棒性

Preserving Angles Improves Feature Distillation

  • 用余弦相似度约束压缩教师特征空间,保留图像嵌入关系
  • 在ImageNet等数据集上显著提升学生模型的泛化与异常检测能力
  • 适合追求轻量级高精度模型的开发者使用

知识蒸馏通过教师模型的分类输出训练学生网络以实现模型压缩,但难以有效传递计算机视觉基础模型的关键属性。尽管特征蒸馏(直接复制教师输出特征)能在多个下游任务中复现性能,却在鲁棒性和分布外(OOD)检测等关键特性上表现不足。本文提出余弦相似度保持压缩(CosPress),一种特征蒸馏技术,通过学习映射将教师模型的潜在空间压缩到学生模型更小的潜在空间,同时保留图像嵌入间的余弦相似度。该方法支持对学生的直接优化,实现对教师属性的更忠实还原。实验表明,在ImageNet等数据集上使用CosPress蒸馏,可获得更精确的学生模型,其在泛化性、鲁棒性和OOD检测基准上均有显著提升,且在小数据集上亦能训练出高性能轻量模型。代码已开源。

原文摘要 · Abstract (English)

Knowledge distillation methods compress models by training a student network using the classification outputs of a high quality teacher model, but can fail to effectively transfer the properties of computer vision foundation models from the teacher to the student. While it has been recently shown that feature distillation$\unicode{x2013}$where a teacher model's output features are replicated instead$\unicode{x2013}$can reproduce performance for foundation models across numerous downstream tasks, they fall short in matching critical properties such as robustness and out-of-distribution (OOD) detection performance. This paper overcomes this shortcoming by introducing Cosine-similarity Preserving Compression (CosPress), a feature distillation technique that learns a mapping to compress the latent space of the teacher model into the smaller latent space of the student, by preserving the cosine similarities between image embeddings. This enables direct optimisation of the student network and produces a more faithful reproduction of the teacher's properties. It is shown that distillation with CosPress on a variety of datasets, including ImageNet, produces more accurate models with greater performance on generalisability, robustness and OOD detection benchmarks, and that this technique provides a competitive pathway for training highly performant lightweight models on small datasets. Code is available at github.com/emannix/cospress.

特征蒸馏模型压缩鲁棒性轻量模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。