Manuscript Offprint
arXiv:2611.00396Evaluating SAM-based and Convolutional Architectures in Thin Retinal Vessel Segmentation: Model Capacity, Computational Cost and Foundation Pre-training
Carlos Eduardo Fontaneli¹,* and Cesar H. Comin¹,†
¹Department of Computer Science, Federal University of São Carlos, Rod. Washington Luís, km 235, 13565-905, São Carlos, SP, Brazil
In retinal vessel segmentation, plain Vision Transformers (ViTs) are commonly expected to perform worse than convolutional neural networks (CNNs) on thin vessels, for reasons such as their coarse patch tokenization, their weak locality bias and their need for large training sets. Although this expectation is widely shared in the literature, how plain ViTs actually compare with CNNs on thin vessels has not been systematically quantified. We address this question by comparing a model with a plain ViT encoder (MEDSAM), a hybrid Transformer (LITEMEDSAM) and three CNNs of different sizes on three retinal datasets (DRIVE, HRF, FIVES) and, as a second-domain check, a microscopy dataset (VessMap). We measured the centerline recall and precision of thin vessels and compared the models while also considering their computational cost and how many epochs they needed to train. We found that the pre-trained MEDSAM had a centerline recall of thin vessels that was not significantly different from that of the best CNN on all four datasets (-0.6 to +2.5 percentage points). A compact plain ViT obtained through architecture search but trained from scratch did not retain this performance. For pre-trained plain ViTs, our results do not support the expectation that they miss thin vessels, although similar thin-vessel performance can be obtained with much smaller models.
Keywords: Vessel segmentation, Thin vessels, Vision Transformers, Foundation models, Pre-training, Computational cost
I. INTRODUCTION
Segmentation of the retinal vessels in fundus images provides quantitative markers for the diagnosis and follow-up of diseases such as diabetic retinopathy and glaucoma [1, 2]. Thin vessels are a particular challenge in this task: they are only a few pixels wide, have low contrast, and contribute little to overlap metrics such as Dice, in which a wide vessel counts more pixels than a thin vessel of the same length.
Convolutional neural networks (CNNs) have dominated vessel segmentation since the U-Net [3-7], and a carefully trained minimal U-Net, with far fewer parameters than the best published models, comes close to their results on retinal benchmarks [8]. Vision Transformers (ViTs) [9] and the foundation models built on them, such as the Segment Anything Model [10] and its medical version MEDSAM [11], offer an alternative: large pre-trained encoders. These models are designed to be general-purpose and can be fine-tuned for specific tasks. A plain ViT, however, splits the image into fixed-size patches, 16 × 16 pixels in MEDSAM [11], and encodes each patch as one token. Its output is therefore a single low-resolution feature map, considered unsuitable for dense prediction [12-14], and Transformers that encode such patches without convolutional features have been reported to lose the low-level detail needed for precise localization [15]. SAM-based models have been reported to struggle with thin and branching structures such as vessels [11, 16-18]. This is a
strong reason to expect a plain ViT to miss thin vessels. In addition, plain ViTs lack the locality bias of convolutions [9, 19]: without large-scale pre-training they do not learn to attend locally in their early layers [20] and are more data-hungry than CNNs [21, 22]. Vessel datasets, in contrast, have only tens to hundreds of annotated images.
To our knowledge, the thin-vessel performance of plain ViTs has not been systematically quantified or compared with that of CNNs. We therefore address three research questions:
-
Can a plain ViT (MEDSAM) match the thin-vessel segmentation performance of CNNs, regardless of computational cost?
-
How does a plain ViT compare with CNNs in thin-vessel performance relative to their computational cost?
-
How much segmentation performance on thin vessels does foundation pre-training add to transformer-based models?
To answer these questions, we trained the plain ViT MEDSAM, the hybrid Transformer LITEMEDSAM, which combines convolutions and attention, and three CNNs of different sizes, CONVNEXT [23], CONVUNEXT [24] and LW-NET [8]. We used three retinal datasets, DRIVE [25], HRF [26] and FIVES [1], and VessMap [27], a microscopy dataset that we used to test the models in a second imaging domain. The two Transformers were also trained from scratch to quantify the contribution of foundation pre-training. In addition, we optimized the architecture of compact versions of the two Transformers on each dataset to test whether smaller models could reach the same performance.
- carlos.fontaneli@estudante.ufscar.br † Corresponding author: comin@ufscar.br
Among our main results, fine-tuned MEDSAM had a centerline recall of thin vessels that was not significantly different from that of the best CNN on each dataset. Pre-training was essential for this performance, and a compact plain ViT found by architecture search and trained from scratch did not reach the performance of the pre-trained model. On HRF and FIVES, fine-tuned MEDSAM also had a significantly higher overall Dice than the best CNN.
The ViT [9] encodes an image as a sequence of patch tokens processed by self-attention [29]. In medical segmentation, Transformers were first combined with CNNs, as in TransUNet [15], or used in hierarchical forms, as in Swin-Unet [30]. A systematic review of 36 studies that compared ViTs with CNNs in medical image analysis found that transformer-based models often performed better and that pre-training was important for them [31], although the review was not specific to vessels. The Segment Anything Model (SAM) [10] is a promptable foundation model for segmentation, but its direct use on medical images is limited [32]. MEDSAM [11] adapted SAM's ViT-B encoder to medical images by training it on over one million image-mask pairs. Its authors report that it has difficulty with vessel-like branching structures, which they attribute to the ambiguity of the box prompt [11]. LITEMEDSAM, the baseline of the CVPR 2024 challenge “Segment Anything in Medical Images on Laptop”, distilled the encoder of MEDSAM into a TinyViT [33], a lightweight hybrid of convolutional and Transformer layers [34].
Several studies have examined how Transformers handle thin and small structures. In retinal vessel segmentation, hybrid models such as PCAT-UNet [35] add convolutions to Transformer blocks, arguing that self-attention captures global context but not the local detail needed for microvessels. A comparison of eight convolutional and Transformer-based U-shaped networks on four retinal datasets found small overall differences, with the CNNs ahead on the low-resolution DRIVE images and the Transformers ahead on the high-resolution HRF images [36]. For small objects in general, the segmentation performance of ViTs depends on the patch size, as shown for tumors of different sizes [37]. Segmentation foundation models show similar difficulties. Zero-shot SAM fails on
retinal vessels [16] and often neglects thin object structures in natural images [17]. Zhang et al. [38] found that SAM, SAM 2 and HQ-SAM perform worse on objects with dense, tree-like morphology, such as retinal vessels. They attributed this to patches that contain mostly boundary pixels and few interior pixels of the object, an imbalance that grows with the model's effective patch size, and found that fine-tuning does not remove this limitation. FineSAM++ [18] addresses such failures on vessels by refining the output of SAM in uncertain regions.
Thin vessels have also been treated as a separate target in training and evaluation. Because pixel-wise losses are dominated by the thick vessels, Yan et al. [39] proposed a segment-level loss that gives thin vessels more weight. The clDice loss [40] for tubular structures is built on the skeleton-based sensitivity and precision of a segmentation, which correspond to the centerline recall and precision used in this work. A recent study that stratified sensitivity by vessel width found that the detection of thin vessels can vary considerably with the input resolution while Dice remains stable [41]. These studies evaluated losses, metrics or input resolution, mostly with CNNs. To our knowledge, no study has compared foundation models against CNNs with thin vessels evaluated separately from the rest of the vessel tree. Moreover, comparisons between architectures often do not optimize the hyperparameters of every model with the same effort, which can favor the proposed model over poorly configured baselines [5].
III. METHODOLOGY
A. Datasets
We used three retinal fundus datasets, DRIVE [25], HRF [26] and FIVES [1], and one microscopy dataset, VessMap [27]. They were chosen to differ in two properties related to the expected weaknesses of a plain ViT (Section I): the number of training images, from 16 to 600, and the image size, from 256 to 3504 pixels per side, which sets how many pixels a vessel spans relative to a patch.
DRIVE is the standard benchmark of retinal vessel segmentation [2], which allows our results to be related to the literature. It has 40 images of pixels with an official split of 20 training and 20 test images. We held out four of the training images (images 37 to 40) for validation and trained on the other 16. DRIVE is therefore the dataset with the fewest training images, the setting in which a plain ViT trained from scratch is expected to suffer most. HRF has 45 images of pixels, 15 each of healthy eyes and of eyes with diabetic retinopathy or glaucoma [26]. FIVES has 800 images of pixels, 200 each of normal eyes and of eyes with age-related macular degeneration, diabetic retinopathy or glaucoma, with an official split of 600 training and 200 test images. With 600 training images, FIVES tests whether the gain from foundation pre-training becomes smaller when many training images are available.
VessMap has 100 confocal fluorescence microscopy images (256 × 256 pixels) of the vasculature of the mouse brain cortex, with low contrast. They were selected from a larger set of images to be as heterogeneous as possible in contrast, noise, vessel density and the variation of intensity along the vessels [27]. VessMap tests whether our findings hold in a second imaging domain.
HRF and VessMap have no official split, so we split each at random, with a fixed seed, into 70% training and 30% test images. On HRF, FIVES and VessMap, no separate validation set was held out, and checkpoint selection, early stopping and the hyperparameter search used the test images. This protocol was the same for every model.
B. Models
Table I summarizes the architectures used. MEDSAM [11] is the plain ViT, a single-scale ViT without convolutional stages. It uses the ViT-B encoder of SAM, with 16 × 16 px patches and a 1024 × 1024 px input, and was trained on over one million medical image-mask pairs. Its training data include fundus images, but only from optic disc and cup datasets, and none of our four datasets is among them [11]. LITEMEDSAM [34] is the hybrid model. Its TinyViT encoder [33] combines convolutional stages (mobile inverted bottleneck convolutions) with windowed attention and has a 256 × 256 px input. It was distilled and fine-tuned on the same data as MEDSAM [34]. Both transformer-based models keep SAM's prompt encoder and mask decoder [10]. In training and inference, we set the prompt as a fixed box covering the whole input window, and the prompt encoder was not trained. The decoder upsamples the 64 × 64 grid of encoder tokens by a factor of four. MEDSAM therefore predicts at a quarter of its input resolution, and its logits are upsampled bilinearly to the size of the window. LITEMEDSAM, whose encoder reduces its 256 px window to the same grid, predicts at its input resolution. The three CNNs span more than three orders of magnitude in size: CONVNEXT, a ConvNeXt-Large encoder [23] with a transposed-convolution decoder; CONVNEXT, a U-Net built from ConvNeXt-style blocks with attention gates [24]; and LW-NET, our implementation of Little W-Net [8].
C. Training protocol
We trained the three CNNs from scratch. The two transformer-based models were trained in two ways: fine-tuned from their published pre-trained weights [11, 34], with all weights updated except those of the prompt encoder, and trained from scratch. Comparing pre-trained transformer-based models with CNNs trained from scratch was deliberate, because these are the configurations in
TABLE I. The five architectures and their parameters. CONVUNEXT and LW-NET are U-Nets without a separate, named encoder, so for them the encoder column gives the type of block of the encoding path. The size of CONVUNEXT depends on the dataset (Appendix A).
| Model | Type | Encoder | Params (M) |
|---|---|---|---|
| MEDSAM | Plain ViT | ViT-B | 93.7 |
| LITEMEDSAM | Hybrid | TinyViT | 9.8 |
| CONVNEXT | CNN | ConvNeXt-L | 211.4 |
| CONVUNEXT | CNN | ConvNeXt blocks | 3.5 / 13.8 |
| LW-NET | CNN | Conv. blocks | 0.07 |
which each kind of model is usually applied. Compact segmentation CNNs are trained from scratch [3, 8, 24, 42, 43], while transformer-based foundation models are fine-tuned from their pre-trained weights. CONVNEXT was included as a CNN in the same cost class as MEDSAM. Although ImageNet weights exist for its encoder, pre-trained weights are rarely available for compact CNNs, so CONVNEXT followed the same protocol as the other two CNNs. Training the transformer-based models also from scratch separates the effect of pre-training from that of the architecture.
For each configuration and dataset, a search of 100 trials chose the learning rate, the weight decay, the batch size, the base width of CONVUNEXT and LW-NET and the stochastic-depth rate of CONVNEXT. Table A.1 contains the full search space. We ran the searches with Optuna [44] (version 4.7.0), using its tree-structured Parzen estimator sampler [45] and median pruning on the validation Dice. In total, the 36 searches ran 3,602 trials in 2,093 GPU hours. The CNNs were trained on an NVIDIA RTX 3090 GPU (24 GB) and the transformer-based models on NVIDIA RTX PRO 5000 (48 GB) and RTX PRO 4000 (24 GB) GPUs.
All models were trained with the soft Dice loss [46] and AdamW [47], in PyTorch [48] (version 2.10.0) with PyTorch Lightning [49] (version 2.6.1). We kept the trial with the highest validation Dice. Training stopped after 50 epochs without improvement of the validation Dice.
Each training sample was a random crop of the size of the model's input (256 px, or 1024 px for MEDSAM), taken after random flips and rotations. Images smaller than the input, which is the case of the DRIVE and VessMap images for MEDSAM, were upscaled to it, so MEDSAM saw DRIVE at about 1.75 times and VessMap at 4 times their native scale. Appendix A gives the full training details.
As an additional investigation, we tested whether smaller transformer-based models could reach the performance of the original ones. We trained, from scratch, a compact version of each transformer-based model, with a 256 px input and an architecture optimized on each dataset. For these models, the search of 100 trials covered the architecture in addition to the training hyper-parameters. For compact MEDSAM, the patch size, the embedding dimension, the depth, the number of attention heads, the MLP ratio and the attention window were optimized. For compact LITEMEDSAM, the embedding dimensions, the depths of its stages, the number of heads, the attention windows and the MLP ratio were optimized. Appendix A describes the search space, and Table A.2 contains the selected architectures.
D. Evaluation protocol and metrics
We evaluated every model on the full test images at native resolution with the sliding-window inference of MONAI [50] (version 1.5.2). The windows had the size of the model's input with an overlap of 25% and they were combined with Gaussian weighting. Images smaller than a window were padded to it. The sigmoid output was binarized at 0.5. Because MEDSAM was trained on upscaled DRIVE and VessMap images, on these two datasets we upscaled each test image to its px input, resized the logits back to the native resolution with bilinear interpolation, and scored them against the native ground truth. We call this the upscaled protocol, and the alternative, in which the native image is padded to the window, the padded protocol. The upscaled protocol evaluates MEDSAM at its training scale, and we used it for every MEDSAM result except the comparison of the two protocols.
All metrics were computed for each test image from the binarized prediction and the ground truth . We used the Dice score over the full image as an overall measure of performance. The centerline metrics use the skeleton of a mask, computed with the skeletonize function of scikit-image [51] (version 0.26.0), which implements Zhang-Suen thinning [52]. Our main metrics are based on the centerline recall,
the fraction of ground-truth centerline pixels that fall inside the predicted mask. To check that high values of were not obtained at the cost of more false positives, we also computed the centerline precision,
the fraction of predicted centerline pixels that fall inside the ground-truth mask. and were used in [40] to define the clDice metric.
To measure recall as a function of vessel caliber, we grouped the ground-truth centerline pixels by radius into the bins [0.5, 1.5), [1.5, 2.5), [2.5, 3.5), [3.5, 4.5) and [4.5, ) px. The radius of a centerline pixel was taken as the value of the Euclidean distance transform of the mask at that pixel. We call a vessel thin when its radius is below 1.5 px. The centerline recall of thin vessels is the
recall of the first bin,
where is the set of ground-truth centerline pixels with radius below 1.5 px. The centerline precision of thin vessels,
considers only the predicted centerline pixels whose radius, measured in the prediction, is below 1.5 px. The two thin-vessel metrics are therefore computed on different sets of pixels: on the ground-truth thin centerline and on the predicted one. When a denominator is empty, the metric is undefined for that image and is left out of the mean.
Note that is used in our analysis only as a sanity check to quantify if models are oversegmenting the vessels to improve their . This is because cannot be considered a coounterbalance to the same way that precision is to recall. measures the capacity of a model to detect thin vessels present in the ground-truth, while measures false positives that happen to be thin structures. For instance, a model that predicts vessel for all pixels will have a of 1, but undefined , because it will have no predicted thin centerline pixels.
We counted the parameters and the floating-point operations of each trained checkpoint with fvcore [53] (version 0.1.5), counting one multiply-add as one FLOP. As a measure of training difficulty, we report the number of epochs the selected run needed to first reach 95% of its best validation Dice.
Significance tests used a two-sided Wilcoxon signed-rank test [54] on per-image paired differences, with the Holm correction [55]. A difference is called significant when its Holm-adjusted p-value is below 0.05. The result tables report the mean standard deviation of each metric over the test images. Bold marks the best value of a comparison, underlining marks the values not significantly different from the best one, and an asterisk marks a significant difference in a pairwise comparison.
IV. RESULTS
A. Overall segmentation performance
Table II reports the Dice, the centerline recall and the centerline precision of the five models, computed over all vessels. The p-values of the pairwise tests are given in Appendix C, in Table C.1 for the Dice and in Table C.2 for and . The best model of each retinal dataset reached a Dice close to published values: 82.3% on DRIVE (LITEMEDSAM) and 81.7% on HRF (MEDSAM), against 82.8% and 81.0% reported for Little
TABLE II. Overall segmentation performance. Values in bold indicate the best performance. Underlined values are not significantly different from the best (bold) of the same row.
| Dataset | Metric | CNN | Fine-tuned | |||
|---|---|---|---|---|---|---|
| LW-NET | CONVUNEXT | CONVNeXT | LITEMEDSAM | MEDSAM | ||
| Dice | ||||||
| Dice | ||||||
| Dice | ||||||
| Dice | ||||||

