Evaluation study on SAM 2 for class-agnostic instance-level segmentation

Jialun Pei, Zhangjun Zhou, T Y ZhangCAAI 2024

TL;DR

This paper provides a comprehensive evaluation of SAM2, the latest iteration of the Segment Anything Model, on class-agnostic instance-level segmentation tasks. While SAM2 shows strong performance with bounding box prompts, particularly for salient and camouflaged objects, its automatic mode and fine-grained segmentation capabilities lag behind expectations, highlighting areas for future improvement and adapter development.

What Problem Does This Paper Address?

The advent of large foundation models like SAM has revolutionized image segmentation, offering unprecedented zero-shot capabilities. SAM2, the successor to SAM, promises further improvements. However, its performance across diverse and challenging instance-level segmentation scenarios, especially those requiring fine-grained detail or dealing with occlusions and subtle features, remains largely unquantified. This paper aims to bridge this gap by systematically evaluating SAM2 on three specific instance-level tasks: Salient Instance Segmentation (SIS), Camouflaged Instance Segmentation (CIS), and Shadow Instance Detection (SID), as well as on the high-resolution Dichotomous Image Segmentation (DIS) benchmark for fine-grained analysis.

Methods

The researchers evaluated SAM2 using two primary prompting strategies: an "automatic" mode (likely relying on default or minimal prompts) and a "ground truth bounding box" (GT-Bbox) mode, where the model is explicitly provided with the object's bounding box. This allowed for a nuanced understanding of SAM2's performance under different levels of guidance. They compared SAM2 against the original SAM and various state-of-the-art task-specific methods across the chosen benchmarks. For the DIS task, a specific strategy was employed to select the best binary mask from SAM2's multiple outputs using a maximum Intersection over Union (IoU) criterion.

Datasets

The study utilized several established datasets for evaluation:

  • Salient Instance Segmentation (SIS): ILSO, SIS10K, SOC, and SIP.
  • Camouflaged Instance Segmentation (CIS): COD10K and NC4K.
  • Shadow Instance Detection (SID): SOBA-challenge and SOBA-test.
  • Dichotomous Image Segmentation (DIS): DIS5K, further broken down into DIS-VD, DIS-TE1, DIS-TE2, DIS-TE3, and DIS-TE4 to assess performance across varying difficulty levels.

Key Insights and Ideas

  • Prompting is Key: SAM2's performance is highly dependent on the prompt. While it excels with GT-Bbox inputs, its automatic mode often struggles, especially in challenging scenarios like CIS. This underscores the importance of guided segmentation for SAM2.
  • SAM2 vs. SAM: In GT-Bbox mode, SAM2 generally outperforms SAM across the tested tasks, demonstrating significant improvements. However, in automatic mode, SAM2 often falls short of SAM, suggesting a potential trade-off or different design philosophy between the two models.
  • Fine-grained Segmentation is a Weakness: SAM2 does not appear to be particularly adept at segmenting high-resolution, fine details. Its performance on the DIS benchmark, which requires precise boundary delineation, was notably poor, even with box prompts.
  • Shadow Detection Challenges: While SAM2 can segment shadow instances effectively with box prompts, it struggles with the crucial aspect of "shadow matching" (i.e., associating a shadow with its corresponding object), a limitation not present in some task-specific methods.
  • Model Size Doesn't Always Help: For SID, increasing the backbone size of SAM2 (and SAM) did not consistently lead to better performance, and in some cases, even degraded it, particularly in automatic mode. This suggests that simply scaling up the model might not be the optimal path for improving performance in certain tasks.

Key Results

  • SIS: SAM2-L achieved an AP of 82.2 on ILSO and 83.1 on SOC in GT-Bbox mode, outperforming SAM-H. However, in automatic mode, SAM2-L scored significantly lower (e.g., 49.1 AP on ILSO vs. SAM-H's 72.2).
  • CIS: SAM2-L with a large backbone achieved a remarkable AP of 68.8 on COD10K in GT-Bbox mode, surpassing all other models. In automatic mode, however, SAM2's AP was as low as 10.6.
  • SID: SAM2-T achieved AP scores of 51.9 on SOBA-challenge and 58.9 on SOBA-test in GT-Bbox mode, outperforming SAM models. However, qualitative results showed challenges in shadow matching.
  • DIS: SAM2 models showed marked improvement over SAM in GT-Bbox mode, with SAM2-B+ achieving an Fmax of 0.765 on DIS-VD. However, overall performance was still significantly lower than fully supervised methods, and the HCE metric indicated struggles with detailed structures.

Limitations and Future Work

The authors acknowledge that SAM2's reliance on GT-Bbox prompts might introduce a slight unfairness in comparisons. A significant limitation is SAM2's poor performance on fine-grained segmentation tasks like DIS, where it struggles to capture intricate details. The lack of instance-shadow IoU matching functionality is also noted as a limitation for shadow detection.

Future work suggested by the authors includes fine-tuning SAM2 and developing specialized adapters to enhance its performance, particularly for tasks requiring fine-grained segmentation and improved object localization in challenging scenarios. The findings also suggest that simply increasing model size is not always beneficial and that alternative approaches might be needed for certain tasks.

Summary updated

BibTeX
@misc{pei2024evaluation,
  author = {Jialun Pei and Zhangjun Zhou and T Y Zhang},
  title = {{Evaluation study on SAM 2 for class-agnostic instance-level segmentation}},
  year = {2024},
  eprint = {2409.02567},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.02567},
}
Figure