Abstract
Weakly supervised semantic segmentation (WSSS) aims to reduce the high cost of pixel-level annotations by utilizing simpler labels such as image-level tags. However, image-level labels often result in sparse object seeds that fail to cover the entire object. This paper introduces AffinityNet, a framework that learns to predict semantic affinity between adjacent pixels to propagate these sparse seeds into complete segmentation masks. By employing a random walk based on learned affinities, the model generates high-quality pseudo-ground truth labels. Evaluated on the PASCAL VOC 2012 benchmark, AffinityNet achieves state-of-the-art performance for image-level supervised methods, reaching 63.7% mIoU and narrowing the gap with fully supervised models.
Introduction
Semantic segmentation is a fundamental task in computer vision, yet its reliance on dense pixel-level annotations makes it prohibitively expensive for large-scale applications. Weakly Supervised Semantic Segmentation (WSSS) offers a more scalable alternative by leveraging cheaper supervision like image-level labels. The primary challenge in WSSS is the "discriminative region" problem: Class Activation Maps (CAMs) typically only highlight the most salient parts of an object (e.g., the head of a bird) rather than its full extent. This paper addresses the need for a robust mechanism to expand these initial seeds into accurate, full-body segmentation masks.
Methodology
The proposed framework consists of a three-stage pipeline designed to bridge the gap between image-level tags and pixel-level masks.
1. Seed Generation (CAMs)
A standard classification network is trained to produce Class Activation Maps (CAMs). These maps are manipulated to identify "confident" areas of objects and background, while uncertain areas are treated as neutral.
2. Learning AffinityNet
The core innovation is AffinityNet, a second network trained to predict the semantic affinity (similarity) between pairs of adjacent pixels. It is trained using the confident regions from the CAMs as pseudo-labels. The network learns that adjacent pixels with similar features likely belong to the same semantic entity.
3. Random Walk Propagation
Once trained, AffinityNet generates an affinity matrix for new images. The sparse CAM seeds are then "diffused" across the image using a random walk based on these affinities. This process allows activation scores to spread into nearby areas deemed semantically similar, effectively "filling in" the object.
Finally, these refined masks serve as synthetic ground truth to train a standard, fully-supervised segmentation network (e.g., ResNet38).
Results
The framework was evaluated on the PASCAL VOC 2012 segmentation benchmark.
- State-of-the-Art Performance: On the test set, the model achieved a 63.7% mIoU, significantly outperforming previous image-level supervised methods.
- Competitive Supervision: Remarkably, the model outperformed several methods using stronger supervision, such as bounding boxes (62.2%) or extra video data (58.7%).
- Closing the Gap: The model achieved approximately 77% of the performance of its fully-supervised counterpart, demonstrating the effectiveness of affinity-based synthetic labels.
Discussion and Key Insights
- Class-Agnostic Affinities: AffinityNet learns general representations of object boundaries and textures that generalize across different semantic classes.
- Efficiency: By focusing on local affinities within a small radius, the model avoids computational explosions while enabling global information propagation via the random walk.
- Independence: Unlike previous WSSS methods, this framework does not rely on external saliency detectors or pre-computed superpixels, reducing external bias.
Conclusion
AffinityNet demonstrates that semantic affinity is a powerful bridge between image-level labels and pixel-level masks. While the method is dependent on the quality of initial CAM seeds and sensitive to certain hyperparameters, it significantly advances the state-of-the-art in WSSS. Future work may explore applying these learned affinities to boundary detection and cross-domain transfer learning.
Summary updated