(c) FIVES
(d) VessMap
FIG. 1. Mean centerline recall for different vessel radius ranges. The first range, radius in [0.5, 1.5) px, shows . Grey bars show the number of ground-truth centerline pixels for each range, calculated on the test images.
W-Net [8], and 92.2% on FIVES (MEDSAM), against 90.4% reported for FR-UNet [42] by Fadugba et al. [6]. VessMap has no published Dice to compare with. The LW-NET stayed 1.7 and 4.1 points below the published values on DRIVE and HRF [8]. This might be because the published protocol optimized the threshold value on the training set and evaluated the Dice score only inside the field of view.
No model had the highest mean on every dataset and metric. For the Dice score, however, an attention-based

FIG. 2. Centerline precision against centerline recall of thin vessels, per dataset.
model had the highest mean on every dataset: LITEMED-SAM on DRIVE and VessMap, and MEDSAM on HRF and FIVES. On VessMap, only CONVNEXT was significantly lower than the other models.
These overall metrics say little about thin vessels. and weigh every centerline pixel equally. Thin vessels hold 55.3% of the ground-truth centerline pixels of DRIVE and 2.3 to 11.7% of those of the other three datasets (pixel counts are shown in Fig. 1). Furthermore, for the Dice score, a wide vessel weighs more than a thin vessel of the same length.
B. Segmentation performance on thin vessels
Fig. 1 shows the mean centerline recall as a function of vessel radius. The compact models are not included because the figure focus on raw performance and also to reduce visual clutter. For every model and dataset, the recall was lowest in the first bin, radius below 1.5 px. On HRF and FIVES, the recall fell steadily as the radius decreased, while on DRIVE and VessMap it was nearly constant above 1.5 px and dropped only in the first bin. The recall of the first bin is the centerline recall of thin vessels, , compared below.
Fine-tuned MEDSAM had an within the range of the three CNNs, that is, between their lowest and highest means, on DRIVE and FIVES, and above this range on HRF and VessMap. Its was not significantly different from that of the best CNN, the CNN with the highest mean for the same dataset and metric, on any dataset. The hybrid LITEMEDSAM had the highest mean on every dataset, significantly above every CNN on DRIVE and HRF. Table C.1 of Appendix C gives the p-values of these comparisons.
A model can raise its by over-segmenting, that is, by trading precision for recall. To check whether this was the case for any of the models, Fig. 2 plots the centerline precision of thin vessels, , against . On DRIVE,
MEDSAM had an not significantly different from those of LW-NET and CONVUNEXT, but a significantly lower . On HRF, MEDSAM and CONVUNEXT did not differ significantly in either metric. On FIVES, no model was significantly better than MEDSAM in either metric, and each of the other four models was significantly worse in at least one. On VessMap, MEDSAM and LW-NET did not differ significantly in either metric.
Taken together, the results indicate that the high values of of MEDSAM did not come at the cost of a low , when compared to CNNs with similar performance. The model had equivalent performance to a CNN on HRF and VessMap and a better overall performance on FIVES.
For LITEMEDSAM, the higher came with a lower than that of the best CNN on every dataset, with a significant difference on DRIVE, HRF and FIVES.
Fig. 3 shows examples of thin vessels found and missed by the five models, and the share of thin centerline pixels missed by all five, found by some and found by all five. The share on which the models disagreed was 35% on DRIVE and HRF, higher on FIVES (44%) and lower on VessMap (25%). The share missed by all five models varied much more, from 59% on HRF and 45% on FIVES to 30% on DRIVE and less than 10% on VessMap. In the examples, the models seem to miss or disagree more on terminal branches. A possible reason is that a thin segment that is not terminal have better support for segmentation when there are vessels connected to both of its ends.
C. Model cost and compact architectures
Fig. 4 shows the parameters and the GFLOPs per test image of each architecture. MEDSAM had the second-largest parameter count, after CONVNEXT, and the highest cost per image on DRIVE and VessMap, whose images are smaller than its 1024 px window and are upscaled to it. On the larger HRF and FIVES images, the models

