Abstract
Due to the complex attention mechanisms and model design, most existing vision Transformers (ViTs) can not perform as efficiently as convolutional neural networks (CNNs) in realistic industrial deployment scenarios, e.g. TensorRT and CoreML. This poses a distinct challenge: Can a visual neural network be designed to infer as fast as CNNs and perform as powerful as ViTs? Recent works have tried to design CNN-Transformer hybrid architectures to address this issue, yet the overall performance of these works is far away from satisfactory. To end these, we propose a next generation vision Transformer for efficient deployment in realistic industrial scenarios, namely Next-ViT, which dominates both CNNs and ViTs from the perspective of latency/accuracy trade-off. In this work, the Next Convolution Block (NCB) and Next Transformer Block (NTB) are respectively developed to capture local and global information with deployment-friendly mechanisms. Then, Next Hybrid Strategy (NHS) is designed to stack NCB and NTB in an efficient hybrid paradigm, which boosts performance in various downstream tasks. Extensive experiments show that Next-ViT significantly outperforms existing CNNs, ViTs and CNN-Transformer hybrid architectures with respect to the latency/accuracy trade-off across various vision tasks.
Introduction
While Vision Transformers (ViTs) have achieved remarkable success in computer vision by modeling global dependencies, their practical application in industrial settings is hindered by a "high-latency dilemma." When deployed on specialized hardware like NVIDIA GPUs (via TensorRT) or mobile devices (via CoreML), ViTs often exhibit significantly higher latency than traditional Convolutional Neural Networks (CNNs). This performance gap arises from the quadratic complexity of standard self-attention, the use of hardware-unfriendly components like LayerNorm and GELU, and high memory overhead.
Previous attempts to bridge this gap through hybrid CNN-Transformer architectures often fail to capture sufficient global information in early stages or suffer from performance saturation. Next-ViT addresses these challenges by introducing deployment-friendly components and a novel stacking strategy designed for real-world throughput.
Proposed Architecture: Next-ViT
Next-ViT is built upon three primary innovations: the Next Convolution Block (NCB), the Next Transformer Block (NTB), and the Next Hybrid Strategy (NHS).
Next Convolution Block (NCB)
The NCB is designed to capture local dependencies with high efficiency. It introduces Multi-Head Convolutional Attention (MHCA), which adopts the multi-head paradigm of Transformers but utilizes fast, grouped convolutions. To ensure maximum throughput on industrial engines, NCB relies on BatchNorm and ReLU activations, which can be fused into preceding layers during deployment to reduce overhead.
Next Transformer Block (NTB)
To model global information, the NTB employs Efficient Multi-Head Self-Attention (E-MHSA). This module reduces computational complexity by applying spatial reduction (pooling) to the Key and Value tensors. Furthermore, NTB acts as a "frequency mixer," integrating low-frequency global signals with high-frequency local information.
Next Hybrid Strategy (NHS)
Unlike traditional hybrid models that restrict Transformer blocks to the final stages, NHS stacks NCBs and NTBs in a specific ratio across all stages. This allows the network to learn global representations from the earliest layers, which is particularly beneficial for downstream tasks like semantic segmentation where global context is vital for pixel-level accuracy.
Experimental Results
Next-ViT was evaluated on ImageNet-1K for classification, MS COCO for detection, and ADE20K for segmentation. The results demonstrate a superior latency/accuracy trade-off across all tasks and hardware platforms.
Performance on TensorRT and CoreML
On TensorRT, Next-ViT-S outperforms ResNet101 by 5.5 mAP on COCO detection and 7.7% mIoU on ADE20K segmentation at similar latency levels. On CoreML, it surpasses the optimized EfficientFormer by 4.6 mAP on COCO and 3.5% mIoU on ADE20K.
Comparison with Advanced ViTs
When compared to state-of-the-art Transformers like CSWin, Next-ViT achieves comparable accuracy while being 3.6× faster. For ImageNet-1K classification, Next-ViT-S reaches 82.5% Top-1 accuracy with a latency of only 7.7ms on TensorRT, significantly outperforming pure CNN and ViT baselines in efficiency.
Conclusion
Next-ViT successfully bridges the gap between the modeling power of Transformers and the deployment efficiency of CNNs. By prioritizing hardware-friendly design choices—such as BatchNorm, ReLU, and efficient attention mechanisms—and employing a novel hybrid stacking strategy, Next-ViT sets a new benchmark for efficient vision models in realistic industrial scenarios.
Summary updated