NVlabs/MambaVision

[CVPR 2025] Official PyTorch Implementation of MambaVision: A Hybrid Mamba-Transformer Vision Backbone

Python

2,241

102 commits

updated Mar 11, 2026

See the code

README

MambaVision: A Hybrid Mamba-Transformer Vision Backbone

Official PyTorch implementation of MambaVision: A Hybrid Mamba-Transformer Vision Backbone.

Star on GitHub

Ali Hatamizadeh and Jan Kautz.

For business inquiries, please visit our website and submit the form: NVIDIA Research Licensing

Try MambaVision: Open In Colab


MambaVision demonstrates a strong performance by achieving a new SOTA Pareto-front in terms of Top-1 accuracy and throughput.

We introduce a novel mixer block by creating a symmetric path without SSM to enhance the modeling of global context:

MambaVision has a hierarchical architecture that employs both self-attention and mixer blocks:

teaser

💥 News 💥

  • [06.10.2025] The MambaVision poster will be presented in CVPR 2025 in Nashville on Sunday, June 15, 2025, from 10:30 a.m. to 12:30 p.m. CDT in Exhibit Hall D, Poster #403.

  • [06.10.2025] Semantic segmentation code and models released here !

  • [06.07.2025] Object detection code and models released here !

  • [03.29.2025] You can now easily run MambaVision in Google Colab. Try here: Open In Colab

  • [03.29.2025] New MambaVision pip package released !

  • [03.25.2025] Updated manuscript is now available on arXiv !

  • [03.25.2025] 21K models and code added to the repository.

  • [03.25.2025] MambaVision is the first mamba-based vision backbone at scale !

  • [03.24.2025] MambaVision-L3-512-21K achieves a Top-1 accuracy of 88.1 %

  • [03.24.2025] New ImageNet-21K models have been added to MambaVision Hugging Face collection

  • [02.26.2025] MambaVision has been accepted to CVPR 2025 !

  • [07.24.2024] MambaVision Hugging Face models are released !

  • [07.14.2024] We added support for processing any resolution images.

  • [07.12.2024] Paper is now available on arXiv !

  • [07.11.2024] Mambavision pip package is released !

  • [07.10.2024] We have released the code and model checkpoints for Mambavision !

Quick Start

Google Colab

You can simply try image classification with MambaVision in Google Colab: Open In Colab

Hugging Face (Classification + Feature extraction)

Pretrained MambaVision models can be simply used via Hugging Face library with a few lines of code. First install the requirements:

pip install mambavision

The model can be simply imported:

>>> from transformers import AutoModelForImageClassification

>>> model = AutoModelForImageClassification.from_pretrained("nvidia/MambaVision-T-1K", trust_remote_code=True)

We demonstrate an end-to-end image classification example in the following.

Given the following image from COCO dataset val set as an input:

The following snippet can be used:

from transformers import AutoModelForImageClassification
from PIL import Image
from timm.data.transforms_factory import create_transform
import requests

model = AutoModelForImageClassification.from_pretrained("nvidia/MambaVision-T-1K", trust_remote_code=True)

# eval mode for inference
model.cuda().eval()

# prepare image for the model
url = 'http://images.cocodataset.org/val2017/000000020247.jpg'
image = Image.open(requests.get(url, stream=True).raw)
input_resolution = (3, 224, 224)  # MambaVision supports any input resolutions

transform = create_transform(input_size=input_resolution,
                             is_training=False,
                             mean=model.config.mean,
                             std=model.config.std,
                             crop_mode=model.config.crop_mode,
                             crop_pct=model.config.crop_pct)

inputs = transform(image).unsqueeze(0).cuda()
# model inference
outputs = model(inputs)
logits = outputs['logits'] 
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])

The predicted label is brown bear, bruin, Ursus arctos.

You can also use Hugging Face MambaVision models for feature extraction. The model provides the outputs of each stage of model (hierarchical multi-scale features in 4 stages) as well as the final averaged-pool features that are flattened. The former is used for downstream tasks such as classification and detection.

The following snippet can be used for feature extraction:

from transformers import AutoModel
from PIL import Image
from timm.data.transforms_factory import create_transform
import requests

model = AutoModel.from_pretrained("nvidia/MambaVision-T-1K", trust_remote_code=True)

# eval mode for inference
model.cuda().eval()

# prepare image for the model
url = 'http://images.cocodataset.org/val2017/000000020247.jpg'
image = Image.open(requests.get(url, stream=True).raw)
input_resolution = (3, 224, 224)  # MambaVision supports any input resolutions

