[论文解读] Locality Guidance for Improving Vision Transformers on Tiny Datasets
本文提出通过轻量级CNN蒸馏实现局部性指导,以提升视觉Transformer(VTs)在小样本数据集上的性能,因为VTs通常因难以学习局部图像结构而表现不佳。通过联合训练VT以模仿CNN特征并学习标签,该方法显著提升性能——例如,在DeiT上提升13.07%,在T2T上提升8.98%,在PVT上提升7.85%,且无需大规模预训练。
While the Vision Transformer (VT) architecture is becoming trendy in computer vision, pure VT models perform poorly on tiny datasets. To address this issue, this paper proposes the locality guidance for improving the performance of VTs on tiny datasets. We first analyze that the local information, which is of great importance for understanding images, is hard to be learned with limited data due to the high flexibility and intrinsic globality of the self-attention mechanism in VTs. To facilitate local information, we realize the locality guidance for VTs by imitating the features of an already trained convolutional neural network (CNN), inspired by the built-in local-to-global hierarchy of CNN. Under our dual-task learning paradigm, the locality guidance provided by a lightweight CNN trained on low-resolution images is adequate to accelerate the convergence and improve the performance of VTs to a large extent. Therefore, our locality guidance approach is very simple and efficient, and can serve as a basic performance enhancement method for VTs on tiny datasets. Extensive experiments demonstrate that our method can significantly improve VTs when training from scratch on tiny datasets and is compatible with different kinds of VTs and datasets. For example, our proposed method can boost the performance of various VTs on tiny datasets (e.g., 13.07% for DeiT, 8.98% for T2T and 7.85% for PVT), and enhance even stronger baseline PVTv2 by 1.86% to 79.30%, showing the potential of VTs on tiny datasets. The code is available at https://github.com/lkhl/tiny-transformers.
研究动机与目标
- 解决视觉Transformer(VTs)在小样本数据集上表现不佳的问题,因其全局自注意力机制难以捕捉局部图像结构。
- 克服预训练-微调范式带来的局限性,该范式成本高、灵活性差,且在缺乏大规模数据的领域(如医学影像)中不可行。
- 提出一种简单、高效且通用的方法,提升VT在小样本数据集上的性能,无需大规模预训练或架构修改。
- 使VT能够学习到类似CNN的层次化局部到全局表征,即使在有限数据上从零开始训练也能实现。
提出的方法
- 提出一种双任务学习框架,使VT同时从监督标签和来自预训练轻量级CNN的特征模仿中学习。
- 通过将VT的隐藏层特征与在相同数据集的低分辨率图像上训练的CNN特征对齐,实施知识蒸馏。
- 使用可学习的线性投影匹配CNN与VT特征之间的通道维度,实现有效的特征蒸馏。
- 通过超参数β平衡模仿损失与自监督损失,使VT既能学习受引导的局部性,又能学习任务特定表征。
- 从CNN的多个层中选择引导位置,当使用所有特征时(R = 1.0)性能最佳,表明层次化特征对齐至关重要。
- 使用轻量级CNN(如ResNet-20、-56、-110)作为引导模型,表明模型复杂度对性能增益影响极小。
实验结果
研究问题
- RQ1能否通过轻量级CNN的局部性指导,在无需大规模预训练的情况下提升视觉Transformer在小样本数据集上的性能?
- RQ2引导位置的选择与特征层选择如何影响VT的性能增益?
- RQ3在双任务训练框架中,模仿损失与自监督损失的最优平衡点是什么?
- RQ4引导CNN的复杂度是否显著影响VT的性能提升?
- RQ5所提方法能否在不同VT架构和数据集(包括医学影像)上实现泛化?
主要发现
- 在从零开始训练时,该方法使DeiT在小样本数据集上性能提升13.07%,T2T-ViT提升8.98%,PVT提升7.85%。
- 即使更强的基线模型PVTv2也实现了1.86%的性能提升,达到CIFAR-100上的79.30% top-1准确率。
- 使用CNN所有特征(R = 1.0)时性能最佳,表明完整层次化特征对齐至关重要。
- 最优β值位于中等范围(如β = 2.0–2.5),此时模仿强度适中,不会压倒模型学习。
- 可学习的线性投影用于通道对齐,优于固定方法(如Attention和Similarity),实现最高77.29% top-1准确率。
- 性能增益在不同CNN复杂度下均保持稳健,ResNet-110仅使VT达到76.62%准确率,表明轻量级引导模型已足够。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。