SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers

  • 2021-05-31 17:59:51
  • Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M. Alvarez, Ping Luo
  • 52

Abstract

We present SegFormer, a simple, efficient yet powerful semantic segmentationframework which unifies Transformers with lightweight multilayer perception(MLP) decoders. SegFormer has two appealing features: 1) SegFormer comprises anovel hierarchically structured Transformer encoder which outputs multiscalefeatures. It does not need positional encoding, thereby avoiding theinterpolation of positional codes which leads to decreased performance when thetesting resolution differs from training. 2) SegFormer avoids complex decoders.The proposed MLP decoder aggregates information from different layers, and thuscombining both local attention and global attention to render powerfulrepresentations. We show that this simple and lightweight design is the key toefficient segmentation on Transformers. We scale our approach up to obtain aseries of models from SegFormer-B0 to SegFormer-B5, reaching significantlybetter performance and efficiency than previous counterparts. For example,SegFormer-B4 achieves 50.3% mIoU on ADE20K with 64M parameters, being 5xsmaller and 2.2% better than the previous best method. Our best model,SegFormer-B5, achieves 84.0% mIoU on Cityscapes validation set and showsexcellent zero-shot robustness on Cityscapes-C. Code will be released at:github.com/NVlabs/SegFormer.

 

Quick Read (beta)

loading the full paper ...