transform = create_transform(input_size=input_resolution,
                             is_training=False,
                             mean=model.config.mean,
                             std=model.config.std,
                             crop_mode=model.config.crop_mode,
                             crop_pct=model.config.crop_pct)
inputs = transform(image).unsqueeze(0).cuda()
# model inference
out_avg_pool, features = model(inputs)
print("Size of the averaged pool features:", out_avg_pool.size())  # torch.Size([1, 640])
print("Number of stages in extracted features:", len(features)) # 4 stages
print("Size of extracted features in stage 1:", features[0].size()) # torch.Size([1, 80, 56, 56])
print("Size of extracted features in stage 4:", features[3].size()) # torch.Size([1, 640, 7, 7])

Currently, we offer MambaVision-T-1K, MambaVision-T2-1K, MambaVision-S-1K, MambaVision-B-1K, MambaVision-L-1K and MambaVision-L2-1K on Hugging Face. All models can also be viewed here.

Classification (pip package)

We can also import pre-trained MambaVision models from the pip package with a few lines of code:

pip install mambavision

A pretrained MambaVision model with default hyper-parameters can be created as in:

>>> from mambavision import create_model

# Define mamba_vision_T model

>>> model = create_model('mamba_vision_T', pretrained=True, model_path="/tmp/mambavision_tiny_1k.pth.tar")

Available list of pretrained models include mamba_vision_T, mamba_vision_T2, mamba_vision_S, mamba_vision_B, mamba_vision_L and mamba_vision_L2.

We can also simply test the model by passing a dummy image with any resolution. The output is the logits:

>>> import torch

>>> image = torch.rand(1, 3, 512, 224).cuda() # place image on cuda
>>> model = model.cuda() # place model on cuda
>>> output = model(image) # output logit size is [1, 1000]

Using the pretrained models from our pip package, you can simply run validation:

python validate_pip_model.py --model mamba_vision_T --data_dir=$DATA_PATH --batch-size $BS 

Results + Pretrained Models

ImageNet-21K

NameAcc@1(%)Acc@5(%)#Params(M)FLOPs(G)ResolutionHFDownload
MambaVision-B-21K84.997.597.715.0224x224linkmodel
MambaVision-L-21K86.197.9227.934.9224x224linkmodel
MambaVision-L2-512-21K87.398.4241.5196.3512x512linkmodel
MambaVision-L3-256-21K87.398.3739.6122.3256x256linkmodel
MambaVision-L3-512-21K88.198.6739.6489.1512x512linkmodel

ImageNet-1K

NameAcc@1(%)Acc@5(%)Throughput(Img/Sec)Resolution#Params(M)FLOPs(G)HFDownload
MambaVision-T82.396.26298224x22431.84.4linkmodel
MambaVision-T282.796.35990224x22435.15.1linkmodel
MambaVision-S83.396.54700224x22450.17.5linkmodel
MambaVision-B84.296.93670224x22497.715.0linkmodel
MambaVision-L85.097.12190224x224227.934.9linkmodel
MambaVision-L285.397.21021224x224241.537.5linkmodel

Detection Results + Models

BackboneDetectorLr Schdbox mAPmask mAP#Params(M)FLOPs(G)ConfigLogModel Ckpt
MambaVision-T-1KCascade Mask R-CNN3x51.144.386740configlogmodel
MambaVision-S-1KCascade Mask R-CNN3x52.345.2108828configlogmodel
MambaVision-B-1KCascade Mask R-CNN3x52.845.7145964configlogmodel

Segmentation Results + Models

BackboneMethodLr SchdmIoU#Params(M)FLOPs(G)ConfigLogModel Ckpt
MambaVision-T-1KUPerNet160K46.055945configlogmodel
MambaVision-S-1KUPerNet160K48.2841135configlogmodel
MambaVision-B-1KUPerNet160K49.11261342configlogmodel
MambaVision-L3-512-21KUPerNet160K53.27803670configlogmodel

Installation

We provide a docker file. In addition, assuming that a recent PyTorch package is installed, the dependencies can be installed by running:

pip install -r requirements.txt

Evaluation

The MambaVision models can be evaluated on ImageNet-1K validation set using the following:

python validate.py \
--model <model-name>
--checkpoint <checkpoint-path>
--data_dir <imagenet-path>
--batch-size <batch-size-per-gpu

Here --model is the MambaVision variant (e.g. mambavision_tiny_1k), --checkpoint is the path to pretrained model weights, --data_dir is the path to ImageNet-1K validation set and --batch-size is the number of batch size. We also provide a sample script here.

