A dataset of clinically similar image pairs from citation-linked case reports for medical image retrieval
Organizations: School of Computer Science and Engineering, The Hebrew University of Jerusalem, Jerusalem, Israel · National Center for Tumor Diseases West, Essen, Germany · Institute of Artificial Intelligence in Medicine, University Hospital Essen, Essen, Germany · Department of Diagnostic and Interventional Radiology, School of Medicine and Health, Technical University of Munich, Munich, Germany ·
Abstract
Retrieving images of patients clinically similar to a given patient can support diagnosis, teaching and research. Training and evaluating retrieval systems requires knowing which images of different patients show the same finding, and existing datasets are small or narrow in scope. We construct PMC-PaIR, a dataset of 86,144 pairs of clinically similar images from 56,013 open-access PubMed Central case reports, which often document rare or challenging presentations. We develop an approach that follows citations, which often link case reports of similar patients. To determine what two linked cases share clinically, it prompts large language models to generate and answer hierarchical questions, from modality to diagnosis and findings, and to match images by caption using the answers. Experts find the pairs highly accurate, and this question-guided approach finds twice as many correct pairs as direct matching. Fine-tuning BiomedCLIP on PMC-PaIR improves retrieval in all modality, anatomy and diagnosis categories tested, for image-only queries and image queries with a short text naming the finding. We release the dataset and the automated pipeline, which can extend PMC-PaIR as new case reports are published.
Figures & tables
| Processing step | Count |
|---|---|
| Selected cases | 138,103 |
| Candidate case pairs | 159,388 |
| Excluded: full-text XML or figure files unavailable | 2,669 |
| Excluded: a case had no retained captioned figure | 31,969 |
| Excluded: a case had no case description | 353 |
| Excluded: citation link not confirmed | 2,032 |
| Stage | Item | Content |
|---|---|---|
| Stage 4 input | Caption of 9899453_1_1 (case A) | T2-weighted and diffusion-weighted MRI findings of paraspinal and epidural abscesses, together with follow-up changes. |
| Caption of 4023003_1_3 (case B) | Contrast-enhanced T1-weighted MRI showing paraspinal collections with thick enhancing walls and extension into the spinal canal. | |
| Stages 2 and 3 | Level 1: modality and organ system | Was spinal MRI the key test identifying paraspinal muscle infection with epidural extension in both cases? Yes. MRI identified paraspinal muscle infection with contiguous epidural abscess extension in both cases. |
| Level 2: diagnostic category | Are both cases classified as pediatric paraspinal muscle infection complicated by spinal epidural abscess? Yes. Both describe a pediatric muscle abscess complicated by spinal epidural abscess. | |
| Level 3: specific findings | Did both cases show MRI findings supporting an abscess rather than diffuse cellulitis alone? Yes. Case A shows diffusion-weighted epidural/posterior spinal canal findings consistent with an abscess. Case B shows intramuscular fluid collections with thick enhancing walls. | |
| Stage 4 output | pair_id | 9899453_1_1 , 4023003_1_3 |
| File | Format | Contents |
|---|---|---|
| image_pairs.json | JSON | 86,144 positive pairs with shared modality, anatomy and diagnosis descriptors |
| image_labels.jsonl | JSONL | Modality, anatomy and diagnosis labels of 86,893 images |
| label_taxonomy.json | JSON | Label categories and mapping rules |
| case_pair_citations_eligible.json | JSON | Citation contexts and citation-intent analyses of 121,831 case pairs |
| case_pair_questions_answers_eligible.jsonl | JSONL | Generated questions and answers for 121,831 case pairs |
| images_captions_001.zip to images_captions_004.zip | ZIP | 86,825 images (JPEG) and their captions (text) |
| Measure | Category | Count (%) |
|---|---|---|
| Modality labels | CT | 40,327 (46.4) |
| MRI | 20,104 (23.1) | |
| Radiography | 13,459 (15.5) | |
| Anatomy labels | Thorax/respiratory | 12,851 (14.8) |
| Musculoskeletal | 12,127 (14.0) | |
| Vasculature | 11,827 (13.6) |
| Check | Sample | Outcome |
|---|---|---|
| Citation-intent analyses | 25 randomly sampled case pairs | Supported 22 (88.0%; 68.8–97.5); partly supported 2 (8.0%; 1.0–26.0); not supported 1 (4.0%; 0.1–20.4) |
| CHIPA versus single-step annotation | 50 randomly sampled case pairs; all 29 image pairs proposed by either workflow | CHIPA: precision 25/25 (100.0%; 86.3–100.0); relative recall 25/27 (92.6%; 75.7–99.1). Single-step: precision 12/14 (85.7%; 57.2–98.2); relative recall 12/27 (44.4%; 25.5–64.7) |
| Image pairs | 163 randomly sampled pairs; two independent reviewers, then consensus | Yes 147 (90.2%; 84.5–94.3); Borderline 6 (3.7%; 1.4–7.8); No 10 (6.1%; 3.0–11.0); unweighted Cohen’s = 0.70 before consensus |
| Image-level labels | 320 images in the reviewed pairs | Yes 299 (93.4%; 90.1–95.9); Borderline 1 (0.3%; 0.0–1.7); No 20 (6.3%; 3.9–9.5) |
| Top five candidates of the fine-tuned (i+t)2i model | 17 randomly sampled CT test queries with heart or vasculature labels; 85 query–candidate pairs; one board-certified radiologist | Radiologist-rated Hit@5: modality 17/17 (100.0%; 80.5–100.0); anatomy 17/17 (100.0%; 80.5–100.0); diagnosis 12/17 (70.6%; 44.0–89.7); all three 11/17 (64.7%; 38.3–85.8) |
| Setting | i2i | (i+t)2i |
|---|---|---|
| Text input | None | Pair descriptions of up to 256 tokens |
| Trained parameters | Image encoder, with layer-wise learning-rate decay of 0.75 | Text encoder and image encoder except blocks 1–8 |
| Loss | InfoNCE, temperature 0.10 | Image–image (weight 0.3) and image–text (weight 0.6) triplet-ranking losses, margin 0.09, over the mean score of up to four highest-scoring eligible negatives |
| Negatives | Eligible images in the batch | Images and descriptions in the batch; batches assembled with mined hard negatives |
| Augmentation | Crop jitter, brightness and contrast jitter, rotation of up to 5 ∘ | Crop jitter |
| Batch size | 128 anchor–positive pairs | 128 image pairs |
| Configuration | Metric | Pretrained | Fine-tuned | Difference (95% CI) |
|---|---|---|---|---|
| i2i | Recall@10 (%) | 14.62 | 20.15 | 5.53 (4.61 to 6.55) |
| Hit@10 (%) | 21.47 | 28.31 | 6.84 (5.73 to 8.09) | |
| MRR | 0.111 | 0.143 | 0.033 (0.027 to 0.039) | |
| Median rank | 65 | 37 | ||
| (i+t)2i | Recall@10 (%) | 20.53 | 31.62 | 11.09 (9.89 to 12.38) |
| Hit@10 (%) | 29.68 | 42.98 | 13.30 (12.07 to 14.66) |