Abstract
Foundation models like the Segment Anything Model (SAM) demonstrate remarkable zero-shot capabilities but often falter under distribution shifts, such as those found in medical imaging or camouflaged object detection. We present SlotSAM, a framework that enhances SAM's robustness through object-centric learning. By reconstructing high-level semantic features into "slots" and injecting them as "Object Tokens" into the decoder, SlotSAM enables self-supervised adaptation to new domains without manual labels. Our approach achieves significant performance gains across diverse datasets, particularly in specialized fields like medical imaging.
Introduction
The Segment Anything Model (SAM) has set a new standard for promptable image segmentation. However, its performance degrades when encountering "out-of-distribution" (OOD) data—such as low-contrast medical scans or highly camouflaged animals—and "prompt shift," where user inputs (points or boxes) differ from training distributions.
Existing adaptation methods often require expensive manual labeling. SlotSAM addresses these challenges by integrating object-centric learning, mimicking human cognition's ability to abstract scenes into distinct entities. This allows the model to "understand" object boundaries and global context autonomously, facilitating adaptation to niche domains where labeled data is scarce.
Methodology: The SlotSAM Framework
SlotSAM employs a two-stage self-supervised process to bridge the gap between general foundation models and specialized downstream tasks.
Stage 1: Object-Centric Representation Acquisition
Unlike traditional Slot Attention that reconstructs raw pixels, SlotSAM focuses on reconstructing high-level semantic features from the SAM encoder. This approach avoids the noise of low-level textures and forces the model to compress unstructured data into "slots"—compact mathematical representations of objects within a scene.
Stage 2: Object-Centric Representation Injection
These slots are transformed into an "Object Token" via a Multi-Layer Perceptron (MLP) and injected directly into the SAM mask decoder. This token provides the decoder with structural anchors and global context, significantly improving mask accuracy even with vague or coarse prompts.
Self-Supervised Bootstrapping
To enable label-free training, SlotSAM utilizes a teacher-student (anchor-student) framework. The student model learns to predict consistent masks across different image augmentations, guided by the anchor model. Periodically, the student's improved weights are copied back to the anchor, allowing the system to iteratively improve its internal representations.
Experimental Results
SlotSAM was evaluated across seven datasets spanning natural images (COCO, Pascal VOC), medical imaging (kvasir-SEG, ISIC), camouflaged objects (CAMO, COD10K), and robotics (OCID).
The results demonstrate SlotSAM's superior generalization:
- Medical Imaging Mastery: On the kvasir-SEG polyp dataset, SlotSAM achieved a mean Intersection over Union (mIoU) exceeding 90%, outperforming the nearest competitor, WESAM, by over 18% in specific prompt scenarios.
- Camouflage Detection: On the COD10K dataset, SlotSAM showed an average improvement of over 3% compared to existing state-of-the-art methods.
- Robustness to Prompt Shift: SlotSAM consistently outperformed baseline models across various prompt types (box, point, poly), indicating that the Object Token effectively compensates for imprecise user inputs.
Discussion and Conclusion
A key insight from this work is that reconstructing high-level features is more effective for foundation model adaptation than pixel-level reconstruction. By focusing on semantic "signal" rather than textural "noise," SlotSAM learns robust object-centric representations. Furthermore, the Object Token's compatibility with SAM's existing architecture makes it a versatile tool for task-agnostic adaptation.
While SlotSAM represents a significant advancement, future work could investigate the dynamics of slot distributions across different domains or explore the generative potential of these object-centric representations for controlled image synthesis. Ultimately, SlotSAM proves that foundation models can overcome distribution shifts by refining how they interpret the data they already possess.
Summary updated