Abstract
The Segment Anything Model (SAM) has demonstrated remarkable zero-shot generalization in common computer vision tasks but often underperforms in specialized domains such as medical imaging or camouflaged object detection. We present SU-SAM (Simple Unified SAM), a parameter-efficient framework that adapts SAM to these "underperformed scenes" without task-specific architectural modifications. By exploring various structural configurations of adapters and Low-Rank Adaptation (LoRA), SU-SAM achieves state-of-the-art performance across nine diverse datasets while keeping over 88% of the model parameters frozen. Our findings suggest that a simple, unified adaptation strategy is sufficient to unlock SAM's potential in highly specialized domains.
Introduction
The Segment Anything Model (SAM) represents a milestone in foundation models for image segmentation. However, its performance degrades significantly when applied to specialized data distributions—medical scans, industrial defects, or camouflaged objects—where the visual cues differ from the general-purpose training data.
Current adaptation strategies often rely on "heavy handcrafting," incorporating task-specific pre-processing, auxiliary inputs (like edge maps), or complex post-processing. While effective, these methods lack generality and increase system complexity. SU-SAM addresses this by proposing a unified, parameter-efficient fine-tuning (PEFT) approach that treats adaptation as a structural alignment problem rather than a task-specific engineering challenge.
Methodology: Structural Variants of SU-SAM
The core of SU-SAM lies in freezing the original SAM parameters and inserting lightweight, trainable modules into the Transformer blocks. We investigate four distinct structural variants to determine the most effective way to inject domain-specific knowledge:
- Series SU-SAM: Adapters are integrated sequentially between the multi-head attention and the Feed-Forward Network (FFN).
- Parallel SU-SAM: Adapters operate in parallel with the attention and FFN layers, with their outputs added back to the main residual stream.
- Mixed SU-SAM: A hybrid configuration utilizing a serial adapter for the attention layer and a parallel adapter for the FFN.
- LoRA SU-SAM: Employs Low-Rank Adaptation on the query and value projection matrices within the attention mechanism.
By removing auxiliary components like edge extractors or specialized data augmentations, SU-SAM serves as a "plug-and-play" solution adaptable to any segmentation task.
Experimental Evaluation
We evaluated SU-SAM across nine datasets spanning six challenging tasks, including salient object segmentation (DUTS), complex shapes (DIS-TE4), shadow masking (SBU), camouflaged object detection (COD10K, CAMO, CHAMELEON), medical imaging (ISIC, ColonDB), and industrial defect segmentation (CDS2K).
Key Results
Our experiments yielded several critical insights:
- Superior Accuracy: SU-SAM consistently outperformed vanilla SAM. On the DUTS dataset, the Mean Absolute Error (MAE) was reduced by an order of magnitude, from 0.298 to 0.029.
- State-of-the-Art Performance: SU-SAM surpassed specialized SOTA models. For instance, on the COD10K dataset, it achieved an MAE of 0.025, outperforming SegMaR (0.034).
- The "Mixed" Advantage: The Mixed SU-SAM variant generally provided the best balance of accuracy, suggesting that varying the insertion form (series vs. parallel) across different components of the Transformer block is beneficial.
- Efficiency: Adapter-based variants require training only ~11.4% of parameters (10.65M), while the LoRA variant is extremely lean at 0.16% (0.15M parameters), albeit with a minor performance trade-off.
Discussion and Conclusion
The success of SU-SAM demonstrates that SAM's internal representations are robust enough to handle specialized scenes if properly aligned via simple PEFT modules. The framework's ability to maintain high performance across diverse tasks when trained as a single "generalized model" proves its universal applicability. Future work will focus on bridging the performance gap between the ultra-efficient LoRA variant and the more accurate Adapter variants.
Summary updated