arXiv:2609.31160cs.CVSep 2026

Manuscript Offprint

arXiv:2609.31160

ReG-SAM: Reference Graph-Driven SAM for 2D Foundational Vessel Segmentation

Donghang Lyu, Zichen Zhang, Oleh Dzyubachyk, Marius Staring

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Vessel segmentation in medical images is essential for many clinical tasks, ranging from diagnosis to treatment planning. However, it remains challenging due to complex vascular morphology and diverse imaging conditions. Existing deep learning methods rarely aim at building a generalizable vessel segmentor across anatomies and modalities. While the Segment Anything Model (SAM) has shown promise for medical image segmentation, its original design does not fully exploit vascular morphology and struggles with fine-grained vascular structures, leading to suboptimal performance. In this paper, we propose ReG-SAM, a SAM-based framework tailored to 2D vessel segmentation that leverages reference graph set for enhancing vascular representations. Specifically, we introduce two modality-aware representations derived from the reference masks: graph prompt embeddings (GPEs) that encode global spatial features from graphs, and vascular prototype embeddings (VPEs) that capture fine-grained modality-specific vessel characteristics from multi-scale feature maps and vascular masks. Since both require vascular masks that are unavailable during inference and require robust modality-aware vascular feature representations, we construct a modality-wise vascular database and develop two reference graph-guided representation learning schemes for estimating GPEs and VPEs using samples from the database rather than ground-truth masks. Extensive experiments across 19 datasets demonstrate that ReG-SAM consistently outperforms existing baselines, even those using manual prompts, particularly on challenging thin vessels. The code and trained models will be made publicly available.

Introduction

Vessel segmentation, which extracts vascular structures from medical images, plays an important role in clinical diagnosis and treatment planning (Kock et al. 2024; Brugnara et al. 2023). It is considerably more challenging than organ segmentation due to the thin, elongated, and highly branching vascular morphology, large diameter variations, low contrast against surrounding tissues, and frequent discontinuities caused by imaging artifacts. Furthermore, vascular appearance varies substantially across anatomies and imaging modalities, making robust vessel segmentation particularly difficult. Traditional methods are essentially image filters (Frangi et al. 1998) that rely on prior knowledge of vascular morphology. These modality-dependent approaches, although effective in specific scenarios, often struggle to generalize across diverse clinical settings. With the advent of deep learning, neural networks have demonstrated strong capability in modeling complex vascular patterns, leading to substantial performance improvements. Representative applications include fundus imaging (Wu et al. 2019; Wang et al. 2020; Ma and Li 2024; Luo et al. 2025), X-ray angiography (Iyer et al. 2021; Zhu et al. 2021; He et al. 2025), and optical coherence tomography angiography (Liu et al. 2022; Li et al. 2025). However, most are designed for individual datasets or modalities. Although foundation medical segmentation models have attracted increasing attention, they are not specifically tailored for vessels. Only few foundational methods (Song et al. 2025) have been proposed for 2D vessel segmentation across anatomies and modalities, leaving this area largely underexplored. In addition, these methods fail to capture discriminative vascular appearance features and model modality-specific vascular structures, such as distinct branching patterns.

The Segment Anything Model (SAM) (Kirillov et al. 2023), a foundation model originally proposed for natural image segmentation, has been successfully adapted to medical domains (Cheng et al. 2023; Ma et al. 2024a), making it a promising backbone for a general vessel segmentor. In SAM, the prompt encoder is an important component that provides high-level guidance to the mask decoder. However, its prompt types, such as points and bounding boxes, are inherently suboptimal for vessel segmentation. Unlike compact organs, vessels are elongated and highly branched tree-like structures, making point-based interaction unreliable, while randomly selected points may even degrade performance. Bounding boxes are also ineffective, as vessels often span large regions of the image, often covering nearly the entire field of view. In contrast, graphs naturally represent vascular morphology, making them a natural choice for vessel segmentation prompts. Besides, graph-derived prompt embeddings can include both vascular structural information and modality-specific characteristics, providing effective guidance across anatomies. Another limitation lies in the mask decoder, which was originally designed for generic object segmentation and hence struggles to preserve fine vascular details such as thin branches and vessel bifurcations.

∗^{*}These authors contributed equally.

Substantial appearance variations across imaging modalities further exacerbate this problem, as the decoder block lacks explicit modality-aware vascular representations to guide fine-grained vessel recovery.

In this paper, we present ReG-SAM, a fully-automatic foundation model for 2D vessel segmentation built upon SAM and guided by modality-aware reference graph set. In particular, we introduce two modality-aware representations to enhance the prompt encoder and mask decoder. (1) A graph constructed from the vascular mask of an image is encoded into a graph prompt embedding (GPE), capturing modality-aware vascular morphology for guiding mask decoding. (2) An auxiliary convolutional neural network (CNN) is employed for extracting multi-scale image features that are used for computing a vascular prototype embedding (VPE) along with the vascular mask, yielding modality-specific vascular representations for fine-grained decoding.

However, GPEs and VPEs face two key challenges. The first is their dependence on ground-truth vascular masks that are unavailable during inference. In particular, GPE construction requires graphs derived from ground-truth masks. Existing alternatives construct graphs by partitioning images into patches and treating each patch as a node (Li et al. 2026; Jalali, Fateh, and Rezvani 2024), or by generating coarse masks using auxiliary modules (Mishra et al. 2021; Shin et al. 2019). However, such graphs often fail to faithfully represent global vascular structures and generalize poorly across anatomies. Second, the learned representations should accurately capture modality-aware spatial and semantic information while remaining robust to variations in anatomy and imaging modality.

To address these challenges, we propose two reference graph-guided representation learning schemes for GPEs and VPEs. (3) We build a modality-aware vascular database containing mask-derived graphs. During training, reference graphs are randomly sampled from the database and encoded into embeddings, which are encouraged to align with the embedding representation of a query image through dedicated loss functions. Consequently, robust GPEs and VPEs with corresponding modality priors can be estimated from the database during inference without ground-truth masks. (4) We establish a comprehensive benchmark comprising 19 public datasets across anatomies and modalities. Extensive experiments demonstrate that ReG-SAM outperforms existing SAM-based foundational methods for 2D vessel segmentation, even those augmented with manual prompts.

References (60)