Abstract
While the Segment Anything Model (SAM) has demonstrated remarkable zero-shot performance in general computer vision, its direct application to medical imaging is often limited by a lack of domain-specific expertise. Fine-tuning such massive foundation models is computationally prohibitive for many clinical applications. This paper introduces SAMAug, a lightweight framework that leverages SAM’s "perceptual priors"—specifically its generated masks and boundary maps—as additional input channels to enhance standard medical segmentation models. By treating SAM as a frozen feature generator, SAMAug significantly improves the performance of architectures like U-Net and HSNet across diverse tasks including polyp, cell, and gland segmentation without the need for intensive fine-tuning.
Introduction
Foundation models have shifted the landscape of artificial intelligence, providing robust general-purpose capabilities. In the realm of computer vision, the Segment Anything Model (SAM) stands out for its ability to identify structures across millions of natural images. However, medical imaging presents a unique challenge: identifying polyps, cell nuclei, or malignant glands requires specialized knowledge that general-purpose models often lack.
Existing strategies to bridge this gap typically involve fine-tuning SAM on medical datasets. While effective, this approach is memory-intensive and requires substantial hardware resources. SAMAug addresses this problem by asking a different question: Can we utilize SAM’s general ability to perceive boundaries and structures to assist smaller, specialized medical models? By using SAM as a "perceptual prior" generator, researchers can augment the input space of task-specific models, combining the broad structural awareness of a foundation model with the precision of a domain-specific segmenter.
The SAMAug Framework
SAMAug operates on the principle of input augmentation rather than model adaptation. The framework consists of four primary components: prior map generation, input fusion, task-specific training, and entropy-based inference.
1. Generating Prior Maps
Using SAM’s "grid prompt" mode—where the model attempts to segment all identifiable structures in an image—the framework extracts two critical pieces of information:
- Segmentation Prior Map: A map where pixel values are derived from the "stability score" of the masks identified by SAM. This provides a signal regarding SAM's confidence in the underlying structures.
- Boundary Prior Map: A map that highlights the exterior boundaries of all masks detected by SAM, emphasizing structural transitions that might be subtle in raw medical scans.
2. Input Augmentation and Training
These maps are fused with the original raw image. For a standard grayscale medical image, the input is transformed into a three-channel tensor: [Raw Image, Segmentation Prior, Boundary Prior].
A standard medical segmentation model (such as U-Net, Swin-UNet, or HSNet) is then trained on these augmented images. Crucially, the parameters of the SAM model remain fixed (frozen) throughout this process. This makes the training phase highly efficient, as the computational burden is limited to the smaller downstream model.
3. Smart Inference via Entropy Selection
To account for instances where SAM might produce irrelevant or noisy priors, the authors implemented an "Entropy-based selection" mechanism during testing. The model generates two predictions: one based on the raw image and one based on the SAM-augmented image. The system then automatically selects the prediction with the lower entropy (higher certainty), acting as a safety net against potential failures in the foundation model's perceptual priors.
Experimental Evaluation
The researchers evaluated SAMAug across three distinct and challenging medical imaging domains:
- Cell Segmentation: Using the MoNuSeg dataset (H&E stained tissue), the team tested various architectures. A standard U-Net saw its Aggregated Jaccard Index (AJI) increase from 58.36 to 64.30, with a nearly 7% improvement in F-score.
- Polyp Segmentation: Tested across five benchmarks (CVC-300, CVC-ClinicDB, Kvasir, CVC-ColonDB, and ETIS), SAMAug significantly boosted the performance of the state-of-the-art HSNet model, particularly on the CVC-ClinicDB and CVC-ColonDB datasets.
- Gland Segmentation: On the GlaS histology dataset, the U-Net’s F-score improved from 79.33 to 82.50, demonstrating the framework's versatility across different tissue types.
Key Insights
- SAM as a Perceptual Prior: Even without medical training, SAM is adept at finding "something" with a boundary. By feeding these guesses into a U-Net, the downstream model does not have to learn basic shape recognition from scratch; it only needs to learn which of SAM's identified shapes are clinically relevant.
- Efficiency and Accessibility: Because SAM is frozen, SAMAug avoids the massive VRAM requirements associated with fine-tuning foundation models, making high-performance segmentation more accessible to researchers with limited hardware.
- Robustness: The entropy-based selection at inference time ensures that the model remains robust even when SAM’s zero-shot performance is suboptimal for a specific scan.
Limitations and Future Directions
While SAMAug offers a powerful boost to performance, it introduces additional inference latency because each test image must first pass through SAM to generate the prior maps. Furthermore, the current implementation uses a simple channel-stacking approach for fusion. Future work may explore more sophisticated, learnable fusion modules to better integrate SAM’s priors. Additionally, the authors intend to investigate how these augmented signals can be used to provide doctors with better clinical uncertainty estimations, highlighting areas where a model might be struggling to interpret a scan.
Conclusion
SAMAug demonstrates that foundation models like SAM can be effectively utilized in specialized domains without the need for expensive fine-tuning. By treating SAM as a source of structural priors, medical imaging models can achieve significant performance gains, bridging the gap between general-purpose artificial intelligence and the high-precision requirements of clinical diagnostics.
Summary updated