Skip to main navigation Skip to search Skip to main content

MSViT: Dynamic Mixed-scale Tokenization for Vision Transformers

  • Jakob Drachmann Havtorn
  • , Amélie Royer
  • , Tijmen Blankevoort
  • , Babak Ehteshami Bejnordi
  • Qualcomm AI Research

Research output: Chapter in Book/Report/Conference proceedingArticle in proceedingsResearchpeer-review

Abstract

The input tokens to Vision Transformers carry little semantic meaning as they are defined as regular equal-sized patches of the input image, regardless of its content. However, processing uniform background areas of an image should not necessitate as much compute as dense, cluttered areas. To address this issue, we propose a dynamic mixed-scale tokenization scheme for ViT, MSViT. Our method introduces a conditional gating mechanism that selects the optimal token scale for every image region, such that the number of tokens is dynamically determined per input. In addition, to enhance the conditional behavior of the gate during training, we introduce a novel generalization of the batch-shaping loss. We show that our gating module is able to learn meaningful semantics despite operating locally at the coarse patch-level. The proposed gating module is lightweight, agnostic to the choice of transformer backbone, and trained within a few epochs with little training overhead. Furthermore, in contrast to token pruning, MSViT does not lose information about the input, thus can be readily applied for dense tasks. We validate MSViT on the tasks of classification and segmentation where it leads to improved accuracy-complexity trade-off.
Original languageEnglish
Title of host publicationProceedings of 2023 IEEE/CVF International Conference on Computer Vision Workshops
PublisherIEEE
Publication date2023
Pages838-848
ISBN (Print)979-8-3503-0745-0
DOIs
Publication statusPublished - 2023
Event2023 IEEE/CVF International Conference on Computer Vision Workshops - Paris Convention Center , Paris, France
Duration: 2 Oct 20236 Oct 2023

Conference

Conference2023 IEEE/CVF International Conference on Computer Vision Workshops
LocationParis Convention Center
Country/TerritoryFrance
CityParis
Period02/10/202306/10/2023

Fingerprint

Dive into the research topics of 'MSViT: Dynamic Mixed-scale Tokenization for Vision Transformers'. Together they form a unique fingerprint.

Cite this