Skip to main content
QUICK REVIEW

[Paper Review] Delving Deep into the Generalization of Vision Transformers under Distribution Shifts

Chongzhi Zhang, Mingyuan Zhang|arXiv (Cornell University)|Jun 14, 2021
Domain Adaptation and Few-Shot LearningComputer Science31 references9 citations
TL;DR

This paper investigates the out-of-distribution (OOD) generalization of Vision Transformers (ViTs) under various distribution shifts, revealing that ViTs learn stronger inductive biases toward shapes and structures—aligning with human cognition—leading to superior OOD performance over CNNs. By introducing Generalization-Enhanced ViTs (GE-ViTs) via adversarial training, information theory, and self-supervised learning with smoothed training, the authors achieve a 4% accuracy gain on OOD data compared to vanilla ViTs, with larger models benefiting more from enhancement.

ABSTRACT

Vision Transformers (ViTs) have achieved impressive performance on various vision tasks, yet their generalization under distribution shifts (DS) is rarely understood. In this work, we comprehensively study the out-of-distribution (OOD) generalization of ViTs. For systematic investigation, we first present a taxonomy of DS. We then perform extensive evaluations of ViT variants under different DS and compare their generalization with Convolutional Neural Network (CNN) models. Important observations are obtained: 1) ViTs learn weaker biases on backgrounds and textures, while they are equipped with stronger inductive biases towards shapes and structures, which is more consistent with human cognitive traits. Therefore, ViTs generalize better than CNNs under DS. With the same or less amount of parameters, ViTs are ahead of corresponding CNNs by more than 5% in top-1 accuracy under most types of DS. 2) As the model scale increases, ViTs strengthen these biases and thus gradually narrow the in-distribution and OOD performance gap. To further improve the generalization of ViTs, we design the Generalization-Enhanced ViTs (GE-ViTs) from the perspectives of adversarial learning, information theory, and self-supervised learning. By comprehensively investigating these GE-ViTs and comparing with their corresponding CNN models, we observe: 1) For the enhanced model, larger ViTs still benefit more for the OOD generalization. 2) GE-ViTs are more sensitive to the hyper-parameters than their corresponding CNN models. We design a smoother learning strategy to achieve a stable training process and obtain performance improvements on OOD data by 4% from vanilla ViTs. We hope our comprehensive study could shed light on the design of more generalizable learning architectures.

Motivation & Objective

  • To understand the out-of-distribution (OOD) generalization behavior of Vision Transformers (ViTs) under real-world distribution shifts.
  • To compare ViT generalization with CNNs across diverse distribution shift types.
  • To identify inductive biases in ViTs that may explain their superior OOD performance.
  • To design and evaluate Generalization-Enhanced ViTs (GE-ViTs) that improve OOD generalization using adversarial learning, information theory, and self-supervised learning.
  • To analyze the sensitivity of GE-ViTs to hyperparameters and propose a smoother training strategy for stable convergence.

Proposed method

  • Proposes a taxonomy of distribution shifts based on semantic concept modifications: background, corruption, texture, and style shifts.
  • Employs extensive evaluation of ViT variants and corresponding CNNs (e.g., DeiT, VGG-16, BiT) across five OOD shift types.
  • Introduces three types of GE-ViTs: T-ADV (adversarial training), T-MME (mutual information maximization), and T-SSL (self-supervised learning) for improved generalization.
  • Applies smoother training strategies to stabilize GE-ViT training, especially critical for adversarial and information-theoretic methods.
  • Uses a unified evaluation protocol across multiple benchmarks to compare OOD performance and generalization gaps.
  • Validates improvements using standard metrics like top-1 accuracy on OOD shift benchmarks.

Experimental results

Research questions

  • RQ1How do ViTs generalize under different types of distribution shifts compared to CNNs?
  • RQ2What inductive biases do ViTs learn, and how do they align with human cognitive traits such as shape and structure sensitivity?
  • RQ3To what extent does model scaling improve the OOD generalization of ViTs?
  • RQ4Can generalization-enhanced ViTs (GE-ViTs) achieve consistent performance gains across diverse OOD shift types?
  • RQ5How sensitive are GE-ViTs to hyperparameters, and can smoother training strategies stabilize their training?

Key findings

  • ViTs generalize better than CNNs under most distribution shifts, achieving over 5% higher top-1 accuracy on OOD data with similar or fewer parameters.
  • ViTs exhibit stronger inductive biases toward shapes and structures and weaker biases toward textures and backgrounds, aligning more closely with human perception.
  • As model scale increases, ViTs strengthen their shape/structure biases, progressively narrowing the performance gap between in-distribution and out-of-distribution settings.
  • GE-ViTs achieve a 4% performance boost on OOD data compared to vanilla ViTs, with consistent improvements across all three enhancement methods.
  • Larger ViTs benefit more from generalization enhancement, indicating scalability advantages in OOD generalization.
  • GE-ViTs are more sensitive to hyperparameters than their CNN counterparts, necessitating smoother training strategies for stable convergence.

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.