README.md

June 26, 2025 · View on GitHub

TinyViM

TinyViM: Frequency Decoupling for Tiny Hybrid Vision Mamba

Xiaowen Ma, Zhenliang Ni, Xinghao Chen

Huawei Noah’s Ark Lab

[Paper Link]

🔥 News

  • 2025/06/26: TinyViM is accepted by ICCV'25 and the checkpoints are available.
  • 2024/11/29: Code is open.
  • 2024/11/27: TinyViM is available at Arxiv.

📷 Introduction

We build a series of tiny hybrid vision Mamba called TinyViM by integrating mobile-friendly convolution and efficient Laplace mixer. The proposed TinyViM achieves impressive performance on several downstream tasks including image classification, semantic segmentation, object detection and instance segmentation. In particular, TinyViM outperforms Convolution, Transformer and Mamba-based models with similar scales, and the throughput is about 2-3 times higher than that of other Mamba-based models.

🏆 Performance

1️⃣ Classification

ModelTypeParams (M)GMACsThroughput (im/s)Top-1(300e/1000e)
TinyViM-SCNN-Mamba5.60.9256379.2/80.3
TinyViM-BCNN-Mamba11.01.5185181.2/82.1
TinyViM-LCNN-Mamba31.74.784383.3/83.6

We have provided the checkpoints and training logs in the table above!

2️⃣ Detection & Instance Segmentation

ModelHeadAP-boxAP-mask
TinyViM-BMask RCNN42.338.7
TinyViM-LMask RCNN44.540.7

3️⃣ Semantic Segmentation

ModelHeadThroughputmIoU
TinyViM-BFPN18041.9
TinyViM-LFPN11144.2

📚 Use example

  • Environment

    conda create --name tinyvim python=3.9.11 -y
    conda activate tinyvim
    conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.7 -c pytorch -c nvidia
    pip install timm==0.5.4
    

    Please refer to VMamba for installing selective_scan_cuda.

    Please refer to mmdetection-2.28.2 and mmsegmentation-0.30.0 for environments and data preparation of detection and segmentation, respectively.

  • Train

    bash train.sh
    
  • Test

    bash eval.sh
    
  • speed

    python speed_gpu.py --model TinyViM_S --resolution 224 --batch 2048
    
  • Detection & Instance Segmentation

    cd detection
    bash train.sh # for train
    bash eval.sh # for eval
    
  • Semantic Segmentation

    cd segmentation
    bash train.sh # for train
    bash eval.sh # for eval
    

🌟 Citation

If you are interested in our work, please consider giving a 🌟 and citing our work below.

@misc{tinyvim,
      title={TinyViM: Frequency Decoupling for Tiny Hybrid Vision Mamba}, 
      author={Xiaowen Ma and Zhenliang Ni and Xinghao Chen},
      year={2024},
      eprint={2411.17473},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2411.17473}, 
}

💡Acknowledgment

Thanks to previous open-sourced repo: Efficientformer, Swiftformer, RepViT, mmsegmentation, mmdetection