晨光
暗夜
晨光
极光
Bilingual Paper Reading · 中英对照精读

DeiT-LT:让知识蒸馏「卷土重来」——面向长尾数据集的 Vision Transformer 训练

准大一 · 计算机科学与技术 × 计算机视觉 × 知识蒸馏 —— 长尾数据 ViT 训练精读材料
原文:arXiv:2404.02900 2024年4月3日发布 arXiv 预印本(cs.CV / cs.AI / cs.LG) 长尾识别 × 知识蒸馏 × 从零训练 附英文摘要朗读音频

一、论文档案

英文标题DeiT-LT: Distillation Strikes Back for Vision Transformer Training on Long-Tailed Datasets
中文标题DeiT-LT:让知识蒸馏「卷土重来」——面向长尾数据集的 Vision Transformer 从零训练
作者哈什·兰瓦尼, 普拉迪普托·蒙达尔, 马扬克·米什拉, 阿希什·拉马耶·阿索坎, R·文卡特什·巴布(机构未在素材中标注)
发布时间2024年4月3日(v1)|分类:cs.CV / cs.AI / cs.LG(计算机视觉 / 人工智能 / 机器学习)
一句话概括让 ViT 摆脱「必须大规模预训练」的枷锁:用 CNN 蒸馏 + 长尾重加权 + 双令牌「专家分工」,从零训练也能在长尾数据上达到 SOTA。
💡 为什么选这篇给你:① 长尾分布是真实世界的常态——医疗影像、卫星图、监控视频里「冷门类别」永远缺样本;② 思路新颖——把「被 DeiT-III 移除的蒸馏」重新请回来,让 CLS 令牌与 DIST 令牌各当一类专家,思想用文字就能读懂;③ 实验从 CIFAR-10 LT 一路做到 iNaturalist-2018,跨度大、故事完整,是入门 Vision Transformer 的绝佳材料。

二、核心术语表(先扫一遍再读正文)

英文术语中文大白话解释
Vision Transformer (ViT)视觉 Transformer把图像切成小块(patch)当作「词」、送入自注意力网络处理的架构,是 CNN 之外的另一大视觉主干。
patch token图像块令牌图像被分成的小块对应的向量表示,ViT 的基本输入单位。
inductive bias归纳偏置模型自带的先验假设(如 CNN 假设邻近像素相关),能帮模型用更少数据学习。
long-tailed distribution长尾分布少数类别样本极多、大量类别样本极少的真实数据分布,形状像「头大尾长」。
head / tail classes头部类 / 尾部类样本多的「热门」类与样本稀少的「冷门」类(后者也叫少数类)。
knowledge distillation知识蒸馏用强模型(教师)的输出指导小模型(学生)学习,把知识「蒸馏」过去。
distillation token (DIST)蒸馏令牌DeiT 中专门承载教师知识的一个特殊 token,与分类令牌并列。
CLS token分类令牌ViT 中汇总全局信息、用于输出分类结果的特殊 token。
OOD images分布外图像这里指用强数据增强生成、超出教师训练数据分布的图像。
Sharpness Aware Minimization (SAM)锐度感知最小化一种专门寻找「平坦极小值」的优化方法,得到的模型泛化性更好。
low-rank features低秩特征冗余少、结构紧凑的特征,通常泛化能力更强。
flat teacher平坦教师用 SAM 训练出的、损失曲面平坦的教师模型。
imbalance ratio (ρ)不均衡比样本最多类与最少类的样本数之比,衡量数据倾斜程度。
training from scratch从零训练不使用大规模预训练权重,直接在小数据集上从头训练模型。

三、摘要中英对照(精读核心)

🎧 音频在文末,可先听一遍原文再读;每个英文句都配了逐句翻译。

摘要 Abstract

