Abstract
The deficiency of segmentation labels is one of the main obstacles to semantic segmentation in the wild. To alleviate this issue, we present a novel framework that generates segmentation labels of images given their image-level class labels. In this weakly supervised setting, trained models have been known to segment local discriminative parts rather than the entire object area. Our solution is to propagate such local responses to nearby areas which belong to the same semantic entity. To this end, we propose a Deep Neural Network (DNN) called AffinityNet that predicts semantic affinity between a pair of adjacent image coordinates. The semantic propagation is then realized by random walk with the affinities predicted by AffinityNet. More importantly, the supervision employed to train AffinityNet is given by the initial discriminative part segmentation, which is incomplete as a segmentation annotation but sufficient for learning semantic affinities within small image areas. Thus the entire framework relies only on image-level class labels and does not require any extra data or annotations. On the PASCAL VOC 2012 dataset, a DNN learned with segmentation labels generated by our method outperforms previous models trained with the same level of supervision, and is even as competitive as those relying on stronger supervision.
Introduction
Semantic segmentation—the task of assigning a class label to every single pixel in an image—is a fundamental challenge in computer vision. However, its progress is often hindered by the high cost of data acquisition. Creating ground-truth pixel-level masks for thousands of images is prohibitively expensive and time-consuming.
To address this, researchers have turned to Weakly Supervised Semantic Segmentation (WSSS). WSSS leverages cheaper, more accessible labels such as bounding boxes or simple image-level tags (e.g., "dog," "car"). While image-level tags indicate the presence of an object, they provide no information regarding its shape or precise location. Most existing WSSS methods utilize Class Activation Maps (CAMs) to identify object locations. However, CAMs typically highlight only the most "discriminative parts" of an object (e.g., the head of a bird) while ignoring the rest of the body (e.g., wings and tail). The core challenge lies in expanding these sparse, incomplete "seeds" into accurate, full-body masks without requiring additional human intervention.
Methodology
The proposed framework addresses the limitations of CAMs through a multi-stage pipeline centered on a novel architecture called AffinityNet.
Pipeline Overview
The process consists of three primary stages as illustrated in Figure 1:
- Computing Initial Seeds: The pipeline begins with standard CAMs to identify the most confident regions for both objects and the background.
- Generating Affinity Labels: From these confident CAM regions, pairs of adjacent pixels are sampled. If both pixels reside within the same confident class area, they are labeled as having affinity (1); if they are in different areas, they have no affinity (0).
- Training AffinityNet: This network is trained to predict the semantic affinity between pairs of adjacent coordinates. Crucially, it is class-agnostic, learning the general concept of "belonging to the same object" based on local appearance and boundaries.
- Random Walk Propagation: The predicted affinities serve as transition probabilities in a random walk. This process diffuses the sparse CAM activations across the image, following learned semantic boundaries until the entire object is covered.
- Final Segmentation Training: The resulting synthesized masks are used as "pseudo-ground truth" to train a standard, fully supervised segmentation network (e.g., DeepLab or ResNet38).
AffinityNet Architecture
The AffinityNet architecture is designed to extract features that are sensitive to semantic boundaries. By focusing on local correctness, the authors extract reliable supervision from noisy CAMs. The network learns to recognize boundaries and similarities regardless of the specific object class, allowing it to generalize across various categories in the dataset.
Key Insights
- Local Correctness: While CAMs are globally incomplete, they are often locally correct. AffinityNet leverages this by focusing on small-scale affinities to derive reliable supervision.
- Class-Agnostic Learning: By training the model to recognize object boundaries generally, it develops a robust representation of object shapes that transfers well across different classes.
- Self-Contained Loop: Unlike many previous WSSS approaches, this method does not require external data sources like video motion cues or pre-trained saliency models. It is a self-improving loop that refines its own labels.
Results and Evaluation
The framework was primarily evaluated on the PASCAL VOC 2012 dataset, a benchmark for object segmentation. The models were also pre-trained on ImageNet.
- State-of-the-Art Performance: On the PASCAL VOC 2012 test set, the method achieved a 63.7% mIoU (mean Intersection over Union), surpassing previous weakly supervised leaders such as AdvErasing and SEC.
- Comparison with Full Supervision: Remarkably, this weakly supervised approach outperformed the original FCN (Fully Convolutional Network), which was the gold standard for fully supervised segmentation just a few years prior.
- Label Quality: The synthesized labels were of sufficient quality that a model trained on them recovered 77% to 86% of the performance of a model trained on expensive, human-annotated pixel labels.
Conclusion and Future Work
AffinityNet demonstrates that high-quality segmentation labels can be generated using only image-level supervision by learning and propagating semantic affinities. While successful, the framework still faces challenges. It remains dependent on the quality of initial CAM seeds; if a classifier fails to activate on an object, AffinityNet has no starting point for propagation. Future work could explore more streamlined, end-to-end training approaches and further refine boundary details to reduce reliance on post-processing steps like dense Conditional Random Fields (dCRF).
Summary updated