VG-SAM: Visual In-Context Guided SAM for Universal Medical Image Segmentation
Medical image segmentation, driven by the intrinsic fractal characteristics of biological patterns, plays a crucial role in medical image analysis. Recently, universal image segmentation, which aims to build models that generalize robustly to unseen anatomical structures and imaging modalities, has emerged as a promising research direction. To achieve this, previous solutions typically follow the in-context learning (ICL) framework, leveraging segmentation priors from a few labeled in-context references to improve prediction performance on out-of-distribution samples. However, these ICL-based methods often overlook the quality of the in-context set and struggle with capturing intricate anatomical details, thus limiting their segmentation accuracy. To address these issues, we propose VG-SAM, which employs a multi-scale in-context retrieval phase and a visual in-context guided segmentation phase. Specifically, inspired by the hierarchical and self-similar properties in fractal structures, we introduce a multi-level feature similarity strategy to select in-context samples that closely match the query image, thereby ensuring the quality of the in-context samples. In the segmentation phase, we propose to generate multi-granularity visual prompts based on the high-quality priors from the selected in-context set. Following this, these visual prompts, along with the semantic guidance signal derived from the in-context set, are seamlessly integrated into an adaptive fusion module, which effectively guides the Segment Anything Model (SAM) with powerful segmentation capabilities to achieve accurate predictions on out-of-distribution query images. Extensive experiments across multiple datasets demonstrate the effectiveness and superiority of our VG-SAM over the state-of-the-art (SOTA) methods. Notably, under the challenging one-shot reference setting, our VG-SAM surpasses SOTA methods by an average of 6.61% in DSC across all datasets.
Authors
- Shuangping Huang
- Gang Wei (ORCID: https://orcid.org/0000-0002-1775-4760)
- Qingfeng Wang (ORCID: https://orcid.org/0000-0003-3666-4610)
- Yutao Qin (ORCID: https://orcid.org/0009-0002-3550-0059)
- Gang Dai (ORCID: https://orcid.org/0000-0001-8864-908X)
Institutions
- South China University of Technology (CN)
Publication Details
- Journal
- Fractal and Fractional
- Published
- 2025-11-08
- DOI
- https://doi.org/10.3390/fractalfract9110722
- Citations
- 1
- Primary Topic
- Advanced Neural Network Applications
- Type
- article
- Field-Weighted Citation Impact
- 1.28