Skip to main content
QUICK REVIEW

[Paper Review] SeMask: Semantically Masked Transformers for Semantic Segmentation

Jitesh Jain, Anu Singh|arXiv (Cornell University)|Dec 23, 2021
Advanced Neural Network ApplicationsComputer Science31 citations
TL;DR

SeMask introduces a semantic-prior SeMask block that injects semantic context into pretrained hierarchical vision transformers, improving semantic segmentation performance and achieving new state-of-the-art on ADE20K (58.25% mIoU) with >3% gains on Cityscapes.

ABSTRACT

Finetuning a pretrained backbone in the encoder part of an image transformer network has been the traditional approach for the semantic segmentation task. However, such an approach leaves out the semantic context that an image provides during the encoding stage. This paper argues that incorporating semantic information of the image into pretrained hierarchical transformer-based backbones while finetuning improves the performance considerably. To achieve this, we propose SeMask, a simple and effective framework that incorporates semantic information into the encoder with the help of a semantic attention operation. In addition, we use a lightweight semantic decoder during training to provide supervision to the intermediate semantic prior maps at every stage. Our experiments demonstrate that incorporating semantic priors enhances the performance of the established hierarchical encoders with a slight increase in the number of FLOPs. We provide empirical proof by integrating SeMask into Swin Transformer and Mix Transformer backbones as our encoder paired with different decoders. Our framework achieves a new state-of-the-art of 58.25% mIoU on the ADE20K dataset and improvements of over 3% in the mIoU metric on the Cityscapes dataset. The code and checkpoints are publicly available at https://github.com/Picsart-AI-Research/SeMask-Segmentation .

Motivation & Objective

  • Motivate finetuning pretrained transformer encoders for semantic segmentation by incorporating image semantic context during encoding.

Proposed method

  • Insert a Semantic Layer after each Transformer Layer in hierarchical backbones (Swin, Mix Transformer) to produce semantic priors and semantically masked features.
  • Use a lightweight semantic decoder to aggregate stage-wise semantic priors and supervise with per-pixel cross-entropy.
  • Combine semantically masked encoder features with a Semantic-FPN decoder for final per-pixel predictions.
  • Train with a dual-loss: main pixel-wise cross-entropy on the primary decoder and a secondary loss on semantic-prior maps.
  • Use a learnable scalar lambda within SeMask blocks to stabilize feature updates.

Experimental results

Research questions

  • RQ1Can injecting semantic priors into pretrained transformer encoders improve semantic segmentation performance without large architectural changes?
  • RQ2How does SeMask interact with different hierarchical backbones (Swin, Mix Transformer) and decoders to affect accuracy?
  • RQ3What is the impact of semantic supervision at multiple encoder stages on segmentation quality?

Key findings

  • Achieves state-of-the-art 58.25% mIoU on ADE20K with SeMask-L Swin backbone and Mask2Former MSFaPN decoder (640×640 training).
  • Gains over 3% mIoU on Cityscapes compared to strong baselines across Swin and Mix Transformer backbones.
  • Demonstrates single-scale and multi-scale gains on ADE20K (57.00% and 58.25% respectively) when using SeMask with advanced decoders.
  • Shows SeMask consistently improves performance across Swin-T, Swin-S, Swin-B, and Swin-L variants and even with Mix Transformer backbones.
  • Indicates the SeMask approach is backbone-agnostic and benefits from lightweight semantic supervision at multiple encoder stages.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.