(e)

FIG. 3. Thin vessel detection agreement among the models. (a–d) Window of each test set with the most thin centerline pixels. Non-thin vessels are shown in dark grey. (e) Agreements between the models over all test images.

(b)
FIG. 4. Cost of each architecture. (a) parameters and (b) GFLOPs per test image, log scale.

(b) HRF
(c) FIVES
(d) VessMap
(e) DRIVE
(f) HRF
(g) FIVES
(h) VessMap

FIG. 5. Relationship between performance and cost. (a–d) and Dice (e–h) against GFLOPs per test image.

(a)

(b)
(c)
FIG. 6. Effect of pre-training. (a) Dice, (b) and (c) of the two transformer-based models fine-tuned (filled) and trained from scratch (hollow), next to the CNNs.
with 256 px windows need many more windows per image than MEDSAM, so CONVNEXT and LITEMEDSAM cost more per image than MEDSAM.
By parameter count, the models fall into three cost classes: MEDSAM and CONVNEXT; LITEMEDSAM, CONVUNEXT and the compact models; and LW-NET. Models of the same class can be compared fairly, while a comparison across classes is fair only when the aim is the highest accuracy regardless of cost. The search for compact LITEMEDSAM, which was not limited to models smaller than LITEMEDSAM, returned models of the same order of size and cost as LITEMEDSAM, and on DRIVE a slightly larger model (Table A.2).
Fig. 5 plots and Dice against the GFLOPs per test image. Fine-tuned MEDSAM, whose was not significantly different from that of the best CNN on any

