Beyond Grids: Exploring Elastic Input Sampling for Vision Transformers
Adam Pardyl, Grzegorz Kurzejamski, Jan Olszewski, Tomasz Trzciński, Bartosz Zieliński
TL;DR
This paper tackles the rigidity of Vision Transformers' input sampling by introducing the notion of input elasticity and a protocol to evaluate resilience to scale, position, and missing data perturbations. It then proposes ElasticViT, featuring a 4D sine-cosine encoding for patch coordinates and a training regime with PatchMix augmentations to enhance elasticity. Through extensive experiments across ImageNet-1k and transfer tasks, ElasticViT demonstrates superior robustness to elastic inputs and maintains competitive accuracy under perturbations, outperforming vanilla ViT and other baselines in many perturbed scenarios. The work also explores adaptive patch sampling (CENTRAL and EDGE) and reveals promising directions for real-world embodied AI applications where observations are partial, multi-scale, and non-grid aligned.
Abstract
Vision transformers have excelled in various computer vision tasks but mostly rely on rigid input sampling using a fixed-size grid of patches. It limits their applicability in real-world problems, such as active visual exploration, where patches have various scales and positions. Our paper addresses this limitation by formalizing the concept of input elasticity for vision transformers and introducing an evaluation protocol for measuring this elasticity. Moreover, we propose modifications to the transformer architecture and training regime, which increase its elasticity. Through extensive experimentation, we spotlight opportunities and challenges associated with such architecture.
