TL;DR
This paper introduces EfficientViT, a new family of vision models designed for efficient high-resolution dense prediction tasks. The core innovation is a novel "multi-scale linear attention" mechanism that achieves global receptive fields and multi-scale learning using hardware-efficient operations, significantly outperforming previous state-of-the-art models in both performance and speed across various hardware platforms.
What Problem Does This Paper Address?
High-resolution dense prediction, crucial for applications like autonomous driving and computational photography, demands models that can process detailed images and understand complex spatial relationships. However, existing state-of-the-art models are computationally very expensive, making them impractical for deployment on resource-constrained hardware like mobile CPUs or edge GPUs. This gap arises because these models often rely on computationally heavy components like softmax attention (which has quadratic complexity with input size) or large-kernel convolutions, which are not well-supported by current hardware. The paper aims to bridge this gap by developing models that are both performant and efficient.
Methods
The key innovation is the multi-scale linear attention module. This module addresses the limitations of previous approaches by:
- Replacing Softmax Attention with ReLU Linear Attention: Instead of the computationally expensive softmax attention, the authors use ReLU linear attention. This reduces the computational complexity from quadratic to linear with respect to the input sequence length, making it much more efficient. It also enables a global receptive field.
- Aggregating Multi-Scale Tokens: To compensate for the potential loss of local information and multi-scale learning capacity inherent in linear attention, the module aggregates information from nearby tokens using lightweight small-kernel convolutions (e.g., 3x3 and 5x5 depthwise convolutions). This creates "multi-scale tokens" that are then fed into the ReLU linear attention.
- Integrating Depthwise Convolutions in FFNs: Depthwise convolutions are also incorporated into the Feed-Forward Network (FFN) layers to further enhance local feature extraction.
The EfficientViT architecture itself is built upon this module, following a standard backbone-head/encoder-decoder design, with the EfficientViT modules strategically placed in later stages of the backbone.
Datasets
The paper evaluates EfficientViT on several standard datasets for its target tasks:
- Semantic Segmentation: Cityscapes and ADE20K.
- Super-Resolution: DIV2K (for lightweight SR), BSD100, FFHQ (for high-resolution SR).
- Image Classification: ImageNet (for backbone evaluation).
- Segment Anything: The authors also adapt their model for the Segment Anything task, leveraging the SAM-ViT architecture.
Key Insights and Ideas
- Linear Attention is Viable for Dense Prediction: The paper demonstrates that linear attention, previously underutilized in high-resolution dense prediction due to perceived limitations, can be made effective by combining it with multi-scale aggregation and local feature enhancement.
- Hardware Efficiency is Paramount: The authors explicitly prioritize hardware efficiency, showing that reducing computational complexity (e.g., from quadratic to linear) directly translates to significant latency reductions on real-world hardware.
- Multi-Scale and Global Receptive Field are Crucial: The work reinforces the importance of both global context (global receptive field) and capturing features at different scales for high-resolution dense prediction tasks. Their proposed module achieves both efficiently.
- Trade-offs Can Be Smart: By strategically combining linear attention with convolutional operations for local and multi-scale features, the authors achieve a superior performance-efficiency trade-off compared to models that rely solely on heavy attention or large convolutions.
Key Results
EfficientViT demonstrates impressive results across various tasks and hardware:
- Semantic Segmentation (Cityscapes): Up to 13.9x GPU latency reduction compared to SegFormer and 6.2x compared to SegNeXt, with comparable or better mIoU. On A100 GPUs, it offers significantly higher throughput.
- Super-Resolution: Up to 6.4x speedup over Restormer with a slight PSNR gain (0.11dB).
- Segment Anything: Achieves similar zero-shot performance to SAM-ViT-Huge but with an 84x higher throughput on A100 GPUs.
- ImageNet Classification: EfficientViT-L2-r384 achieves 86.0 top-1 accuracy, outperforming EfficientNetV2-L with 2.6x speedup on A100.
- Latency: On mobile CPUs, ReLU linear attention is shown to be 3.3-4.5x faster than softmax attention.
Limitations and Future Work
- Local Information Capacity: The paper acknowledges that ReLU linear attention, due to its lack of a non-linear similarity function, might be weaker at capturing highly localized information compared to softmax attention (as visualized in Figure 3). The multi-scale aggregation and FFN enhancements aim to mitigate this.
- Single-Point Segmentation: For the Segment Anything task, the paper notes that while EfficientViT-SAM performs well with box prompts, SAM-ViT-H shows better performance with single-point prompts, potentially due to the lack of an interactive segmentation setup during end-to-end training.
- Future Work: The authors suggest exploring EfficientViT for other vision tasks and further scaling up their models. They also mention the need for further investigation into improving single-point segmentation performance.
Summary updated