WorksComputer Science
A dataset of clinically similar image pairs from citation-linked case reports for medical image retrieval
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.
Curation pipeline: https://github.com/GuyShmueli/pmc-pair-pipeline
Retrieval code: https://github.com/GuyShmueli/pmc-pair-retrieval
Dataset: https://huggingface.co/datasets/dhtandguy21/PMC-PaIR
Model: https://huggingface.co/dhtandguy21/PMC-PaIR-BiomedCLIP
Background & Summary
Clinicians facing an unfamiliar presentation, educators assembling teaching material and researchers studying a disease often need images of other patients with clinically similar findings. Content-based medical image retrieval addresses this need by ranking images by their similarity to a query image, [1] and retrieval from the literature can also improve the diagnostic predictions of vision–language models. [2] Developing and evaluating such systems requires data that specify which images of different patients are clinically similar.
Published case reports could potentially be a valuable source of such images. A case report describes an individual patient in detail, including imaging, and is often published because the presentation is rare, atypical or diagnostically challenging. Comparable cases are therefore scarce in any single institution’s archive but can be found across the literature. The PubMed Central (PMC) Open Access Subset makes many such reports and their figures available for reuse. [4]
However, existing datasets of PMC figures relate each figure only to text from its own article, whether they draw on articles of any type, such as ROCOv2, MedICaT and PMC-15M, [5, 6, 7] or on case reports, such as MultiCaRe. [8, 9] Medical image retrieval benchmarks either cover many modalities and body regions with few queries or are restricted to a single modality or body region. ImageCLEF [10] and the image-retrieval task of M3Retrive [11] have a few dozen to several hundred queries, whereas 3D-MIR covers computed tomography (CT) volumes of four organs [12] and RadIR covers chest radiographs and chest CT scans. [13] None of these resources provides clinically similar image pairs at scale across modalities, body regions and diseases.
We present PMC-PaIR (PubMed Central Patient Image Retrieval), a dataset of 86,144 pairs of clinically similar images from 56,013 open-access case reports (Figure 1). Two radiological, nuclear-medicine or ophthalmic images from different reports are clinically similar when they share an imaging modality, an anatomical region and a type of abnormality, such as an abscess or an aneurysm. We build on PMC-Patients, which links the patients of two case reports whenever one cites the other. [24, 25] Because authors often cite earlier reports of similar patients, we form image pairs between linked reports. PMC-Patients does not, however, examine why the citation was made or link the figures of the two reports. A citation alone does not indicate which figures correspond, because a report’s figures may show the primary disease, a complication, a coexisting condition or the result of treatment, and authors cite earlier reports for many reasons. Expert annotation of image pairs is costly, [26] and labels extracted automatically from radiology reports [27] can differ from what individual images show. [28] For each pair of linked reports, or case pair, large language models (LLMs) therefore identify the reason for the citation from its citation contexts, compare the two cases through structured questions that progress from imaging modality and organ system to diagnosis and specific findings, and then match figures by caption. We call this procedure citation-guided hierarchical image-pair annotation (CHIPA). On randomly selected case pairs, CHIPA finds about twice as many correct pairs as direct matching from full articles, and no incorrect ones. As the models read only text, the pairs are independent of any image model.
Figure 1. Construction of PMC-PaIR and the two retrieval tasks. Cases whose source articles are linked by a citation form case pairs (left), of which 122,365 were annotated. For each case pair, language models that read only text (1) state why report A cites report B, (2) ask comparative questions that move from imaging modality and organ system to diagnosis and specific findings, (3) answer them from the case descriptions and (4) match images whose captions describe the same modality, anatomy and type of abnormality, recording descriptors of what they share. After post-processing, 86,144 image pairs remained (right). In the two retrieval tasks (bottom), abbreviated i2i and (i+t)2i, each test image serves as a query, either alone or with the descriptions of its pairs, and the other test images, except those linked to it only indirectly, are ranked to retrieve the images paired with it. Models are listed in Table 1, and the prompts are given at the end of Methods. The example in steps 1–4 is the case pair [14, 15] of Table 2, with abridged text and schematic images. The retrieval example is the query of Figure 2, with images reproduced, cropped, from the source articles of the query, its positive and the other test images shown, [16, 17, 18, 19, 20, 21, 22, 23] under the licenses given in the legend of Figure 2. CT, computed tomography; MRI, magnetic resonance imaging.
The dataset covers case reports published until February 2026, and we release the automated curation pipeline, which can be rerun as PMC grows. Each pair is annotated with the modality, anatomy and diagnosis its two images share, and we derived image-level labels in 12 modality, 20 anatomy and 40 diagnosis categories. We assigned all 86,893 images to training, validation and test partitions such that no pair or source article spans two partitions, preventing leakage between them. The release also includes citation contexts and generated citation-intent analyses, questions and answers for 121,831 case pairs.
Two experts reviewed a sample of pairs and judged the large majority to match and none to differ in diagnosis, and the image-level labels were also highly accurate. Fine-tuning the vision–language model BiomedCLIP[7] on the pairs improves retrieval in every modality, anatomy and diagnosis category tested, both for queries consisting of an image alone (Figure 2) and, more strongly, for queries that add a short text naming the finding of interest, as when a clinician searches for a specific abnormality. PMC-PaIR also supports representation learning, figure classification and, through the citation records and questions and answers, the study of citation intent and the training of models that compare clinical cases.
Figure 2. Example of image-only retrieval. a, Test query 5748087_1_2, a CT image of a splenic artery aneurysm, and its only positive, the single image paired with it in PMC-PaIR. The image-only (i2i) model does not use the pair description shown. b,c, The five highest-ranked candidates of pretrained BiomedCLIP (b) and of the fine-tuned i2i model (c), labeled with the finding they show. Fine-tuning moved the positive, marked in c, from rank 29 to rank 1 among 7,844 candidates. The query was chosen for illustration. Images are reproduced, some cropped, from the source articles of the query, [16] the positive [17] and the candidates showing an adrenal pheochromocytoma, [18] a splenic laceration, [19] a gastric tumor, [20] an accessory spleen, [21] an aortic thrombus [22] and a contained aortic rupture, [23] under the Creative Commons Attribution 4.0 license (https://creativecommons.org/licenses/by/4.0/), except the last, which is reproduced under the Creative Commons Attribution 3.0 license (https://creativecommons.org/licenses/by/3.0/). CT, computed tomography.
Methods
Throughout, a case is a patient record in PMC-Patients, and its source article is the publication that reports it. Two cases form a case pair when one source article cites the other; each case pair is counted once, regardless of citation direction. An image is one published figure, which may contain several panels. An image pair consists of one image from each source article of a case pair. The image pairs included in PMC-PaIR are positive pairs, and the positives of an image are the images that form a positive pair with it.
We selected citation-linked case pairs and their figures, annotated image pairs with CHIPA (Figure 1), derived image-level labels and partitioned the images for benchmarking (Figure 3). Table 1 gives the counts after each processing step and the model used at each stage of CHIPA.
Table 1 | Inputs, outputs and models of the annotation. Counts are given after each processing step, and the exclusion rows give the case pairs removed by each selection criterion, applied in the order shown. All models are OpenAI models, and the reasoning-effort setting controls how much internal reasoning a model performs before answering.
| 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 |
| Case pairs submitted for annotation | 122,365 |
| Image pairs proposed | 93,113 |
| Case pairs removed by the veterinary-report filter | 534 |
| Case-pair citation records released | 121,831 |
| Image pairs released | 86,144 |
| Stage of CHIPA | Model (reasoning effort) |
| Stage 1 (citation-intent analysis) | gpt-5.4-mini (medium) |
| Stage 2 (question generation) | gpt-5.4-nano (high) |
| Stage 3 (question answering) | gpt-5.4-nano (high) |
| Stage 4 (image-pair proposal) | gpt-5.4-mini (low) |
Table 1. Inputs, outputs and models of the annotation. Counts are given after each processing step, and the exclusion rows give the case pairs removed by each selection criterion, applied in the order shown. All models are OpenAI models, and the reasoning-effort setting controls how much internal reasoning a model performs before answering.
Figure 3. Partitioning by article groups. a, Positive pairs link images, each tagged with the number of its source article, into connected components. Because images C and D come from the same source article (article 1) but lie in different components, their components are merged into one article group without adding a pair. b, Whole article groups are assigned to the training, validation and test partitions in proportions of 80:10:10 by number of groups, so that no positive pair or source article spans two partitions. Images are schematic.
Selection of citation-linked case pairs
We drew cases from two versions of PMC-Patients, the published collection of 167,034 cases from 140,897 articles published until January 2022[24, 25] and a collection of 319,939 cases from 268,151 articles published until February 2026, which we regenerated with the published construction code [24] from the PMC Open Access Subset and PubMed files downloaded in March 2026. We excluded records of the regenerated collection that lacked citation information. Because figures from an article that reports several patients cannot be reliably attributed to one of them, we retained only articles associated with exactly one case in their collection.
Candidate case pairs were the citation-based links that PMC-Patients records between the retained cases.[24] From the regenerated collection, we added only pairs containing at least one case absent from the published collection. Excluding cases without a candidate pair left 138,103 distinct cases in 159,388 candidate case pairs (Table 1).
Figures, case descriptions and citation evidence
For each selected case, we obtained the full-text Extensible Markup Language (XML) and figure files of the source article from the PMC Open Access Subset[4] and linked each figure and its caption to the case. To remove diagrams and text-heavy figures, we discarded images with predominantly white backgrounds and, among the remaining images, those in which Tesseract optical character recognition (through pytesseract) detected extensive text, using thresholds given in the code of the curation pipeline (Code Availability). We took the case description from the article sections with case-report headings such as ‘Case presentation’ or ‘Case report’.
We verified each citation link by searching the reference list of each article for an entry identifying the other article, and a matching entry in either article confirmed the link. We matched entries on the digital object identifier (DOI), PubMed identifier (PMID) or PubMed Central identifier (PMCID), in that order, accepting a match on any one identifier and using normalized title substring matching as a fallback. As citation evidence, we collected the titles and abstracts of both articles and the citation contexts, that is, the paragraphs and table rows whose cross-reference (<xref>) elements point to the matched entry. For author–year citations that are not linked to the bibliography in the article XML, the link was confirmed from the reference list, but no citation context could be extracted.
We submitted a case pair for annotation only if the full-text XML and figure files of both articles were available, each case had at least one retained figure with a valid caption and a case description, and the citation link was verified. Of the 159,388 candidate case pairs, 122,365 met these criteria (Table 1).
Image-pair annotation with CHIPA
CHIPA annotates each case pair with four successive LLM calls (Figure 1): citation-intent analysis, question generation, question answering and image-pair proposal. Dividing the task gives each call a narrower objective and allows each stage to use a different model and reasoning-effort setting (Table 1). The prompts are reproduced at the end of Methods, and Table 2 shows the captions given to stage 4 and the outputs of stages 2–4 for one case pair.
| 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 |
modality | MRI | |
anatomy | lumbar spine/paraspinal muscles/epidural space | |
diagnosis | paraspinal abscess with spinal epidural abscess | |
| Image-level labels | Modality | mri |
| Anatomy | musculoskeletal, spine_spinal_cord | |
| Diagnosis | infection_or_abscess |
Table 2. Inputs and outputs of citation-guided hierarchical image-pair annotation (CHIPA) for one case pair. Case A[14] and case B[15] describe children with paraspinal muscle infection complicated by spinal epidural abscess. One of the questions generated at each level is shown with its answer. Captions are paraphrased, and descriptors are reproduced from the model output. The image-level labels of 9899453_1_1 are derived from its three positive pairs, all of which have the descriptors shown. MRI, magnetic resonance imaging.
Citation-intent analysis. The model receives the titles and abstracts of both articles together with any extracted citation contexts. As in citation-intent classification, [29] it states the reason for the citation, together with the possible similarities between the two cases and a short explanation of how the citation is used. The purpose of a citation affects how informative the link is for comparing figures. For example, a report of an ectopic parathyroid adenoma in the piriform sinus [30] cites an earlier report of an adenoma at the same site, [31] whereas a report of an ectopic pituitary tumor [32] cites a report of metastatic testicular cancer [33] because both describe the use of ChatGPT in writing case reports. PMC-Patients, in contrast, treats every citation between two case reports as a link between similar patients, without examining its context. [24]
Question generation and answering. Given both case descriptions and the citation-intent analysis, the model generates about three comparative questions at each of three levels: imaging modality and organ system (level 1), diagnostic category and disease process (level 2), and specific imaging and clinical findings (level 3). A second call answers each question with Yes, No, Partial or Unclear and a brief reason, using only the case descriptions and the citation-intent analysis. The questions and answers provide the final stage with clinical context that captions may omit. The questions and answers for all 121,831 case pairs in the release are provided in case_pair_questions_answers_eligible.jsonl (Data Records).
Image-pair proposal. The final call receives the questions and answers together with the captions of both articles, each keyed by its image identifier, and considers every combination of one caption from each article. It returns, in JavaScript Object Notation (JSON), the combinations whose captions describe the same imaging modality and the same type of abnormality within the same anatomical region or organ system, together with free-text descriptors of the shared modality, anatomy and diagnosis. Differences in view, imaging plane, sequence, laterality, acuity, severity, slice or anatomical level do not by themselves prevent a match. The prompt restricts pairing to radiological, nuclear-medicine and ophthalmic imaging and excludes clinical and operative photographs, histopathology, endoscopy, electrophysiological recordings and diagrams. A case pair can yield zero, one or several image pairs.
Post-processing and exclusion of veterinary reports
Parsing the saved model responses, with formatting errors repaired where possible, yielded 93,113 proposed image pairs (Table 1). We then removed proposals with invalid image identifiers or unavailable image files, proposals involving source articles flagged as veterinary case reports (described below) and duplicate proposals (treating pairs as unordered), leaving 86,144 image pairs. Of the 121,831 case pairs that remained after the veterinary-report filter, 48,331 (39.7%) contributed at least one positive pair.
To exclude veterinary case reports, we flagged likely dog and cat reports with keyword and phrase rules applied to article titles and abstracts, using journal titles as additional context. An article was flagged if its title matched an animal-related pattern, if its abstract matched such a pattern together with veterinary or case-report context, or if its abstract matched at least two distinct animal-related patterns. Exceptions covered expressions used in human case reports, such as ‘dog bite’, ‘CAT scan’ and the dental term ‘canine’. We applied the filter after annotation, removing 534 case pairs together with their image pairs.
Image-level labels
We derived image-level labels by mapping the free-text descriptors of the positive pairs to controlled vocabularies of 12 modality, 20 anatomy and 40 diagnosis categories, each of which includes the catch-all category other. The 12 modality categories are CT, magnetic resonance imaging (MRI), radiography (including dental radiography and mammography), ultrasound, angiography/fluoroscopy, nuclear medicine, optical imaging, photography, microscopy, endoscopy, electrophysiology and other. Optical imaging, assigned to 1,354 images, comprises optical coherence tomography and other ophthalmic or optical techniques such as fluorescein and indocyanine-green angiography, fundus autofluorescence, slit-lamp imaging and reflectance confocal microscopy, whereas fundus photographs are assigned to photography. Although the prompt restricts pairing to radiological, nuclear-medicine and ophthalmic imaging, some pairs share another modality, for example when a compound figure that combines CT with endoscopy is paired with an endoscopy image. Microscopy, endoscopy and electrophysiology labels are assigned to 1,449, 219 and 263 images, respectively, and photography labels to 837. The vocabularies and mapping rules are provided in label_taxonomy.json, and Table 2 shows an example. Regular-expression rules recognize spelling variants, synonyms and abbreviations. For example, ‘hepatic abscess’ and ‘liver abscess’ both map to infection_or_abscess. Broad diagnostic categories group related terms: ‘tumor’, ‘mass’ and ‘unspecified lesion’ all map to mass_or_lesion, which does not distinguish benign from malignant findings.
The rules first split diagnosis descriptors into clauses at commas, semicolons and the connectives ‘but’, ‘however’, ‘and’, ‘with’, ‘plus’, ‘complicated by’, ‘associated with’ and ‘due to’. Within a clause, rules for specific conditions take precedence over generic lesion terms, so that ‘abscess lesion’ maps to infection_or_abscess. The rules also recognize explicit negation and resolution, mapping, for example, ‘no abscess’ to normal_or_negative_report and ‘resolved abscess’ to postoperative_or_resolved_state. A descriptor that matches no rule maps to other.
We assigned the categories derived from a pair to both of its images. For each image and field, we took the union of the categories contributed by all pairs that contain the image. An image can therefore carry several labels per field, and labels contributed by different pairs may refer to different panels of a compound figure. We assigned other only when no pair contributed a more specific category to that field, which occurred for 65 images (0.07%) in modality, 277 (0.32%) in anatomy and 2,250 (2.59%) in diagnosis.
The nuclear_medicine label is the only label also assigned directly from an image’s own caption, independently of its pairs. Nuclear-medicine studies such as positron emission tomography (PET) are often fused with, or displayed beside, CT or MRI, whereas a pair descriptor records only the modality that the two images share. A fused PET/CT image paired with a CT image is therefore described as ‘CT’. We applied the nuclear_medicine rule of the taxonomy to every caption and assigned the label to each matching image, counting the abbreviation PET only when capitalized. Of the 3,068 images labeled nuclear_medicine, 873 received the label only from their captions.
Benchmark partitions
We partitioned the images so that every positive pair and every source article lies entirely within one partition (Figure 3). We represented the dataset as an undirected graph whose nodes are images and whose edges are positive pairs. Each connected component of this graph contains the images linked directly or indirectly through positive pairs. Because the images of one source article can fall into different components, we merged components that share a source article until all images of each article belonged to the same merged component, which we call an article group. Merging did not add pairs to the dataset and produced 13,338 article groups.
We sorted the article groups by their smallest image identifier, compared as strings, and shuffled them with the shuffle method of Python’s random.Random generator initialized with seed 42. The first 10,670 groups (80%, rounded down) formed the training partition, the next 1,333 (10%, rounded down) the validation partition and the remaining 1,335 the test partition. These proportions apply to article groups rather than to images. The training, validation and test partitions contain 70,552, 8,245 and 8,096 images and 70,262, 8,034 and 7,848 positive pairs, respectively, and the test images come from 5,255 source articles.
Ethics statement
PMC-PaIR was derived entirely from case reports published in the PMC Open Access Subset and from the PMC-Patients collection extracted from them. No patients were recruited or contacted, no data other than the published
articles were used, and no attempt was made to identify individuals.
CHIPA prompts
The prompts of the four CHIPA stages are reproduced verbatim from the curation pipeline. Text in braces is a placeholder that is replaced with the inputs of each case pair.
Stage 1: citation-intent analysis. The placeholders are filled with the titles and abstracts of the citing and cited articles and with the extracted citation contexts.
You are a medical citation analysis assistant. You will read excerpts from a 'citing paper' referencing
another 'cited paper,' each describing a single-patient case report. Your task is to produce three
pieces of information:
1. Reason for Citation (a short phrase or sentence about why the authors mention the cited paper).
2. Possible Similarities (a brief mention of how these patients’ cases align, if at all).
3. Explanation (one to two sentences summarizing how the citation is used).
----
Follow this exact output format:
Reason for Citation: <short phrase or sentence>
Possible Similarities: <brief mention>
Explanation: <one to two sentences>
----
Read the following excerpt(s) and generate your final answer in the required format. Unify your
response if multiple citations are present. If no citations are specified, base your response on the
articles' titles and abstracts.
Citing Title: {citing_title}
Citing Abstract: {citing_abstract}
Citation Paragraph: {citation_paragraph}
Cited Title: {cited_title}
Cited Abstract: {cited_abstract}
Stage 2: question generation. The placeholders are filled with the two case descriptions and the output of stage 1.
You are an experienced clinician specializing in medical imaging. You will be given two cases and the
reason for citation between the two (one case report cites the other), and asked to generate a set of
comparative, clinically relevant questions that highlight both similarities and differences, helping
differentiate potential diagnoses. Your questions should:
1. **Focus on Diagnostic Clues and Clinical Significance:**
- Avoid trivial or purely technical details (like minor differences in image orientation).
- Emphasize findings that inform diagnosis (e.g., presence of lesions, pattern of abnormalities,
symptoms).
2. **Use a Comparative Framing:**
- Explicitly compare Case A and Case B.
- Aim for questions that probe both common ground and distinguishing features.
- If possible, try asking mostly yes/no questions.
3. **Follow a Hierarchical Reasoning Approach:**
- **Level 1 (Broad Context)**: Are both cases the same modality/organ system?
- **Level 2 (General Diagnosis Category)**: Are they both infectious, both neoplastic, etc.?
- **Level 3 (Specific Features & Findings)**: Detailed imaging findings (e.g., cavitation,
consolidation, nodules), clinical presentation, organism type, etc.
4. **Consider Step-by-Step Reasoning:**
- You may first silently analyze the diagnoses and imaging findings for each case.
- Then generate questions that a clinician would naturally ask to tease out whether the two cases
have the same underlying pathology or different pathologies.
5. **Provide a subtitle specifying the level (1/2/3) of the current set of questions.**
6. **Generate approximately three questions per hierarchical level.**
Below are the two case descriptions and the reason for citation between the two. Read them carefully,
then generate a concise list of question prompts (in numbered format) that compare these cases on
clinically meaningful aspects.
---
Case A:
{case_a}
Case B:
{case_b}
Reason for Citation, Possible Similarities and Explanation:
{citation_reason}
Stage 3: question answering. The placeholders are filled with the two case descriptions, the output of stage 1 and the questions from stage 2.
You are an experienced clinician specializing in medical imaging.
You will be given:
- Case A
- Case B
- Reason for Citation
- A numbered list of comparative questions
Answer each question using only the provided case information.
Rules:
- Keep the exact numbering.
- Each line must follow this format exactly:
<number>. <Yes|No|Partial|Unclear> — <brief reason>
- The brief reason must be short and evidence-based.
- Do not add any text before or after the numbered answers.
- Do not restate the questions.
- Do not use outside knowledge or speculation.
Below are the two case descriptions and the set of questions to be answered.
---
Case A:
{case_a}
Case B:
{case_b}
Reason for Citation, Possible Similarities and Explanation:
{citation_reason}
Questions:
{questions}
---
Stage 4: image-pair proposal. The placeholders are filled with the questions and answers from stages 2 and 3 and with the captions of the two articles, keyed by image identifier.
You are a medical-AI expert.
You will receive:
1. Patient-context questions and answers for a case pair.
2. A dictionary of caption_id -> caption for Case A.
3. A dictionary of caption_id -> caption for Case B.
IMPORTANT PRE-FILTER: RADIOLOGY AND OPHTHALMIC IMAGING ONLY
Before forming any pairs, keep only captions that describe radiology imaging modalities or the ophthalmic imaging types listed below.
Allowed modality families and imaging types include:
- CT
- Ophthalmic photography / fundus imaging / OCT / OCTA / FA / ICG
- MRI
- X-ray / radiograph
- Fluoroscopy
- Mammography
- Ultrasound / sonography
- Angiography
- Nuclear medicine / hybrid imaging such as PET, SPECT, PET/CT, PET/MR
Ignore any caption outside these allowed radiology and ophthalmic imaging types, including:
- clinical photographs or gross inspection images, except the ophthalmic imaging listed above
- dermatology / operative / specimen photos
- pathology / histology / cytology / microscopy / IHC stains
- endoscopy / colonoscopy / bronchoscopy / EGD
- ECG / EKG / EEG
- diagrams / illustrations / schematics
- any other image outside the allowed radiology and ophthalmic imaging types
Your task is to evaluate every remaining inter-case caption pair (one caption from Case A and one caption from Case B) and return only the POSITIVE matches.
A pair is POSITIVE only if:
1. It is inter-case.
2. The two captions describe the same modality family, ignoring view/plane/sequence details.
3. The two captions describe the same pathology family within the same anatomy / organ system.
4. You ignore decorators such as acuity, severity, laterality, exact slice, or exact level.
Output rules:
- Output valid JSON only, with no markdown and no prose.
- Output a JSON array.
- Each item must have exactly these keys:
{
"pair_id": ["caption_id_from_case_a", "caption_id_from_case_b"],
"modality": "<shared modality family>",
"anatomy": "<shared anatomy or organ system>",
"diagnosis": "<shared pathology family>"
}
- Use caption IDs exactly as they appear in the provided dictionaries.
- If there are no positive matches, output [].
### PATIENT-CONTEXT QUERIES & ANSWERS
{questions}
{answers}
### IMAGE CAPTIONS (MULTIPLE PAIRS)
{captions_a}
{captions_b}
Data Records
PMC-PaIR is available from Zenodo. [34] Table 3 lists the files. JSON Lines (JSONL) files contain one JSON object per line.
| 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) |
| file_manifest.csv | CSV | Archive, size and SHA-256 checksum of each image and caption file |
| licenses.csv | CSV | Provenance, publication year, license and attribution |
| withheld.csv | CSV | Identifiers, reasons and source locations of the 68 withheld images |
| included_image_ids.txt | Text | Identifiers of the 86,825 distributed images |
| withheld_image_ids.txt | Text | Identifiers of the 68 withheld images |
| pair_availability.csv | CSV | Availability of the image files of both members of each positive pair |
| release_summary.json | JSON | Release counts and archive and licensing summaries |
| README.txt, LICENSE.txt, SHA256SUMS.txt | Text | File descriptions and reuse instructions, licensing statement and file checksums |
Table 3. Files in the PMC-PaIR data record.
Image and case identifiers. Image identifiers link the annotation, label, partition, image and caption files. Each identifier joins, with underscores, the numeric part of the article’s PMCID, the case index and the extraction index of the figure. For example, 9899453_1_1 is the first extracted figure of case 1 in article PMC9899453. Because only single-case articles were retained, the case index is 1 in every identifier. Each identifier refers to a complete figure, which may contain several panels. Case identifiers, which appear in the case-pair questions and answers, join the numeric part of the PMCID and the case index with a hyphen, as in case 9899453–1, to which image 9899453_1_1 belongs.
Image-pair annotations. The file image_pairs.json is a JSON array with one object per positive pair. Each object has four fields: pair_id, a two-element array with the identifiers of the two images, one from each source article; and the three free-text descriptors modality, anatomy and diagnosis, which describe the shared imaging modality, anatomical region and type of abnormality. A descriptor may name several related structures or findings (Table 2). Each unordered pair occurs once.
Image-level labels. The file image_labels.jsonl contains one object per image with two fields, image_id and labels, the second of which has the keys modality, anatomy and diagnosis, each holding an array of category names. The file label_taxonomy.json defines the categories and the mapping rules, including text normalization and matching priorities. Labels derived from pair descriptors can be traced to the records in image_pairs.json. whose pair_id contains the image identifier.
Case-pair citation records. The file case_pair_citations_eligible.json is a JSON array of 121,831 records, one for each annotated case pair that passed the veterinary-report filter. Each record describes the citation from one source article to the other with four string fields: citing_case and cited_case, the PMCIDs (for example, PMC9899453) of the citing and cited articles, whose numeric parts are the first components of the image identifiers; extracted_citation, the citation contexts; and citation_reason, the output of the citation-intent analysis stage. In the 857 records for which no citation context could be extracted, extracted_citation is an empty string.
Case-pair questions and answers. The file case_pair_questions_answers_eligible.jsonl contains 121,831 records, one for each case pair in the citation records. Each record has eight string fields: annotation_id, a unique record identifier; case_pair_id, an order-independent identifier that joins the two case identifiers, sorted as strings, with ‘|’, for example 5563556-1|8167975-1; case_a_uid and case_b_uid, the identifiers of the two cases in the order used in the prompts (case A and case B), which does not indicate citation direction; citing_case and cited_case, the PMCIDs of the citing and cited articles, for example PMC8167975 and PMC5563556; and questions and answers, the generated text as saved from the model output. Records can be joined with the citation records through citing_case and cited_case.
Images and captions. The archives images_captions_001.zip to images_captions_004.zip contain 86,825 images, stored as images/<image_id>.jpg, and their source captions, stored as captions/<image_id>.txt. Files for the remaining 68 images are withheld because the redistribution terms of their article or figure could not be confirmed (44 images), because their licenses prohibit derivatives (23) or because they await privacy review (1). Of these images, 60 are in the training partition, 3 in the validation partition and 5 in the test partition, and withheld.csv lists their identifiers, the reasons and their locations in the source articles. All 86,893 identifiers are retained in the annotation and label files, and pair_availability.csv indicates for every positive pair whether the files of both images are distributed. The file file_manifest.csv gives the archive, size and SHA-256 checksum of every image and caption file.
Benchmark partitions. The partition of every image is distributed with the code, as data/article_disjoint_split.json in the retrieval repository and, as an identical copy, as image_splits.json in the dataset-curation repository (Code Availability).
Licensing and provenance. The file licenses.csv records the provenance, publication year, license and attribution information of the source articles and of the distributed images and captions. Images, captions and the citation contexts in the case-pair records remain under the terms of their source articles. Our annotations, labels, generated citation-intent analyses, questions and answers, and other original content are released under the Creative Commons Attribution 4.0 International license (CC BY 4.0) to the extent of the authors’ rights, as stated in LICENSE.txt.
Dataset composition. The 86,144 positive pairs involve 86,893 images from 56,013 source articles. The articles were published between 1986 and 2026, 60.6% of them in 2020 or later, with a median year of 2021 and an interquartile range (IQR) of 2017–2023 (Table 4). CT, MRI and radiography are the most frequent modality labels (46.4%, 23.1% and 15.5% of images), and the most frequent anatomy and diagnosis labels are thorax/respiratory (14.8%) and mass/lesion (31.4%), respectively. An image belongs to a median of one positive pair (IQR 1–2; maximum 33), and 45.9% of images belong to two or more. The graph of positive pairs has 18,597 connected components with a median of three images (IQR 2–4; maximum 963), and the 13,338 article groups contain a median of three images (IQR 2–6; maximum 1,465).
| 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) | |
| Diagnosis labels | Mass/lesion | 27,277 (31.4) |
| Infection/abscess | 8,361 (9.6) | |
| Inflammatory/autoimmune | 6,623 (7.6) | |
| Positive pairs per image | 1 | 47,002 (54.1) |
| 2 | 20,173 (23.2) | |
| 3–5 | 16,364 (18.8) | |
| ≥6 | 3,354 (3.9) | |
| Publication year of source article | 1986–1999 | 18 (<0.1) |
| 2000–2009 | 1,443 (2.6) | |
| 2010–2019 | 20,636 (36.8) | |
| 2020–2026 | 33,916 (60.6) |
Table 4. Composition of PMC-PaIR. Percentages for labels and for positive pairs per image are relative to all 86,893 images, including the 68 whose files are withheld, and those for publication years to the 56,013 source articles. Label rows show the three most frequent categories of each field, with display names (for example, Mass/lesion for mass_or_lesion). An image can carry several labels per field.
Technical Validation
We assessed the citation-intent analyses that guide annotation, the structured design of CHIPA compared with single-step annotation, the image pairs, the image-level labels and the use of the pairs for training and evaluating image retrieval. Table 5 summarizes the manual checks. For proportions from manual review, we report exact (Clopper–Pearson) 95% confidence intervals (CIs).
| 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 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) |
Table 5. Summary of manual validation. Percentages are followed by exact 95% confidence intervals (CIs). Relative recall is the number of correct pairs a workflow proposed divided by the number of correct pairs proposed by either workflow. Radiologist-rated Hit@5 is the proportion of queries for which at least one of the five highest-ranked candidates matched the query in the stated attribute or attributes. , image-plus-text retrieval.
Citation-intent analyses
To check that the citation-intent analyses are faithful to their inputs, we sampled 25 case pairs at random and compared each analysis with the titles, abstracts and citation contexts from which it was generated. An analysis was rated supported when it correctly described the role of the cited article, partly supported when it identified relevant content but overstated or imprecisely described that role, and not supported when the source text did not establish the claimed reason. Twenty-two analyses were supported, two were partly supported and one was not supported (Table 5).
CHIPA versus single-step annotation
We compared CHIPA with a single-step baseline that received the full-text XML of both articles and proposed image pairs directly, without citation-intent analysis or questions and answers, using the model and reasoning-effort setting of the image-pair proposal stage (gpt-5.4-mini, low). Both workflows were applied to 50 randomly selected case pairs, and every image pair proposed by either was reviewed manually. Of the 29 distinct pairs proposed, 27 were judged correct. CHIPA proposed 25 of these 27 pairs and no incorrect pair, whereas the baseline proposed 12 correct and 2 incorrect pairs (Table 5). Using o4-mini (low reasoning effort) in place of gpt-5.4-mini gave similar results. The comparison focused on proposed pairs because PMC-PaIR lists positive pairs only. A false positive adds an incorrect pair to the dataset, whereas a missed pair leaves a true pair unlisted.
Expert review of image pairs
A medical physicist and a resident physician independently reviewed 163 randomly sampled pairs and resolved disagreements by discussion. For each pair, the reviewers examined both images, the titles and abstracts of the two source articles and the citation context, and rated the match in modality, anatomy and diagnosis as Yes, Borderline or No. The overall rating was No if any attribute was rated No and otherwise equaled the diagnosis rating.
By consensus, 147 pairs (90.2%), including 13 with a borderline modality or anatomy rating, matched overall, 6 (3.7%) were borderline and 10 (6.1%) did not match (Figure 4a and Table 5). The 10 mismatches concerned modality (4 pairs) or anatomy (6 pairs), and diagnosis, which matched for 156 pairs (95.7%), was never rated a mismatch. Before discussion, the reviewers’ overall ratings agreed for 151 pairs (92.6%; 95% CI 87.5–96.1%), with an unweighted Cohen’s of 0.70, which indicates substantial agreement. [35]
Figure 4. Manual review of image pairs and image-level labels. a, Consensus ratings of a medical physicist and a resident physician for 163 randomly sampled pairs. Modality, anatomy and diagnosis were rated separately, and the overall rating is No if any attribute is rated No and otherwise equals the diagnosis rating. b, Ratings of the labels of the 320 images in these pairs, with the overall rating derived in the same way. Bars and numbers give the percentage of pairs or images with each rating, and error bars give exact (Clopper–Pearson) 95% confidence intervals, computed separately for each rating.
Review of image-level labels
The labels of the 320 distinct images in the 163 reviewed pairs were also rated. For each field, labels were rated Yes when supported by the reviewed evidence, Borderline when they described only part of the main abnormality and No when a category was incorrect. A label was counted as supported if the evidence of any pair containing the image supported it. The overall rating followed the rule used for pairs. Labels were correct overall for 299 images (93.4%), borderline for 1 (0.3%) and incorrect for 20 (6.3%; Figure 4b and Table 5). Modality, anatomy and diagnosis labels were correct for 314 (98.1%), 307 (95.9%) and 314 (98.1%) images, respectively. Of the 20 errors, 12 arose when descriptors were mapped to categories, 7 were inherited from the pair descriptors and 1 had both sources.
Image retrieval with the benchmark partitions
Benchmark design. To test whether the positive pairs can be used to train and evaluate medical image retrieval models, we fine-tune a vision–language model on the training partition and evaluate it on the test partition. We use BiomedCLIP, which was pretrained on the 15 million PMC figure–caption pairs of PMC-15M. [7] Each of the 8,096 test images serves once as a query. Its candidates are all other test images except those linked to it only indirectly, through other positive pairs in its connected component, which we exclude because they may be clinically related to the query. To cover wide and multi-panel figures, we resize each image so that its shorter side is 224 pixels, take three crops from the start, middle and end of its longer side, and represent the image by the normalized mean of the three crop embeddings.
We evaluate two retrieval tasks (Figure 1). In image-only retrieval (i2i), candidates are ranked by the cosine similarity between the query and candidate image embeddings. In image-plus-text retrieval, abbreviated (i+t)2i, the query image is accompanied by the descriptions of its positive pairs, which are sentences generated from the pair descriptors with the template ‘{diagnosis} in the {anatomy} on {modality}.’ Candidates are ranked by the unweighted sum of the image similarity and the mean similarity between the candidate image and the query’s distinct descriptions. This task evaluates retrieval when a description of the finding of interest, here derived from the pair annotations, is available at query time. We compare each fine-tuned model with pretrained BiomedCLIP queried in the same way.
Evaluation. is the proportion of queries with at least one positive among the highest-ranked candidates, is the mean fraction of each query’s positives found among them, and the mean reciprocal rank (MRR) is the mean of the reciprocal rank of the first positive, [36] with each query weighted equally. We estimate 95% CIs for the differences between fine-tuned and pretrained models with a cluster bootstrap[37] that resamples whole test article groups 5,000 times, keeping all queries of each drawn group together and evaluating both models on the same resampled queries. Because relevance is defined by the positive pairs, the metrics measure how well a model retrieves the annotated positives rather than all clinically similar images in the test partition.[38]
Fine-tuned models. In both tasks, the eligible negatives of a training image are the images not linked to it, directly or indirectly, through positive pairs, and we select the checkpoint with the highest validation , computed with the same candidates, image crops and ranking as at test time. For i2i, we fine-tune all 12 transformer blocks of the image encoder with layer-wise learning-rate decay and an InfoNCE contrastive loss,[39, 40] pairing each training image in each epoch with one randomly chosen positive and using the other eligible images in the batch as negatives. For (i+t)2i, we fine-tune the text encoder and all but the first eight blocks of the image encoder with two triplet-ranking losses: [41] an image–image loss and a bidirectional image–text loss that aligns each pair description with the normalized mean embedding of the pair’s two images. Training batches for this model include hard negatives, [42] that is, images that pretrained BiomedCLIP rates as similar to a training image but that belong to a different connected component and a different source article. Table 6 lists all settings.
| 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 | Crop jitter |
| Batch size | 128 anchor–positive pairs | 128 image pairs |
| Peak learning rate; weight decay | ; 0.05 | ; 0.2 |
| Epochs | 12 | At most 30, with early stopping after three epochs without improvement |
| Selected checkpoint (seed 42) | Epoch 11 | Epoch 21 (training stopped after epoch 24) |
Table 6. Fine-tuning settings for the two retrieval tasks. i2i, image-only retrieval; (i+t)2i, image-plus-text retrieval. Both models use three crops per image, the AdamW optimizer, bfloat16 mixed precision, gradient clipping at 1.5, and 200 warm-up steps followed by cosine learning-rate decay scheduled over the maximum number of epochs. Checkpoints were selected by validation Recall@10.
Retrieval results. Fine-tuning improves all metrics in both tasks (Table 7). The gains are larger when the query includes text, with Recall@10 rising by 11.09 points for (i+t)2i and by 5.53 points for i2i. For i2i, Hit@10 increases from 21.5% to 28.3% and the median rank of the first positive decreases from 65 to 37; for (i+t)2i, Hit@10 increases from 29.7% to 43.0%. Across training seeds 42, 43 and 44, test Recall@10 is 20.11 ± 0.07% for i2i and 31.57 ± 0.04% for (i+t)2i (mean ± s.d.). Among the 44 modality, anatomy and diagnosis categories with at least 140 test queries from at least 20 article groups, Hit@10 increases in every category in both tasks, and the 95% CI excludes zero in 40 categories for i2i and in all 44 for (i+t)2i (Figure 5). Figure 2 shows an example query.
| 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) | |
| MRR | 0.154 | 0.220 | 0.065 (0.057 to 0.075) | |
| Median rank | 34 | 15 |
Table 7. Retrieval performance on the 8,096 test queries. i2i, image-only queries; (i+t)2i, image-plus-text queries. Hit@10 is the proportion of queries with at least one positive among the ten highest-ranked candidates, Recall@10 the mean fraction of positives found among them, MRR the mean reciprocal rank of the first positive and median rank the median rank of the first positive. Each fine-tuned model (training seed 42) is compared with pretrained BiomedCLIP queried in the same way. Differences are fine-tuned minus pretrained values, computed before rounding, with 95% confidence intervals (CIs) from a cluster bootstrap over test article groups.
Figure 5. Change in Hit@10 with fine-tuning across label categories of the test queries. Hit@10 is the proportion of queries with at least one positive among the ten highest-ranked candidates. a, Image-only queries, i2i. b, Image-plus-text queries, (i+t)2i. For the queries that carry each label, points show the fine-tuned minus pretrained change in Hit@10, in percentage points, with 95% confidence intervals from 5,000 paired cluster-bootstrap resamples of article groups. The difference over all test queries is 6.84 percentage points for i2i and 13.30 for (i+t)2i. Columns on the left give the number of queries () and article groups in each category, and numbers on the right give Hit@10 (%) of the pretrained and fine-tuned models. Categories with at least 140 queries from at least 20 article groups are shown. A query can carry several labels per field, and intervals are not adjusted for multiple comparisons.
Radiologist review of retrieved images
Radiologist review of retrieved images
A board-certified radiologist with 9 years of experience (K.K.B.) reviewed the five highest-ranked candidates returned by the fine-tuned model for 17 test queries (85 query–candidate pairs). The queries were sampled at random from those with CT and heart or vasculature labels, to match the radiologist’s subspecialty. The radiologist rated whether each candidate matched the query in modality, anatomy and diagnosis, regardless of whether it was one of the query’s positives. At least one of the five candidates matched the query in modality and in anatomy for all 17 queries, in diagnosis for 12 (70.6%) and in all three attributes for 11 (64.7%; Table 5). These ratings count any clinically matching candidate and therefore complement the metrics based on the positive pairs.
Usage Notes
Benchmarking. Because the pairs were derived from text, without reference to any image model, they can be used to compare image models. To obtain results comparable with those reported here, users should adopt the released partitions and, as in Technical Validation, exclude from each query’s candidates the images linked to it only indirectly. The reported results use all 8,096 test images, including 5 whose files are withheld, and can be recomputed from the saved per-query results (Code Availability). With the distributed files, the retrieval code excludes the withheld images and their pairs and evaluates the remaining 8,088 test queries, and the resulting metrics differ slightly from those reported. Models pretrained on PMC figures and captions, including BiomedCLIP, [7] may have encountered PMC-PaIR images during pretraining.
Positive pairs. PMC-PaIR contains positive pairs only; image pairs that are not listed are unlabeled rather than negative. [43] When training with contrastive objectives, images linked only indirectly through positive pairs can be excluded from the negatives, as in our fine-tuning experiments, or false negatives can be handled explicitly. [44] By design, the two images of a pair share an imaging modality, which excludes cross-modality matches such as a CT and an MRI image of the same kind of lesion.
Labels and descriptors. Shared image-level labels indicate a coarser similarity than positive pairs: two images labeled CT, thorax/respiratory and mass/lesion can show unrelated abnormalities, whereas the two images of a positive pair were matched on the type of abnormality in the context of both cases. Because labels describe whole figures, which may contain several panels, users who need panel-level labels can combine PMC-PaIR with compound-figure separation. [6] Users who need finer or different categories can remap the free-text descriptors with their own rules or adapt those in label_taxonomy.json, and label errors that arise in this mapping can be corrected in the same way, without changing the pair annotations. To restrict the data to radiological images, users can filter images and their pairs by modality label.
Images and licensing. Images are figures as published in the source articles and are distributed in JPEG format. Many contain arrows, letters or other marks added by the authors, which users training image models may want to crop or mask. The images retain the licenses of their source articles, and licenses.csv allows users to select images by license and to attribute them.
Linking to the source articles. The PMCID numbers in the image identifiers and the PMCIDs in the citation records link every image to its source article in PMC, from which users can retrieve the full case description and the article’s other figures, for example to build case-level or combined text-and-image tasks.
Questions and answers. For each case pair, the released questions and answers record the clinical comparison that guided image matching, at the levels of imaging modality and organ system, diagnosis and specific findings. They can explain why two images were paired, and their answers at each level allow users to select case pairs that agree at a chosen level, for example to build stricter or graded relevance judgments. They can also serve as training and evaluation data for models that compare two clinical cases or generate comparative clinical questions, and as intermediate supervision for distilling the annotation procedure into smaller open models.
Extending the dataset. The released curation pipeline can be rerun on later releases of the PMC Open Access Subset to annotate newly published case reports, given application programming interface (API) access to language models such as those in Table 1. Unlike the procedure described in Methods, it applies the veterinary-report filter before annotation.
Data Availability
PMC-PaIR is available from Zenodo[34] at https://doi.org/10.5281/zenodo.23439169. The record contains the image-pair annotations, image-level labels, label taxonomy, case-pair citation records, case-pair questions and answers, 86,825 images with their captions, and the provenance, licensing and checksum files described in Data Records. The benchmark partitions are distributed with the code, which is archived at Zenodo.
Code Availability
Code for the dataset-curation pipeline is available in the pmc-pair-pipeline GitHub repository, together with the annotation prompts and the provenance records of the dataset construction. Code for BiomedCLIP fine-tuning, retrieval evaluation and analysis of the saved results is available in the pmc-pair-retrieval GitHub repository, together with the benchmark partitions, the saved evaluation results, which include per-query results and overall and per-category metrics (results/figures/source_data/subgroups.csv), and the metadata and checksums of the fine-tuned checkpoints. The fine-tuned weights are attached to release v1.0.3 of this repository under the MIT License, together with the license notice of BiomedCLIP. Version 1.0.2 of the pipeline repository and version 1.0.3 of the retrieval repository are archived at Zenodo. [45, 46] They differ from version 1.0.0, which was used for this work, only in licensing, documentation, checksums, version strings and, for the retrieval code, the download of the fine-tuned weights from GitHub. Both repositories include environment specifications, configuration files and usage instructions. Their code, documentation, configuration files and prompts are released under the MIT License, and their data files, including the benchmark partitions and the label taxonomy, and saved results under CC BY 4.0. Article images reproduced in the example figures of the repositories keep the licenses of their source articles. Fine-tuning started from the pretrained checkpoint microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224. The LLMs and reasoning-effort settings are listed in Table 1.
Author Contributions
G.S. designed and implemented the annotation workflow, built the dataset and benchmark, performed the technical validation and wrote the manuscript. K.K.B. reviewed the retrieved images and revised the manuscript. T.H. conceived and supervised the project and revised the manuscript.
Competing Interests
The authors declare no competing interests.
Funding
This work received no external funding.
References
- [1]Müller, H., Michoux, N., Bandon, D. & Geissbuhler, A. A review of content-based image retrieval systems in medical applications—clinical benefits and future directions. Int. J. Med. Inform. 73, 1–23 (2004). https://doi.org/10.1016/j.ijmedinf.2003.11.024
- [2]Mazor, N. & Hope, T. TLVML-aware multimodal retrieval for RAG-based medical diagnosis with general-purpose models. In Findings of the Association for Computational Linguistics: ACL 2026 10532–10553 (Association for Computational Linguistics, 2026). https://doi.org/10.18653/v1/2026.findings-acl.512
- [4]National Library of Medicine. PMC Open Access Subset. https://pmc.ncbi.nlm.nih.gov/tools/openftlist/ (2026).
- [5]Rückert, J. et al. ROCov2: Radiology Objects in Context version 2, an updated multimodal image dataset. Sci. Data 11, 688 (2024). https://doi.org/10.1038/s41597-024-03496-6
- [6]Subramanian, S. et al. MedICaT: a dataset of medical images, captions, and textual references. In Findings of the Association for Computational Linguistics: EMNLP 2020 2112–2120 (Association for Computational Linguistics, 2020). https://doi.org/10.18653/v1/2020.findings-emnlp.191
- [7]Zhang, S. et al. A multimodal biomedical foundation model trained from fifteen million image–text pairs. NEJM AI 2, Aioa200640 (2025). https://doi.org/10.1056/Aioa2400640
- [8]Nievas Offidani, M. A. & Delrieux, C. A. Dataset of clinical cases, images, image labels and captions from open access case reports from PubMed Central (1990–2023). Data Brief 52, 110008 (2024). https://doi.org/10.1016/j.dib.2023.110008
- [9]Nievas Offidani, M., Roffet, F., González Galtier, M. C., Massiris, M. & Delrieux, C. An open-source clinical case dataset for medical image classification and multimodal AI applications. Data 10, 123 (2025). https://doi.org/10.3390/data10080123
- [10]Kalpathy-Cramer, J. et al. Evaluating performance of biomedical image retrieval systems—an overview of the medical image retrieval task at ImageCLEF 2004–2013. Comput. Med. Imaging Graph. 39, 55–61 (2015). https://doi.org/10.1016/j.compmedimag.2014.03.004
- [11]Acharya, A. et al. M3Retrieve: benchmarking multimodal retrieval for medicine. In Proc. 2025 Conference on Empirical Methods in Natural Language Processing 15263–15276 (Association for Computational Linguistics, 2025). https://doi.org/10.18653/v1/2025.emnlp-main.771
- [12]Ben Abacha, A. et al. 3D-MIR: a benchmark and empirical study on 3D medical image retrieval in radiology. Preprint at https://doi.org/10.48550/arXiv.2311.13752 (2023).
- [13]Zhang, T. et al. RadIR: a scalable framework for multi-grained medical image retrieval via radiology report mining. Preprint at https://doi.org/10.48550/arXiv.2503.04653 (2025).
- [14]Tomori, S., Korematsu, S., Tanikawa, S., Urushihara, Y. & Moriwaki, K. Paraspinal muscle abscesses in children—a case report and review of the literature. Surg. Neurol. Int. 14, 3 (2023). https://doi.org/10.25259/SNI_994_2022
- [15]Boulyana, M. & Kilani, M. S. Nontropical pyomyositis complicated with spinal epidural abscess in a previously healthy child. Surg. Neurol. Int. 5, S119–S121 (2014). https://doi.org/10.4103/2152-7806.130718
- [16]Aday, U., Bozdağ, E., Gündeş, E., Gülmez, S. & Değer, K. C. Spleen-preserving surgery in splenic artery aneurysm. Case Rep. Surg. 2017, 8716962 (2017). https://doi.org/10.1155/2017/8716962
- [17]Vemireddy, L. P. et al. Early thrombosis of splenic artery stent graft. Cureus 13, e16285 (2021). https://doi.org/10.7759/cureus.16285
- [18]Reyes, H. A., Paquin, J. J. & Harris, D. M. Pheochromocytoma, “the great masquerader,” presenting as severe acute decompensated heart failure in a young patient. Case Rep. Cardiol. 2018, 8767801 (2018). https://doi.org/10.1155/2018/8767801
- [19]Alswaimil, N. F., Alzahrani, S. A., Alfuraih, M. A., Alfaraj, D. & Alshahrani, A. Splenic heterogeneity in focused assessment with sonography for trauma (FAST) scan led to the diagnosis of grade 2 splenic injury in a pediatric blunt abdominal trauma. Cureus 14, e33128 (2022). https://doi.org/10.7759/cureus.33128
- [20]Ao, T. et al. Solitary fibrous tumor of the stomach: diagnostic pitfalls and clinical implications. Surg. Case Rep. 11, 25-0314 (2025). https://doi.org/10.70352/scrj.cr.25–0314
- [21]AlShammari, A., Kalagi, D., Hijji, T. & Aburahmah, M. Laparoscopic intrapancreatic accessory splenectomy: a case report of recurrent immune thrombocytopenia in a 33 years old male patient after 6 years of splenectomy. Int. J. Surg. Case Rep. 60, 168–170 (2019). https://doi.org/10.1016/j.ijscr.2019.06.012
- [22]Uchida, K. et al. Surgical treatment for thoracoabdominal intra-aortic thrombus with multiple infarctions: a case report. J. Med. Case Rep. 10, 220 (2016). https://doi.org/10.1186/s13256-016-1017-1
- [23]Yuksekkaya, R. et al. Multidetector computed tomography angiography findings of chronic-contained thoracoabdominal aortic aneurysm rupture with severe thoracal vertebral body erosion. Case Rep. Radiol. 2013, 596517 (2013). https://doi.org/10.1155/2013/596517
- [24]Zhao, Z., Jin, Q., Chen, F., Peng, T. & Yu, S. A large-scale dataset of patient summaries for retrieval-based clinical decision support systems. Sci. Data 10, 909 (2023). https://doi.org/10.1038/s41597-023-02814-8
- [25]Zhao, Z. PMC-Patients. figshare https://doi.org/10.6084/m9.figshare.c.6723465 (2023).
- [26]Karimi, D., Dou, H., Warfield, S. K. & Gholipour, A. Deep learning with noisy labels: exploring techniques and remedies in medical image analysis. Med. Image Anal. 65, 101759 (2020). https://doi.org/10.1016/j.media.2020.101759
- [27]Irvin, J. et al. CheXpert: a large chest radiograph dataset with uncertainty labels and expert comparison. Proc. AAAI Conf. Artif. Intell. 33, 590–597 (2019). https://doi.org/10.1609/aaai.v33i01.3301590
- [28]Jain, S. et al. VisualCheXbert: addressing the discrepancy between radiology report labels and image labels. In Proc. Conference on Empirical Inference and Learning 105–115 (Association for Computing Machinery, 2021). https://doi.org/10.1145/3450439.3451862
- [29]Cohan, A., Ammar, W., van Zuylen, M. & Cady, F. Structural scaffolds for citation intent classification in scientific publications. In Proc. 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies Vol. 1, 3586–3596 (Association for Computational Linguistics, 2019). https://doi.org/10.18653/v1/N19-1361
- [30]Sardella, C. et al. Persistent primary hyperparathyroidism caused by an ectopic adenoma in the piriform sinus: case report and review of the literature. Front. Oncol. 14, 1431561 (2024). https://doi.org/10.3389/fonc.2024.1431561
- [31]Zenno, A. et al. Case report: nine-year-old with parathyroid adenoma within the piriform sinus. Front. Endocrinol. 14, 1171052 (2023). https://doi.org/10.3389/fendo.2023.1171052
- [32]Li, J., Zhong, J., Li, Z., Xiao, Y. & Wang, S. Ectopic pituitary neuroendocrine tumor: a case report written with the help of ChatGPT. Cureus 15, e46999 (2023). https://doi.org/10.7759/cureus.46999
- [33]Le, D. P. & Hall, S. C. Medical literature writing with ChatGPT: a rare case of choriocarcinoma syndrome with hemorrhagic brain metastases due to burned out metastatic mixed testicular cancer. Cureus 15, e36655 (2023). https://doi.org/10.7759/cureus.36655
- [34]Shmueli, G. & Hope, T. PMC-PaIR: clinically similar medical image pairs from PubMed Central case reports. Zenodo https://doi.org/10.5281/zenodo.23439169 (2026).
- [35]Landis, J. R. & Koch, G. G. The measurement of observer agreement for categorical data. Biometrics 33, 159–174 (1977). https://doi.org/10.2307/2529310
- [36]Manning, C. D., Raghavan, P. & Schütze, H. Introduction to Information Retrieval (Cambridge Univ. Press, 2008). https://doi.org/10.1017/CBO9780511809071
- [37]Field, C. A. & Welsh, A. H. Bootstrapping clustered data. J. R. Stat. Soc. B 69, 369–390 (2007). https://doi.org/10.1111/j.1467-9868.2007.00593.x
- [38]Buckley, C. & Voorhees, E. M. Retrieval evaluation with incomplete information. In Proc. 27th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval 25–32 (Association for Computing Machinery, 2004). https://doi.org/10.1145/1008992.1009000
- [39]van den Oord, A., Li, Y. & Vinyals, O. Representation learning with contrastive predictive coding. Preprint at https: //doi.org/10.48550/arXiv.1807.03748 (2018).
- [40]Radford, A. et al. Learning transferable visual models from natural language supervision. In Proc. 38th International Conference on Machine Learning Vol. 139 (eds Meila, M. & Zhang, T.) 8748–8763 (PMLR, 2021). https://proceedings.mlr.press/v139/radford21a.htmlarxiv.org/abs/2103.00020
- [41]Faghri, F., Fleet, D. J., Kiros, J. R. & Fidler, S. VSE++: improving visual-semantic embeddings with hard negatives. In Proc. British Machine Vision Conference (BMVA Press, 2018). https://bmva-archive.org.uk/bmvc/2018/contents/papers/0344.pdf
- [42]Robinson, J., Chuang, C.-Y., Sra, S. & Jegelka, S. Contrastive learning with hard negative samples. In Proc. 9th International Conference on Learning Representations (2021). https://openreview.net/forum?id=CR1XOQ0UTharxiv.org/abs/2010.04592
- [43]Elkan, C. & Noto, K. Learning classifiers from only positive and unlabeled data. In Proc. 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining 213–220 (Association for Computing Machinery, 2008). https://doi.org/10.1145/1401890.1401920
- [44]Wang, Z., Wu, Z., Agarwal, D. & Sun, J. MedCLIP: contrastive learning from unpaired medical images and text. In Proc. 2022 Conference on Empirical Methods in Natural Language Processing 3876–3887 (Association for Computational Linguistics, 2022). https://doi.org/10.18653/v1/2022.emnlp-main.256
- [45]Shmueli, G. & Hope, T. PMC-PaIR dataset construction pipeline, version 1.0.2. Zenodo https://doi.org/10.5281/zenodo.24401132 (2026).
- [46]Shmueli, G. & Hope, T. BiomedCLIP image retrieval on PMC-PaIR, version 1.0.3. Zenodo https://doi.org/10.5281/zenodo.24305019 (2026).




