Abstract
Vision Transformers have witnessed prevailing success in a series of vision tasks. However, these Transformers often rely on extensive computational costs to achieve high performance, which is burdensome to deploy on resource-constrained devices. To alleviate this issue, we draw lessons from depthwise separable convolution and imitate its ideology to design an efficient Transformer backbone, i.e., Separable Vision Transformer, abbreviated as SepViT. SepViT helps to carry out the local-global information interaction within and among the windows in sequential order via a depthwise separable self-attention. The novel window token embedding and grouped self-attention are employed to compute the attention relationship among windows with negligible cost and establish long-range visual interactions across multiple windows, respectively. Extensive experiments on general-purpose vision benchmarks demonstrate that SepViT can achieve a state-of-the-art trade-off between performance and latency. Among them, SepViT achieves 84.2% top-1 accuracy on ImageNet-1K classification while decreasing the latency by 40%, compared to the ones with similar accuracy (e.g., CSWin). Furthermore, SepViT achieves 51.0% mIoU on ADE20K semantic segmentation task, 47.9 AP on the RetinaNet-based COCO detection task, 49.4 box AP and 44.6 mask AP on Mask R-CNN-based COCO object detection and instance segmentation tasks.
Introduction
Vision Transformers (ViTs) have revolutionized computer vision by capturing long-range dependencies that traditional Convolutional Neural Networks (CNNs) often miss. However, this power comes at a high computational cost. Standard ViTs struggle with "quadratic complexity," where the cost of computation grows rapidly with image resolution.
Existing solutions like the Swin Transformer use window-based attention to limit computation, but they rely on "shifted windows" to share information between those windows. These operators can be tricky to optimize for deployment tools like ONNX or TensorRT. Other models that attempt to bridge the local-global gap often remain computationally heavy or have low throughput. SepViT addresses these challenges by introducing a "deployment-friendly" backbone that offers a superior trade-off between accuracy and inference speed, mimicking the efficiency of depthwise separable convolutions.
Architecture and Methodology
The core innovation of SepViT is the Depthwise Separable Self-Attention module. This module breaks the attention process into two sequential steps within a single block, facilitating local-global interaction more efficiently than the successive blocks required by architectures like Swin.
Depthwise Self-Attention (DSA)
DSA captures local features within individual windows. To enhance efficiency, the authors introduce Window Token Embedding. Each window is assigned a single "summary token" that interacts with all pixels in that window, learning a global representation of that specific local area.
Pointwise Self-Attention (PSA)
Following DSA, the PSA module facilitates communication between windows. Instead of pixel-to-pixel comparisons across the entire image, PSA uses only the summary window tokens to establish long-range dependencies. This approach provides global reasoning with negligible computational overhead.
Grouped Self-Attention (GSA)
In the later stages of the network, SepViT employs Grouped Self-Attention (GSA). By grouping neighboring sub-windows into larger blocks, the model captures visual dependencies across multiple windows simultaneously, further boosting expressive power.
Experimental Results
SepViT was evaluated on ImageNet-1K (classification), ADE20K (segmentation), and COCO (detection/segmentation). The results consistently show that SepViT achieves a dominant performance-to-latency profile.
On ImageNet-1K, SepViT-B achieves 84.2% top-1 accuracy. Crucially, it is 40% faster (lower latency) than CSWin and significantly outperforms Swin-B in both accuracy and speed. On the ADE20K benchmark, it reached 51.0% mIoU, outperforming both CNN-based (ConvNeXt) and Transformer-based (Swin) competitors. For object detection on COCO, it achieved 49.4 box AP and 44.6 mask AP, demonstrating its versatility for dense prediction tasks.
Conclusion
SepViT successfully ports the efficiency of separable convolutions into the Transformer domain. By using window tokens to summarize local information and facilitate global interaction, it avoids the high costs of standard self-attention. While Grouped Self-Attention adds slight complexity, its strategic use in later stages balances performance and speed. Future work may explore the scalability of this architecture on extremely large datasets or its performance in self-supervised learning settings.
Summary updated