All models

smp_FPN_mit_b0

SMP's FPN segmentation decoder on SegFormer's MiT-B0 encoder, random weights, 21 classes at 256 px.

Segmentation · 432 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 (30 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
5.1M
Operations
432
Framework
PyTorch
Recurrent
No
Published
CVPR 2017
Cited by
461 (as of 5 October 2026)
Authors
Tsung-Yi Lin, Piotr Dollár, Ross Girshick 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
m9413
Graph hash
b018f57d3a1cfa2cb7edba6e088ee43e2345da200bf9d97ffe8fc85d0d672175
Skeleton hash
92dff73aa587f6aaab75f750605093d91e90505144d0353b42c9d43f46ead039
Architecture hash
d73ba498b357ac1dce27845b6a7323175c9c6ad442637b8c43381a36c7c962f4
Diagram SHA-256
710cc5b7853240a6344931b46709a219a716b364cae4d1e41df0416d7027164d
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.FPN(encoder_name='mit_b0', encoder_weights=None, in_channels=3, classes=21)

What it is

This member pairs two papers' ideas: the Feature Pyramid Network of Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan and Serge Belongie as the decoder, and SegFormer's Mix Transformer as the encoder, assembled by the Segmentation Models Pytorch (SMP for short) library. SMP offers 12 encoder-decoder model architectures (Unet, Unet++, Segformer, DPT, ...) and 800+ pretrained convolution- and transform-based encoders, so a pyramid decoder on a transformer backbone is one combination among hundreds. The result is a semantic segmenter that takes a single-scale image of an arbitrary size as input, and outputs proportionally sized feature maps, here decoded into a per-pixel class map.

FPN's insight is to exploit the inherent multi-scale, pyramidal hierarchy of deep convolutional networks to construct feature pyramids with marginal extra cost. Its top-down pathway hallucinates higher resolution features by upsampling spatially coarser, but semantically stronger, feature maps from higher pyramid levels, and each upsampled map is merged with the corresponding bottom-up map (which undergoes a 1×1 convolutional layer to reduce channel dimensions) by element-wise addition. The paper fixes the feature dimension at d = 256 in every pyramid level and appends a 3×3 convolution on each merged map to reduce aliasing. The original paper already generalized FPNs to instance segmentation proposals, so a dense segmentation head on the pyramid follows the authors' own direction.

The encoder here is MiT-B0, the smallest of the Mix Transformer encoders (MiT), MiT-B0 to MiT-B5, with the same architecture but different sizes, which SegFormer's authors Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M. Alvarez and Ping Luo describe as their lightweight model for fast inference. It is a hierarchically structured Transformer encoder which outputs multiscale features and does not need positional encoding, thereby avoiding the interpolation of positional codes which leads to decreased performance when the testing resolution differs from training. Position comes instead from Mix-FFN, which considers the effect of zero padding to leak location information by directly using a 3 × 3 Conv in the feed-forward network (FFN), and the encoder yields multi-level features at {1/4, 1/8, 1/16, 1/32} of the original image resolution, the four scales the FPN decoder consumes. The member is built with random weights and 21 output classes, which SMP supports through its classes argument, the model output channels (number of classes in your dataset).

Key idea. A top-down pathway with lateral connections that turns a backbone's multi-scale hierarchy into 256-channel semantic maps at every level, here fed by a positional-encoding-free Mix Transformer encoder.

  • fpn
  • feature pyramid network
  • smp fpn
  • segmentation_models_pytorch
  • smp.FPN mit_b0
  • mit_b0
  • mit-b0
  • mix transformer
  • segformer encoder
  • semantic segmentation
  • fpn with transformer encoder
  • lin dollar girshick he
  • xie wang yu anandkumar alvarez luo

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

Cite the paper

@misc{lin2017featurepyramidnetworksobject,
      title={Feature Pyramid Networks for Object Detection}, 
      author={Tsung-Yi Lin and Piotr Dollár and Ross Girshick and Kaiming He and Bharath Hariharan and Serge Belongie},
      year={2017},
      eprint={1612.03144},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1612.03144}, 
}