TL;DR
MedPrompt is a new weakly supervised prompt learning framework that automates the generation of medical text prompts for vision-language models, removing the need for time-consuming manual engineering by clinicians. By utilizing a lightweight, instance-adaptive prompt generator, it achieves state-of-the-art zero-shot and few-shot medical image classification performance across multiple chest X-ray benchmarks.
What Problem Does This Paper Address?
Deep learning has shown immense promise in medical image recognition, but it heavily relies on large, precisely annotated datasets. In medicine, obtaining these labels requires expensive, highly specialized domain expertise, leading to a persistent "low-resource" data challenge.
Recently, large-scale pre-trained vision-language models (VLMs) like CLIP have offered a way out. By aligning images with text (such as radiology reports), these models can perform "zero-shot" classification using text prompts (e.g., "An X-ray showing subsegmental atelectasis"). However, as shown in the figure below, designing these prompts is highly dataset-dependent and requires clinicians to meticulously hand-craft descriptions of disease subtypes, severity, and locations.
This manual prompt engineering creates a new bottleneck. The authors introduce MedPrompt to eliminate this expert dependency by automatically learning optimal medical prompts directly from the data.
Methods
MedPrompt consists of two primary stages: Unsupervised Pre-training and Weakly Supervised Prompt Learning.
[Image] ---> [Image Encoder] ---> [Meta-Net] ---> Conditional Token (π)
+
[Context Embeddings (V)]
+
[Class Embeddings (C)]
│
▼
[Auto Prompt Embeddings]
- Pre-training Stage: The framework decouples image-report pairs from large datasets (CheXpert and MIMIC-CXR). Instead of strict one-to-one pairing, it uses a knowledge extractor (Negbio) to pull medical entities from reports and computes a ground-truth semantic similarity matrix to train the image and text encoders.
- Prompt Learning Stage: Once pre-trained, the image and text encoders are frozen. MedPrompt introduces an instance-adaptive prompt generator. For every input image, a lightweight two-layer bottleneck network (Meta-Net) generates a unique conditional token ($\pi$). This token is combined with a set of learnable context word embeddings ($V$) and class embeddings ($C_k$) to form the final prompt embedding.
This architecture is detailed in the overall framework diagram:
The learning is weakly supervised because the model only requires coarse dataset class labels to optimize the prompt generator; it requires no manual text annotations or natural language templates.
Datasets
The authors evaluated MedPrompt across four major chest X-ray benchmarks:
- CheXpert & MIMIC-CXR: Used for large-scale pre-training. For downstream evaluation, 5-class multi-class subsets (CheXpert-5×200 and MIMIC-CXR-5×200) were sampled.
- COVID: A publicly available dataset containing COVID and non-COVID X-rays, used strictly for downstream evaluation to test cross-dataset generalization.
- RSNA: A chest X-ray dataset for pneumonia detection, also used exclusively for downstream evaluation.
Key Insights and Ideas
- Zero-Shot Beats Full Supervision: Remarkably, MedPrompt’s zero-shot performance (without seeing a single training image from the target dataset) outperformed the fully supervised versions of older architectures (like ConVIRT and GLoRIA) on CheXpert, MIMIC-CXR, and COVID.
- Instance-Adaptive Flexibility: Unlike static prompts (e.g., "a photo of a [CLASS]"), generating prompts conditioned on the specific image instance allows the model to learn richer, more transferable representations that generalize better to unseen disease categories.
- Extreme Efficiency: The entire prompt generator module contains only 86,016 parameters and requires 86,112 FLOPs. This accounts for a mere 0.048% of the total model parameters, making it lightweight enough to be embedded into edge or mobile network architectures.
Key Results
- Zero-Shot Classification: MedPrompt achieved state-of-the-art zero-shot performance on CheXpert (0.6220), MIMIC-CXR (0.5720), and COVID (0.7997), outperforming MedCLIP and other baselines using hand-crafted prompts.
- Few-Shot Learning: With as few as 4 labeled samples per class for fine-tuning, MedPrompt's classification accuracy surpassed the zero-shot performance of SOTA manual prompt models across all datasets.
- Fully Supervised Performance: When fully fine-tuned, MedPrompt achieved an accuracy of 0.9553 on the COVID dataset and 0.8304 on RSNA, substantially outperforming standard CLIP and medical VLM baselines.
Limitations and Future Work
Despite its success, the authors note a few limitations:
- Domain Gaps in Annotations: MedPrompt performed slightly worse than MedCLIP in a zero-shot setting on the RSNA dataset. The authors attribute this to the fact that MedPrompt was trained on labels generated by automated tools (Negbio), creating a domain gap when evaluated against RSNA's manual expert annotations.
- Modality Constraints: The current model was only trained and evaluated on X-ray images. Its performance on other critical modalities like MRI or CT scans remains unproven.
- Task Scope: The framework has only been validated on image classification. Future work will focus on expanding the model to handle more complex downstream clinical tasks, such as medical image segmentation, object detection, and report generation.
Summary updated