All models

smp_Segformer_timm-tf_efficientnet_lite4

SegFormer's lightweight all-MLP segmentation decoder, traced here on 73 different encoder backbones.

Segmentation · 504 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (27 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
12.2M
Operations
504
Framework
PyTorch
Recurrent
No
Published
2021
Cited by
921 (as of 9 October 2026)
Authors
Enze Xie, Wenhai Wang, Zhiding Yu and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m9839
Graph hash
81c78000b2429de35be084dc24cb7ed120f9037626cf2dbb02593a3be1f58dd3
Skeleton hash
87f94de7d80e3c9a9b8708925c06fee592954e5b629de4087bac5a177458c64d
Architecture hash
3ebcaf4d7f92b4360ac96697d1f3a46c81095e3ded62358bc37c57ab85096a35
Diagram SHA-256
77de371e2063564caf1d3e6c37b486b07a2f8ee035c34f8b04343055d552ce86
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

segmentation_models_pytorch.Segformer(encoder_name='timm-tf_efficientnet_lite4', encoder_weights=None, in_channels=3, classes=21)

What it is

About this model's family

SegFormer is Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M. Alvarez and Ping Luo's semantic segmentation framework, a simple and efficient design that unifies Transformers with lightweight MLP decoders. It was accepted at NeurIPS 2021. The paper claims two appealing features: a novel hierarchically structured Transformer encoder that outputs multiscale features and does not need positional encoding, and a decoder that avoids the complexity of its predecessors. Skipping positional encoding avoids interpolating positional codes, which the authors say leads to decreased performance when the testing resolution differs from training.

The MLP decoder aggregates information from different layers, combining local attention and global attention into one powerful representation, and the authors show that this simple and lightweight design is the key to efficient segmentation on Transformers. Scaled from SegFormer-B0 to SegFormer-B5, the B4 model achieves 50.3% mIoU on ADE20K with 64M parameters, 5x smaller and 2.2% better than the previous best method, and B5 achieves 84.0% mIoU on the Cityscapes validation set.

This family captures only the decoder half of that story: the lightweight MLP decoder, fed by 73 different encoders, the paper's own hierarchical MiT Transformers (mit_b0 to mit_b5) among them and the rest convolutional, each producing a 21-class mask at random initialization. The best model, SegFormer-B5, also shows excellent zero-shot robustness on Cityscapes-C.

Key idea. A hierarchical Transformer encoder with no positional encoding paired with an all-MLP decoder that fuses multiscale features, showing that a simple and lightweight design is the key to efficient segmentation on Transformers.

  • segformer
  • segformer decoder
  • mix transformer
  • mit
  • all-mlp decoder
  • segmentation_models_pytorch
  • smp segformer
  • semantic segmentation
  • ade20k
  • cityscapes

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{xie2021segformersimpleefficientdesign,
      title={SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers}, 
      author={Enze Xie and Wenhai Wang and Zhiding Yu and Anima Anandkumar and Jose M. Alvarez and Ping Luo},
      year={2021},
      eprint={2105.15203},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2105.15203}, 
}