All models

SETR_MLA

A pure transformer encoder that segments images as patch sequences, with three decoder designs.

Segmentation · 201 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

Family
setr
Parameters
262.6K
Operations
201
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2020)
Cited by
3,680 (as of 9 October 2026)
Authors
Sixiao Zheng, Jiachen Lu, Hengshuang Zhao and others
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
m2666
Graph hash
5373787326bf6ff20115ad8e8865b5ec57b7c4f77c21d0532927ab41d4d35dfd
Skeleton hash
68f3a148fe2df4bfce3c6ffb0ba62c64e072d810d1b39994e23d89c25e61a681
Architecture hash
ad7a2956a35aefd2345218e1858ef2d46f7031c8354ecbd2f94aa50531415ef9
Diagram SHA-256
4d78b9e24356d0e38be34fc4f561d8ec11f65e0d2de6e24b04e22f1d2839a1c0
TorchLens version
2.35.3
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

menagerie.classics.setr_vit_seg:build_setr_mla: build({})

What it is

SETR-MLA aggregates features from several transformer layers in parallel streams, in the spirit of a feature pyramid network.

About this model's family

SETR, the SEgmentation TRansformer, treats semantic segmentation as a sequence-to-sequence prediction problem. A pure transformer, with no convolution and no resolution reduction, encodes the image as a sequence of patches. This encoder is then combined with a simple decoder to make the segmentation model. The point is to drop the fully convolutional encoder-decoder design, in which spatial resolution shrinks layer by layer: here there is no downsampling, and global context is modeled at every layer of the encoder.

The image is split into fixed-size patches, each linearly embedded, given a position embedding and fed to a standard Transformer encoder. The paper introduces three decoders of increasing complexity, and all three are captured here: SETR-Naive, SETR-PUP and SETR-MLA. The naive decoder projects the transformer output to the number of categories with two 1 by 1 convolutions and bilinearly upsamples it to full resolution in one step. Progressive upsampling alternates convolutions with 2x upsampling, taking four steps to reach full resolution. Multi-level aggregation fuses features from several transformer layers in the spirit of a feature pyramid network.

The captured members emit 19-channel maps, the category count the paper uses for Cityscapes. SETR reached 50.28% mIoU on ADE20K and 55.83% on Pascal Context, and took first position on the ADE20K test server leaderboard on the day of submission.

Key idea. Reformulating semantic segmentation as sequence-to-sequence learning with a pure transformer encoder that keeps full spatial resolution, as an alternative to the encoder-decoder FCN design.

  • setr
  • segmentation transformer
  • semantic segmentation
  • vision transformer
  • ade20k
  • cityscapes
  • pascal context
  • setr-pup
  • setr-mla
  • setr-naive

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{zheng2021rethinkingsemanticsegmentationsequencetosequence,
      title={Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers}, 
      author={Sixiao Zheng and Jiachen Lu and Hengshuang Zhao and Xiatian Zhu and Zekun Luo and Yabiao Wang and Yanwei Fu and Jianfeng Feng and Tao Xiang and Philip H. S. Torr and Li Zhang},
      year={2021},
      eprint={2012.15840},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2012.15840}, 
}