TouvronHugo ; CordMatthieu ; DouzeMatthijs ; MassaFrancisco ; SablayrollesAlexandre ; JégouHervé

摘要
最近,纯基于注意力机制的神经网络在图像理解任务(如图像分类)中展现出了良好的效果。然而,这些视觉变压器通常需要使用昂贵的基础设施进行数亿张图像的预训练,这限制了它们的应用范围。在这项工作中,我们仅通过在ImageNet上训练,生成了一个具有竞争力且无卷积操作的变压器模型。我们使用单台计算机在不到3天的时间内完成了训练。我们的基准视觉变压器(8600万个参数)在ImageNet上实现了83.1%的单裁剪评估准确率,而未使用任何外部数据。更重要的是,我们引入了一种专为变压器设计的教师-学生策略。该策略依赖于一个蒸馏令牌(distillation token),确保学生模型通过注意力机制从教师模型中学习。我们展示了这种基于令牌的蒸馏方法的优势,特别是在使用卷积神经网络作为教师模型时。这使得我们在ImageNet上获得了与卷积神经网络相当的结果(最高达到85.2%的准确率),并且在迁移到其他任务时也表现出色。我们已共享了代码和模型。
代码仓库
omihub777/vit-cifar
pytorch
GitHub 中提及
UdbhavPrasad072300/Transformer-Implementations
pytorch
GitHub 中提及
gatech-eic/vitcod
pytorch
GitHub 中提及
liuxingwt/CLS
pytorch
GitHub 中提及
rwightman/pytorch-image-models
pytorch
GitHub 中提及
zhuhanqing/lightening-transformer
pytorch
GitHub 中提及
bshantam97/Attention_Based_Networks
pytorch
GitHub 中提及
smu-ivpl/DeepfakeDetection
pytorch
GitHub 中提及
ttt496/vit-pytorch
pytorch
GitHub 中提及
aiot-mlsys-lab/famba-v
pytorch
GitHub 中提及
PaddlePaddle/PaddleClas
paddle
TACJu/TransFG
pytorch
GitHub 中提及
skchen1993/TrangFG
pytorch
GitHub 中提及
facebookresearch/deit
官方
pytorch
GitHub 中提及
alibaba/EasyCV
pytorch
IMvision12/keras-vision-models
pytorch
GitHub 中提及
asrafulashiq/deit-custom
pytorch
GitHub 中提及
wangyz1608/knowledge-distillation-via-nd
pytorch
GitHub 中提及
huggingface/transformers
pytorch
GitHub 中提及
Burf/VisionTransformer-Tensorflow2
tf
GitHub 中提及
jacobgil/vit-explain
pytorch
GitHub 中提及
nus-hpc-ai-lab/dyvm
pytorch
GitHub 中提及
holdfire/CLS
pytorch
GitHub 中提及
s-chh/patchrot
pytorch
GitHub 中提及
alessiomora/unlearning_fl
tf
GitHub 中提及
moein-shariatnia/Pix2Seq
pytorch
GitHub 中提及
open-edge-platform/geti
pytorch
GitHub 中提及
affjljoo3581/deit3-jax
jax
GitHub 中提及
ahmedelmahy/myownvit
pytorch
GitHub 中提及
holdfire/FAS
pytorch
GitHub 中提及
tianhai123/vit-pytorch
pytorch
GitHub 中提及
hustvl/vim
pytorch
GitHub 中提及
基准测试
| 基准 | 方法 | 指标 |
|---|---|---|
| document-image-classification-on-rvl-cdip | DeiT-B | Accuracy: 90.32% Parameters: 87M |
| document-layout-analysis-on-publaynet-val | DeiT-B | Figure: 0.957 List: 0.921 Overall: 0.932 Table: 0.972 Text: 0.934 Title: 0.874 |
| efficient-vits-on-imagenet-1k-with-deit-s | Base (DeiT-S) | GFLOPs: 4.6 Top 1 Accuracy: 79.8 |
| efficient-vits-on-imagenet-1k-with-deit-t | Base (DeiT-T) | GFLOPs: 1.2 Top 1 Accuracy: 72.2 |
| fine-grained-image-classification-on-oxford | DeiT-B | Accuracy: 98.8% PARAMS: 86M |
| fine-grained-image-classification-on-stanford | DeiT-B | Accuracy: 93.3% PARAMS: 86M |
| image-classification-on-cifar-10 | DeiT-B | Percentage correct: 99.1 |
| image-classification-on-cifar-100 | DeiT-B | PARAMS: 86M Percentage correct: 90.8 |
| image-classification-on-flowers-102 | DeiT-B | Accuracy: 98.8% PARAMS: 86M |
| image-classification-on-imagenet | DeiT-B | Number of params: 86M Top 1 Accuracy: 84.2% |
| image-classification-on-imagenet | DeiT-B 384 | Hardware Burden: Number of params: 87M Operations per network pass: Top 1 Accuracy: 85.2% |
| image-classification-on-imagenet | DeiT-B | Number of params: 5M Top 1 Accuracy: 76.6% |
| image-classification-on-imagenet | DeiT-B | Number of params: 22M Top 1 Accuracy: 82.6% |
| image-classification-on-imagenet-real | DeiT-Ti | Accuracy: 82.1% Params: 5M |
| image-classification-on-imagenet-real | DeiT-B | Accuracy: 88.7% Params: 86M |
| image-classification-on-imagenet-real | DeiT-S | Accuracy: 86.8% Params: 22M |
| image-classification-on-imagenet-real | DeiT-B-384 | Accuracy: 89.3% Params: 86M |
| image-classification-on-inaturalist-2018 | DeiT-B | Top-1 Accuracy: 79.5% |