Visual Memory and Textual Alignment for Cross-Modal Few-Shot Segmentation
Authors: Tianqi Wei, Zhi Chen, Xin Yu, Scott Chapman, Zi Huang
Organizations: The University of Queensland, Brisbane, Australia · University of Southern Queensland, Toowoomba, Australia · Adelaide University, Adelaide, Australia
Few-shot segmentation (FSS) aims to segment target objects with limited annotated examples. Recent studies have begun to explore large foundation models to improve generalization for this task. In particular, SAM 3 provides strong visual representations and supports text-guided segmentation. However, its performance remains limited in specialized domains, where semantic prompts and visual representations are often poorly aligned. To address this challenge, we propose ViTA-SAM, a framework built upon SAM 3 that integrates visual memory and textual features through cross-modal alignment. Specifically, we construct a visual memory module that encodes support features together with their corresponding masks, providing support-aware visual guidance for query prediction. In parallel, we leverage the text encoder of SAM 3 to extract semantic features as complementary priors. To bridge the gap between semantic and visual representations, we introduce a cross-modal alignment module that conditions textual features on memory-enhanced visual representations, yielding more consistent and visually grounded predictions. In addition, we propose a pseudo-label refinement strategy that updates the memory with predicted query masks, enabling query-adaptive representation learning. Extensive experiments on multiple benchmarks show that ViTA-SAM achieves the best overall performance among the compared methods, outperforming the strongest competing method by over 5% in average mIoU.
Figures & tables
Figure 1: (a) Under text prompts, predictions show large deviations from the ground truth, revealing severe semantic–visual misalignment under domain shifts. (b) Traditional FSS methods rely on prototype matching between support and query features. (c) Our method introduces textual representations and performs cross-modal alignment with visual features to provide complementary semantic cues.
Figure 2: Overview of ViTA-SAM. The method integrates visual memory and textual alignment to capture both appearance and semantic cues.
Methods
Chest X-ray
ISIC
FSS-1000
Deepglobe
Average
1-shot
5-shot
1-shot
5-shot
1-shot
5-shot
1-shot
5-shot
1-shot
5-shot
Traditional Few-shot Semantic Segmentation Methods
AMP [ 28 ]
51.23
53.04
28.42
30.41
57.18
59.24
37.61
40.61
43.61
45.83
PANet [ 34 ]
57.75
69.31
25.29
33.99
69.15
71.68
36.55
45.43
47.19
55.10
CANet [ 39 ]
28.35
28.62
26.12
29.22
70.67
72.03
20.37
23.03
36.38
38.23
RPMMs [ 36 ]
30.11
30.15
18.02
20.04
65.12
67.06
12.99
13.47
31.56
32.68
Table 1: Quantitative comparison of the proposed ViTA-SAM with existing few-shot and cross-domain few-shot segmentation methods in mIoU (%).
Figure 3: Visualization of output logit maps of the textual and visual modules. From left to right: input images, logits from the aligned text module (T-branch), logits from the visual memory module (V-branch), final prediction, and GT masks.
Visual
Textual
Refine
CXR
ISIC
FSS
DGL
✓
✗
✗
87.28
53.36
85.37
43.10
✗
✓
✗
88.64
46.95
83.90
36.49
✓
✓
✗
90.29
56.98
87.60
43.90
✓
✓
✓
90.53
57.80
87.71
44.42
Table 2: Ablation study of the proposed modules. Visual: visual memory branch; Textual: aligned textual branch; Refine: pseudo-label refinement.
Iteration
CXR
ISIC
FSS
DGL
0
90.29
56.98
87.60
43.90
1
90.53
57.80
87.71
44.42
2
90.59
57.79
87.52
44.11
3
90.61
57.20
87.13
44.09
Table 3: Effect of iterative pseudo-label refinement.
Method
CXR
ISIC
FSS
DGL
SAM 3 (Text)
0.66
0.65
51.04
6.38
SAM 3 (Text + Alignment)
88.64
46.95
83.90
36.49
Table 4: Comparison of the SAM 3 textual branch performance before and after the proposed cross-modal alignment.
Figure 4: Comparison of response maps from raw SAM 3 and ViTA-SAM.