[Paper Review] Vision Transformer for Small-Size Datasets
This paper introduces Shifted Patch Tokenization (SPT) and Locality Self-Attention (LSA) to give Vision Transformers stronger locality inductive bias, enabling learning from scratch on small datasets and improving performance on Tiny-ImageNet and other small-scale benchmarks.
Recently, the Vision Transformer (ViT), which applied the transformer structure to the image classification task, has outperformed convolutional neural networks. However, the high performance of the ViT results from pre-training using a large-size dataset such as JFT-300M, and its dependence on a large dataset is interpreted as due to low locality inductive bias. This paper proposes Shifted Patch Tokenization (SPT) and Locality Self-Attention (LSA), which effectively solve the lack of locality inductive bias and enable it to learn from scratch even on small-size datasets. Moreover, SPT and LSA are generic and effective add-on modules that are easily applicable to various ViTs. Experimental results show that when both SPT and LSA were applied to the ViTs, the performance improved by an average of 2.96% in Tiny-ImageNet, which is a representative small-size dataset. Especially, Swin Transformer achieved an overwhelming performance improvement of 4.08% thanks to the proposed SPT and LSA.
Motivation & Objective
- Address the lack of locality inductive bias in Vision Transformers when training from scratch on small datasets.
- Propose generic add-on modules (SPT and LSA) to improve tokenization and locally-focused attention.
- Demonstrate performance gains on Tiny-ImageNet and CIFAR/CIFAR-100, and assess impact on mid-size datasets like ImageNet.
Proposed method
- Introduce Shifted Patch Tokenization (SPT) to expand the receptive field of visual tokens by spatially shifting and concatenating patches before tokenization.
- Propose Locality Self-Attention (LSA) with diagonal masking to remove self-token attention and apply a learnable softmax temperature, sharpening local attention.
- Explain how SPT can be applied to patch embedding and pooling layers as an easy add-on to ViTs.
- Provide quantitative and qualitative analyses showing improved locality and better object shape capture when SPT and LSA are used.
- Compare performance with and without SPT/LSA across several ViT variants (ViT, PiT, Swin, CaiT) on small datasets and ImageNet.
Experimental results
Research questions
- RQ1Can ViTs learn from scratch on small-size datasets without large-scale pre-training?
- RQ2Do SPT and LSA increase locality inductive bias and improve performance across ViT variants?
- RQ3How much do these methods improve accuracy on Tiny-ImageNet and CIFAR-like datasets, and what is the impact on mid-size datasets like ImageNet?
Key findings
- Applying SPT and LSA yields an average accuracy improvement of 2.96% on Tiny-ImageNet across tested ViTs.
- The maximum improvement observed is 4.08% on Tiny-ImageNet (e.g., Swin Transformer).
- On CIFAR-100, CaiT and PiT improve by 3.43% and 4.01%, respectively, with the proposed methods.
- On Tiny-ImageNet, ViT and Swin show improvements up to 4.00% and 4.08%, respectively.
- On ImageNet from scratch, ViT gains up to 1.60% (SL-ViT) and 1.44% (SL-PiT); Swin gains up to 1.06% (SL-Swin).
- Ablation shows that both learnable temperature scaling and diagonal masking contribute to performance gains, with combined use delivering synergistic improvements.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.