[Paper Review] WeakTr: Exploring Plain Vision Transformer for Weakly-supervised Semantic Segmentation
WeakTr leverages a plain Vision Transformer with adaptive attention fusion to generate high-quality CAMs end-to-end and employs a gradient clipping decoder for online retraining, achieving state-of-the-art WSSS results on VOC 2012 and COCO 2014.
Transformer has been very successful in various computer vision tasks and understanding the working mechanism of transformer is important. As touchstones, weakly-supervised semantic segmentation (WSSS) and class activation map (CAM) are useful tasks for analyzing vision transformers (ViT). Based on the plain ViT pre-trained with ImageNet classification, we find that multi-layer, multi-head self-attention maps can provide rich and diverse information for weakly-supervised semantic segmentation and CAM generation, e.g., different attention heads of ViT focus on different image areas and object categories. Thus we propose a novel method to end-to-end estimate the importance of attention heads, where the self-attention maps are adaptively fused for high-quality CAM results that tend to have more complete objects. Besides, we propose a ViT-based gradient clipping decoder for online retraining with the CAM results efficiently and effectively. Furthermore, the gradient clipping decoder can make good use of the knowledge in large-scale pre-trained ViT and has a scalable ability. The proposed plain Transformer-based Weakly-supervised learning method (WeakTr) obtains the superior WSSS performance on standard benchmarks, i.e., 78.5% mIoU on the val set of PASCAL VOC 2012 and 51.1% mIoU on the val set of COCO 2014. Source code and checkpoints are available at https://github.com/hustvl/WeakTr.
Motivation & Objective
- Motivate improving CAM quality for WSSS using plain ViT without convolutional induction bias.
- Propose an adaptive attention fusion module to weight ViT heads for better CAM generation.
- Introduce an end-to-end CAM training strategy that optimizes CAM quality via classification signals.
- Develop an online retraining approach using a gradient clipping decoder to update segmentation models efficiently.
- Demonstrate state-of-the-art WSSS performance on VOC 2012 and COCO 2014 benchmarks.
Proposed method
- Use a plain ViT backbone with C class tokens and N^2 patch tokens as input to a transformer encoder.
- Generate coarse CAM via a convolution on patch tokens, then refine with adaptive attention fusion of self-attention maps.
- Compute dynamic head weights W by pooling attention maps and passing through an FFN to obtain W', then weight cross-attention and patch-attention maps to form CAM_fine.
- Train end-to-end with a combined loss L = L_Fine-CAM + L_CLS-token + L_Coarse-CAM to supervise head weighting.
- Introduce a gradient clipping decoder for online retraining to update segmentation nets by constraining gradient flow based on global/local gradient statistics.
- During inference, apply CRF to refine segmentation maps.
Experimental results
Research questions
- RQ1How can plain Vision Transformer self-attention maps be adaptively fused to produce higher-quality CAMs for WSSS?
- RQ2Can end-to-end CAM training with adaptive head weighting improve pseudo-label quality without CAM refinement phases?
- RQ3Does online retraining with a gradient clipping decoder improve WSSS efficiency and accuracy compared to traditional CAM refinement pipelines?
- RQ4What is the performance impact of WeakTr on standard WSSS benchmarks (VOC 2012 and COCO 2014) using ViT backbones?
- RQ5How does WeakTr compare to state-of-the-art WSSS methods in terms of both CAM quality and final segmentation mIoU?
Key findings
- WeakTr achieves state-of-the-art WSSS results on VOC 2012 val and COCO 2014 val benchmarks.
- On VOC 2012 val, WeakTr with ViT-S achieves 78.4% mIoU and 79.0% on test, outperforming prior methods.
- On VOC 2012 train, the CAM improvements (Fine-CAM) surpass several prior CAM methods (e.g., MCTformer, ViT-PCM).
- Online retraining with the gradient clipping decoder yields significant training time savings (approx. 2.6x faster overall) and maintains high mIoU.
- Adaptive attention fusion (AAF) provides higher CAM precision/recall and mIoU than mean-sum aggregation, especially when CRF post-processing is used.
- Ablation studies show that gradient patch size and clipping start threshold affect final performance, with meaningful gains from the proposed decoder.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.