EN · 原文
Vision Transformer (ViT) has emerged as a prominent architecture for various computer vision tasks.
CN · 翻译
Vision Transformer(ViT)已成为各种计算机视觉任务的主流架构
EN · 原文
In ViT, we divide the input image into patch tokens and process them through a stack of self attention blocks.
CN · 翻译
在 ViT 中,我们把输入图像分成一个个图像块令牌(patch token),通过一叠自注意力模块进行处理。
EN · 原文
However, unlike Convolutional Neural Networks (CNN), ViTs simple architecture has no informative inductive bias (e.g., locality,etc. ).
CN · 翻译
然而,与卷积神经网络(CNN)不同,ViT 简单的架构没有信息丰富的归纳偏置(如局部性等)。
EN · 原文
Due to this, ViT requires a large amount of data for pre-training.
CN · 翻译
正因如此,ViT 需要大量数据进行预训练
EN · 原文
Various data efficient approaches (DeiT) have been proposed to train ViT on balanced datasets effectively.
CN · 翻译
人们提出了多种数据高效方法(DeiT),以便在均衡数据集上有效训练 ViT。
EN · 原文
However, limited literature discusses the use of ViT for datasets with long-tailed imbalances.
CN · 翻译
然而,针对长尾不均衡数据集使用 ViT 的文献仍然很少。
EN · 原文
In this work, we introduce DeiT-LT to tackle the problem of training ViTs from scratch on long-tailed datasets.
CN · 翻译
本文提出 DeiT-LT,解决在长尾数据集上从零训练 ViT 的问题。
EN · 原文
In DeiT-LT, we introduce an efficient and effective way of distillation from CNN via distillation DIST token by using out-of-distribution images and re-weighting the distillation loss to enhance focus on tail classes.
CN · 翻译
在 DeiT-LT 中,我们提出一种高效且有效的 CNN 蒸馏方式:利用分布外图像、通过蒸馏 DIST 令牌进行蒸馏,并重新加权蒸馏损失以加强对尾部类的关注。
EN · 原文
This leads to the learning of local CNN-like features in early ViT blocks, improving generalization for tail classes.
CN · 翻译
这使得 ViT 早期模块学到局部的、类似 CNN 的特征,提升尾部类的泛化能力。
EN · 原文
Further, to mitigate overfitting, we propose distilling from a flat CNN teacher, which leads to learning low-rank generalizable features for DIST tokens across all ViT blocks.
CN · 翻译
进一步,为缓解过拟合,我们提出从「平坦」的 CNN 教师蒸馏,使所有 ViT 模块的 DIST 令牌学到低秩、可泛化的特征
EN · 原文
With the proposed DeiT-LT scheme, the distillation DIST token becomes an expert on the tail classes, and the classifier CLS token becomes an expert on the head classes.
CN · 翻译
在提出的 DeiT-LT 方案下,蒸馏 DIST 令牌成为尾部类专家,而分类 CLS 令牌成为头部类专家
EN · 原文
The experts help to effectively learn features corresponding to both the majority and minority classes using a distinct set of tokens within the same ViT architecture.
CN · 翻译
这两个专家帮助在同一 ViT 架构内用不同的令牌集合,有效学习多数类和少数类对应的特征。
EN · 原文
We show the effectiveness of DeiT-LT for training ViT from scratch on datasets ranging from small-scale CIFAR-10 LT to large-scale iNaturalist-2018.
CN · 翻译
我们展示了 DeiT-LT 在从小规模 CIFAR-10 LT 到大规模 iNaturalist-2018 数据集上从零训练 ViT 的有效性。

关键词 Keywords:Vision Transformer 视觉 Transformer | Long-Tailed Recognition 长尾识别 | Knowledge Distillation 知识蒸馏 | Training from Scratch 从零训练

四、引言精选(为什么这个问题重要)

① 长尾分布:真实世界数据的「默认形态」

EN · 原文
Visual Recognition has seen unprecedented success with the advent of deep neural networks trained on large datasets. Consequently, efforts are being made to collect large datasets through crowd-sourcing to train deep neural networks for various applications across domains. As a result of crowd-sourcing, these datasets often exhibit long-tailed data distributions due to inherent natural statistics, i.e., a large number of images belong to a small portion of (majority) classes, whereas other (minority) classes contain few image samples each.
CN · 翻译
随着在大型数据集上训练的深度神经网络出现,视觉识别取得了前所未有的成功。因此,人们通过众包收集大型数据集,以训练用于各领域应用的深度神经网络。由于众包的结果,这些数据集往往因固有的自然统计特性而呈现长尾数据分布——即大量图像属于一小部分(多数)类别,而其他(少数)类别每类只有很少的图像样本。

② ViT 很强,但「预训练依赖」很贵

EN · 原文
Recently, the transformer architecture adapted for computer vision, named as Vision Transformer (ViT), has gained popularity due to its scalability and impressive performance on various computer vision tasks. One caveat behind its impressive performance is the requirement for pre-training on large datasets. The data-efficient transformers (DeiT) aimed to reduce this requirement for pre-training by distilling information from a pre-trained CNN. Subsequent efforts have further improved the data and compute efficiency of ViTs. However, all these improvements have been primarily based on increasing performance on the balanced ImageNet dataset. We find that these improvements are still insufficient for robust performance on long-tailed datasets (Fig. 1c).
CN · 翻译
近来,为计算机视觉改造的 Transformer 架构——视觉 Transformer(ViT)——因其可扩展性和在各种视觉任务上的出色表现而广受欢迎。其出色表现背后的一个隐忧是:它需要在大数据集上预训练。数据高效 Transformer(DeiT)旨在通过从预训练 CNN 蒸馏信息来降低这一预训练需求。后续工作进一步提升了 ViT 的数据与计算效率。然而,这些改进都主要建立在提升均衡 ImageNet 数据集性能的基础上。我们发现,这些改进在长尾数据集上仍然不足以实现稳健的性能。

