Skip to main content
QUICK REVIEW

[Paper Review] Multi-class Token Transformer for Weakly Supervised Semantic Segmentation

Xu Lian, Wanli Ouyang|arXiv (Cornell University)|Mar 6, 2022
Advanced Neural Network ApplicationsComputer Science19 citations
TL;DR

This paper proposes MCTformer, a multi-class token transformer that uses multiple class-specific tokens to learn class-discriminative attention maps for weakly supervised semantic segmentation. By leveraging class-to-patch attention and patch-level pairwise affinity from self-attention, it generates high-quality pseudo-segmentation labels that outperform existing methods, achieving 58.2% mIoU on PASCAL VOC and 61.7% with refinement, while complementing CAM for superior performance.

ABSTRACT

This paper proposes a new transformer-based framework to learn class-specific object localization maps as pseudo labels for weakly supervised semantic segmentation (WSSS). Inspired by the fact that the attended regions of the one-class token in the standard vision transformer can be leveraged to form a class-agnostic localization map, we investigate if the transformer model can also effectively capture class-specific attention for more discriminative object localization by learning multiple class tokens within the transformer. To this end, we propose a Multi-class Token Transformer, termed as MCTformer, which uses multiple class tokens to learn interactions between the class tokens and the patch tokens. The proposed MCTformer can successfully produce class-discriminative object localization maps from class-to-patch attentions corresponding to different class tokens. We also propose to use a patch-level pairwise affinity, which is extracted from the patch-to-patch transformer attention, to further refine the localization maps. Moreover, the proposed framework is shown to fully complement the Class Activation Mapping (CAM) method, leading to remarkably superior WSSS results on the PASCAL VOC and MS COCO datasets. These results underline the importance of the class token for WSSS.

Motivation & Objective

  • To address the limitation of single-class-token ViTs in weakly supervised semantic segmentation, which produce class-agnostic localization maps with low discriminability.
  • To enable transformers to learn class-specific attention by introducing multiple class tokens, each linked to a specific class via a class-aware training strategy.
  • To improve localization quality by utilizing patch-to-patch attention as a pairwise affinity for refining class-specific attention maps.
  • To demonstrate that the proposed method complements traditional CAM-based methods, leading to more accurate pseudo ground-truth labels.
  • To establish the class token’s critical role in weakly supervised learning, contrary to recent trends of removing it.

Proposed method

  • Introduces multiple class tokens in the vision transformer, each responsible for learning representations for a specific object class.
  • Applies average pooling over the class token embeddings to generate class scores, which are supervised by ground-truth labels to enforce class-specific learning.
  • Uses class-to-patch attention maps from each class token as class-specific object localization maps.
  • Extracts patch-to-patch attention as a patch-level pairwise affinity to refine the localization maps without additional computation.
  • Fuses the class-specific attention maps with CAM features to generate more consistent and accurate pseudo-segmentation labels.
  • Employs a multi-stage training strategy that combines classification and localization supervision, with feature fusion from the last three transformer layers for optimal performance.

Experimental results

Research questions

  • RQ1Can multiple class tokens in a vision transformer learn class-specific attention maps that improve object localization in weakly supervised semantic segmentation?
  • RQ2How does the patch-to-patch attention in the transformer contribute to refining localization maps in a weakly supervised setting?
  • RQ3Can the proposed transformer-based localization maps effectively complement the Class Activation Mapping (CAM) method to improve segmentation performance?
  • RQ4What is the optimal strategy for combining class token representations across multiple transformer layers to balance localization completeness and accuracy?
  • RQ5Does average pooling over class token embeddings outperform other aggregation methods (e.g., max pooling or fully connected layers) in generating discriminative localization maps?

Key findings

  • The proposed MCTformer-V1 achieves an mIoU of 47.2% on PASCAL VOC using only class-specific attention maps, outperforming TS-CAM* by 5.9%.
  • When combined with CAM and refined using patch-level pairwise affinity, MCTformer-V2 achieves 61.7% mIoU on PASCAL VOC, a significant improvement over the baseline.
  • The patch-level pairwise affinity, derived from patch-to-patch attention, improves pseudo-label quality by 8% and boosts segmentation performance by 3.2%.
  • Average pooling over class token embeddings yields the best performance (47.2% mIoU), outperforming max pooling (26.8%) and fully connected layers (41.5%), due to better spatial context modeling.
  • Fusing attention maps from the last three transformer layers yields the best balance between coverage and discriminability, with higher-layer fusion leading to over-activation and lower-layer fusion to under-activation.
  • Visualization confirms that MCTformer produces more complete, smoother object contours with reduced background noise compared to TS-CAM, which suffers from sparse and low responses.

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.