Skip to main content
QUICK REVIEW

[Paper Review] Efficient Training of Visual Transformers with Small Datasets

Yahui Liu, Enver Sangineto|arXiv (Cornell University)|Jun 7, 2021
Advanced Neural Network ApplicationsComputer Science84 citations
TL;DR

The paper analyzes Visual Transformers (VTs) on small datasets and introduces a self-supervised dense relative localization loss to regularize VT training, improving accuracy especially with limited data. It shows consistent gains across multiple VT architectures and datasets, sometimes dramatic.

ABSTRACT

Visual Transformers (VTs) are emerging as an architectural paradigm alternative to Convolutional networks (CNNs). Differently from CNNs, VTs can capture global relations between image elements and they potentially have a larger representation capacity. However, the lack of the typical convolutional inductive bias makes these models more data-hungry than common CNNs. In fact, some local properties of the visual domain which are embedded in the CNN architectural design, in VTs should be learned from samples. In this paper, we empirically analyse different VTs, comparing their robustness in a small training-set regime, and we show that, despite having a comparable accuracy when trained on ImageNet, their performance on smaller datasets can be largely different. Moreover, we propose a self-supervised task which can extract additional information from images with only a negligible computational overhead. This task encourages the VTs to learn spatial relations within an image and makes the VT training much more robust when training data are scarce. Our task is used jointly with the standard (supervised) training and it does not depend on specific architectural choices, thus it can be easily plugged in the existing VTs. Using an extensive evaluation with different VTs and datasets, we show that our method can improve (sometimes dramatically) the final accuracy of the VTs. Our code is available at: https://github.com/yhlleo/VTs-Drloc.

Motivation & Objective

  • Compare the robustness of different second-generation Visual Transformers when trained from scratch or with limited data.
  • Introduce a self-supervised auxiliary task to regularize VT training without extra annotations.
  • Evaluate the proposed method across diverse datasets and training regimes to quantify gains.

Proposed method

  • Represent images as a final k×k grid of embeddings from the VT and attach a lightweight MLP to predict relative embedding distances.
  • Define a dense relative localization loss that samples embedding pairs and regresses their normalized 2D grid distances to a target offset.
  • Combine L_drloc with standard cross-entropy as a multi-task objective with a fixed weight lambda.
  • Use a 7×7 grid for the localization task to ensure stable convergence across architectures.
  • Apply the localization MLP to final token embeddings without altering the base VT architectures.

Experimental results

Research questions

  • RQ1How do different second-generation Visual Transformers perform on small or medium datasets compared to each other and to ResNets?
  • RQ2Can a self-supervised auxiliary task improve VT training when data is scarce or domain-shifted?
  • RQ3Is the proposed dense relative localization loss broadly compatible with various VT architectures and training regimes (from scratch or fine-tuning)?

Key findings

  • VTs exhibit large performance variation on small datasets despite similar ImageNet results.
  • CvT tends to be more robust to small-data regimes than Swin or T2T across several datasets.
  • Adding the dense relative localization loss (L_drloc) consistently improves VT accuracy across architectures and datasets, sometimes by large margins (up to 45 points in some cases).
  • L_drloc provides significant regularization especially when training from scratch or with limited epochs, and also benefits ResNets modestly.
  • The approach is simple to plug into existing VTs and does not rely on additional annotations.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.