③ 从零训练:省掉预训练的「昂贵」与「偏见」

EN · 原文
In this work, we aim to investigate and improve the training of Vision Transformers from scratch without the need for large-scale pre-training on diverse long-tailed datasets, varying in image size and resolution. Recent works show improved performance for ViTs on long-tailed recognition tasks, but they often need expensive pre-training on large-scale datasets. The requirement of pre-training is computationally expensive and restricts their application to specialized domains such as medicine, satellite, speech, etc. Furthermore, the large-scale pre-trained datasets often contain biases that might be inadvertently induced with their usage. To mitigate these shortcomings, we introduce Data-efficient Image Transformers for Long-Tailed Data (DeiT-LT) - a scheme for training ViTs from scratch on small and large-scale long tailed datasets.
CN · 翻译
本文旨在研究并改进:在图像尺寸与分辨率各异的长尾数据集上,无需大规模预训练、从零训练 Vision Transformer。近期工作表明 ViT 在长尾识别任务上性能有所提升,但往往需要在大规模数据集上昂贵的预训练。预训练的要求计算代价高昂,并限制了其在医学、卫星、语音等专业领域的应用。此外,大规模预训练数据集常含有偏见,使用它们可能会无意间引入这些偏见。为克服这些缺点,我们提出面向长尾数据的数据高效图像 Transformer(DeiT-LT)——一种在小型和大型长尾数据集上从零训练 ViT 的方案。

④ 结果一句话:无需预训练,全面超越

EN · 原文
We demonstrate the effectiveness of DeiT-LT across diverse small-scale (CIFAR-10 LT, CIFAR-100 LT) as well as large-scale datasets (ImageNet-LT, iNaturalist-2018). We find that DeiT-LT effectively improves over the teacher CNN across all datasets and achieves performances superior to SotA CNN-based methods without requiring any pre-training.
CN · 翻译
我们在多种小型(CIFAR-10 LT、CIFAR-100 LT)与大型(ImageNet-LT、iNaturalist-2018)数据集上展示了 DeiT-LT 的有效性。我们发现 DeiT-LT 在所有数据集上都稳定优于教师 CNN,并且无需任何预训练即可达到超越 SOTA CNN 方法的性能。

五、论文贡献(3 个要点)

EN · 原文
1. OOD distillation. DeiT-LT involves distilling knowledge from low-resolution teacher networks using out-of-distribution (OOD) images generated through strong augmentations. Notably, this method proves effective even if the CNN teacher wasn't originally trained on such augmentations. The outcome is the successful induction of CNN-like feature locality in the ViT student network, ultimately enhancing generalization performance, particularly for minority (tail) classes (Fig. 1a, 4(a) and Sec. 3.1).
CN · 翻译
1. 分布外(OOD)蒸馏。DeiT-LT 利用强增强生成的分布外图像,从低分辨率教师网络蒸馏知识。值得注意的是,即使 CNN 教师最初并未用此类增强训练,该方法依然有效。其结果是成功地在 ViT 学生网络中引入了类似 CNN 的特征局部性,最终提升了泛化性能,尤其是对少数(尾部)类。
EN · 原文
2. Flat teacher distillation. Further, to improve the generality of features, we propose to distill knowledge via flat CNN teachers trained through Sharpness Aware Minimization (SAM). This results in low-rank generalizable features for long-tailed setup across all ViT blocks (Fig. 1b and Sec. 3.2).
CN · 翻译
2. 平坦教师蒸馏。为提升特征通用性,我们提出通过经锐度感知最小化(SAM)训练的平坦 CNN 教师蒸馏知识。这使得长尾场景下所有 ViT 模块都能学到低秩、可泛化的特征。
EN · 原文
3. Token-level expertise division. In DeiT, the classification and distillation tokens produce similar predictions. However, in proposed DeiT-LT, we ensure their divergence such that the classification token becomes an expert on the majority classes. Whearas, the distillation token learns local low-rank features, becoming an expert on the minority. Hence, DeiT-LT can focus on both the majority and minority effectively, which is not possible with vanilla DeiT training (Fig. 5 and Sec. 3.1).
CN · 翻译
3. 令牌级「专家分工」。在 DeiT 中,分类令牌与蒸馏令牌产生相似的预测;而在提出的 DeiT-LT 中,我们确保它们分化:分类令牌成为多数类专家,蒸馏令牌学习局部低秩特征、成为少数类专家。因此 DeiT-LT 能同时有效关注多数类与少数类,这是普通 DeiT 训练做不到的。

