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

Win-Win:从两个窗口训练高分辨率视觉Transformer

Win-Win: Training High-Resolution Vision Transformers from Two Windows

Naver Labs Europe(Naver欧洲实验室)

Vincent Leroy, Jerome Revaud, Thomas Lucas, Philippe Weinzaepfel

AI总结:

提出Win-Win策略,通过在训练时仅保留N个随机窗口屏蔽高分辨率输入,实现高分辨率视觉Transformer的高效训练与推理,在语义分割、单目深度和光流任务上取得优异性能。

摘要:

Transformer已成为最先进视觉架构的标准,在图像级和密集像素级任务上均取得了令人瞩目的性能。然而,为高分辨率像素级任务训练视觉Transformer的成本极其高昂。典型的解决方案归结为分层架构、快速近似注意力,或在低分辨率裁剪图像上进行训练。后一种解决方案虽然不限制架构选择,但当测试分辨率明显高于训练分辨率时,会导致性能明显下降,因此需要专门且缓慢的后处理方案。在本文中,我们提出了一种用于高效训练和推理高分辨率视觉Transformer的新策略。关键原则是在训练期间屏蔽大部分高分辨率输入,仅保留N个随机窗口。这使得模型能够学习每个窗口内token之间的局部交互,以及来自不同窗口的token之间的全局交互。因此,模型在测试时可以直接处理高分辨率输入,而无需任何特殊技巧。我们表明,当使用相对位置嵌入(例如rotary embeddings)时,此策略是有效的。它的训练速度比全分辨率网络快4倍,并且与现有方法相比,在测试时易于使用。我们将此策略应用于具有高分辨率数据的三个密集预测任务。首先,我们在语义分割任务上展示了具有2个窗口的简单设置表现最佳,因此我们的方法命名为:Win-Win。其次,我们在单目深度预测任务上证实了这一结果。第三,我们进一步将其扩展到光流的双目任务中,在包含Full-HD图像的Spring基准上达到了最先进的性能,且推理速度比最佳竞争对手快一个数量级。

英文摘要:

Transformers have become the standard in state-of-the-art vision architectures, achieving impressive performance on both image-level and dense pixelwise tasks. However, training vision transformers for high-resolution pixelwise tasks has a prohibitive cost. Typical solutions boil down to hierarchical architectures, fast and approximate attention, or training on low-resolution crops. This latter solution does not constrain architectural choices, but it leads to a clear performance drop when testing at resolutions significantly higher than that used for training, thus requiring ad-hoc and slow post-processing schemes. In this paper, we propose a novel strategy for efficient training and inference of high-resolution vision transformers. The key principle is to mask out most of the high-resolution inputs during training, keeping only N random windows. This allows the model to learn local interactions between tokens inside each window, and global interactions between tokens from different windows. As a result, the model can directly process the high-resolution input at test time without any special trick. We show that this strategy is effective when using relative positional embedding such as rotary embeddings. It is 4 times faster to train than a full-resolution network, and it is straightforward to use at test time compared to existing approaches. We apply this strategy to three dense prediction tasks with high-resolution data. First, we show on the task of semantic segmentation that a simple setting with 2 windows performs best, hence the name of our method: Win-Win. Second, we confirm this result on the task of monocular depth prediction. Third, we further extend it to the binocular task of optical flow, reaching state-of-the-art performance on the Spring benchmark that contains Full-HD images with an order of magnitude faster inference than the best competitor.

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

↑