Recognizing objects in images requires capturing both global and local visual features. Vision Transformer(ViT) learns to extract these features from large-scale datasets. However, it is known that ViT struggles with local feature extraction on small-scale datasets, such as CIFAR-10, Tiny ImageNet, and ImageNet-100, which are smaller than ImageNet-1k, resulting in poor performance. To resolve this issue, we introduce a novel self-attention mechanism incorporating spatial locality constraints in the attention calculation. Specifically, our method performs the self-attention process independently in spatially divided regions. This constraint limits the receptive fields of attention and forces the local feature extraction. In addition, we provide a global attention path to compute self-attention from the entire image to achieve local and global feature extraction. Experiments demonstrate our approach outperforms ViT and enhanced variants of ViT with original self-attention on various standard small-scale datasets. Moreover, we evaluated the characteristics of learned attention weights using mean attention distance and found that our attention mechanism allows us to extract not only global features but also local features in all blocks.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Incorporating Spatial Locality Into Self-attention for Training Vision Transformer on Small-Scale Datasets

  • Yuki Igaue,
  • Takio Kurita,
  • Hiroaki Aizawa

摘要

Recognizing objects in images requires capturing both global and local visual features. Vision Transformer(ViT) learns to extract these features from large-scale datasets. However, it is known that ViT struggles with local feature extraction on small-scale datasets, such as CIFAR-10, Tiny ImageNet, and ImageNet-100, which are smaller than ImageNet-1k, resulting in poor performance. To resolve this issue, we introduce a novel self-attention mechanism incorporating spatial locality constraints in the attention calculation. Specifically, our method performs the self-attention process independently in spatially divided regions. This constraint limits the receptive fields of attention and forces the local feature extraction. In addition, we provide a global attention path to compute self-attention from the entire image to achieve local and global feature extraction. Experiments demonstrate our approach outperforms ViT and enhanced variants of ViT with original self-attention on various standard small-scale datasets. Moreover, we evaluated the characteristics of learned attention weights using mean attention distance and found that our attention mechanism allows us to extract not only global features but also local features in all blocks.