region:us
Foundation models trained on large-scale dataset gain a recent surge in CV and NLP. In contrast, development in biomedical domain lags far behind due to data scarcity.
To address this issue, we build and release PMC-OA, a biomedical dataset with 1.6M image-caption pairs collected from PubMedCentral's OpenAccess subset, which is 8 times larger than before.
PMC-OA covers diverse modalities or diseases, with majority of the image-caption samples aligned at finer-grained level, i.e., subfigure and subcaption.
While pretraining a CLIP-style model on PMC-OA, our model named PMC-CLIP achieves state-of-the-art results on various downstream tasks,
including image-text retrieval on ROCO, MedMNIST image classification, Medical VQA, i.e. +8.1% R@10 on image-text retrieval, +3.9% accuracy on image classification.
@article{lin2023pmc,
  title={PMC-CLIP: Contrastive Language-Image Pre-training using Biomedical Documents},
  author={Lin, Weixiong and Zhao, Ziheng and Zhang, Xiaoman and Wu, Chaoyi and Zhang, Ya and Wang, Yanfeng and Xie, Weidi},
  journal={arXiv preprint arXiv:2303.07240},
  year={2023}
}
# PMC-OA Dataset

**News: We have released the PMC-OA dataset. You can choose the subset specifically.**

**P.S.** There's something wrong with the huggingface dataset viewer when the dataset scale gets large.
So we sample a subset of it to visualize it directly on web. Click [PMC-OA-Demo](https://huggingface.co/datasets/axiong/pmc_oa_demo) to view it.



[中文文档](./README.zh.md)

- [PMC-OA Dataset](#pmc-oa-dataset)
  - [Model Zoo](#model-zoo)
  - [Daraset Structure](#daraset-structure)
  - [Sample](#sample)


## Model Zoo
Check it out if you want to load model pretrained on PMC-OA directly.

We plan to release more models pretrained on PMC-OA. Feel free to reach us if the model you want is not included in model zoo for now.
Also, we express our thanks to the help from the community.

| Model | Link | Provider |
| --- | --- | --- |
| ViT-L-14 | https://huggingface.co/ryanyip7777/pmc_vit_l_14 | @ryanyip7777 |


## Daraset Structure

**PMC-OA** (seperated images, separated caption).
- `images.zip`: images folder
- `pmc_oa.jsonl`: dataset file of pmc-oa
- `pmc_oa_beta.jsonl`: dataset file of pmc-oa-beta

~~- `train.jsonl`: metafile of train set~~
~~- `valid.jsonl`: metafile of valid set~~
~~- `test.jsonl`: metafile of test set~~

The difference between PMC-OA & PMC-OA-Beta lies in the methods of processing captions.
In PMC-OA, we utilize ChatGPT to help us divide compound captions into seperate ones.
While PMC-OA-Beta keeps all the compound ones without division.


## Sample

A row in `pmc_oa.jsonl` is shown bellow,

```python
{
    "image": "PMC212319_Fig3_4.jpg",
    "caption": "A. Real time image of the translocation of ARF1-GFP to the plasma membrane ...",
}
```

Explanation to each key

- image: path to the image
- caption: corresponding to the image

