Skip to main content
QUICK REVIEW

[Paper Review] Rethinking Local Perception in Lightweight Vision Transformer

Qihang Fan, Huaibo Huang|arXiv (Cornell University)|Mar 31, 2023
Visual Attention and Saliency DetectionComputer Science32 citations
TL;DR

CloFormer is a lightweight vision transformer with a two-branch design: a local AttnConv branch that fuses shared and context-aware weights for high-frequency local features, and a downsampled global attention branch for low-frequency global information, achieving strong accuracy with low FLOPs.

ABSTRACT

Vision Transformers (ViTs) have been shown to be effective in various vision tasks. However, resizing them to a mobile-friendly size leads to significant performance degradation. Therefore, developing lightweight vision transformers has become a crucial area of research. This paper introduces CloFormer, a lightweight vision transformer that leverages context-aware local enhancement. CloFormer explores the relationship between globally shared weights often used in vanilla convolutional operators and token-specific context-aware weights appearing in attention, then proposes an effective and straightforward module to capture high-frequency local information. In CloFormer, we introduce AttnConv, a convolution operator in attention's style. The proposed AttnConv uses shared weights to aggregate local information and deploys carefully designed context-aware weights to enhance local features. The combination of the AttnConv and vanilla attention which uses pooling to reduce FLOPs in CloFormer enables the model to perceive high-frequency and low-frequency information. Extensive experiments were conducted in image classification, object detection, and semantic segmentation, demonstrating the superiority of CloFormer. The code is available at \url{https://github.com/qhfan/CloFormer}.

Motivation & Objective

  • Motivate and address the performance drop of mobile-sized ViTs by improving local perception.
  • Design a lightweight backbone that blends shared (convolutional) and context-aware (attention-like) weights.
  • Propose AttnConv to capture high-frequency local information while maintaining translation equivariance.
  • Combine a local AttnConv branch with a downsampled global attention branch to model both high- and low-frequency information.
  • Show effectiveness across image classification, object detection, and semantic segmentation with competitive FLOPs and parameters.

Proposed method

  • Introduce AttnConv, a convolution operator in attention style that uses depth-wise convolution (shared weights) to aggregate local information, followed by context-aware weight generation via Q, K processing and a nonlinear transformation (including Tanh and Swish).
  • Use a two-branch Clo block: a local branch (AttnConv) for high-frequency information and a global branch (downsampled K and V) for low-frequency information.
  • Fuse local and global branch outputs by concatenation and a final fully-connected layer.
  • Replace the vanilla FFN with ConvFFN (DWconv after GELU) to inject local information throughout the network.
  • Provide four-stage CloFormer variants and progressively larger AttnConv kernel sizes (3 to 9) to capture features from high to low frequencies.

Experimental results

Research questions

  • RQ1How can shared weights and context-aware weights be combined to improve local perception in lightweight ViTs?
  • RQ2Can a two-branch architecture effectively fuse high-frequency local and low-frequency global information under mobile constraints?
  • RQ3Does AttnConv provide a nonlinear, translation-equivariant local perception mechanism outperforming traditional conv or self-attention in lightweight settings?

Key findings

  • CloFormer-XXS achieves 77.0% Top-1 on ImageNet-1K with 4.2M parameters and 0.6 GFLOPs.
  • CloFormer-XS achieves 79.8% Top-1 on ImageNet-1K with 7.2M parameters and 1.1 GFLOPs.
  • CloFormer-S achieves 81.6% Top-1 on ImageNet-1K with 12.3M parameters and 2.0 GFLOPs.
  • On COCO object detection, CloFormer-XXS improves AP by up to 0.9 over comparable lightweight backbones (e.g., EdgeViT variants).
  • On ADE20K semantic segmentation, CloFormer-XXS/XS achieve higher mIoU than EdgeViT variants by up to 0.7–1.0 points.
  • Ablation shows AttnConv (with Swish-Tanh nonlinearity and DWconv for Q/K) outperforms shared-only or context-attention-only configurations across ImageNet, COCO, and ADE20K.

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.