FIG. 7. Training epochs required to reach 95% of the best validation Dice. Models were validated every epoch or every 10 epochs (see Table A.1 for details). “≤” means that the model reached the performance at the first validation.
TABLE III. MEDSAM evaluated with the padded and the upscaled protocol. Bold indicates the best value. Significant differences are indicated by an asterisk.
| MEDSAM | Metric | DRIVE () | VessMap () | ||||
|---|---|---|---|---|---|---|---|
| Padded | Upscaled | Padded | Upscaled | ||||
| Fine-tuned | Dice | ||||||
| From scratch | Dice | ||||||
dataset, belongs to the most expensive class by parameter count. Its compact version did not reach the same performance. Against the best CNN, its was significantly lower on DRIVE and FIVES, and its and Dice were significantly lower on all four datasets.
The search for compact MEDSAM selected finer patches than the 16 px of MEDSAM. On DRIVE, HRF and VessMap, the optimal patch size was 4 px, while on FIVES it was 8 px. Full details are shown in Table A.3. Patches of 1 and 2 px ran out of GPU memory, so 4 px was the finest patch that could be trained.
D. Pre-training and convergence speed
Fig. 6 compares MEDSAM and LITEMEDSAM fine-tuned from their pre-trained weights with the same architectures trained from scratch, next to the three CNNs. Table B.1 in Appendix B provides the values used in the figure for MEDSAM and LITEMEDSAM.
Pre-training raised the Dice of MEDSAM significantly on every dataset. Its effect on the of MEDSAM
depended on the dataset. rose by 17.6 and 12.4 points on DRIVE and VessMap, by only 1.9 points on FIVES, and did not change significantly on HRF. Without pre-training, the of MEDSAM was significantly lower than that of the best CNN on DRIVE, FIVES and VessMap. Pre-training also raised the of MEDSAM on HRF and VessMap, and slightly reduced it on DRIVE. For the hybrid LITEMEDSAM, pre-training raised significantly on every dataset.
For MEDSAM, the Dice gain from pre-training was smallest on FIVES, the dataset with the most training images. Interestingly, the gain in for MEDSAM was lower on the high-resolution datasets.
Fig. 7 shows the number of epochs until each selected run first reached 95% of its best validation Dice. Pre-trained MEDSAM converged the fastest of all models on HRF and FIVES, where it reached this level at the first validation, and about as fast as LW-NET and CONVUNEXT on DRIVE and VessMap. Without pre-training, MEDSAM needed more epochs on every dataset, and so did compact MEDSAM. Pre-trained LITEMEDSAM converged faster than every CNN, except on FIVES, where it was slower than CONVUNEXT.
E. Inference protocol of MedSAM: padding versus upscaling
Upscaling the DRIVE and VessMap images to the 1024 px window of MEDSAM adds no information, but it changes the scale at which the model sees the thin vessels. To measure the effect of this choice, we compared the upscaled and padded protocols of Section IIID on these two datasets. The results are shown in Table III.
The padded protocol gave a significantly lower Dice and than the upscaled protocol, both for fine-tuned MEDSAM and for MEDSAM trained from scratch. For fine-tuned MEDSAM, fell by 17.9 points on DRIVE and 41.3 points on VessMap, below the range of the CNNs on both datasets.
V. CONCLUSION
We compared a plain ViT (MEDSAM), a hybrid (LITEMEDSAM) and three CNNs on the thin vessels of three retinal datasets, DRIVE, HRF and FIVES, with VessMap as a check in a second imaging domain. Table IV summarizes the raw segmentation performance, comparing fine-tuned MEDSAM with the best Dice and achieved by a CNN on each dataset.
TABLE IV. Fine-tuned MEDSAM against the best CNN of each metric and dataset. L: LW-NET, U: CONVUNEXT, N: CONVNEXT. Bold indicates the best value. Asterisks indicate significantly different values.
| Dataset | Dice | |||
|---|---|---|---|---|
| MEDSAM | Best CNN | MEDSAM | Best CNN | |
| DRIVE | ||||
| HRF | ||||
| FIVES | ||||
| VessMap | ||||
Fine-tuned from its pre-trained weights, MEDSAM had an not significantly different from that of the best CNN on all four datasets, with differences from -0.6 to +2.5 percentage points. For MEDSAM in these conditions, the results do not support the expectation that a plain ViT misses thin vessels. Importantly, this holds for the default px patch of MEDSAM, which is much wider than thin vessels.
The drawback is cost. The cost per image of MEDSAM was 2 to 18 times that of CONVUNEXT and more than 30 times that of LW-NET. A compact plain ViT trained from scratch did not keep the performance of the original model. Against the best CNN, its was significantly lower on DRIVE and FIVES, and its and Dice were significantly lower on all four datasets. The hybrid LITEMEDSAM had the highest mean on every
dataset, but a lower than the best CNNs. Where cost matters, compact CNNs remain good candidates on small datasets. LW-NET, with 0.07 M parameters, had a Dice and an not significantly different from those of fine-tuned MEDSAM on DRIVE and VessMap.
Pre-training was essential for MEDSAM. Without it, MEDSAM fell significantly below the best CNN in on three datasets. The Dice gain from pre-training was smallest on FIVES, the dataset with the most training images.
Our study has limitations that suggest directions for future work. First, the CNNs were trained from scratch, while the transformer-based models were fine-tuned. As mentioned in Section III C, ImageNet weights exist for the ConvNeXt-Large encoder [23], but smaller models, which are commonly used in practice, lack pre-trained encoders. Second, although the hyperparameters of each configuration were selected from 100 trials, the reported results come from a single training run, that of the best trial. Furthermore, the optimization protocol varied slightly among datasets and models, for instance in the validation interval and in the range of batch sizes (Appendix A). Some design choices, such as the optimizer and the learning-rate schedule, were also kept fixed.
Thin vessels are challenging to annotate, so metrics calculated on them can have high variability. The quality of biomedical annotations depends on factors such as the labeling instructions and the expertise of the annotators [56]. On DRIVE, for instance, the between the two annotators is , close to the value obtained for MEDSAM (56.9%). However, the influence of the annotator is challenging to quantify, since most retinal datasets do not contain multiple annotations. This constitutes an interesting direction for future work.
CREDIT AUTHORSHIP CONTRIBUTION STATEMENT
Carlos Eduardo Fontaneli: Methodology, Investigation, Software, Data curation, Writing - original draft. Cesar H. Comin: Conceptualization, Supervision, Methodology, Writing - original draft, Writing - review and editing.
FUNDING
This work was supported by the São Paulo Research Foundation (FAPESP) [grant number 25/04800-9].
DATA AVAILABILITY
The four datasets used in this study are publicly available from their original sources: DRIVE [25], HRF [26], FIVES [1] and VessMap [27]. The code of the experiments is available at https://github.com/CarlosFontaneli/thin-vessel-sam-cnn.
DECLARATION OF GENERATIVE AI AND AI-ASSISTED TECHNOLOGIES IN THE MANUSCRIPT PREPARATION PROCESS
During the preparation of this work the authors used Claude (Anthropic) in order to improve the language and flow of the text. After using this tool, the authors reviewed and edited the content as needed and take full responsibility for the content of the published article.
Appendix A: Training details
1. Data preparation, sampling and augmentation
Each training sample was flipped horizontally and vertically at random (probability 0.5 each) and rotated by a random angle between and . The sample was then cropped at a random position to the model's input size: 256 px for the CNNs, LITEMEDSAM and the compact models, and 1024 px for MEDSAM. Images smaller than the input size, such as the DRIVE ( px) and VessMap ( px) images for MEDSAM, were upscaled to it with bilinear interpolation for the image and nearest-exact interpolation for the mask.
In 106 training masks and 5 test masks of FIVES, pixels along the image border were incorrectly labeled as vessel. We corrected this by setting a 2 px border of these masks to background.
2. Loss function
All models were trained with the soft Dice loss with squared terms in the denominator [46],
where is the sigmoid output and . The loss was computed for each image and averaged over the batch. LW-NET produces a coarse and a refined segmentation, and its loss is the sum of Eq. (A.1) over the two outputs.
3. Hyperparameter search
Table A.1 gives the search space of the training hyperparameters and of the CNN architectures for each configuration and dataset. Every run used AdamW with a cosine learning-rate schedule [57] over at most 1000 epochs.
For each CNN, the search covered one architecture parameter. For LW-NET and CONVUNEXT, this parameter is the base width, the number of channels of the first level, which sets the size of the model. It was searched on DRIVE, FIVES and VessMap and fixed on HRF at 8 for LW-NET and 32 for CONVUNEXT. The selected LW-NET has a base width of 8 on every dataset (0.07 M parameters), and the selected CONVUNEXT has a base width of 64 on DRIVE and VessMap (13.8 M) and 32 on HRF and FIVES (3.5 M). For CONVNEXT, the searched parameter is the stochastic-depth rate, which does not change its size (211.4 M).
For the compact models, the search also covered the architecture. For compact MEDSAM, it covered the patch size (1, 4, 8 or 16 px on DRIVE and 1, 2, 4, 8 or 16 px on the other datasets), the embedding dimension (128, 256
or 384), the depth (4, 6 or 8), the number of attention heads (4 or 8), the MLP ratio, that is, the ratio of the hidden width of the feed-forward block (2, 4 or 6), and the attention window (7 or 14). For compact LITEMEDSAM, it covered the embedding dimensions of the four stages, (32, 64, 80, 160) or (64, 128, 160, 320), and their depths, (1, 1, 3, 1) or (2, 2, 6, 2). On DRIVE, it also covered the number of heads per stage, (1, 2, 2, 5) or (2, 4, 5, 10), the attention windows, (7, 7, 7, 7) or (7, 7, 14, 7), and the MLP ratio (2, 4 or 6). On the other datasets, these three parameters kept the values of the original LITEMEDSAM. Table A.2 contains the selected architectures. Table A.3 gives the best validation Dice that the search reached with each patch size.
Validation ran the sliding-window inference of Section IIIID over the full validation images. To reduce training time, every run on HRF, every compact model and the transformer-based models on FIVES were validated every 10 epochs, except the selected run of fine-tuned LITEMEDSAM on FIVES (Table A.1). The other runs were validated every epoch. In both cases, training stopped after 50 epochs without improvement. For MEDSAM on DRIVE and VessMap, validation used the padded protocol of Section IIIID, while the test results of MEDSAM used the upscaled protocol, except in the comparison of Section IV E.
Appendix B: Pre-training results
Table B.1 gives the values plotted in Fig. 6. It shows the Dice, and of MEDSAM and LITEMEDSAM fine-tuned and trained from scratch, the gain from pre-training and the values of the best CNN.
Appendix C: Statistical tests
Tables C.1 and C.2 list the Holm-adjusted p-values of the pairwise comparisons of Section IV. The Holm correction was applied separately to each family of tests. In Table C.1, a family is formed by the 36 pairs of the nine configurations for one dataset and metric. In the top part of Table C.2, a family is formed by the 10 pairs of the five models for one dataset and metric. The 12 tests of the bottom part, which compare the two protocols of MEDSAM, form a single family. Every model was evaluated on the same test images of a dataset, so we compared models through their per-image paired differences. Zero differences were discarded, and an image with an undefined value was left out of the pairs that involve it. The p-values were computed with SciPy [58] (version 1.17.1), from the exact null distribution of the signed-rank statistic for up to 50 image pairs and from its normal approximation otherwise. The direction marks of the two tables follow the sign of the Hodges–Lehmann estimate [59] of the paired difference, that is, the median of the averages of all pairs of per-image differences.
TABLE A.1. Hyperparameter search. Learning rate and weight decay: log-uniform in the ranges shown. CNN architecture parameter: LW-NET, width of the first of its three levels (doubled at each level); CONVUNEXT, width of the first stage; CONVNEXT, stochastic-depth (drop-path) rate. Val.: validation interval in epochs. GPU h: sum of the trial durations.
| Configuration | Dataset | Learning rate | Weight decay | Batch size | Architecture | Val. | GPU h |
|---|---|---|---|---|---|---|---|
| LW-NET | DRIVE | 2, 4, 8 | first width 8, 16, 32 | 1 | 13.0 | ||
| HRF | 2, 4, 8, 16 | - | 10 | 34.0 | |||
| FIVES | 2, 4, 8, 16, 32, 64 | first width 8, 16, 32 | 1 | 108.6 | |||
| VessMap | 2, 4, 8, 16, 32 | first width 8, 16, 32 | 1 | 1.2 | |||
| CONVUNEXT | DRIVE | 2, 4, 8 | base width 16, 32, 64 | 1 | 13.4 | ||
| HRF | 2, 4, 8, 16 | - | 10 | 25.1 | |||
| FIVES | 2, 4, 8, 16, 32, 64 | base width 16, 32, 64 | 1 | 292.6 | |||
| VessMap | 2, 4, 8, 16, 32 | base width 16, 32, 64 | 1 | 2.5 | |||
| CONVNEXT | DRIVE | 2, 4, 8 | drop path 0-0.5 | 1 | 15.1 | ||
| HRF | 2, 4, 8, 16 | drop path 0-0.5 | 10 | 40.2 | |||
| FIVES | 2, 4, 8, 16, 32 | drop path 0-0.5 | 1 | 210.5 | |||
| VessMap | 2, 4, 8, 16, 32 | drop path 0-0.5 | 1 | 31.5 | |||
| LITEMEDSAM, fine-tuned | DRIVE | 2, 4, 8 | - | 1 | 7.6 | ||
| HRF | 4, 8 | - | 10 | 7.0 | |||
| FIVES | 8, 16 | - | 1 | 117.3 | |||
| VessMap | 2, 4, 8 | - | 1 | 20.9 | |||
| LITEMEDSAM, from scratch | DRIVE | 1, 2, 4 | - | 1 | 17.4 | ||
| HRF | 4, 8 | - | 10 | 13.6 | |||
| FIVES | 4, 8 | - | 10 | 138.1 | |||
| VessMap | 1, 2, 4 | - | 1 | 9.0 | |||
| LITEMEDSAM, compact | DRIVE | 8, 16, 32 | Table A.2 | 10 | 1.7 | ||
| HRF | 8, 16, 32 | Table A.2 | 10 | 11.6 | |||
| FIVES | 8, 16, 32 | Table A.2 | 10 | 107.3 | |||
| VessMap | 8, 16, 32 | Table A.2 | 10 | 17.2 | |||
| MEDSAM, fine-tuned | DRIVE | 2 | - | 1 | 9.9 | ||
| HRF | 2, 4 | - | 10 | 15.0 | |||
| FIVES | 2, 4 | - | 10 | 277.1 | |||
| VessMap | 2 | - | 1 | 21.1 | |||
| MEDSAM, from scratch | DRIVE | 1 | - | 1 | 28.6 | ||
| HRF | 1, 2, 4 | - | 10 | 20.8 | |||
| FIVES | 1, 2, 4 | - | 10 | 345.2 | |||
| VessMap | 1 | - | 1 | 26.3 | |||
| MEDSAM, compact | DRIVE | 4, 8, 16 | Table A.2 | 10 | 0.9 | ||
| HRF | 4, 8, 16 | Table A.2 | 10 | 7.6 | |||
| FIVES | 4, 8, 16 | Table A.2 | 10 | 66.5 | |||
| VessMap | 4, 8, 16 | Table A.2 | 10 | 17.7 |
TABLE A.2. Selected compact models and, for comparison, the original MEDSAM and LITEMEDSAM. Input and Patch in px. Tokens: patch grid of one window, calculated as image size divided by patch size. Emb.: embedding dimension. MLP: ratio of the hidden width of the MLP block. Window: size of the attention window in patches. Params: number of parameters in millions.
| Model | Version | Input | Patch | Tokens | Emb. | Depth | Heads | MLP | Window | Params | Dice | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MEDSAM | original | 1024 | 16 | 64 × 64 | 768 | 12 | 12 | 4 | 14 | 93.7 | Table B.1 | ||
| compact, DRIVE | 256 | 4 | 64 × 64 | 256 | 4 | 8 | 2 | 14 | 7.9 | 77.7±2.5 | 43.4±13.5 | 69.3±8.3 | |
| compact, HRF | 256 | 4 | 64 × 64 | 128 | 6 | 4 | 2 | 14 | 6.0 | 78.3±5.9 | 23.7±15.3 | 43.3±11.6 | |
| compact, FIVES | 256 | 8 | 32 × 32 | 256 | 8 | 8 | 6 | 7 | 13.5 | 87.8±9.0 | 32.0±11.3 | 41.9±10.7 | |
| compact, VessMap | 256 | 4 | 64 × 64 | 384 | 6 | 4 | 6 | 7 | 20.6 | 91.7±2.8 | 77.5±18.2 | 74.5±14.5 | |
| LITEMEDSAM | original | 256 | – | – | 64,128,160,320 | 2,2,6,2 | 2,4,5,10 | 4 | 7,7,14,7 | 9.8 | Table B.1 | ||
| compact, DRIVE | 256 | – | – | 64,128,160,320 | 2,2,6,2 | 2,4,5,10 | 6 | 7,7,7,7 | 11.4 | 81.4±2.0 | 62.4±12.1 | 72.9±5.7 | |
| compact, HRF | 256 | – | – | 32,64,80,160 | 1,1,3,1 | 2,4,5,10 | 4 | 7,7,14,7 | 5.4 | 79.2±5.7 | 30.5±13.9 | 41.2±11.9 | |
| compact, FIVES | 256 | – | – | 64,128,160,320 | 1,1,3,1 | 2,4,5,10 | 4 | 7,7,14,7 | 7.4 | 86.7±10.8 | 32.1±10.7 | 41.2±12.1 | |
| compact, VessMap | 256 | – | – | 64,128,160,320 | 1,1,3,1 | 2,4,5,10 | 4 | 7,7,14,7 | 7.4 | 92.3±1.9 | 81.8±11.5 | 75.7±15.6 | |
TABLE A.3. Patch sizes in the search of compact MEDSAM. Number of trials that reached a validation epoch (Tr.) and their best validation Dice (%). Bold indicates the best performance for each dataset, which set the patch sizes used in the experiments. OOM: every trial ran out of GPU memory.
| Patch (px) | DRIVE | HRF | FIVES | VessMap | ||||
|---|---|---|---|---|---|---|---|---|
| Tr. | Dice | Tr. | Dice | Tr. | Dice | Tr. | Dice | |
| 1 | 0 | OOM | 0 | OOM | 0 | OOM | 0 | OOM |
| 2 | 0 | OOM | 0 | OOM | 0 | OOM | 0 | OOM |
| 4 | 18 | 76.8 | 44 | 78.9 | 4 | 85.3 | 37 | 92.1 |
| 8 | 16 | 70.2 | 13 | 75.0 | 69 | 89.6 | 32 | 90.5 |
| 16 | 56 | 15.7 | 16 | 14.0 | 8 | 82.7 | 6 | 87.0 |
TABLE B.1. Effect of pre-training. LITEMEDSAM and MEDSAM fine-tuned (FT) and trained from scratch, and the best CNN. L: LW-NET, U: CONVUNEXT, N: CONVNEXT. shows the FT value minus Scratch, with an asterisk when the difference is significant. Bold indicates the best value, including the CNN. Underlined values are not significantly different from the best of the same row.
| Dataset | Metric | LITEMEDSAM | MEDSAM | CNN | ||||
|---|---|---|---|---|---|---|---|---|
| FT | Scratch | FT | Scratch | |||||
| DRIVE(n = 20) | Dice | |||||||
| -1.7 | -3.2* | |||||||
| HRF(n = 14) | Dice | +1.1 | ||||||
| -1.1 | ||||||||
| FIVES(n = 200) | Dice | |||||||
| +1.5 | ||||||||
| VessMap(n = 30) | Dice | |||||||
| -2.7 | ||||||||
TABLE C.1. Holm-adjusted p-values of the pairwise tests. A + superscript indicates that the first model of the pair is significantly better (). A – is used when the second configuration is better. LW: LW-NET; CU: CONVUNEXT; CN: CONVNEXT; LM, LM-S, LM-C: LITEMEDSAM fine-tuned, from scratch and compact; M, M-S, M-C: MEDSAM fine-tuned, from scratch and compact.
| Pair | DRIVE | HRF | FIVES | VessMap | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Dice | Dice | Dice | Dice | |||||||||
| LW vs CU | 0.58 | 0.054 | 0.19 | 1.00 | 0.54 | <0.001- | <0.001- | <0.001+ | 1.00 | 1.00 | 1.00 | |
| LW vs CN | <0.001+ | <0.001+ | 1.00 | 1.00 | 0.59 | <0.001- | <0.001- | 0.059 | <0.001+ | <0.001+ | 0.75 | |
| LW vs LM | <0.001- | <0.001+ | 0.25 | <0.001- | <0.001- | <0.001+ | 1.00 | 0.076 | 1.00 | |||
| LW vs LM-S | 0.44 | 0.62 | 1.00 | <0.001- | 0.33 | 1.00 | <0.001+ | 0.15 | ||||
| LW vs LM-C | 0.77 | <0.001- | <0.001+ | 0.47 | 1.00 | <0.001- | <0.001- | <0.001+ | 1.00 | 0.073 | ||
| LW vs M | 1.00 | 0.95 | <0.001+ | 1.00 | 1.00 | <0.001- | <0.001- | 0.12 | 1.00 | 0.49 | 1.00 | |
| LW vs M-S | <0.001+ | <0.001+ | 0.35 | 1.00 | 1.00 | <0.001- | <0.001- | 1.00 | <0.001+ | <0.001+ | ||
| LW vs M-C | <0.001+ | <0.001+ | 0.63 | 1.00 | 1.00 | <0.001- | <0.001- | <0.001+ | <0.001+ | 1.00 | ||
| CU vs CN | <0.001+ | 1.00 | <0.001- | <0.001- | <0.001- | <0.001+ | <0.001+ | |||||
| CU vs LM | <0.001- | <0.001- | 0.49 | <0.001+ | <0.001- | 1.00 | <0.001- | 1.00 | ||||
| CU vs LM-S | <0.001- | 1.00 | <0.001+ | <0.001+ | <0.001- | <0.001+ | 1.00 | |||||
| CU vs LM-C | 0.15 | <0.001- | 0.63 | <0.001+ | <0.001- | <0.001+ | 0.44 | <0.001+ | ||||
| CU vs M | 1.00 | 0.098 | 0.28 | 1.00 | <0.001- | <0.001- | 1.00 | |||||
| CU vs M-S | 0.084 | 1.00 | <0.001- | 1.00 | <0.001- | <0.001+ | ||||||
| CU vs M-C | <0.001+ | 1.00 | <0.001+ | <0.001- | <0.001+ | 1.00 | <0.001+ | |||||
| CN vs LM | <0.001- | <0.001- | 1.00 | <0.001+ | 0.27 | <0.001+ | <0.001- | <0.001- | 0.20 | |||
| CN vs LM-S | <0.001- | <0.001- | <0.001- | <0.001+ | <0.001+ | 0.40 | 0.88 | |||||
| CN vs LM-C | <0.001- | <0.001- | 0.19 | <0.001+ | <0.001+ | <0.001+ | <0.001- | <0.001- | 1.00 | |||
| CN vs M | <0.001- | <0.001- | 0.13 | 1.00 | <0.001- | 1.00 | <0.001- | <0.001- | <0.001- | 1.00 | ||
| CN vs M-S | <0.001- | 0.67 | 0.21 | <0.001- | <0.001- | <0.001+ | 1.00 | 0.52 | ||||
| CN vs M-C | 0.81 | 0.95 | 1.00 | 1.00 | <0.001+ | <0.001+ | <0.001+ | 1.00 | ||||
| LM vs LM-S | <0.001+ | 0.084 | 0.24 | <0.001+ | <0.001+ | <0.001- | <0.001+ | <0.001+ | 0.77 | |||
| LM vs LM-C | <0.001+ | 0.084 | <0.001+ | <0.001+ | <0.001- | <0.001+ | 0.35 | |||||
| LM vs M | <0.001+ | 0.35 | 0.49 | <0.001- | 0.27 | <0.001- | 0.94 | 1.00 | 1.00 | |||
| LM vs M-S | <0.001+ | <0.001+ | 0.35 | 0.46 | 0.25 | <0.001- | <0.001+ | <0.001- | <0.001+ | <0.001+ | ||
| LM vs M-C | <0.001+ | <0.001+ | 0.072 | 0.12 | <0.001+ | <0.001+ | <0.001- | <0.001+ | 0.077 | 0.081 | ||
| LM-S vs LM-C | 1.00 | <0.001+ | 1.00 | 1.00 | 0.12 | 0.69 | <0.001- | <0.001+ | <0.001- | |||
| LM-S vs M | 0.56 | 0.072 | 1.00 | <0.001- | <0.001- | <0.001- | <0.001- | |||||
| LM-S vs M-S | <0.001+ | 1.00 | 1.00 | 1.00 | <0.001- | <0.001- | 0.36 | <0.001+ | 0.98 | <0.001+ | ||
| LM-S vs M-C | <0.001+ | <0.001+ | 0.15 | 0.59 | <0.001- | <0.001- | <0.001+ | 1.00 | 0.52 | <0.001+ | ||
| LM-C vs M | 0.56 | 1.00 | 1.00 | <0.001- | <0.001- | <0.001- | 1.00 | 1.00 | ||||
| LM-C vs M-S | <0.001+ | <0.001+ | 0.11 | 0.49 | 1.00 | 1.00 | <0.001- | <0.001- | <0.001+ | <0.001+ | 1.00 | |
| LM-C vs M-C | <0.001+ | <0.001+ | 0.34 | 0.28 | 1.00 | <0.001- | 1.00 | 1.00 | 0.53 | 1.00 | 1.00 | |
| M vs M-S | <0.001+ | <0.001+ | 1.00 | <0.001+ | <0.001+ | 0.36 | <0.001+ | <0.001+ | ||||
| M vs M-C | <0.001+ | <0.001+ | 0.14 | 0.67 | <0.001+ | <0.001+ | <0.001+ | <0.001+ | 0.38 | |||
| M-S vs M-C | 0.053 | 1.00 | <0.001+ | <0.001+ | <0.001- | <0.001- | 1.00 | |||||
TABLE C.2. Holm-adjusted p-values for Table II (top) and Table III (bottom). LW: LW-NET; CU: CONVUNEXT; CN: CONVNEXT; LM: LITEMEDSAM fine-tuned; M: MEDSAM fine-tuned. See the caption of Table C.1 for the meaning of the + and − superscripts.
| Pair | DRIVE | HRF | FIVES | VessMap | ||||
|---|---|---|---|---|---|---|---|---|
| LW vs CU | 0.36 | 1.00 | 0.23 | <0.001- | <0.001- | 0.29 | ||
| LW vs CN | <0.001+ | 1.00 | 1.00 | <0.001- | <0.001- | <0.001+ | 1.00 | |
| LW vs LM | <0.001- | <0.001+ | 0.001- | 1.00 | <0.001- | <0.001- | 0.084 | |
| LW vs M | 0.70 | <0.001+ | 0.27 | <0.001- | <0.001- | 1.00 | ||
| CU vs CN | 0.43 | 1.00 | <0.001- | 0.14 | 0.55 | |||
| CU vs LM | <0.001- | <0.001- | <0.001+ | <0.001- | 1.00 | |||
| CU vs M | 1.00 | <0.001- | <0.001- | <0.001- | ||||
| CN vs LM | <0.001- | <0.001+ | <0.001+ | <0.001- | 0.55 | |||
| CN vs M | <0.001- | <0.001- | <0.001- | <0.001- | 1.00 | |||
| LM vs M | 1.00 | <0.001- | <0.001- | 0.69 | 0.29 | |||
| MEDSAM | DRIVE | VessMap | ||||
|---|---|---|---|---|---|---|
| Dice | Dice | |||||
| Fine-tuned | <0.001+ | <0.001+ | <0.001+ | <0.001+ | <0.001+ | 0.35 |
| From scratch | <0.001+ | <0.001+ | <0.001+ | <0.001+ | <0.001+ | |
[1] Kai Jin, Xingru Huang, Jingxing Zhou, Yunxiang Li, Yan Yan, Yibao Sun, Qianni Zhang, Yaqi Wang, and Juan Ye, "FIVES: A fundus image dataset for artificial intelligence based vessel segmentation," Scientific Data 9, 475 (2022).
[2] Sara Moccia, Elena De Momi, Sara El Hadji, and Leonardo S Mattos, “Blood vessel segmentation algorithms—review of methods, datasets and evaluation metrics,” Computer Methods and Programs in Biomedicine 158, 71–91 (2018).
[3] Olaf Ronneberger, Philipp Fischer, and Thomas Brox, "U-Net: Convolutional networks for biomedical image segmentation," in Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015, Lecture Notes in Computer Science (Springer, 2015) pp. 234–241.
[4] Nahian Siddique, Sidike Paheding, Colin P. Elkin, and Vijay Devabhaktuni, “U-Net and its variants for medical image segmentation: A review of theory and applications,” IEEE Access 9, 82031–82057 (2021).
[5] Fabian Isensee, Tassilo Wald, Constantin Ulrich, Michael Baumgartner, Saikat Roy, Klaus Maier-Hein, and Paul F. Jäger, “nnU-Net revisited: A call for rigorous validation in 3D medical image segmentation,” in Medical Image Computing and Computer Assisted Intervention – MICCAI 2024, Lecture Notes in Computer Science (Springer, 2024) pp. 488–498.
[6] Jeremiah Fadugba, Patrick Köhler, Lisa Koch, Petru Manescu, and Philipp Berens, “Benchmarking retinal blood vessel segmentation models for cross-dataset and cross-disease generalization,” (2024), arXiv:2406.14994 [eess.IV].
[7] Bastian Wittmann, Yannick Wattenberg, Tamaz Amiranashvili, Suprosanna Shit, and Bjoern Menze, “vesselFM: A foundation model for universal 3D blood vessel segmentation,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2025) pp. 20874–20884.
[8] Adrian Galdran, André Anjos, José Dolz, Hadi Chakor, Hervé Lombaert, and Ismail Ben Ayed, “State-of-the-art retinal vessel segmentation with minimalistic models,” Scientific Reports 12, 6174 (2022).
[9] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby, “An image is worth 16x16 words: Transformers for image recognition at scale,” in International Conference on Learning Representations (ICLR) (2021) arXiv:2010.11929.
[10] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C. Berg, Wan-Yen Lo, Piotr Dollár, and Ross Girshick, “Segment anything,” in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2023) pp. 3992–4003.
[11] Jun Ma, Yuting He, Feifei Li, Lin Han, Chenyu You, and Bo Wang, “Segment anything in medical images,” Nature Communications 15, 654 (2024).
[12] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo, “Swin transformer: Hierarchical vision transformer using shifted windows,” in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) pp. 9992–10002.
[13] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao, “Pyramid vision transformer: A versatile backbone for dense prediction without convolutions,” in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) (2021) pp. 548–558.
[14] Zhe Chen, Yuchen Duan, Wenhai Wang, Junjun He, Tong Lu, Jifeng Dai, and Yu Qiao, “Vision transformer adapter for dense predictions,” in International Conference on Learning Representations (ICLR) (2023).
[15] Jieneng Chen, Yongyi Lu, Qihang Yu, Xiangde Luo, Ehsan Adeli, Yan Wang, Le Lu, Alan L. Yuille, and Yuyin Zhou, “TransUNet: Transformers make strong encoders for medical image segmentation,” (2021), arXiv:2102.04306 [cs.CV].
[16] Peilun Shi, Jianing Qiu, Sai Mu Dalike Abaxi, Hao Wei, Frank P.-W. Lo, and Wu Yuan, “Generalist vision foundation models for medical imaging: A case study of Segment Anything Model on zero-shot medical segmentation,” Diagnostics 13, 1947 (2023).
[17] Lei Ke, Mingqiao Ye, Martin Danelljan, Yifan Liu, Yu-Wing Tai, Chi-Keung Tang, and Fisher Yu, “Segment anything in high quality,” in Advances in Neural Information Processing Systems (NeurIPS) (2023).
[18] Weili Jiang, Jinrong Lv, Xun Gong, Xiaomeng Li, and Chubin Ou, “Gate to the vessel: Residual experts restore what SAM overlooks,” in Advances in Neural Information Processing Systems (NeurIPS) (2025).
[19] Stéphane d'Ascoli, Hugo Touvron, Matthew L. Leavitt, Ari S. Morcos, Giulio Biroli, and Levent Sagun, “ConViT: Improving vision transformers with soft convolutional inductive biases,” in Proceedings of the International Conference on Machine Learning (ICML) (2021).
[20] Maithra Raghu, Thomas Unterthiner, Simon Kornblith, Chiyuan Zhang, and Alexey Dosovitskiy, “Do vision transformers see like convolutional neural networks?” in Advances in Neural Information Processing Systems (NeurIPS) (2021).
[21] Yahui Liu, Enver Sangineto, Wei Bi, Nicu Sebe, Bruno Lepri, and Marco De Nadai, “Efficient training of visual transformers with small datasets,” in Advances in Neural Information Processing Systems (NeurIPS) (2021).
[22] Jeya Maria Jose Valanarasu, Poojan Oza, Ilker Hacihaliloglu, and Vishal M. Patel, “Medical transformer: Gated axial-attention for medical image segmentation,” in Medical Image Computing and Computer Assisted Intervention – MICCAI 2021, Lecture Notes in Computer Science (Springer, 2021) pp. 36–46.
[23] Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie, “A ConvNet for the 2020s,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2022) pp. 11966–11976.
[24] Zhimeng Han, Muwei Jian, and Gai-Ge Wang, “ConvUNeXt: An efficient convolution neural network for medical image segmentation,” Knowledge-Based Systems 253, 109512 (2022).
[25] Joes Staal, Michael D. Abrämoff, Meindert Niemeijer, Max A. Viergever, and Bram van Ginneken, “Ridge-based vessel segmentation in color images of the retina,” IEEE Transactions on Medical Imaging 23, 501–509 (2004).
[26] Attila Budai, Rüdiger Bock, Andreas Maier, Joachim Hornegger, and Georg Michelson, "Robust vessel segmentation in fundus images," International Journal of Biomedical Imaging 2013, 154860 (2013).
[27] Matheus Viana da Silva, Natália de Carvalho Santos, Julie Ouellette, Baptiste Lacoste, and Cesar H Comin, "A new dataset for measuring the performance of blood vessel segmentation methods under distribution shifts," PLOS ONE 20, e0322048 (2025).
[28] Jonathan Long, Evan Shelhamer, and Trevor Darrell, "Fully convolutional networks for semantic segmentation," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2015) pp. 3431–3440.
[29] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin, "Attention is all you need," in Advances in Neural Information Processing Systems, Vol. 30 (Curran Associates, Inc., 2017).
[30] Hu Cao, Yueyue Wang, Joy Chen, Dongsheng Jiang, Xiaopeng Zhang, Qi Tian, and Manning Wang, "Swin-Unet: Unet-like pure transformer for medical image segmentation," in Computer Vision – ECCV 2022 Workshops, Lecture Notes in Computer Science (Springer, 2023) pp. 205–218.
[31] Satoshi Takahashi, Yusuke Sakaguchi, Nobuji Kouno, Ken Takasawa, Kenichi Ishizu, Yu Akagi, Rina Aoyama, Naoki Teraya, Amina Bolatkan, Norio Shinkai, Hidenori Machino, Kazuma Kobayashi, Ken Asada, Masaaki Komatsu, Syuzo Kaneko, Masashi Sugiyama, and Ryuji Hamamoto, "Comparison of vision transformers and convolutional neural networks in medical image analysis: A systematic review," Journal of Medical Systems 48, 84 (2024).
[32] Yichi Zhang, Zhenrong Shen, and Rushi Jiao, "Segment Anything Model for medical image segmentation: Current applications and future directions," Computers in Biology and Medicine 171, 108238 (2024).
[33] Kan Wu, Jinnin Zhang, Houwen Peng, Mengchen Liu, Bin Xiao, Jianlong Fu, and Lu Yuan, "TinyViT: Fast pretraining distillation for small vision transformers," in Computer Vision – ECCV 2022, Lecture Notes in Computer Science (Springer, 2022) pp. 68–85.
[34] Jun Ma, Feifei Li, Sumin Kim, et al., “Efficient MedSAMs: Segment anything in medical images on laptop,” (2024), arXiv:2412.16085 [eess.IV].
[35] Danny Chen, Wenzhong Yang, Liejun Wang, Sixiang Tan, Jiangzhaung Lin, and Wenxiu Bu, “PCAT-UNet: UNet-like network fused convolution and transformer for retinal vessel segmentation,” PLOS ONE 17, e0262689 (2022).
[36] Morteza Tavakol Sadrabadi and Hamed Agahi, “Comparative analysis of retinal vessel segmentation utilising convolutional and transformer-based architectures,” engrXiv preprint (2024).
[37] Ramtin Mojtahedi, Mohammad Hamghalam, Richard K. G. Do, and Amber L. Simpson, “Towards optimal patch size in vision transformers for tumor segmentation,” in Multiscale Multimodal Medical Imaging (MMMI), Lecture Notes in Computer Science, Vol. 13594 (2022) pp. 110–120.
[38] Yixin Zhang, Nicholas Konz, Kevin Kramer, and Maciej A. Mazurowski, “Quantifying the limits of segmentation foundation models: Modeling challenges in segmenting tree-like and low-contrast objects,” in Proceedings of
the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV) (2026) pp. 5205–5215.
[39] Zengqiang Yan, Xin Yang, and Kwang-Ting Cheng, “Joint segment-level and pixel-wise losses for deep learning based retinal vessel segmentation,” IEEE Transactions on Biomedical Engineering 65, 1912–1923 (2018).
[40] Suprosanna Shit, Johannes C. Paetzold, Anjany Sekuboyina, Ivan Ezhov, Alexander Unger, Andrey Zhylka, Josien P. W. Pluim, Ulrich Bauer, and Bjoern H. Menze, “clDice – a novel topology-preserving loss function for tubular structure segmentation,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2021) pp. 16555–16564.
[41] Amarnath R., “Effect of input resolution on retinal vessel segmentation performance: An empirical study across five datasets,” Journal of Imaging Informatics in Medicine (2026), 10.1007/s10278-026-02135-3.
[42] Wentao Liu, Huihua Yang, Tong Tian, Zhiwei Cao, Xipeng Pan, Weijin Xu, Yang Jin, and Feng Gao, “Full-resolution network and dual-threshold iteration for retinal vessel and coronary angiograph segmentation,” IEEE Journal of Biomedical and Health Informatics 26, 4623–4634 (2022).
[43] Fabian Isensee, Paul F. Jaeger, Simon A. A. Kohl, Jens Petersen, and Klaus H. Maier-Hein, “nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation.” Nature Methods 18, 203–211 (2021).
[44] Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama, “Optuna: A next-generation hyperparameter optimization framework,” in Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (ACM, 2019) pp. 2623–2631.
[45] James Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl, “Algorithms for hyper-parameter optimization,” in Advances in Neural Information Processing Systems, Vol. 24 (Curran Associates, Inc., 2011).
[46] Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi, “V-Net: Fully convolutional neural networks for volumetric medical image segmentation,” in 2016 Fourth International Conference on 3D Vision (3DV) (2016) pp. 565–571.
[47] Ilya Loshchilov and Frank Hutter, “Decoupled weight decay regularization,” in International Conference on Learning Representations (ICLR) (2019) arXiv:1711.05101.
[48] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala, "PyTorch: An imperative style, high-performance deep learning library," in Advances in Neural Information Processing Systems, Vol. 32 (Curran Associates, Inc., 2019).
[49] William Falcon and The PyTorch Lightning team, "PyTorch Lightning," Zenodo, version 2.6.1 (2026).
[50] M. Jorge Cardoso, Wenqi Li, Richard Brown, Nic Ma, Eric Kerfoot, Yiheng Wang, Benjamin Surrey, Andriy Myronenko, Can Zhao, Dong Yang, Vishwesh Nath, Yufan He, et al., “MONAI: An open-source framework for deep learning in healthcare,” (2022), arXiv:2211.02701 [cs.LG].
[51] Stéfan van der Walt, Johannes L. Schönberger, Juan Nunez-Iglesias, François Boulogne, Joshua D. Warner, Neil Yager, Emmanuelle Gouillart, Tony Yu, and the scikit-image contributors, “scikit-image: image processing in Python,” PeerJ 2, e453 (2014).
[52] T. Y. Zhang and C. Y. Suen, “A fast parallel algorithm for thinning digital patterns,” Communications of the ACM 27, 236–239 (1984).
[53] Facebook AI Research, “fvcore: Light-weight core library for computer vision frameworks,” GitHub repository, version 0.1.5 (2022).
[54] Frank Wilcoxon, “Individual comparisons by ranking methods,” Biometrics Bulletin 1, 80–83 (1945).
[55] Sture Holm, “A simple sequentially rejective multiple test procedure,” Scandinavian Journal of Statistics 6, 65–70 (1979).
[56] Tim Rädsch, Annika Reinke, Vivienn Weru, Minu D. Tizabi, Nicholas Schreck, A. Emre Kavur, et al., “Labelling instructions matter in biomedical image analysis,” Nature Machine Intelligence 5, 273–283 (2023).
[57] Ilya Loshchilov and Frank Hutter, “SGDR: Stochastic gradient descent with warm restarts,” in International Conference on Learning Representations (ICLR) (2017) arXiv:1608.03983.
[58] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, et al., “SciPy 1.0: fundamental algorithms for scientific computing in Python,” Nature Methods 17, 261–272 (2020).
[59] J. L. Hodges and E. L. Lehmann, “Estimates of location based on rank tests,” The Annals of Mathematical Statistics 34, 598–611 (1963).