arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.12753cs.CVcs.AIcs.LG
收藏

LookupViT:将视觉信息压缩到有限数量的令牌

LookupViT: Compressing visual information to a limited number of tokens

Google DeepMind(谷歌DeepMind);Ludwig Maximilian University of Munich(慕尼黑大学)

Rajat Koner, Gagan Jain, Prateek Jain, Volker Tresp, Sujoy Paul

AI总结:

LookupViT通过将高分辨率令牌压缩为固定数量令牌并采用双向交叉注意力,在保持或提升精度的同时将FLOPs减半,适用于图像分类、视频分类和图像描述等任务。

摘要:

视觉变换器(ViT)已成为众多工业级视觉解决方案的事实标准。然而,在许多场景下,其推理成本可能过高,因为它在每一层都计算自注意力,而自注意力的计算复杂度随令牌数量呈二次方增长。另一方面,图像中的空间信息和视频中的时空信息通常是稀疏且冗余的。在这项工作中,我们引入了LookupViT,旨在利用这种信息稀疏性来降低ViT的推理成本。LookupViT提供了一种新颖的通用视觉变换器模块,其工作原理是将来自高分辨率令牌的信息压缩到固定数量的令牌。这些少量压缩令牌经过精细处理,而高分辨率令牌则通过计算成本较低的层传递。这两个令牌集之间的信息共享通过双向交叉注意力机制实现。该方法具有多个优点:(a)通过标准高级运算符易于在标准机器学习加速器(GPU/TPU)上实现;(b)适用于标准ViT及其变体,因此可推广到各种任务;(c)能够处理不同的分词和注意力方法。LookupViT还为压缩令牌提供了灵活性,使得在单个训练模型中能够实现性能与计算之间的权衡。我们在多个领域展示了LookupViT的有效性:(a)图像分类(ImageNet-1K和ImageNet-21K);(b)视频分类(Kinetics400和Something-Something V2);(c)使用冻结编码器的图像描述(COCO-Captions)。LookupViT在这些领域中在保持或提高准确率的同时,将FLOPs减少了2倍。此外,LookupViT在图像分类(ImageNet-C、R、A、O)上也表现出开箱即用的鲁棒性和泛化能力,相比ViT提高了高达4%。

英文摘要:

Vision Transformers (ViT) have emerged as the de-facto choice for numerous industry grade vision solutions. But their inference cost can be prohibitive for many settings, as they compute self-attention in each layer which suffers from quadratic computational complexity in the number of tokens. On the other hand, spatial information in images and spatio-temporal information in videos is usually sparse and redundant. In this work, we introduce LookupViT, that aims to exploit this information sparsity to reduce ViT inference cost. LookupViT provides a novel general purpose vision transformer block that operates by compressing information from higher resolution tokens to a fixed number of tokens. These few compressed tokens undergo meticulous processing, while the higher-resolution tokens are passed through computationally cheaper layers. Information sharing between these two token sets is enabled through a bidirectional cross-attention mechanism. The approach offers multiple advantages - (a) easy to implement on standard ML accelerators (GPUs/TPUs) via standard high-level operators, (b) applicable to standard ViT and its variants, thus generalizes to various tasks, (c) can handle different tokenization and attention approaches. LookupViT also offers flexibility for the compressed tokens, enabling performance-computation trade-offs in a single trained model. We show LookupViT's effectiveness on multiple domains - (a) for image-classification (ImageNet-1K and ImageNet-21K), (b) video classification (Kinetics400 and Something-Something V2), (c) image captioning (COCO-Captions) with a frozen encoder. LookupViT provides $2\times$ reduction in FLOPs while upholding or improving accuracy across these domains. In addition, LookupViT also demonstrates out-of-the-box robustness and generalization on image classification (ImageNet-C,R,A,O), improving by up to $4\%$ over ViT.

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

↑