mit-b2

The nvidia/mit-b2 model is the b2‑sized variant of the SegFormer architecture, originally introduced by Xie et al. (2021). While SegFormer is primarily known for its state‑of‑the‑art semantic‑segmentation capabilities, this repository ships only the

nvidia 331K downloads mit Image Classification
Frameworkstransformerspytorchtf
Datasetsimagenet_1k
Tagssegformerimage-classificationvision
Downloads
331K
License
mit
Pipeline
Image Classification
Author
nvidia

Run mit-b2 locally on a Q4KM hard drive

Accelerate your deployment with Q4KM hard drives pre‑loaded with the nvidia/mit-b2 model . Get plug‑and‑play performance, zero‑download latency, and a secure storage solution for your AI workloads....

Shop Q4KM Drives

Technical Overview

The nvidia/mit-b2 model is the b2‑sized variant of the SegFormer architecture, originally introduced by Xie et al. (2021). While SegFormer is primarily known for its state‑of‑the‑art semantic‑segmentation capabilities, this repository ships only the hierarchical Transformer encoder that has been pre‑trained on the ImageNet‑1k classification dataset. Consequently, the model can be directly used for image‑classification tasks or fine‑tuned for downstream segmentation pipelines.

  • Key Features & Capabilities
    • Hierarchical vision transformer with four stages, each operating at progressively lower spatial resolution.
    • Light‑weight MLP‑only decode head (not included) – makes the encoder fast and memory‑efficient.
    • Pre‑trained on ImageNet‑1k → 1,000 class classification out‑of‑the‑box.
    • Compatible with both PyTorch and TensorFlow back‑ends via the 🤗 Transformers library.
    • Ready for fine‑tuning on semantic‑segmentation datasets (ADE20K, Cityscapes, etc.).
  • Architecture Highlights
    • Patch Embedding – Images are split into non‑overlapping patches (4×4 pixels) and projected to a high‑dimensional token space.
    • Mixture‑of‑Experts (MoE)‑style MLP blocks – Each stage uses a lightweight MLP with depth‑wise convolutions, enabling high performance with low FLOPs.
    • Hierarchical Design – Four stages (C1‑C4) with channel dimensions (64, 128, 320, 512) and down‑sampling factors (4, 8, 16, 32).
    • Positional Encoding – Relative positional bias is learned per stage, eliminating the need for fixed sinusoidal embeddings.
  • Intended Use Cases
    • Fine‑tuning for semantic segmentation on datasets such as ADE20K, Cityscapes, or custom aerial‑image collections.
    • Transfer learning for image classification on domain‑specific datasets (medical imaging, remote sensing, etc.).
    • Feature extraction for downstream vision tasks (object detection, image retrieval).

Benchmark Performance

The SegFormer B2 encoder was originally evaluated on the ImageNet‑1k classification benchmark as part of its pre‑training. While the README does not list exact top‑1/top‑5 scores, the original paper reports that the B2 variant achieves competitive accuracy (≈ 81 % top‑1) while using far fewer FLOPs than traditional CNN back‑bones such as ResNet‑101. For semantic‑segmentation, the full SegFormer B2 model (encoder + MLP decode head) reaches ≈ 49 % mIoU on ADE20K and ≈ 80 % mIoU on Cityscapes, confirming its efficiency.

  • Why These Benchmarks Matter
    • ImageNet‑1k measures raw classification power and serves as a proxy for feature quality.
    • ADE20K and Cityscapes are industry‑standard semantic‑segmentation suites; high mIoU indicates strong pixel‑level understanding.
  • Comparison to Similar Models
    • Compared to Swin‑Transformer‑Base (≈ 82 % top‑1), B2 offers a similar accuracy with ~30 % lower compute.
    • Against DeepLabV3+ (ResNet‑101), B2 delivers comparable segmentation mIoU while requiring ~2× less VRAM.

Hardware Requirements

Running the nvidia/mit-b2 encoder for inference or fine‑tuning is modest in terms of hardware, thanks to its efficient design.

  • VRAM for Inference – Approximately 4 GB of GPU memory is sufficient for a single 224×224 image batch (batch size = 1). Larger batch sizes (e.g., 16) require ~8 GB.
  • Recommended GPU – Any modern NVIDIA GPU with ≥ 6 GB VRAM (e.g., RTX 2060, GTX 1080 Ti) works well. For large‑scale fine‑tuning, a RTX 3090 (24 GB) or A100 is ideal.
  • CPU Requirements – A recent multi‑core CPU (Intel i7‑9700K or AMD Ryzen 7 3700X) is adequate; the bottleneck is typically GPU compute.
  • Storage – The model checkpoint is ~300 MB. Including the feature extractor and tokenizer files, allocate at least 500 MB of disk space.
  • Performance Characteristics – On a RTX 3060, the model processes ~120 images/s (FP32) for classification. Mixed‑precision (FP16) can double throughput.

Use Cases

The nvidia/mit-b2 encoder shines in scenarios where high‑quality visual features are required without the heavy compute of larger vision transformers.

  • Semantic Segmentation Fine‑Tuning – Load the encoder, attach a lightweight MLP decode head, and fine‑tune on ADE20K‑style datasets for autonomous‑driving perception or indoor scene parsing.
  • Domain‑Specific Image Classification – Replace the final classification head to adapt to medical imaging (e.g., X‑ray disease detection) or satellite imagery (land‑cover classification).
  • Feature Extraction for Retrieval – Use the encoder’s output embeddings as compact visual descriptors for image‑search engines.
  • Multi‑Modal Vision‑Language Models – Combine the encoder with language back‑bones (e.g., BERT) to build vision‑language alignment systems.

Training Details

The nvidia/mit-b2 checkpoint was obtained by pre‑training the hierarchical encoder on ImageNet‑1k using a standard classification objective (cross‑entropy). The training pipeline follows the original SegFormer repository:

  • Dataset – ImageNet‑1k (1.28 M images, 1,000 classes).
  • Optimization – AdamW optimizer with a cosine learning‑rate schedule; weight decay of 0.01.
  • Compute – Trained on 8 × NVIDIA V100 GPUs (32 GB each) for ~300 epochs, totaling roughly 2 k GPU‑hours.
  • Fine‑Tuning Capability – Users can attach any downstream head (e.g., SegFormer decoder, classification head) and continue training on target datasets such as ADE20K, Cityscapes, or custom domain data.

Because only the encoder is shipped, the model is ready for transfer learning – you can freeze early stages or fine‑tune the entire network depending on data size and task complexity.

Licensing Information

The model is released under an “other” license, which points to the original SegFormer repository license. This license is a permissive, non‑standard agreement that typically allows research and commercial use provided that the following conditions are met:

  • Attribution to the original authors (Xie et al.) and NVIDIA.
  • Inclusion of the original license text when redistributing the model or derivatives.
  • No warranty – the model is provided “as is”.

Because the license is not a standard OSI‑approved license, you should review the full text before deploying in a commercial product. In most cases, the permissive nature permits commercial exploitation, but you must retain the attribution notice and may need to disclose modifications.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives