arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2208.09520cs.CV
收藏

通过补丁采样时间表加速视觉Transformer训练

Accelerating Vision Transformer Training via a Patch Sampling Schedule

Franklin and Marshall College(富兰克林与马歇尔学院)

Bradley McDanel, Chi Phuong Huynh

摘要:

我们引入了补丁采样时间表(PSS)的概念,该时间表在训练期间改变每个批次使用的视觉Transformer(ViT)补丁的数量。由于对于大多数视觉目标来说,所有的补丁不是同等重要的(例如,分类),我们认为不太重要的补丁可以在更少的训练迭代中使用,从而缩短训练时间,对性能的影响最小。此外,我们观察到,PSS的训练使ViT在推理过程中对更宽的补丁采样范围更鲁棒。这允许在推理期间在吞吐量和准确性之间进行细粒度的动态权衡。我们在ImageNet的ViTs上使用PSS进行评估,包括从头开始训练和使用重建损失函数进行预训练。对于预训练模型,与每次迭代使用所有补丁相比,我们实现了分类准确率降低0.26%,训练时间减少31%(从25小时减少到17小时)。代码、模型检查点和日志可在www.example.com上获得。

英文摘要:

We introduce the notion of a Patch Sampling Schedule (PSS), that varies the number of Vision Transformer (ViT) patches used per batch during training. Since all patches are not equally important for most vision objectives (e.g., classification), we argue that less important patches can be used in fewer training iterations, leading to shorter training time with minimal impact on performance. Additionally, we observe that training with a PSS makes a ViT more robust to a wider patch sampling range during inference. This allows for a fine-grained, dynamic trade-off between throughput and accuracy during inference. We evaluate using PSSs on ViTs for ImageNet both trained from scratch and pre-trained using a reconstruction loss function. For the pre-trained model, we achieve a 0.26% reduction in classification accuracy for a 31% reduction in training time (from 25 to 17 hours) compared to using all patches each iteration. Code, model checkpoints and logs are available at https://github.com/BradMcDanel/pss.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