FAQ

  1. Does MambaVision support processing images with any input resolutions ?

Yes ! you can pass images with any arbitrary resolutions without the need to change the model.

  1. I am interested in re-implementing MambaVision in my own repository. Can we use the pretrained weights ?

Yes ! the pretrained weights are released under CC-BY-NC-SA-4.0. Please submit an issue in this repo and we will add your repository to the README of our codebase and properly acknowledge your efforts.

  1. Can I apply MambaVision for downstream tasks like detection, segmentation ?

Yes ! we have released the model that supports downstream tasks along code and pretrained models for object detection and semantic segmentation.

  1. How were the throughput and FLOPs calculated for each model ?

Please see this snippet for throughput and FLOPs measurement. Results may vary depending on the hardware.

Citation

If you find MambaVision to be useful for your work, please consider citing our paper:

@inproceedings{hatamizadeh2025mambavision,
  title={Mambavision: A hybrid mamba-transformer vision backbone},
  author={Hatamizadeh, Ali and Kautz, Jan},
  booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
  pages={25261--25270},
  year={2025}
}

Star History

Stargazers repo roster for @NVlabs/MambaVision

Star History Chart

Licenses

Copyright © 2026, NVIDIA Corporation. All rights reserved.

This work is made available under the NVIDIA Source Code License-NC. Click here to view a copy of this license.

The pre-trained models are shared under CC-BY-NC-SA-4.0. If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

For license information regarding the timm repository, please refer to its repository.

For license information regarding the ImageNet dataset, please see the ImageNet official website.

Acknowledgement

This repository is built on top of the timm repository. We thank Ross Wrightman for creating and maintaining this high-quality library.

deep-learning
foundation-models
huggingface-transformers
hybrid-models
image-classification
instance-segmentation
mamba
object-detection
self-attention
semantic-segmentation
transformers
vision-transformer
visual-recognition

Project health

Latest release

1.2.0 · Jul 22, 2025

Releases this year

0

Significant stargazers

Omar Sanseviero

1,113 followers · starred Jul 2024

Piotr Skalski

7,139 followers · starred Jun 2025

Xin Ma

84 followers · starred Aug 2024

Huajie Tan

84 followers · starred Jul 2024

NVlabs/MambaVision

[CVPR 2025] Official PyTorch Implementation of MambaVision: A Hybrid Mamba-Transformer Vision Backbone

Python

2,241

102 commits

updated Mar 11, 2026

See the code

README

MambaVision: A Hybrid Mamba-Transformer Vision Backbone

Official PyTorch implementation of MambaVision: A Hybrid Mamba-Transformer Vision Backbone.

Star on GitHub

Ali Hatamizadeh and Jan Kautz.

For business inquiries, please visit our website and submit the form: NVIDIA Research Licensing

Try MambaVision: Open In Colab


MambaVision demonstrates a strong performance by achieving a new SOTA Pareto-front in terms of Top-1 accuracy and throughput.

We introduce a novel mixer block by creating a symmetric path without SSM to enhance the modeling of global context:

MambaVision has a hierarchical architecture that employs both self-attention and mixer blocks:

teaser

💥 News 💥

  • [06.10.2025] The MambaVision poster will be presented in CVPR 2025 in Nashville on Sunday, June 15, 2025, from 10:30 a.m. to 12:30 p.m. CDT in Exhibit Hall D, Poster #403.

  • [06.10.2025] Semantic segmentation code and models released here !

  • [06.07.2025] Object detection code and models released here !

  • [03.29.2025] You can now easily run MambaVision in Google Colab. Try here: Open In Colab

  • [03.29.2025] New MambaVision pip package released !

  • [03.25.2025] Updated manuscript is now available on arXiv !

  • [03.25.2025] 21K models and code added to the repository.

  • [03.25.2025] MambaVision is the first mamba-based vision backbone at scale !

  • [03.24.2025] MambaVision-L3-512-21K achieves a Top-1 accuracy of 88.1 %

  • [03.24.2025] New ImageNet-21K models have been added to MambaVision Hugging Face collection

  • [02.26.2025] MambaVision has been accepted to CVPR 2025 !

  • [07.24.2024] MambaVision Hugging Face models are released !

  • [07.14.2024] We added support for processing any resolution images.

  • [07.12.2024] Paper is now available on arXiv !

  • [07.11.2024] Mambavision pip package is released !

  • [07.10.2024] We have released the code and model checkpoints for Mambavision !

Quick Start

Google Colab

