Skip to main content
QUICK REVIEW

[Paper Review] Token Contrast for Weakly-Supervised Semantic Segmentation

Lixiang Ru, Heliang Zheng|arXiv (Cornell University)|Mar 2, 2023
Advanced Neural Network ApplicationsComputer Science9 citations
TL;DR

The paper introduces Token Contrast (ToCo) for WSSS using Vision Transformers to combat ViT over-smoothing by (1) Patch Token Contrast (PTC) that aligns final patch tokens with intermediate-layer semantics, and (2) Class Token Contrast (CTC) that enforces local-global representation consistency between uncertain regions and whole objects, achieving strong single-stage WSSS results on VOC and COCO.

ABSTRACT

Weakly-Supervised Semantic Segmentation (WSSS) using image-level labels typically utilizes Class Activation Map (CAM) to generate the pseudo labels. Limited by the local structure perception of CNN, CAM usually cannot identify the integral object regions. Though the recent Vision Transformer (ViT) can remedy this flaw, we observe it also brings the over-smoothing issue, \ie, the final patch tokens incline to be uniform. In this work, we propose Token Contrast (ToCo) to address this issue and further explore the virtue of ViT for WSSS. Firstly, motivated by the observation that intermediate layers in ViT can still retain semantic diversity, we designed a Patch Token Contrast module (PTC). PTC supervises the final patch tokens with the pseudo token relations derived from intermediate layers, allowing them to align the semantic regions and thus yield more accurate CAM. Secondly, to further differentiate the low-confidence regions in CAM, we devised a Class Token Contrast module (CTC) inspired by the fact that class tokens in ViT can capture high-level semantics. CTC facilitates the representation consistency between uncertain local regions and global objects by contrasting their class tokens. Experiments on the PASCAL VOC and MS COCO datasets show the proposed ToCo can remarkably surpass other single-stage competitors and achieve comparable performance with state-of-the-art multi-stage methods. Code is available at https://github.com/rulixiang/ToCo.

Motivation & Objective

  • Address the limitations of CAM in WSSS by leveraging ViT to capture global object regions.
  • Mitigate ViT over-smoothing by supervising final patch tokens with intermediate-layer semantic signals (PTC).
  • Differentiate uncertain CAM regions using class-token based local-global contrast (CTC).
  • Develop a single-stage WSSS framework that achieves competitive performance with multi-stage approaches.

Proposed method

  • Introduce Patch Token Contrast (PTC) to supervise final patch tokens using pseudo token relations derived from intermediate ViT layers.
  • Derive auxiliary CAM from intermediate layers via an auxiliary classifier and use it to form reliable token labels for PTC.
  • Define Class Token Contrast (CTC) to align global class tokens with local crops from uncertain regions and contrast with background crops using InfoNCE loss.
  • Combine L_cls, L_cls^m, L_ptc, and L_ctc with a segmentation loss L_seg in an end-to-end ToCo objective for training.
  • Apply an EMA-based update for the global projection head in CTC to stabilize local-global token alignment.
  • Integrate ToCo into a single-stage WSSS framework with PAR refinement and a simple decoder for pixel-level predictions.
Figure 1 : The generated CAM and the pairwise cosine similarity of patch tokens ( $sim.$ map). Our method can address the over-smoothing issue well and produce accurate CAM. Here we use ViT-Base.
Figure 1 : The generated CAM and the pairwise cosine similarity of patch tokens ( $sim.$ map). Our method can address the over-smoothing issue well and produce accurate CAM. Here we use ViT-Base.

Experimental results

Research questions

  • RQ1Can intermediate ViT representations provide semantic diversity to counter over-smoothing in final patch tokens?
  • RQ2Does supervising final patch tokens with intermediate-layer CAM improve CAM quality and pseudo-labels for WSSS?
  • RQ3Can class-token level contrast between global and local views improve activation of uncertain regions in CAM?
  • RQ4How does ToCo perform relative to state-of-the-art single-stage and multi-stage WSSS methods on VOC and COCO?

Key findings

  • ToCo significantly improves CAM quality and downstream segmentation performance over ViT baselines.
  • PTC reduces patch-token over-smoothing, improving final CAM from 27.9% to 62.5% mIoU on VOC val in ablations.
  • CTC adds an additional 4.7% mIoU improvement in CAM quality and semi-supervised-like local-global consistency.
  • On VOC, ToCo achieves 70.5% mIoU in val with ViT-B and 68.1–70.5 range across variants; on VOC test it reaches 72.3–72.2% mIoU depending on pretrained weights.
  • On COCO val, ToCo attains 42.3% mIoU, and with ViT-B† backbones reaches 71.1% val and 72.2% test mIoU (image-level supervision).
  • ToCo single-stage results outperform many single-stage competitors and approach or match several multi-stage methods using image-level labels only.
Figure 2 : The average pairwise cosine similarity of patch tokens in each Transformer block. The cosine similarity is computed on the VOC train set. Here we use the ViT-Base (ViT-B) [ 12 ] architecture which includes 12 Transformer blocks.
Figure 2 : The average pairwise cosine similarity of patch tokens in each Transformer block. The cosine similarity is computed on the VOC train set. Here we use the ViT-Base (ViT-B) [ 12 ] architecture which includes 12 Transformer blocks.

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.