Mamba or RWKV: Exploring High-Quality and High-Efficiency Segment Anything Model

Haobo Yuan, Xiangtai Li, Lu Qi, Tao Zhang, Ming-Hsuan Yang +2 more
6/27/2024
cs.CV

No official code found. Best implementation: HarborYuan/ovsam (1,034 stars, last commit 2025-08-04).

Abstract

Transformer-based segmentation methods face the challenge of efficient inference when dealing with high-resolution images. Recently, several linear attention architectures, such as Mamba and RWKV, have attracted much attention as they can process long sequences efficiently. In this work, we focus on designing an efficient segment-anything model by exploring these different architectures. Specifically, we design a mixed backbone that contains convolution and RWKV operation, which achieves the best for both accuracy and efficiency. In addition, we design an efficient decoder to utilize the multiscale tokens to obtain high-quality masks. We denote our method as RWKV-SAM, a simple, effective, fast baseline for SAM-like models. Moreover, we build a benchmark containing various high-quality segmentation datasets and jointly train one efficient yet high-quality segmentation model using this benchmark. Based on the benchmark results, our RWKV-SAM achieves outstanding performance in efficiency and segmentation quality compared to transformers and other linear attention models. For example, compared with the same-scale transformer model, RWKV-SAM achieves more than 2x speedup and can achieve better segmentation performance on various datasets. In addition, RWKV-SAM outperforms recent vision Mamba models with better classification and semantic segmentation results. Code and models will be publicly available.

View on arXivView PDF

Code Implementations(1)

HarborYuan/ovsamCommunity100%

[ECCV 2024] The official code of paper "Open-Vocabulary SAM".

1,03435C++, CudaJan 5, 20241 years agoNOASSERTION

Similar Papers

Cite this paper

@article{yuan2024mamba,
  title  = {Mamba or RWKV: Exploring High-Quality and High-Efficiency Segment Anything Model},
  author = {Haobo Yuan and Xiangtai Li and Lu Qi and Tao Zhang and Ming-Hsuan Yang and Shuicheng Yan and Chen Change Loy},
  year   = {2024},
  eprint = {2406.19369},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.19369v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.19369.svg)](https://codeofpaper.com/paper/2406.19369)

Discussion