Few-shot Adaptation of Medical Vision-Language Models

Fereshteh Shakeri, Yunshi Huang, Julio Silva-Rodríguez, Houda Bahig, An Tang, Jose Dolz, Ismail Ben Ayed · DOI

Abstract

Adapting large-scale vision-language models (VLMs) to specialized medical tasks is often constrained by the scarcity of labeled data and limited computational resources. This paper introduces a structured benchmark for medical VLM adaptation in "strict" few-shot settings (1 to 16 samples). The authors propose LP+text, a text-informed linear probing method that achieves state-of-the-art performance while significantly reducing memory requirements and training time compared to complex prompt-learning strategies.

Introduction

Deep learning in the medical domain is frequently hindered by the "data bottleneck"—the difficulty of obtaining large, high-quality labeled datasets for specific clinical tasks. While foundation models like CLIP, pre-trained on massive image-text pairs, have shown remarkable zero-shot capabilities, they often require fine-tuning to excel in niche medical applications such as grading rare tumors or identifying specific retinal pathologies.

However, current adaptation strategies face two primary hurdles. First, many studies claiming to be "few-shot" actually utilize 1% to 10% of a dataset, which in a medical context can still represent thousands of images. Second, state-of-the-art methods like prompt tuning require backpropagating through large text encoders, demanding high-end hardware (e.g., 28GB of VRAM) that is often unavailable in clinical settings. Furthermore, these methods often require access to internal model weights, making them incompatible with proprietary or privacy-protected "black-box" models.

Methodology

The Benchmark

The authors established a comprehensive evaluation framework across three distinct medical domains, utilizing specialized foundation models for each:

  1. Histology: Utilizing the Quilt-1M model, evaluated on NCT-CRC (colorectal cancer), SICAPv2 (prostate cancer), and SkinCancer datasets.
  2. Ophthalmology: Utilizing the FLAIR model, evaluated on MESSIDOR (diabetic retinopathy), FIVES, and ODIR200x3.
  3. Radiology: Utilizing MedCLIP, evaluated on CheXpert, MIMIC, and RSNA chest X-ray datasets.

The benchmark focuses on the "strict" few-shot regime, testing performance at $S = \{1, 2, 4, 8, 16\}$ images per class.

Adaptation Strategies

The study compares several adaptation paradigms:

  • Prompt Learning (e.g., CoOp, KgCoOp): These methods optimize the input text prompt to describe a class. While powerful, they are computationally intensive and require tuning the text encoder.
  • Adapters (e.g., Tip-Adapter): These insert small, trainable layers between pre-trained encoders.
  • Linear Probing (LP): A baseline where the image encoder is frozen and a simple linear classifier is trained on top. While fast, it often ignores the semantic knowledge within the text encoder.
  • LP+text (Proposed): This method generalizes the linear probe by seeking an optimal blend of visual prototypes (learned from few-shot images) and text embeddings (from the pre-trained model). It uses learnable class-wise multipliers ($\alpha$) and a specialized full-batch optimizer that eliminates the need for manual hyperparameter tuning, making it a robust "plug-and-play" solution.

Key Insights and Results

Performance and Stability

Experimental results demonstrate that simplicity is often underestimated in medical VLM adaptation. LP+text consistently outperformed or matched complex prompt-learning strategies. For instance, in 1-shot histology tasks, LP+text achieved 55.6% accuracy, compared to 46.05% for CoOp and 52.05% for standard LP.

A critical finding was the role of text as an anchor. Standard LP fails in ultra-low-shot scenarios (e.g., 1-shot) because it lacks sufficient visual data to form a boundary. LP+text mitigates this by using pre-trained text knowledge as a "prior" to stabilize learning when images are scarce. Additionally, prompt-learning methods exhibited high variance across different random seeds, whereas LP+text remained stable.

Computational Efficiency

The resource disparity between methods is stark. In tests on the NCT-CRC dataset:

  • Memory: Prompt learning (CoOp) required up to 28GB of peak GPU memory. In contrast, LP+text required only 800MB, allowing it to run on standard consumer laptops rather than server-grade GPUs.
  • Speed: Training LP+text took approximately 4 seconds, while CoOp and CoCoOp required 3 minutes and 12 minutes, respectively.

Black-Box Compatibility

Because LP+text only requires the output embeddings of the encoders, it is uniquely suited for medical environments where the underlying model might be a protected API. It does not require access to the model's internal architecture or gradients for the backbone.

Limitations and Future Work

While LP+text is highly efficient, its performance is ultimately capped by the quality of the underlying foundation model. If a pre-trained model lacks a fundamental understanding of a specific modality, adaptation can only provide marginal improvements. Furthermore, the method still relies on the quality of the initial "domain-expert descriptions" used for text embeddings.

Future research directions include expanding this benchmark to 3D modalities (such as CT or MRI) and investigating the robustness of these efficient adaptation methods against "domain shift," where models must generalize from one clinical institution's data to another's.

Conclusion

This work demonstrates that for medical VLM adaptation, complex is not always better. By effectively leveraging text embeddings as a prior, the LP+text approach provides a high-performance, resource-efficient, and stable alternative to traditional prompt-learning methods, paving the way for easier deployment of foundation models in clinical practice.

Summary updated

BibTeX
@inproceedings{shakeri2025few,
  author = {Fereshteh Shakeri and Yunshi Huang and Julio Silva-Rodríguez and Houda Bahig and An Tang and Jose Dolz and Ismail Ben Ayed},
  title = {{Few-shot Adaptation of Medical Vision-Language Models}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2025},
  url = {https://openreview.net/forum?id=SmPv6jIdoz},
}
Figure