[论文解读] Understanding Why ViT Trains Badly on Small Datasets: An Intuitive Perspective
该论文在小数据集(CIFAR-10/100)上实证显示 Vision Transformer (ViT) 相较于 ResNet-18 表现较差,在 SVHN 上表现相似,并概述了表示分析的计划。
Vision transformer (ViT) is an attention neural network architecture that is shown to be effective for computer vision tasks. However, compared to ResNet-18 with a similar number of parameters, ViT has a significantly lower evaluation accuracy when trained on small datasets. To facilitate studies in related fields, we provide a visual intuition to help understand why it is the case. We first compare the performance of the two models and confirm that ViT has less accuracy than ResNet-18 when trained on small datasets. We then interpret the results by showing attention map visualization for ViT and feature map visualization for ResNet-18. The difference is further analyzed through a representation similarity perspective. We conclude that the representation of ViT trained on small datasets is hugely different from ViT trained on large datasets, which may be the reason why the performance drops a lot on small datasets.
研究动机与目标
- 证明在与 ResNet-18 等 CNN 相比时,ViT 在小数据集上的表现不佳。
- 在受控设置下比较 ViT 与 ResNet-18 在 CIFAR-10、CIFAR-100 和 SVHN 上的表现。
- 提供对 ViT 在小数据上欠拟合行为的直观解释及可视化/定量证据。
- 为分析表示以理解 ViT 在小数据集上的失效模式打下基础。
提出的方法
- 在 CIFAR-10、CIFAR-100 和 SVHN 上以相同的超参数训练 ViT(6 层编码器、8 个注意头、64 维注意向量、64 维 MLP、 dropout 0.1)和 ResNet-18(lr=1e-4、batch=100、Adam、500 个时期)。
- 使用数据增强(随机裁剪并填充 4、水平翻转)以及不进行像素归一化,以标准化跨模型的输入。
- 与一个 ResNet-18 基线对比(11.5M 参数)以镜像 ViT 的参数量(~9.6M)。
- 报告 top-1 准确率并用 wandb 可视化跟踪训练/测试损失和准确率。
- 通过注意力和前向传播可视化提供定性观察以支持直觉。

实验结果
研究问题
- RQ1为什么 ViT 在小规模数据集上的表现比像 ResNet 这样的 CNN 差?
- RQ2数据集规模如何影响 ViT 与 CNN 的性能,这一差距是否可以直观地解释?
- RQ3对表示的简单定性/定量分析(如注意力模式、前向传播)是否揭示 ViT 在小数据上的失效模式?
- RQ4哪些经验性方向(如使用 CKA 的表示分析)可以揭示为何 ViT 在数据有限时难以有效学习?
主要发现
| 数据集 | ViT accuracy (%) | ResNet18 accuracy (%) |
|---|---|---|
| CIFAR-10 | 81.36 | 92.8 |
| CIFAR-100 | 54.31 | 70.7 |
| SVHN | 95.17 | 95.78 |
- 在 CIFAR-10 和 CIFAR-100 上,ViT 的准确率显著低于 ResNet-18(CIFAR-10: ViT 81.36% vs ResNet-18 92.8%;CIFAR-100: ViT 54.31% vs ResNet-18 70.7%)。
- 在 SVHN 上,ViT 与 ResNet-18 的表现相近(ViT 95.17% vs ResNet-18 95.78%),尽管 ViT 收敛速度较慢。
- 结果支持 ViT 在小数据集上表现不佳的说法,与更具挑战性的按类分布数据(CIFAR-100)相比,相对性能较弱;相较于 SVHN。
- 作者计划使用 CKA 分析 ViT 与 CNN 的局部与全局表示,以解释在不同数据集规模下的学习差异。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。