You can simply try image classification with MambaVision in Google Colab: Open In Colab

Hugging Face (Classification + Feature extraction)

Pretrained MambaVision models can be simply used via Hugging Face library with a few lines of code. First install the requirements:

pip install mambavision

The model can be simply imported:

>>> from transformers import AutoModelForImageClassification

>>> model = AutoModelForImageClassification.from_pretrained("nvidia/MambaVision-T-1K", trust_remote_code=True)

We demonstrate an end-to-end image classification example in the following.

Given the following image from COCO dataset val set as an input:

The following snippet can be used:

from transformers import AutoModelForImageClassification
from PIL import Image
from timm.data.transforms_factory import create_transform
import requests

model = AutoModelForImageClassification.from_pretrained("nvidia/MambaVision-T-1K", trust_remote_code=True)

# eval mode for inference
model.cuda().eval()

# prepare image for the model
url = 'http://images.cocodataset.org/val2017/000000020247.jpg'
image = Image.open(requests.get(url, stream=True).raw)
input_resolution = (3, 224, 224)  # MambaVision supports any input resolutions

transform = create_transform(input_size=input_resolution,
                             is_training=False,
                             mean=model.config.mean,
                             std=model.config.std,
                             crop_mode=model.config.crop_mode,
                             crop_pct=model.config.crop_pct)

inputs = transform(image).unsqueeze(0).cuda()
# model inference
outputs = model(inputs)
logits = outputs['logits'] 
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])

The predicted label is brown bear, bruin, Ursus arctos.

You can also use Hugging Face MambaVision models for feature extraction. The model provides the outputs of each stage of model (hierarchical multi-scale features in 4 stages) as well as the final averaged-pool features that are flattened. The former is used for downstream tasks such as classification and detection.

The following snippet can be used for feature extraction:

from transformers import AutoModel
from PIL import Image
from timm.data.transforms_factory import create_transform
import requests

model = AutoModel.from_pretrained("nvidia/MambaVision-T-1K", trust_remote_code=True)

# eval mode for inference
model.cuda().eval()

# prepare image for the model
url = 'http://images.cocodataset.org/val2017/000000020247.jpg'
image = Image.open(requests.get(url, stream=True).raw)
input_resolution = (3, 224, 224)  # MambaVision supports any input resolutions

transform = create_transform(input_size=input_resolution,
                             is_training=False,
                             mean=model.config.mean,
                             std=model.config.std,
                             crop_mode=model.config.crop_mode,
                             crop_pct=model.config.crop_pct)
inputs = transform(image).unsqueeze(0).cuda()
# model inference
out_avg_pool, features = model(inputs)
print("Size of the averaged pool features:", out_avg_pool.size())  # torch.Size([1, 640])
print("Number of stages in extracted features:", len(features)) # 4 stages
print("Size of extracted features in stage 1:", features[0].size()) # torch.Size([1, 80, 56, 56])
print("Size of extracted features in stage 4:", features[3].size()) # torch.Size([1, 640, 7, 7])

Currently, we offer MambaVision-T-1K, MambaVision-T2-1K, MambaVision-S-1K, MambaVision-B-1K, MambaVision-L-1K and MambaVision-L2-1K on Hugging Face. All models can also be viewed here.

Classification (pip package)

We can also import pre-trained MambaVision models from the pip package with a few lines of code:

pip install mambavision

A pretrained MambaVision model with default hyper-parameters can be created as in:

>>> from mambavision import create_model

# Define mamba_vision_T model

>>> model = create_model('mamba_vision_T', pretrained=True, model_path="/tmp/mambavision_tiny_1k.pth.tar")

Available list of pretrained models include mamba_vision_T, mamba_vision_T2, mamba_vision_S, mamba_vision_B, mamba_vision_L and mamba_vision_L2.

We can also simply test the model by passing a dummy image with any resolution. The output is the logits:

>>> import torch

>>> image = torch.rand(1, 3, 512, 224).cuda() # place image on cuda
>>> model = model.cuda() # place model on cuda
>>> output = model(image) # output logit size is [1, 1000]

Using the pretrained models from our pip package, you can simply run validation:

python validate_pip_model.py --model mamba_vision_T --data_dir=$DATA_PATH --batch-size $BS 

Results + Pretrained Models

ImageNet-21K

