BiomedGPT is a vision-language foundation model pre-trained and fine-tuned on multi-modal biomedical data, for visual question answering, image captioning, text summarization, natural language inference and image classification.
Important
For academic research only. Commercial and clinical use is prohibited: BiomedGPT inherits the non-commercial license of OFA, it is not licensed for use in healthcare, and it cannot guarantee the accuracy required for medical diagnosis.
- [2025/07/07] Released larger-scale checkpoints—up to 5× larger (930M parameters)—including stronger large and xlarge pre-trained models. [ckpt] [technical report]
- [2026/03] Released MedGPT-oss, an open-weight 20B vision-language model for biomedicine. [paper] [model]
pip install "git+https://github.com/taokz/BiomedGPT.git"
python -m biomedgpt.convert --hf PanaceaAI/BiomedGPT-Base-Pretrained --out biomedgpt-baseimport biomedgpt.hf # registers BiomedGPT with transformers
from PIL import Image
from transformers import AutoModelForSeq2SeqLM, AutoProcessor
model = AutoModelForSeq2SeqLM.from_pretrained("biomedgpt-base").eval()
processor = AutoProcessor.from_pretrained("biomedgpt-base")
inputs = processor(images=Image.open("example.jpg"), text="<VQA> What modality is used to take this image?")
out = model.generate(**inputs, num_beams=1, normalize_scores=False, max_new_tokens=16)
print(processor.post_process_generation(out, task="<VQA>"))The notebook covers fine-tuned checkpoints, closed-set VQA, captioning, batches and image embeddings.
| Checkpoints | Download |
|---|---|
| Pre-trained (all scales) | Dropbox |
| Instruction-tuned | checkpoints.md |
| Fine-tuned (SLAKE, PathVQA, VQA-RAD, IU X-ray, PEIR Gross, ROCO) | checkpoints.md |
transformers format |
Hugging Face |
Setup (Linux, Python 3.10):
git clone https://github.com/taokz/BiomedGPT && cd BiomedGPT
conda create --name biomedgpt python=3.10 && conda activate biomedgpt
python -m pip install pip==24.0 # pip >= 24.1 cannot install omegaconf 2.0.6
pip install -r requirements.txt # CPU only: add --extra-index-url https://download.pytorch.org/whl/cpuPut checkpoints in checkpoints/ (e.g. checkpoints/biomedgpt_base.pt) and data in datasets/ as described in
datasets.md. Run each script from its folder, e.g. cd scripts/vqa && bash train_vqa_rad_beam_scale.sh.
| Task | Folder | Fine-tune | Evaluate |
|---|---|---|---|
| Pretraining | scripts/pretrain |
pretrain_tiny.sh |
|
| Visual question answering | scripts/vqa |
train_vqa_rad_beam_scale.sh |
evaluate_vqa_rad_beam_scale.sh |
| Image captioning | scripts/caption |
train_peir_gross.sh |
evaluate_peir_gross.sh |
| Text summarization | scripts/text_sum |
train_meqsum.sh |
evaluate_meqsum.sh |
| Natural language inference | scripts/mednli |
train_mednli.sh |
evaluate_mednli.sh |
| Image classification | scripts/image_cls |
train_medmnist.sh |
evaluate_medmnist.sh |
Zero-shot: evaluate.py evaluates a pre-trained checkpoint zero-shot (VQA, visual grounding, visual entailment),
e.g. scripts/vqa/evaluate_vqa_rad_zero_shot.sh; evaluate_vqa_rad_unconstrained.sh evaluates the
instruction-tuned checkpoints. BiomedGPT is not designed as a chatbot: it learns general biomedical representations
for downstream tasks.
@article{zhang2024generalist,
title={A generalist vision--language foundation model for diverse biomedical tasks},
author={Zhang, Kai and Zhou, Rong and Adhikarla, Eashan and Yan, Zhiling and Liu, Yixin and Yu, Jun and Liu, Zhengliang and Chen, Xun and Davison, Brian D and Ren, Hui and others},
journal={Nature Medicine},
volume={30},
number={11},
pages={3129--3141},
year={2024},
publisher={Nature Publishing Group US New York},
doi={10.1038/s41591-024-03185-2}
}
@article{peng2025scaling,
title={Scaling Up Biomedical Vision-Language Models: Fine-Tuning, Instruction Tuning, and Multi-Modal Learning},
author={Peng, Cheng and Zhang, Kai and Lyu, Mengxian and Liu, Hongfang and Sun, Lichao and Wu, Yonghui},
journal={Journal of Biomedical Informatics},
volume={171},
pages={104946},
year={2025},
publisher={Elsevier},
doi={10.1016/j.jbi.2025.104946}
}BiomedGPT builds on OFA, fairseq, taming-transformers and self-critical.pytorch.