Abstract
Weakly supervised semantic segmentation (WSSS) using only image-level labels is a challenging task due to the limited receptive field of traditional Convolutional Neural Networks (CNNs), which often focus on discriminative object parts rather than the entire object. This paper introduces WegFormer, the first framework to successfully utilize Vision Transformers (ViT) for WSSS. By leveraging the global context captured by self-attention, WegFormer produces high-quality pseudo-labels. We introduce three tailored components: Deep Taylor Decomposition (DTD) for attention map generation, a soft erasing module for smoothing, and Efficient Potential Object Mining (EPOM) for background noise filtering. WegFormer achieves a state-of-the-art 70.5% mIoU on the PASCAL VOC 2012 dataset, significantly outperforming previous CNN-based methods.
Introduction
Semantic segmentation is a fundamental computer vision task that typically requires dense, pixel-level annotations, which are expensive and time-consuming to produce. Weakly Supervised Semantic Segmentation (WSSS) aims to mitigate this by training models using cheaper image-level labels.
The standard approach to WSSS relies on CNN-based Class Activation Maps (CAMs). However, CNNs have a local receptive field, causing them to focus only on the most "discriminative" parts of an object (e.g., a bird's beak instead of its whole body). This leads to incomplete pseudo-labels. WegFormer addresses this by introducing Transformers, which possess a global receptive field, allowing the model to capture the entire object context from the start.
Methodology
The WegFormer framework follows a multi-stage pipeline designed to refine initial object localizations into high-quality segmentation masks:
- Transformer-based Classifier: A Vision Transformer (specifically DeiT) is trained on image-level labels to identify object categories.
- Deep Taylor Decomposition (DTD): Standard CAMs do not translate well to Transformer architectures. WegFormer uses DTD to propagate relevancy scores back through the network layers, generating initial attention maps that highlight target objects more effectively than methods like Attention Rollout.
- Soft Erase Module: To prevent the model from over-focusing on small, high-confidence regions, this module "smooths" the attention map, narrowing the gap between high-response and low-response areas to cover more of the object.
- Efficient Potential Object Mining (EPOM): This module integrates offline saliency maps (which identify foreground objects regardless of class) to filter out background noise. EPOM is optimized to use only the final attention map, enhancing efficiency.
- Self-Training: Finally, these refined pseudo-labels are used to train a standard segmentation network, such as DeepLab-V3+, in a fully supervised manner.
Key Insights
- Global Context: The self-attention mechanism in Transformers naturally mitigates the "partial activation" problem inherent in CNNs.
- Last Block Superiority: Research revealed that using attention maps from only the last Transformer block yielded better results (59.5% mIoU) than integrating all blocks (58.2%), as shallower blocks tend to introduce localization noise.
- DTD Effectiveness: Deep Taylor Decomposition was found to be significantly more effective for object localization in Transformers than other visualization techniques.
Results and Discussion
WegFormer sets a new benchmark for WSSS on the PASCAL VOC 2012 dataset. Using a ResNet-101 backbone for the final segmentation stage, it achieved 70.5% mIoU on the test set, outperforming the previous best method (NSROM) by a substantial 2.2%. Even with a lighter VGG-16 backbone, it reached 66.2% mIoU.
As shown in the figure above, the integration of saliency maps via the EPOM module (column e) provides a massive performance boost compared to using attention maps alone (column d), effectively filtering background noise and completing object shapes.
Conclusion
WegFormer demonstrates the potential of Transformers in the realm of weakly supervised learning. By addressing the limitations of CNNs with a global receptive field and specialized refinement modules, it achieves state-of-the-art performance. While the method currently relies on offline saliency detectors, future work may explore end-to-end integration or more advanced Transformer architectures to further push the boundaries of WSSS.
Summary updated