MedCLIP
A CLIP-style medical image and text model trained with a semantic matching loss on unpaired data.
Medical imaging · 1,064 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Medical imaging
- Parameters
- 136.6M
- Operations
- 1,064
- Framework
- PyTorch
- Recurrent
- No
- Published
- EMNLP 2022
- Cited by
- 782 (as of 22 October 2026)
- Authors
- Zifeng Wang, Zhenbang Wu, Dinesh Agarwal, Jimeng Sun
- Source
- GitHub: RyanWangZf/MedCLIP
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m1742
- Graph hash
- f44dc62aadaba5b2117f64bcfc3464280109baa9cf3e5148a7649e71be423261
- Skeleton hash
- 3219ac16568840461832971cc9e562d96e03f1d6dbc534091d17734dd68f31c5
- Architecture hash
- 1d831307700138f2534aed6b242fefb033054cea9881de5486670ec6f862eb9c
- Diagram SHA-256
- 1970b2125e06d6e45ced9057b8cf0c3c27860d3e22315ed85b5a544491fcd69f
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
MedCLIP is a CLIP-style model for medical images and text, made of one visual encoder and one text encoder. The paper targets two limits of earlier medical image-text contrastive learning: paired image and report data is scarce, and images and reports from separate patients are treated as negatives even when they carry the same meaning. Its answer to the first is to decouple images and texts, so that image-only and text-only datasets can be used for training.
For the second, it replaces the InfoNCE loss with a semantic matching loss based on medical knowledge. MetaMap extracts medical entities from report sentences and maps image labels to the same concepts, and multi-hot vectors built from those entities describe both images and texts. The loss is the cross entropy between the image-text logits and soft targets computed from those vectors.
In the paper's implementation the text encoder is BioClinicalBERT and the vision encoder is a Swin Transformer. Each encoder is followed by a linear projection head with output dimension 512. The authors report that MedCLIP pre-trained on 20K samples gave better zero-shot results on CheXpert-5x200 than GLoRIA trained on around 200K image-text pairs.
Key idea. MedCLIP decouples medical images and texts for contrastive learning and replaces the InfoNCE loss with a semantic matching loss built from medical knowledge to remove false negatives.
- medclip
- medical image-text contrastive learning
- medical vision-language pre-training
- chest x-ray
- zero-shot classification
- image-text retrieval
- unpaired medical images and text
- semantic matching loss
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{wang2022medclipcontrastivelearningunpaired,
title={MedCLIP: Contrastive Learning from Unpaired Medical Images and Text},
author={Zifeng Wang and Zhenbang Wu and Dinesh Agarwal and Jimeng Sun},
year={2022},
eprint={2210.10163},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2210.10163},
}