Skip to main content
QUICK REVIEW

[Paper Review] Pretrained ViTs Yield Versatile Representations For Medical Images

C. Matsoukas, Johan Fredin Haslum|arXiv (Cornell University)|Mar 13, 2023
AI in cancer detectionComputer Science7 citations
TL;DR

This paper demonstrates that vision transformers (ViTs) pretrained on ImageNet achieve performance on par with convolutional neural networks (CNNs) on multiple 2D medical image classification benchmarks. When fine-tuned on medical datasets, off-the-shelf ViTs match or slightly exceed CNNs, especially with self-supervised pretraining, while offering improved interpretability through attention maps and reduced reliance on inductive biases.

ABSTRACT

Convolutional Neural Networks (CNNs) have reigned for a decade as the de facto approach to automated medical image diagnosis, pushing the state-of-the-art in classification, detection and segmentation tasks. Over the last years, vision transformers (ViTs) have appeared as a competitive alternative to CNNs, yielding impressive levels of performance in the natural image domain, while possessing several interesting properties that could prove beneficial for medical imaging tasks. In this work, we explore the benefits and drawbacks of transformer-based models for medical image classification. We conduct a series of experiments on several standard 2D medical image benchmark datasets and tasks. Our findings show that, while CNNs perform better if trained from scratch, off-the-shelf vision transformers can perform on par with CNNs when pretrained on ImageNet, both in a supervised and self-supervised setting, rendering them as a viable alternative to CNNs.

Motivation & Objective

  • To evaluate whether vision transformers (ViTs) can serve as viable alternatives to CNNs in medical image classification.
  • To assess the impact of ImageNet pretraining and self-supervised pretraining on ViT performance across diverse medical imaging tasks.
  • To investigate whether ViTs offer advantages in interpretability and feature learning compared to CNNs in medical contexts.
  • To determine if ViTs scale effectively with model capacity and data size in medical imaging settings.
  • To compare the attention patterns of ViTs and CNNs in medical image analysis, particularly in localization of pathologies.

Proposed method

  • Fine-tuned DeiT-Small and DeiT-Base ViT architectures on six public 2D medical image benchmarks: ISIC 2019, APTOS 2019, PatchCamelyon, CheXpert, CBIS-DDSM, and others.
  • Compared ViT performance to ResNet-50 under identical training protocols, including supervised and self-supervised pretraining settings.
  • Applied self-supervised pretraining using MoCo v2 and BYOL on medical image data to evaluate domain-specific representation learning.
  • Utilized Grad-CAM and class token attention maps to visualize and compare model interpretability between ViTs and CNNs.
  • Conducted ablation studies on patch size, model capacity, and attention patterns to analyze architectural impacts on performance.
  • Evaluated ViT performance across different data regimes, including few-shot and full-supervision settings, to assess data efficiency.

Experimental results

Research questions

  • RQ1Can vision transformers (ViTs) achieve performance comparable to CNNs in 2D medical image classification when pretrained on ImageNet?
  • RQ2Does self-supervised pretraining on medical data further improve ViT performance beyond ImageNet pretraining?
  • RQ3How do ViT attention maps compare to CNN activation maps in localizing pathologies in medical images?
  • RQ4To what extent do ViTs benefit from transfer learning compared to training from scratch, and how does this compare to CNNs?
  • RQ5Do ViTs exhibit better scalability with model size and data quantity than CNNs in medical imaging tasks?

Key findings

  • ViTs pretrained on ImageNet achieve performance on par with ResNet-50 on all evaluated medical image classification benchmarks, including ISIC 2019, APTOS 2019, PatchCamelyon, CheXpert, and CBIS-DDSM.
  • When trained from scratch, CNNs outperform ViTs, but ViTs receive a significantly larger performance boost from ImageNet pretraining compared to CNNs.
  • Self-supervised pretraining on medical data yields a small but consistent performance advantage for ViTs over CNNs, especially when combined with ImageNet pretraining.
  • ViTs produce more localized and interpretable attention maps than CNNs, with clear focus on pathologies such as skin lesions, hemorrhages, and opacities in X-rays.
  • ViTs attend to global and local image regions from early layers, demonstrating that long-range dependencies are captured early, unlike CNNs which rely on deeper layers for global context.
  • ViT performance scales similarly to CNNs with increased model capacity and smaller patch sizes, and they maintain strong performance even with reduced inductive bias.

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.