Abstract
The Segment Anything Model (SAM) has set a new benchmark for zero-shot generalization in computer vision. However, its performance degrades significantly in "underperformed scenes" characterized by camouflage, complex shadows, or specialized medical features. We present MCA-SAM, a multi-scale contrastive learning framework designed to enhance SAM's discriminative power via parameter-efficient adaptor learning. By integrating Token-level and Sample-level Contrastive Adaptors, our method refines both local patch details and global scene relationships. MCA-SAM achieves up to a 20% performance improvement over existing state-of-the-art methods while keeping the massive core SAM model frozen, adding only 0.2M tunable parameters.
Introduction
While foundation models like SAM excel in general object segmentation, they often fail in specialized domains where objects blend into their surroundings (camouflage) or are obscured by lighting conditions (shadows). Retraining such large models for specific tasks is computationally prohibitive. The common alternative, "adaptor learning," involves inserting small trainable layers into the frozen model. However, standard adaptors frequently lack the subtle discriminative features required to distinguish camouflaged objects from their backgrounds. MCA-SAM addresses this by using contrastive learning as a fine-tuning signal to specialize the model for difficult edge cases.
Methodology
MCA-SAM introduces a Multi-scale Contrastive Adaptor (MC-adaptor) framework that inserts lightweight modules into each layer of the frozen SAM encoder. The architecture leverages two synergistic contrastive signals:
- Token-level Contrastive Adaptor (TC-adaptor): This module focuses on the micro scale, applying a contrastive loss to individual image patches (tokens). It ensures that tokens from the same object are represented similarly while pushing dissimilar tokens apart, sharpening local perception.
- Sample-level Contrastive Adaptor (SC-adaptor): This module operates at the macro scale. By utilizing data augmentations and comparing different images within a training batch, it helps the model develop a robust global understanding of diverse scenes.
During training, the massive SAM encoder remains frozen, and only the lightweight adaptors and the mask decoder are updated, ensuring high parameter efficiency.
Experiments and Results
The model was evaluated on four challenging benchmarks: COD10K and CAMO (camouflage), ISTD (shadows), and Kvasir-SEG (medical polyps). MCA-SAM consistently outperformed state-of-the-art (SOTA) methods across all domains:
- Camouflage: Achieved a 20.0% relative improvement in Mean Absolute Error (MAE) on COD10K and a 6.0% improvement on CAMO.
- Shadows: Demonstrated a 15.4% improvement in Balance Error Rate (BER) on the ISTD dataset.
- Medical Imaging: Improved the mDice score by 7.9% on the Kvasir-SEG dataset.
Qualitative visualizations highlight that MCA-SAM produces significantly cleaner and more accurate masks than standard adaptor methods, which often struggle with boundary leakage in camouflaged or low-contrast environments.
Conclusion
MCA-SAM demonstrates that multi-scale contrastive learning is a powerful mechanism for adapting general foundation models to specialized, high-difficulty tasks. By balancing local refinement with global scene understanding, the framework achieves significant performance gains with negligible computational overhead. Future work will explore more advanced data augmentation strategies and higher-quality annotations to further improve segmentation in extreme camouflage scenarios.
Summary updated