Skip to main content
QUICK REVIEW

[Paper Review] Learning Affinity from Attention: End-to-End Weakly-Supervised Semantic Segmentation with Transformers

Lixiang Ru, Yibing Zhan|arXiv (Cornell University)|Mar 5, 2022
Advanced Neural Network ApplicationsComputer Science15 citations
TL;DR

This paper proposes a novel end-to-end weakly-supervised semantic segmentation framework using Transformers, introducing the Affinity from Attention (AFA) module to learn reliable semantic affinity from multi-head self-attention features and refine pseudo-labels via random walk propagation. The method achieves 66.0% mIoU on PASCAL VOC 2012 and 38.9% on MS COCO 2014, setting new state-of-the-art performance for end-to-end WSSS.

ABSTRACT

Weakly-supervised semantic segmentation (WSSS) with image-level labels is an important and challenging task. Due to the high training efficiency, end-to-end solutions for WSSS have received increasing attention from the community. However, current methods are mainly based on convolutional neural networks and fail to explore the global information properly, thus usually resulting in incomplete object regions. In this paper, to address the aforementioned problem, we introduce Transformers, which naturally integrate global information, to generate more integral initial pseudo labels for end-to-end WSSS. Motivated by the inherent consistency between the self-attention in Transformers and the semantic affinity, we propose an Affinity from Attention (AFA) module to learn semantic affinity from the multi-head self-attention (MHSA) in Transformers. The learned affinity is then leveraged to refine the initial pseudo labels for segmentation. In addition, to efficiently derive reliable affinity labels for supervising AFA and ensure the local consistency of pseudo labels, we devise a Pixel-Adaptive Refinement module that incorporates low-level image appearance information to refine the pseudo labels. We perform extensive experiments and our method achieves 66.0% and 38.9% mIoU on the PASCAL VOC 2012 and MS COCO 2014 datasets, respectively, significantly outperforming recent end-to-end methods and several multi-stage competitors. Code is available at https://github.com/rulixiang/afa.

Motivation & Objective

  • To address the limitation of CNN-based end-to-end WSSS methods in capturing global context and producing incomplete object regions.
  • To leverage the global modeling capability of Transformers to generate more integral initial pseudo-labels for weakly-supervised semantic segmentation.
  • To exploit the inherent consistency between multi-head self-attention and semantic affinity to learn reliable affinity maps for pseudo-label refinement.
  • To ensure local consistency and reliability of pseudo-labels by incorporating low-level image appearance features through a pixel-adaptive refinement module.
  • To establish a simple, end-to-end training pipeline that avoids the complexity of multi-stage frameworks.

Proposed method

  • Proposes an end-to-end Transformer-based framework for WSSS using image-level labels, replacing CNNs with a Vision Transformer backbone to generate initial class activation maps (CAMs) as pseudo-labels.
  • Introduces the Affinity from Attention (AFA) module to learn reliable semantic affinity from multi-head self-attention (MHSA) features, using pseudo-labels as supervision to refine attention-based affinity predictions.
  • Employs random walk propagation with the learned affinity to refine initial pseudo-labels, enhancing object region completeness and suppressing false activations.
  • Designs a Pixel-Adaptive Refinement (PAR) module that integrates local RGB and positional features to refine pseudo-labels, improving alignment with low-level image structures.
  • Uses the AFA module’s output affinity to guide label propagation, ensuring global consistency while maintaining local detail through PAR.
  • Trains the entire model end-to-end, eliminating the need for separate training stages and simplifying the pipeline.
Figure 1: (a) Image and the query points (denote with ” $\bigstar$ ”) to visualize the attention and affinity maps; (b) the self-attention maps in Transformer blocks only capture coarse semantic-level affinity relations; (c) the learned reliable semantic affinity from self-attention with our propose
Figure 1: (a) Image and the query points (denote with ” $\bigstar$ ”) to visualize the attention and affinity maps; (b) the self-attention maps in Transformer blocks only capture coarse semantic-level affinity relations; (c) the learned reliable semantic affinity from self-attention with our propose

Experimental results

Research questions

  • RQ1Can Transformers improve the quality of initial pseudo-labels in end-to-end weakly-supervised semantic segmentation by modeling global context more effectively than CNNs?
  • RQ2Can the inherent self-attention mechanism in Transformers be leveraged to learn reliable semantic affinity for pseudo-label refinement?
  • RQ3How can we supervise the attention-based affinity learning to ensure it produces accurate and reliable affinity maps for label propagation?
  • RQ4Can the integration of low-level image appearance features improve the local consistency and accuracy of refined pseudo-labels?
  • RQ5Does an end-to-end training strategy with attention-based affinity learning outperform existing multi-stage and end-to-end WSSS methods on standard benchmarks?

Key findings

  • The proposed method achieves 66.0% mIoU on the PASCAL VOC 2012 validation set, significantly outperforming recent end-to-end methods and several multi-stage competitors.
  • On the more challenging MS COCO 2014 dataset, the method attains 38.9% mIoU on the validation set, surpassing most recent multi-stage methods and setting a new SOTA for end-to-end WSSS.
  • The model achieves 83.8% of the performance of a fully-supervised Segformer baseline on VOC 2012, demonstrating strong efficiency and effectiveness with weak supervision.
  • Ablation studies confirm that both the AFA and PAR modules contribute significantly to performance gains, with AFA improving affinity learning and PAR enhancing local label consistency.
  • Qualitative results show that the method produces segmentation maps with finer boundary alignment and more complete object regions compared to baselines like 1Stage and AA&LR.
  • The end-to-end training strategy is effective and efficient, avoiding the complex multi-stage pipeline common in prior WSSS approaches.
Figure 2: CAM generated with (b) Transformers activates more integral regions than (a) CNN. Refining CAM with (c) coarse MHSA doesn’t work well, while (d) the learned affinity could remarkably improve the generated CAM.
Figure 2: CAM generated with (b) Transformers activates more integral regions than (a) CNN. Refining CAM with (c) coarse MHSA doesn’t work well, while (d) the learned affinity could remarkably improve the generated CAM.

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.