Medical Multimodal LLMs
401
stars
20
commits
Python
primary language
Apr 23, 2025
updated
| # Data | Download | |
|---|---|---|
| PubMedVision Dataset | 1,294,062 | HF Link |
| VQA-RAD | SLAKE | PathVQA | PMC-VQA | |
|---|---|---|---|---|
| LLaVA-v1.6-34B | 58.6 | 67.3 | 59.1 | 44.4 |
| LLaVA-v1.5-LLaMA3-8B | 54.2 | 59.4 | 54.1 | 36.4 |
| LLaVA-v1.5-LLaMA3-8B + PubMedVision | 63.8 | 74.5 | 59.9 | 52.7 |
| OmniMedVQA | MMMU Health & Medicine (Test Set) | |
|---|---|---|
| LLaVA-v1.6-34B | 61.4 | 48.8 |
| LLaVA-v1.5-LLaMA3-8B | 48.8 | 38.2 |
| LLaVA-v1.5-LLaMA3-8B + PubMedVision | 75.1 | 49.1 |
HuatuoGPT-Vision is our medical multimodal LLMs, built on PubMedVision.
Our model is available on Huggingface in two versions:
Chat via the command line:
python cli.py --model_dir path-to-huatuogpt-vision-model
Inference using our ChatBot:
query = 'What does the picture show?'
image_paths = ['image_path1']
from cli import HuatuoChatbot
bot = HuatuoChatbot(path-to-huatuogpt-vision-model)
output = bot.inference(query, image_paths)
print(output) # Prints the output of the model
| VQA-RAD | SLAKE | PathVQA | PMC-VQA | |
|---|---|---|---|---|
| LLaVA-Med-7B | 51.4 | 48.6 | 56.8 | 24.7 |
| LLaVA-v1.6-34B | 58.6 | 67.3 | 59.1 | 44.4 |
| HuatuoGPT-Vision-7B | 63.7 | 76.2 | 57.9 | 54.3 |
| HuatuoGPT-Vision-34B | 68.1 | 76.9 | 63.5 | 58.2 |
| OmniMedVQA | MMMU Health & Medicine (Test Set) | |
|---|---|---|
| LLaVA-Med-7B | 44.5 | 36.9 |
| LLaVA-v1.6-34B | 61.4 | 48.8 |
| HuatuoGPT-Vision-7B | 74.0 | 50.6 |
| HuatuoGPT-Vision-34B | 76.9 | 54.4 |
| Dataset | Link |
|---|---|
| Medical_Multimodal_Evaluation_Data | link |
We have bundled multiple evaluation datasets together. Simply download the data and extract the images.zip file.
accelerate launch eval.py --data_path Medical_Multimodal_Evaluation_Data/medical_multimodel_evaluation_data.json --model_path HuatuoGPT-Vision-7B
VQA-RAD, SLAKE, PathVQA, PMC-VQA, OmniMedVQA, and MMMU-Medical-Tracks.This project uses LLaVA's code for training, and it is recommended to use LLaVA's code for training. The code is available at LLaVA.
To reproduce our results, please train the model using a combination of the PubMedVision dataset and LLaVA's dataset.
Update (April 23, 2025):
We release our training process using an newer architecture. Given that the original LLaVA codebase are relatively outdated, we’ve transitioned to a cleaner and more efficient training framework based on Qwen2.5-VL.
The Qwen2.5-VL architecture is more compatible with Huggingface Transformers, making both training and deployment easier, and it offers better support for image processing. We strongly recommend using Qwen2.5-VL. (Note: Use the latest Transformers library for Qwen2.5-VL compatibility.)
Initialize Qwen2.5-VL with LLMs (Qwen2.5-LLM). This step initializes a Qwen2.5-VL with an LLM so that we can train an MLLM from scratch.
python convert_llm_to_vl.py \
--vl_model_path Qwen/Qwen2.5-VL-7B-Instruct \
--llm_model_path Qwen/Qwen2.5-7B-Instruct \
--save_path ./Qwen2.5-VL-7B-Base
accelerate launch --config_file ./config/ds.yaml \
--num_processes 8 \
--num_machines 1 \
--machine_rank 0 \
--main_process_port 29502 \
--deepspeed_multinode_launcher standard train_vl.py \
--experiment_name huatuogpt_vision_alignment \
--run_name huatuogpt_vision \
--model_path ./Qwen2.5-VL-7B-Base \
--max_ckpts 1 \
--gradient_accumulation_steps 8 \
--data_path Vision_Alignment_Data.json \
--output_dir ./huatuogpt_vision_alignment_checkpoint \
--n_epochs 1 \
--warmup_rates 0.05 \
--train_bsz_per_gpu 2 \
--learning_rate 5e-6 \
--gradient_checkpointing
accelerate launch --config_file ./config/ds.yaml \
--num_processes 8 \
--num_machines 1 \
--machine_rank 0 \
--main_process_port 29502 \
--deepspeed_multinode_launcher standard train_vl.py \
--experiment_name huatuogpt_vision_sft \
--run_name huatuogpt_vision \
--model_path huatuogpt_vision_alignment_model \
--max_ckpts 1 \
--gradient_accumulation_steps 8 \
--data_path Vision_SFT_Data.json \
--n_epochs 1 \
--warmup_rates 0.05 \
--train_bsz_per_gpu 2 \
--learning_rate 5e-6 \
--gradient_checkpointing
Explore our HuatuoGPT series:
@misc{chen2024huatuogptvisioninjectingmedicalvisual,
title={HuatuoGPT-Vision, Towards Injecting Medical Visual Knowledge into Multimodal LLMs at Scale},
author={Junying Chen and Ruyi Ouyang and Anningzhe Gao and Shunian Chen and Guiming Hardy Chen and Xidong Wang and Ruifei Zhang and Zhenyang Cai and Ke Ji and Guangjun Yu and Xiang Wan and Benyou Wang},
year={2024},
eprint={2406.19280},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2406.19280},
}
Python
100.0%
Medical Multimodal LLMs
401
stars
20
commits
Python
primary language
Apr 23, 2025
updated
| # Data | Download | |
|---|---|---|
| PubMedVision Dataset | 1,294,062 | HF Link |
| VQA-RAD | SLAKE | PathVQA | PMC-VQA | |
|---|---|---|---|---|
| LLaVA-v1.6-34B | 58.6 | 67.3 | 59.1 | 44.4 |
| LLaVA-v1.5-LLaMA3-8B | 54.2 | 59.4 | 54.1 | 36.4 |
| LLaVA-v1.5-LLaMA3-8B + PubMedVision | 63.8 | 74.5 | 59.9 | 52.7 |
| OmniMedVQA | MMMU Health & Medicine (Test Set) | |
|---|---|---|
| LLaVA-v1.6-34B | 61.4 | 48.8 |
| LLaVA-v1.5-LLaMA3-8B | 48.8 | 38.2 |
| LLaVA-v1.5-LLaMA3-8B + PubMedVision | 75.1 | 49.1 |
HuatuoGPT-Vision is our medical multimodal LLMs, built on PubMedVision.
Our model is available on Huggingface in two versions:
Chat via the command line:
python cli.py --model_dir path-to-huatuogpt-vision-model
Inference using our ChatBot:
query = 'What does the picture show?'
image_paths = ['image_path1']
from cli import HuatuoChatbot
bot = HuatuoChatbot(path-to-huatuogpt-vision-model)
output = bot.inference(query, image_paths)
print(output) # Prints the output of the model
| VQA-RAD | SLAKE | PathVQA | PMC-VQA | |
|---|---|---|---|---|
| LLaVA-Med-7B | 51.4 | 48.6 | 56.8 | 24.7 |
| LLaVA-v1.6-34B | 58.6 | 67.3 | 59.1 | 44.4 |
| HuatuoGPT-Vision-7B | 63.7 | 76.2 | 57.9 | 54.3 |
| HuatuoGPT-Vision-34B | 68.1 | 76.9 | 63.5 | 58.2 |
| OmniMedVQA | MMMU Health & Medicine (Test Set) | |
|---|---|---|
| LLaVA-Med-7B | 44.5 | 36.9 |
| LLaVA-v1.6-34B | 61.4 | 48.8 |
| HuatuoGPT-Vision-7B | 74.0 | 50.6 |
| HuatuoGPT-Vision-34B | 76.9 | 54.4 |
| Dataset | Link |
|---|---|
| Medical_Multimodal_Evaluation_Data | link |
We have bundled multiple evaluation datasets together. Simply download the data and extract the images.zip file.
accelerate launch eval.py --data_path Medical_Multimodal_Evaluation_Data/medical_multimodel_evaluation_data.json --model_path HuatuoGPT-Vision-7B
VQA-RAD, SLAKE, PathVQA, PMC-VQA, OmniMedVQA, and MMMU-Medical-Tracks.This project uses LLaVA's code for training, and it is recommended to use LLaVA's code for training. The code is available at LLaVA.
To reproduce our results, please train the model using a combination of the PubMedVision dataset and LLaVA's dataset.
Update (April 23, 2025):
We release our training process using an newer architecture. Given that the original LLaVA codebase are relatively outdated, we’ve transitioned to a cleaner and more efficient training framework based on Qwen2.5-VL.
The Qwen2.5-VL architecture is more compatible with Huggingface Transformers, making both training and deployment easier, and it offers better support for image processing. We strongly recommend using Qwen2.5-VL. (Note: Use the latest Transformers library for Qwen2.5-VL compatibility.)
Initialize Qwen2.5-VL with LLMs (Qwen2.5-LLM). This step initializes a Qwen2.5-VL with an LLM so that we can train an MLLM from scratch.
python convert_llm_to_vl.py \
--vl_model_path Qwen/Qwen2.5-VL-7B-Instruct \
--llm_model_path Qwen/Qwen2.5-7B-Instruct \
--save_path ./Qwen2.5-VL-7B-Base
accelerate launch --config_file ./config/ds.yaml \
--num_processes 8 \
--num_machines 1 \
--machine_rank 0 \
--main_process_port 29502 \
--deepspeed_multinode_launcher standard train_vl.py \
--experiment_name huatuogpt_vision_alignment \
--run_name huatuogpt_vision \
--model_path ./Qwen2.5-VL-7B-Base \
--max_ckpts 1 \
--gradient_accumulation_steps 8 \
--data_path Vision_Alignment_Data.json \
--output_dir ./huatuogpt_vision_alignment_checkpoint \
--n_epochs 1 \
--warmup_rates 0.05 \
--train_bsz_per_gpu 2 \
--learning_rate 5e-6 \
--gradient_checkpointing
accelerate launch --config_file ./config/ds.yaml \
--num_processes 8 \
--num_machines 1 \
--machine_rank 0 \
--main_process_port 29502 \
--deepspeed_multinode_launcher standard train_vl.py \
--experiment_name huatuogpt_vision_sft \
--run_name huatuogpt_vision \
--model_path huatuogpt_vision_alignment_model \
--max_ckpts 1 \
--gradient_accumulation_steps 8 \
--data_path Vision_SFT_Data.json \
--n_epochs 1 \
--warmup_rates 0.05 \
--train_bsz_per_gpu 2 \
--learning_rate 5e-6 \
--gradient_checkpointing
Explore our HuatuoGPT series:
@misc{chen2024huatuogptvisioninjectingmedicalvisual,
title={HuatuoGPT-Vision, Towards Injecting Medical Visual Knowledge into Multimodal LLMs at Scale},
author={Junying Chen and Ruyi Ouyang and Anningzhe Gao and Shunian Chen and Guiming Hardy Chen and Xidong Wang and Ruifei Zhang and Zhenyang Cai and Ke Ji and Guangjun Yu and Xiang Wan and Benyou Wang},
year={2024},
eprint={2406.19280},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2406.19280},
}
Python
100.0%