cs.CVAug 22, 2026

Retrieval-Augmented Visual Prompting: Guiding Foundation Models in Two-Photon Imaging

Authors: Salvatore Calcagno, Marco Finocchiaro, Giovanni Bellitto, Daniela Giordano, Concetto Spampinato, Federica Proietto Salanitri

Organizations: PeRCeiVe Lab Department of Electrical, Electronic and Computer Engineering University of Catania, Catania, Italy

Abstract

Two-photon calcium imaging presents a challenging setting for foundation models: image appearance varies substantially across recordings and experimental conditions, annotations are scarce, and rapid adaptation is often needed. Rather than adapting model weights through fine-tuning, we ask whether a foundation model can be guided at inference time by injecting external visual memory directly into its input. We implement this idea with SAM 3 and introduce Retrieval-Augmented Visual Prompting (RAVP), a framework in which each target tile is augmented with a retrieved annotated exemplar whose bounding box is used as a concept prompt. RAVP turns retrieval into a form of visual prompting and enables adaptation through input design alone. We study multiple exemplar selection strategies, including fluorescence-guided heuristics and a lightweight recall predictor trained to estimate which exemplar is most informative for a target tile. Experiments on the Allen Brain Observatory show that exemplar-augmented inference consistently strengthens zero-shot neuron detection and instance segmentation. Ablation studies further show that a single carefully selected exemplar is more effective than prompting with multiple retrieved examples. These results position inference-time visual memory injection as a simple and effective alternative to parameter adaptation for foundation models in specialized biomedical imaging.

Figures & tables

Appendix figures & tables4 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. See First, Answer Later: Visual Evidence Pre-Alignment via Sufficiency-Driven RL

    Jun 16, 2026Yilian Liu, Sicong Leng, Guoshun Nan +7Multimodal PretrainingVisually Grounded Reasoning

  2. Calibrating Retrieval Geometry: Reliability-Guided Training-Free Aggregation for Visual Place Recognition

    Sep 22, 2026Xin Li, Zhimin Mao, Shang Wang +2Visual Place RecognitionFeature Fusion