Skip to main content
QUICK REVIEW

[Paper Review] Bridging the Gap Between Vision Transformers and Convolutional Neural Networks on Small Datasets

Zhiying Lu, Hongtao Xie|arXiv (Cornell University)|Oct 12, 2022
Advanced Neural Network ApplicationsComputer Science38 citations
TL;DR

The paper introduces Dynamic Hybrid Vision Transformer (DHVT), a non-hierarchical ViT with convolutional patch embedding, dynamic aggregation FFN, and head tokens to close the gap with CNNs when training from scratch on small datasets. It achieves state-of-the-art results on CIFAR-100 and competitive on ImageNet-1K.

ABSTRACT

There still remains an extreme performance gap between Vision Transformers (ViTs) and Convolutional Neural Networks (CNNs) when training from scratch on small datasets, which is concluded to the lack of inductive bias. In this paper, we further consider this problem and point out two weaknesses of ViTs in inductive biases, that is, the spatial relevance and diverse channel representation. First, on spatial aspect, objects are locally compact and relevant, thus fine-grained feature needs to be extracted from a token and its neighbors. While the lack of data hinders ViTs to attend the spatial relevance. Second, on channel aspect, representation exhibits diversity on different channels. But the scarce data can not enable ViTs to learn strong enough representation for accurate recognition. To this end, we propose Dynamic Hybrid Vision Transformer (DHVT) as the solution to enhance the two inductive biases. On spatial aspect, we adopt a hybrid structure, in which convolution is integrated into patch embedding and multi-layer perceptron module, forcing the model to capture the token features as well as their neighboring features. On channel aspect, we introduce a dynamic feature aggregation module in MLP and a brand new "head token" design in multi-head self-attention module to help re-calibrate channel representation and make different channel group representation interacts with each other. The fusion of weak channel representation forms a strong enough representation for classification. With this design, we successfully eliminate the performance gap between CNNs and ViTs, and our DHVT achieves a series of state-of-the-art performance with a lightweight model, 85.68% on CIFAR-100 with 22.8M parameters, 82.3% on ImageNet-1K with 24.0M parameters. Code is available at https://github.com/ArieSeirack/DHVT.

Motivation & Objective

  • Identify why ViTs underperform CNNs when trained from scratch on small datasets due to weak inductive biases in spatial relevance and channel representation.
  • Propose a hybrid architecture (DHVT) that strengthens spatial locality and channel interactions to improve data efficiency.
  • Introduce mechanisms (SOPE, DAFF, head tokens) to fuse local features and channel-wise representations for robust classification.
  • Demonstrate state-of-the-art performance on CIFAR-100 and competitive results on ImageNet-1K with a lightweight model.

Proposed method

  • Sequential Overlapping Patch Embedding (SOPE) to integrate convolution into patch embedding and preserve fine-grained features.
  • Dynamic Aggregation Feed Forward (DAFF) that uses depth-wise conv within FFN and a squeeze-excitation-like channel re-calibration for the class token.
  • Head Token mechanism that creates head tokens to enable interaction across attention heads and fuse diverse channel representations.
  • Head-Interacted Multi-Head Self-Attention (HI-MHSA) that concatenates head tokens with patch and class tokens before MHSA.
  • Non-hierarchical DHVT blocks with shared encoder configurations, enabling variable token lengths and efficient training from scratch.

Experimental results

Research questions

  • RQ1Can strengthening spatial relevance and diverse channel representation reduce data efficiency gaps between ViTs and CNNs on small datasets?
  • RQ2Does integrating convolution in patch embedding and MLP improve low-level feature preservation and local context learning in ViTs?
  • RQ3Do dynamic token mechanisms (DAFF and head tokens) enhance channel interaction to produce stronger integral representations?
  • RQ4How does DHVT perform when trained from scratch on CIFAR-100, DomainNet small domains, and ImageNet-1K compared to CNNs and other ViTs?

Key findings

  • DHVT closes the performance gap between CNNs and ViTs on small datasets like CIFAR-100, achieving 85.68% with 22.8M parameters (Small model).
  • DHVT-T achieves 83.54% and DHVT-S achieves 85.68% on CIFAR-100, outperforming several strong CNNs and ViT baselines under scratch training.
  • On ImageNet-1K, DHVT-S reaches 82.3% accuracy with 24.0M parameters, a strong result for non-hierarchical ViTs trained from scratch.
  • SOPE plus DAFF and head tokens provide substantial gains, with ablation showing up to +13.26 accuracy when all components are used on CIFAR-100.
  • Head tokens enable interaction across attention heads, improving feature fusion and classification performance.
  • DHVT demonstrates competitive results on DomainNet small-domain datasets (ClipArt, Painting, Sketch) and outperforms ResNet-50 baselines in those settings.

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.