Large-scale medical vision-language pretraining from PubMed Central
Abstract
Biomedical figures are usually compound: a single figure packs several panels, each a different imaging modality, anatomy, or concept, all sharing one caption. Pairing the whole compound figure with that caption injects noise into contrastive pretraining. Open-PMC takes a quality-first approach: decompose compound figures into panels, then align each panel with its caption.
Open-PMC-18M scales this to 18 million subfigure-caption pairs spanning radiology (CT, MRI, X-ray), microscopy (histopathology, blood & tissue), and visible-light photography (dermatology, retinal fundus), using a transformer-based subfigure extractor trained on 500K synthetic compound figures.
How the dataset is built
A typical PubMed Central figure is a compound panel: a CT scan beside a histology slide beside a chart, all sharing one caption. Pairing that whole figure with the caption is the misalignment most medical datasets bake in. Open-PMC-18M removes it by decomposing figures into their panels first, then pairing and filtering.
Concretely, we start from 6M PMC compound figures (PMC-6M), run a transformer detector that cuts them into roughly 32M single panels, and keep the 18M panels a relevance classifier judges clinically meaningful, each now aligned to the caption text that describes it.
Caption (shared, illustrative). (A) Axial CT of the abdomen. (B) H&E-stained histology of the resected mass. (C) Dermoscopic view of the associated skin lesion.
One caption describes a CT panel, a histology panel, and a dermoscopy panel. Pairing the whole figure with this caption forces the model to align three unrelated images with one text, which is the noise Open-PMC removes.
Running the detector on the figure above returns three bounding boxes, one per panel. Each dashed box below is a cropped-out panel, tagged with the modality it belongs to:
The final dataset is dominated by pathology and microscopy, with radiology and visible-light photography making up the rest, and captions that are often long and detailed.
Captions average 165.8 tokens; 19.5% exceed 256 tokens, up to a maximum of 7,352.
Step 2 above is the technical core. To train a panel detector at scale we need labeled compound figures, but annotated ones are scarce. So we compose synthetic compound figures from single-panel images, which hands us exact ground-truth boxes for free, then train on 500K of them.
Classical splitters rely on whitespace, edges, or layout heuristics and break on irregular panels. Instead we frame extraction as object detection: given a compound figure, predict a bounding box around every subpanel. We use DAB-DETR (Dynamic Anchor Box DETR), a transformer detector whose queries are explicit 4-D anchor boxes (x, y, w, h) refined layer by layer. Anchoring queries to real boxes gives sharper localization and faster convergence than vanilla DETR, which matters for the tight, non-uniform layouts of published figures.
Annotated compound figures are scarce; prior work trained on just 2,069 hand-labeled MedICaT figures. We reverse the problem: instead of decomposing figures, we compose them. A generator samples single-panel images, arranges them on randomized grids with varied margins, label schemes (1, a, a1, a-1), and aspect ratios, and records exact ground-truth boxes for free. Trained on 500,000 such figures, the detector hits 98.6% mAP on held-out synthetic data and beats the MedICaT model on real ImageCLEF 2016 figures (36.9 vs 28.2 mAP).
Results
Zero-shot cross-modal retrieval with the released Open-PMC-18M checkpoint, with no task-specific fine-tuning. Recall@200 for image→text and text→image across three modalities.
| Benchmark | Image → Text | Text → Image |
|---|---|---|
MIMIC-IV-CXR Chest X-ray · test |
27.47% | 28.14% |
Quilt-1M Histopathology · val |
25.53% | 27.16% |
DeepEyeNet Retina · test |
19.30% | 20.48% |
Produced by the scripts in
evaluation/zero_shot_retrieval/; by default they pull the released
Open-PMC-18M checkpoint
from the Hugging Face Hub, so you just point each script at its dataset root directory.
| Model | Synthetic mAP | Synthetic F1 | ImageCLEF 2016 mAP | ImageCLEF 2016 F1 |
|---|---|---|---|---|
| Previous model (MedICaT) | 33.22 | 73.18 | 28.20 | 64.85 |
| Our model (DAB-DETR) | 98.58 | 99.96 | 36.88 | 73.55 |
Across zero-shot classification (18 tasks in radiology, microscopy, and VLP), Open-PMC-18M also achieves the highest average performance and improved robustness under visual perturbations; see the paper for full tables.
Get started
# Load the Open-PMC-18M CLIP checkpoint via open_clip
import torch, open_clip
from PIL import Image
model, _, preprocess = open_clip.create_model_and_transforms(
"hf-hub:vector-institute/open-pmc-18m-clip"
)
tokenizer = open_clip.get_tokenizer(
"hf-hub:vector-institute/open-pmc-18m-clip"
)
model.eval()
# Encode an image and candidate captions
image = preprocess(Image.open("panel.png")).unsqueeze(0)
text = tokenizer(["chest x-ray", "H&E histology", "retinal fundus"])
with torch.no_grad():
img_feat = model.encode_image(image)
txt_feat = model.encode_text(text)
img_feat /= img_feat.norm(dim=-1, keepdim=True)
txt_feat /= txt_feat.norm(dim=-1, keepdim=True)
probs = (100.0 * img_feat @ txt_feat.T).softmax(dim=-1)
print(probs)
# Reproduce the retrieval numbers above.
# Scripts default to the released HF checkpoint;
# just set each dataset's root directory.
# Histopathology: Quilt-1M
QUILT_ROOT_DIR=/data/quilt \
bash evaluation/zero_shot_retrieval/quilt.sh
# Chest X-ray: MIMIC-IV-CXR
MIMIC_ROOT_DIR=/data/mimic \
bash evaluation/zero_shot_retrieval/mimic.sh
# Retina: DeepEyeNet
DEN_ROOT_DIR=/data/deepeyenet \
bash evaluation/zero_shot_retrieval/deepeyenet.sh
# To score a local checkpoint instead:
# export CKPT=/path/to/open_clip_model.pt
See evaluation/README.md for the full list of datasets and options, including zero-shot classification.
Citation
@article{baghbanzadeh2025open,
title={Open-pmc-18m: A high-fidelity large scale medical dataset
for multimodal representation learning},
author={Baghbanzadeh, Negin and Islam, Mohammed Saidul and
Ashkezari, Sajad and Dolatabadi, Elham and Afkanpour, Arash},
journal={arXiv preprint arXiv:2506.02738},
year={2025}
}
@article{baghbanzadeh2025advancing,
title = {Advancing Medical Representation Learning Through
High-Quality Data},
author = {Baghbanzadeh, Negin and Fallahpour, Adibvafa and
Parhizkar, Yasaman and Ogidi, Franklin and Roy, Shuvendu and
Ashkezari, Sajad and Khazaie, Vahid Reza and Colacci, Michael
and Etemad, Ali and Afkanpour, Arash and Dolatabadi, Elham},
journal = {arXiv preprint arXiv:2503.14377},
year = {2025}
}
Dataset & code: github.com/VectorInstitute/pmc-data-extraction · 🤗 Open-PMC-18M collection