Introduction
Vision Transformers (ViTs) have set new benchmarks in computer vision, yet their deployment on resource-constrained edge devices remains hindered by high computational and memory costs. Existing "efficient" ViTs often retain architectural redundancies from larger models, such as 4x4 patch embeddings and Multi-Head Self-Attention (MHSA). SHViT (Single-Head Vision Transformer) addresses these inefficiencies by aggressively eliminating redundancy at both the macro and micro levels, achieving superior speed-accuracy tradeoffs.
Addressing Architectural Redundancy
The authors identify two primary sources of inefficiency in current mobile ViTs:
- Macro Redundancy: Standard 4x4 patchify stems generate a large number of tokens in early stages, creating significant memory access bottlenecks.
- Micro Redundancy: In MHSA, multiple heads often perform nearly identical operations, and the associated "reshape" and "transpose" operations are computationally expensive on hardware.
Methodology: SHViT Architecture
SHViT introduces a streamlined design focused on hardware efficiency, combining a novel macro-scale tokenization strategy with a simplified attention mechanism.
Memory-Efficient Macro Design
Unlike standard models, SHViT utilizes a 16x16 overlapping patchify stem. This design drastically reduces the token count from the outset, alleviating the "memory wall" and allowing the network to process semantically dense representations immediately. This reduction in early-stage tokens significantly lowers memory access costs.
Single-Head Self-Attention (SHSA)
To resolve micro-level redundancy, SHViT replaces MHSA with a Single-Head Self-Attention mechanism. Crucially, this module operates on only a subset of input channels (a partial channel approach), while the remaining channels use an identity mapping. This eliminates the need for expensive tensor reshapes and transposes that typically plague MHSA performance on mobile hardware.
Hybrid Block Structure
Each SHViT block integrates a 3x3 depthwise convolution for local feature extraction followed by the SHSA for global context. The design prioritizes hardware-friendly components like ReLU activations and Batch Normalization, which can be fused during inference to further reduce latency.
Experimental Results
SHViT was evaluated on ImageNet-1k for classification and MS COCO for downstream tasks like object detection and instance segmentation.
Speed and Accuracy Tradeoffs
SHViT demonstrates a significant leap in efficiency. On an Nvidia A100 GPU, SHViT-S4 achieves 79.4% Top-1 accuracy while running up to 3.3x faster than MobileViTv2. Compared to EfficientNet-B0, it provides a 2.3% accuracy improvement with substantially higher throughput.
Downstream Tasks
When integrated into a Mask R-CNN framework for COCO, SHViT maintains performance comparable to state-of-the-art models like FastViT-SA12 while offering 3.8x lower backbone latency on GPUs. This versatility proves that the single-head design is effective beyond simple classification tasks.
Conclusion
SHViT proves that "less is more" in efficient vision model design. By replacing complex multi-head mechanisms with a single-head partial channel approach and adopting a memory-efficient macro design, SHViT sets a new standard for high-performance computer vision on the edge. Future work may explore these redundancy-reduction principles in larger-scale models or specialized tasks requiring finer-grained feature extraction.
Summary updated