Semantic-aware SAM for Point-Prompted Instance Segmentation

Zhaoyang Wei, Pengfei Chen, Xuehui Yu, Guorong Li, Jianbin Jiao, Zhenjun Han

TL;DR

SAPNet (Semantic-Aware Instance Segmentation Network) bridges the gap between cheap point-prompted annotations and expensive pixel-level masks by making the Segment Anything Model (SAM) category-aware. By combining Multiple Instance Learning (MIL) with novel geometric and refinement strategies, SAPNet overcomes SAM's semantic ambiguity and standard weak-supervision pitfalls to achieve state-of-the-art instance segmentation performance.

What Problem Does This Paper Address?

Training deep learning models for instance segmentation typically requires fully supervised datasets with detailed, pixel-level mask annotations. Creating these masks is notoriously time-consuming and expensive. Weakly supervised instance segmentation (WSIS) attempts to use cheaper alternatives like bounding boxes or single-point prompts.

Recently, foundation models like Meta's Segment Anything Model (SAM) have revolutionized zero-shot mask generation from simple point prompts. However, SAM has a major flaw for specific vision tasks: it is class-agnostic. It can find boundaries perfectly, but it doesn't know what it is looking at. This leads to three major challenges:

  1. Semantic Ambiguity: Given a point on a person, SAM might output highly confident masks for "clothes," "trousers," or the whole "person" indiscriminately.
  2. The "Group" Problem: When objects of the same category are close together, standard selection methods often merge them into a single mask.
  3. The "Local" Problem: Weakly supervised classifiers often focus only on the most discriminative part of an object (e.g., segmenting just a bird's wing instead of its entire body).
Figure 1. Three Challenges Brought by SAM and single-MIL. Orange dash box illustrates that semantic ambiguity in SAM- generated masks, where it erroneously assigns higher scores to non-object categories like clothes, despite the person being our de- sired target. Green dash box depicts a comparison between mask proposals using single-MIL and SAPNet. It illustrates two primary challenges: ‘group’, where segmentation encounters difficulties in isolating individual targets among adjacent objects of the same category, and ‘local’, where MIL favors foreground-dominant re- gions, resulting in overlooked local details.

This paper introduces SAPNet to solve these issues, turning SAM into a precise, category-specific segmenter using only single-point prompts.

Methods

SAPNet uses a dual-branch architecture. One branch focuses on generating and refining high-quality pseudo-labels (masks) during training, while the other branch trains a standard instance segmenter (SOLOv2) using those pseudo-labels.

The core innovation lies in how the pseudo-labels are selected and refined:

  • Proposal Selection Module (PSM): SAM generates multiple class-agnostic mask proposals from a point prompt. The PSM uses an MIL paradigm to evaluate these proposals and select the one that best matches the target object category.
  • Point Distance Guidance (PDG): To solve the "group" problem, PDG introduces a spatial penalty mechanism. It calculates the Euclidean distance between annotated points of identical categories. If a mask proposal mistakenly swallows multiple distinct object points, it is heavily penalized.
  • Positive and Negative Proposals Generator (PNPG) & Proposals Refinement Module (PRM): This pair refines the initial bounding boxes. PNPG samples background noise and object sub-parts to create a strict set of negative examples, forcing the PRM to reject incomplete or overly large boxes.
  • Box Mining Strategy (BMS): To combat the "local" problem, BMS adaptively expands and merges localized box proposals based on their intersection-over-union (IoU) and size, ensuring the final mask covers the entire object boundary.
Figure 2. The framework of SAPNet comprises two components: one for generating mask proposals and another for their utilization in instance segmentation. The process starts with generating category-agnostic mask proposals using point prompts within a visual foundation model. That is followed by an initial proposal selection via MIL combined with PDG. Next, the PRM refines these proposals using positive and negative samples from PNPG, capturing global object semantics. Finally, augmented with the multi-mask proposal supervision, the segmentation branch aims to improve segmentation quality.

Datasets

The authors evaluated SAPNet on two widely accepted benchmarks:

  • MS COCO 2017: Containing 118k training and 5k validation images across 80 object categories.
  • Pascal VOC 2012 / SBD: Consisting of 20 categories with 10,582 training images and 1,449 validation images.

Key Insights and Ideas

  • Foundation Models Need Semantic Anchors: SAM's internal scoring mechanism favors structural definition over semantic intent. Without a classification layer like SAPNet's MIL module, the top-scoring mask from SAM will frequently target sub-components (like a shirt) rather than the whole object (the person).
  • Geometry Can Fix Weak Supervision: The "group" problem is notoriously difficult in weakly supervised learning. SAPNet elegantly solves this by using the geometric distance between point prompts as a regularizer, proving that simple spatial priors can prevent models from merging adjacent objects.
  • Embrace and Expand Local Biases: Instead of trying to force the neural network not to look at highly discriminative local features, the Box Mining Strategy accepts this bias as a starting anchor and dynamically expands the boundaries outward to capture the full object.

Key Results

SAPNet achieves state-of-the-art performance in point-prompted instance segmentation, effectively bridging the gap to more expensive supervision types.

  • MS COCO: SAPNet achieved 31.2 mAP using a ResNet-50 backbone under a standard 1x training schedule, outperforming the previous best point-supervised method (BESTIE) by a massive 13.5 AP. Under a 3x schedule with a ResNet-101 backbone, it reached 34.6 mAP, actually outperforming box-supervised methods like BoxInst (33.2 mAP) and nearly matching fully supervised baselines.
  • Pascal VOC: SAPNet achieved 64.8 $AP_{50}$, outperforming box-supervised methods (BoxInst at 61.4 and DiscoBox at 62.2) and reaching 92.3% of the performance of a fully supervised Mask R-CNN.
Figure 4. The comparative visualization between SAM-top1 and SAPNet is presented, showcasing SAM’s segmentation outcomes in green masks and our results in yellow. The orange and red bounding boxes highlight the respective mask boundaries.

Limitations and Future Work

While SAPNet demonstrates impressive robustness, it relies on several hyperparameter thresholds for its Box Mining Strategy ($T_{min1}, T_{min2}$) and Negative Proposal Generation ($T_{neg1}, T_{neg2}$). Tuning these across highly divergent datasets could require empirical tweaking.

Additionally, the training pipeline is relatively complex, requiring multi-stage proposal filtering and refinement. Future work could focus on streamlining these modules into a more unified, single-stage end-to-end framework.

Summary updated

BibTeX
@misc{wei2023semantic,
  author = {Zhaoyang Wei and Pengfei Chen and Xuehui Yu and Guorong Li and Jianbin Jiao and Zhenjun Han},
  title = {{Semantic-aware SAM for Point-Prompted Instance Segmentation}},
  year = {2023},
  eprint = {2312.15895},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.15895},
}
Figure