六、结论中英对照

EN · 原文
In this work, we introduce DeiT-LT, a training scheme to train ViTs from scratch on real-world long-tailed datasets efficiently. We reintroduce the idea of knowledge distillation into ViT students via teacher CNN, as it enables effective learning on the tail classes. This distillation component was found to be redundant and removed from the latest DeiT-III.
CN · 翻译
本文提出 DeiT-LT——一种在真实世界长尾数据集上高效从零训练 ViT 的训练方案。我们重新把知识蒸馏引入 ViT 学生(通过教师 CNN),因为它能在尾部类上实现有效学习。这一蒸馏组件曾被最新版 DeiT-III 认为冗余而移除。
EN · 原文
Further, in DeiT-LT, we introduce out-of-distribution (OOD) distillation via the teacher, in which we pass strongly augmented images to teachers originally trained via mild augmentations for distillation. The distillation loss is re-weighted to enhance the focus on learning from tail classes. This helps make the classification token an expert on the head classes and the distillation token an expert on the tail classes.
CN · 翻译
进一步,在 DeiT-LT 中,我们引入通过教师进行的分布外(OOD)蒸馏:把强增强的图像送给原本用温和增强训练的教师做蒸馏。蒸馏损失被重新加权,以加强对尾部类学习的关注。这帮助分类令牌成为头部类专家、蒸馏令牌成为尾部类专家。
EN · 原文
To improve generality in minority classes, we induce low-rank features in ViT by distilling from teachers trained from Sharpness Aware Minimization (SAM). The proposed DeiT-LT scheme allows ViTs to be trained from scratch as CNNs and achieve performance competitive to SotA without requiring any pre-training on large-datasets.
CN · 翻译
为提升少数类的通用性,我们通过从锐度感知最小化(SAM)训练的教师蒸馏,在 ViT 中诱导低秩特征。所提出的 DeiT-LT 方案使 ViT 能像 CNN 一样从零训练,无需在大数据集上预训练即可达到与 SOTA 竞争的性能。

七、编者解读:这篇论文到底讲了什么(大白话版)

  1. 问题:现实世界的数据几乎都是「长尾」的——少数热门类别占大多数样本,大量冷门类别只有零星样本;而 ViT 天生「娇贵」,没有 CNN 那种局部性先验,需要海量数据预训练才能好用。
  2. 做法:DeiT-LT 把「知识蒸馏」重新请回来:① 用强增强造出「分布外」图像,让 CNN 教师教 ViT 学局部特征;② 用 SAM 训练出的「平坦教师」教出低秩可泛化特征;③ 让 CLS 令牌专攻头部类、DIST 令牌专攻尾部类,各司其职。
  3. 结果:在 CIFAR-10 LT 到 iNaturalist-2018 的四个数据集上,无需任何预训练,全面超过 SOTA CNN 方法。
  4. 最值钱的观点:「不是所有任务都需要大模型 + 海量数据」——靠巧妙的双令牌分工和轻量蒸馏,小模型也能打;另外,预训练数据里的偏见会被模型「继承」,从零训练反而更干净。
  5. 工程意义:医疗影像、卫星图、安全监控等专业领域没有 ImageNet 级数据,DeiT-LT 这类「从零训练」方案让 ViT 在这些场景真正可用。
🎯 对保研的启示:这篇论文示范了「针对痛点做减法」的科研思路——别人都在堆预训练规模,它反其道研究「没有预训练怎么办」,并靠结构设计取胜。复试时若能讲出「我发现了什么被忽视的问题、如何用最小代价解决」,比堆砌大模型名词更能打动导师。

八、给准大一的阅读路线图 & 延伸方向

📖 怎么读这篇论文(三遍法)

  1. 第一遍(10 分钟):只读摘要和术语表,回答三个问题——问题是什么(长尾数据上训练 ViT 难)?方法是什么(CNN 蒸馏 + 损失重加权 + 双令牌分工)?结果是什么(无预训练超 SOTA)?
  2. 第二遍(20 分钟):读引言 + 结论,重点体会「为什么蒸馏被 DeiT-III 移除后,长尾场景又需要它回来」以及「预训练数据的偏见」这个动机。
  3. 第三遍(30 分钟):读方法文字部分(DIST 令牌、OOD 蒸馏、SAM 平坦教师),跳过公式和实验表格,只看文字描述;遇到不懂的术语回查术语表。

🚀 这个方向你能延伸做什么

九、英文摘要朗读(练听力用)

先盲听一遍→再看对照稿→再听一遍。目标是听出每个数字(如 CIFAR-10 LT、iNaturalist-2018)和术语(如 distillation token、long-tailed、SAM)。