NameAcc@1(%)Acc@5(%)#Params(M)FLOPs(G)ResolutionHFDownload
MambaVision-B-21K84.997.597.715.0224x224linkmodel
MambaVision-L-21K86.197.9227.934.9224x224linkmodel
MambaVision-L2-512-21K87.398.4241.5196.3512x512linkmodel
MambaVision-L3-256-21K87.398.3739.6122.3256x256linkmodel
MambaVision-L3-512-21K88.198.6739.6489.1512x512linkmodel

ImageNet-1K

NameAcc@1(%)Acc@5(%)Throughput(Img/Sec)Resolution#Params(M)FLOPs(G)HFDownload
MambaVision-T82.396.26298224x22431.84.4linkmodel
MambaVision-T282.796.35990224x22435.15.1linkmodel
MambaVision-S83.396.54700224x22450.17.5linkmodel
MambaVision-B84.296.93670224x22497.715.0linkmodel
MambaVision-L85.097.12190224x224227.934.9linkmodel
MambaVision-L285.397.21021224x224241.537.5linkmodel

Detection Results + Models

BackboneDetectorLr Schdbox mAPmask mAP#Params(M)FLOPs(G)ConfigLogModel Ckpt
MambaVision-T-1KCascade Mask R-CNN3x51.144.386740configlogmodel
MambaVision-S-1KCascade Mask R-CNN3x52.345.2108828configlogmodel
MambaVision-B-1KCascade Mask R-CNN3x52.845.7145964configlogmodel

Segmentation Results + Models

BackboneMethodLr SchdmIoU#Params(M)FLOPs(G)ConfigLogModel Ckpt
MambaVision-T-1KUPerNet160K46.055945configlogmodel
MambaVision-S-1KUPerNet160K48.2841135configlogmodel
MambaVision-B-1KUPerNet160K49.11261342configlogmodel
MambaVision-L3-512-21KUPerNet160K53.27803670configlogmodel

Installation

We provide a docker file. In addition, assuming that a recent PyTorch package is installed, the dependencies can be installed by running:

pip install -r requirements.txt

Evaluation

The MambaVision models can be evaluated on ImageNet-1K validation set using the following:

python validate.py \
--model <model-name>
--checkpoint <checkpoint-path>
--data_dir <imagenet-path>
--batch-size <batch-size-per-gpu

Here --model is the MambaVision variant (e.g. mambavision_tiny_1k), --checkpoint is the path to pretrained model weights, --data_dir is the path to ImageNet-1K validation set and --batch-size is the number of batch size. We also provide a sample script here.

FAQ

  1. Does MambaVision support processing images with any input resolutions ?

Yes ! you can pass images with any arbitrary resolutions without the need to change the model.

  1. I am interested in re-implementing MambaVision in my own repository. Can we use the pretrained weights ?

Yes ! the pretrained weights are released under CC-BY-NC-SA-4.0. Please submit an issue in this repo and we will add your repository to the README of our codebase and properly acknowledge your efforts.

  1. Can I apply MambaVision for downstream tasks like detection, segmentation ?

Yes ! we have released the model that supports downstream tasks along code and pretrained models for object detection and semantic segmentation.

  1. How were the throughput and FLOPs calculated for each model ?

Please see this snippet for throughput and FLOPs measurement. Results may vary depending on the hardware.

Citation

If you find MambaVision to be useful for your work, please consider citing our paper:

@inproceedings{hatamizadeh2025mambavision,
  title={Mambavision: A hybrid mamba-transformer vision backbone},
  author={Hatamizadeh, Ali and Kautz, Jan},
  booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
  pages={25261--25270},
  year={2025}
}

Star History

Stargazers repo roster for @NVlabs/MambaVision

Star History Chart

Licenses

Copyright © 2026, NVIDIA Corporation. All rights reserved.

This work is made available under the NVIDIA Source Code License-NC. Click here to view a copy of this license.

The pre-trained models are shared under CC-BY-NC-SA-4.0. If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

For license information regarding the timm repository, please refer to its repository.

For license information regarding the ImageNet dataset, please see the ImageNet official website.

Acknowledgement

This repository is built on top of the timm repository. We thank Ross Wrightman for creating and maintaining this high-quality library.

deep-learning
foundation-models
huggingface-transformers
hybrid-models
image-classification
instance-segmentation
mamba
object-detection
self-attention
semantic-segmentation
transformers
vision-transformer
visual-recognition

Project health

Latest release

1.2.0 · Jul 22, 2025

Releases this year

0

Significant stargazers

Omar Sanseviero

1,113 followers · starred Jul 2024

Piotr Skalski

7,139 followers · starred Jun 2025

Xin Ma

84 followers · starred Aug 2024

Huajie Tan

84 followers · starred Jul 2024