TL;DR
The SeSAM framework successfully adapts the Segment Anything Model (SAM)—originally designed for instance segmentation—to the task of weakly supervised semantic segmentation. By intelligently bridging the gap between class-level weak labels and instance-level priors, SeSAM achieves up to 94% of fully supervised performance while slashing the annotation budget by 98%.
What Problem Does This Paper Address?
Training deep learning models for semantic segmentation typically requires dense, pixel-level annotations. Gathering these fine-grained labels is notoriously slow and expensive (e.g., taking around 90 minutes per image for the Cityscapes dataset). Weakly Supervised Semantic Segmentation (WSSS) attempts to solve this by training models on cheaper alternatives like points, scribbles, or coarse bounding boxes.
Recently, foundation models like Meta's Segment Anything Model (SAM) have emerged as powerful zero-shot instance segmenters. However, you cannot simply plug SAM into a semantic segmentation pipeline. SAM is instance-aware and class-agnostic—it excels at finding "objects" but has no concept of semantic categories (like "car" or "pedestrian"). Furthermore, if you naively prompt SAM with weak semantic labels, it faces three major hurdles:
- Instance Ambiguity: Semantic labels often group multiple disconnected objects of the same class together, which confuses SAM's instance-centric design.
- Suboptimal Prompting: Standard point-sampling strategies often fail to capture the full extent of an object.
- Granularity Ambiguity: SAM outputs multiple valid mask granularities (whole, part, and subpart) for a single prompt, and choosing the right one automatically is difficult.
This paper introduces SeSAM to systematically resolve these challenges.
Methods
SeSAM adapts SAM for semantic segmentation through a three-step refinement pipeline integrated into a semi-supervised teacher-student framework:
- Instance Separation: To satisfy SAM's instance-based nature, SeSAM applies connected-component labeling to the weak class masks, isolating individual object candidates before prompting.
- Skeleton-Based Point Sampling: Instead of random sampling or picking points based on network confidence, SeSAM computes a normalized distance field to find the topological "skeleton" of the weak mask. It then uses a grid-based approach to sample points uniformly along this central structure, ensuring maximum object coverage and edge refinement.
- Weak-Label-Aware Mask Selection: To select the best mask from SAM's multi-granularity outputs, SeSAM evaluates candidate masks using a two-fold criterion: maximizing intersection with the weak label (to ensure high recall) while penalizing masks that excessively bleed past the weak label's boundaries (to ensure high precision).
This pipeline is embedded into an iterative semi-supervised learning loop where a teacher network generates pseudo-labels, which are then expanded and refined by SAM to train a student network.
Datasets
The authors evaluated SeSAM across three widely used benchmarks:
- PASCAL VOC 2012: A standard object-centric benchmark with 20 classes.
- Cityscapes: A challenging urban scene dataset featuring complex multi-class co-occurrences and fine/coarse annotations.
- ADE20k: A highly complex dataset containing 150 indoor and outdoor semantic categories.
Key Insights and Ideas
- Scribbles Outperform Coarse Masks: Counterintuitively, models trained on scribble annotations generated via SeSAM often outperformed those trained on manually drawn coarse masks. The authors discovered that manual coarse masks suffer from severe human annotation errors (e.g., mislabeling walls as fences), whereas scribbles derived from fine annotations preserve cleaner boundary definitions.
- The Power of the Skeleton: Sampling points along an object's topological skeleton provides far more stable and comprehensive structural cues to SAM than relying on high-confidence clusters from a neural network, which often collapse onto a small sub-part of the object.
- SAM 1 vs. Newer Versions: When comparing mask generation quality, the original SAM actually outperformed SAM 2 and SAM 3 in this specific static image refinement task, demonstrating a superior trade-off between precision and recall for image-based segmentation.
Key Results
SeSAM consistently outperformed prior state-of-the-art WSSS methods (like AGMM) across all datasets and weak annotation types.
- Performance vs. Cost: On the Cityscapes dataset using a SegFormer architecture, SeSAM with scribble annotations achieved 71.6% mIoU—reaching roughly 94% of the fully supervised baseline (76.0% mIoU) while requiring only 2% of the annotation time budget.
- Closing the Gap on Complex Data: On the highly complex ADE20k dataset, SeSAM with coarse masks achieved 37.3% mIoU, coming remarkably close to the fully supervised upper bound of 38.1% mIoU.
- Computational Efficiency: Compared to previous methods like AGMM, SeSAM cut training time nearly in half (from 1.56 to 0.81 sec/iter) and drastically reduced GPU memory usage (from 60.8 GB to 22.7 GB), making WSSS viable on standard hardware for datasets with many classes.
Limitations and Future Work
Despite its strong performance, SeSAM has a few notable limitations:
- Amorphous "Stuff" Classes: SAM is inherently object-centric, meaning it struggles with "stuff" classes that lack distinct shapes, such as vegetation, sky, or open water.
- Thin Structures: For very thin objects like poles, traffic signs, or fences, SAM frequently fails by merging the object mask into the surrounding background.
- Error Propagation: Because SeSAM relies on weak labels to guide mask selection, any initial systematic errors in the ground-truth weak annotations are faithfully propagated into the final training targets.
Summary updated