
PIDNet_S
Segmentation149 ops1M params
A plain ViT that segments images by itself: learned queries join the tokens, and the decoders go.
Segmentation · 149 operations Checked
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
How this diagram was made
menagerie.classics.pidnet:build_pidnet_s: build({}) EoMT, the Encoder-only Mask Transformer, repurposes a plain Vision Transformer to do image segmentation without the convolutional adapter, pixel decoder and Transformer decoder that ViT segmentation models usually add. The paper's claim is that the inductive biases those task-specific components introduce can be learned by the ViT itself, given sufficiently large models and extensive pre-training. With large-scale models and pre-training, EoMT reaches segmentation accuracy similar to state-of-the-art models that use those components while being significantly faster, up to 4x faster with ViT-L.
The first L1 Transformer encoder blocks of the ViT are unchanged and only process the input image. After those blocks a set of K learnable queries is concatenated to the patch tokens, and the remaining L2 encoder blocks process queries and patches together. Query-to-query self-attention and query-to-patch cross-attention, which a Mask Transformer decoder runs as separate steps, thus happen jointly inside one ordinary self-attention layer. A small mask module then passes each query token through a linear layer for class logits and through a three-layer MLP whose output is dotted with the upscaled image features F4 to give mask logits.
During training, masked attention survives in Mask2Former's manner: the mask module also runs before each of the last L2 blocks to predict intermediate masks, which then restrict each query's attention to the region it has predicted. A mask annealing schedule then phases this out: the masking probability starts at 1.0 and decays block by block to 0.0 over training, so inference needs no masked attention at all. The reference setup uses DINOv2-L with a 640 by 640 input and 16 by 16 patches, with L2 set to 4 for ViT-L; the member traced here is the Transformers port at that 640 pixel image size.
Key idea. Showing that a large, well pre-trained plain ViT can segment images by itself, with only a few extra learned queries and a small mask prediction module, once masked attention is annealed away.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{kerssies2025vitsecretlyimagesegmentation,
title={Your ViT is Secretly an Image Segmentation Model},
author={Tommie Kerssies and Niccolò Cavagnero and Alexander Hermans and Narges Norouzi and Giuseppe Averta and Bastian Leibe and Gijs Dubbelman and Daan de Geus},
year={2025},
eprint={2503.19108},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2503.19108},
}