Vision Transformer models process input images by dividing them into a spatially regular grid of equal-size patches. Conversely, Transformers were originally introduced over natural language sequences, where each token represents a subword - a chunk of raw data of arbitrary size. In this work, we apply this approach to Vision Transformers by introducing a novel image tokenization scheme, replacing the standard uniform grid with a mixed-resolution sequence of tokens, where each token represents a patch of arbitrary size. Using the Quadtree algorithm and a novel saliency scorer, we construct a patch mosaic where low-saliency areas of the image are processed in low resolution, routing more of the model's capacity to important image regions. Using the same architecture as vanilla ViTs, our Quadformer models achieve substantial accuracy gains on image classification when controlling for the computational budget. Code and models are publicly available at https://github.com/TomerRonen34/mixed-resolution-vit .
翻译:视觉Transformer模型通过将输入图像分割成空间规则网格的等尺寸块来处理。然而,Transformer最初是针对自然语言序列提出的,其中每个令牌代表一个子词——即任意大小的原始数据块。在本研究中,我们通过引入一种新颖的图像令牌化方案,将这种方法应用于视觉Transformer,即用混合分辨率的令牌序列替代标准的均匀网格,其中每个令牌代表任意大小的图像块。利用四叉树算法和一种新颖的显著性评分器,我们构建了一个图像块马赛克,其中图像的低显著性区域以低分辨率处理,从而将更多模型容量分配到重要图像区域。与普通ViT使用相同架构的Quadformer模型在控制计算预算时,在图像分类任务上实现了显著的准确率提升。代码和模型已在https://github.com/TomerRonen34/mixed-resolution-vit公开提供。