uni-medical/GMAI-VL

GMAI-VL & GMAI-VL-5.5M: A Large Vision-Language Model and A Comprehensive Multimodal Dataset Towards General Medical AI.

102

stars

13

commits

Python

primary language

Jun 23, 2026

updated

README

GMAI-VL & GMAI-VL-5.5M: A Large Vision-Language Model and A Comprehensive Multimodal Dataset Towards General Medical AI

arXiv AAAI Hugging Face

Welcome to the official code repository for GMAI-VL & GMAI-VL-5.5M (AAAI 2026). This repository provides the training code needed for reproducing the results and furthering research in medical AI through vision-language models.

  • GMAI-VL: A state-of-the-art general medical vision-language model that achieves 88.48% on OmniMedVQA with only 7B parameters, surpassing models with 34B+ parameters.
  • GMAI-VL-5.5M: The largest open-source medical multimodal dataset with 5.5 million QA pairs from 219 professional medical data sources, covering 13 imaging modalities and 18 clinical departments. Available on Hugging Face.

πŸ“Š GMAI-VL-5.5M Dataset

GMAI-VL-5.5M is systematically constructed from 219 professional medical data sources using an Annotation-Guided Data Generation pipeline β€” all text is grounded in expert annotations, not hallucinated.

Dataset Subsets

SubsetSizeTypeDescription
GMAI-MM-Caption1.7MMultimodalHigh-quality medical image captions
GMAI-MM-Percept1.3MMultimodalMedical image classification & segmentation labels
GMAI-MM-Instrunct0.9MMultimodalMedical image analysis instruction QA
GMAI-Text-Single1.0MText-onlySingle-turn medical text QA
GMAI-Text-Multi0.7MText-onlyMulti-turn medical text QA

Comparison with Existing Datasets

DatasetScaleModalitiesLanguagesTraceableSource
PathVQA32.7KPathologyENβœ—Textbooks
MIMIC-CXR227KX-RayENβœ“Hospital
PMC-OA1.65MMultiENβœ—PubMed
PubMedVision1.29MMultiEN&CNβœ—PubMed
GMAI-VL-5.5M5.5MMulti (13)EN&CNβœ“219 medical datasets

πŸ‘‰ Download: πŸ€— Hugging Face

πŸ₯ GMAI-VL Model

GMAI-VL is built on the LLaVA architecture with InternLM2.5-7B (LLM) + CLIP Vision Encoder + MLP Projector, trained using a three-stage progressive strategy:

StageStrategyTrainable ComponentsLearning Rate
Stage IShallow AlignmentProjector only1e-3
Stage IIDeep AlignmentProjector + Vision Encoder1e-4
Stage IIIInstruction TuningFull model1e-5

Benchmark Results

ModelParamsOmniMedVQAGMAI-MMBenchMMMU H&MVQA-RAD
InternVL240B78.70β€”β€”β€”
HuatuoGPT-Vision34B73.23β€”50.3β€”
medgemma4B81.92β€”43.3β€”
GMAI-VL7B88.4862.4351.366.3

With only 7B parameters, GMAI-VL outperforms models with 34B+ parameters on multiple benchmarks, demonstrating the value of high-quality data + progressive training.

πŸ–₯️ Visualization Demo

A Gradio-based visualization demo is available in demo/gmai_vl_demo. It supports medical image upload, preset multimodal examples, task/body-system controls, and screenshot-friendly model responses.

cd demo/gmai_vl_demo
pip install -r requirements-gmai-vl-demo.txt
export GMAI_VL_MODEL_PATH=./model_weight
PORT=10083 bash run_demo.sh

πŸ› οΈ Model Training Instructions

1. Installation

To set up the environment for training, please follow the instructions in the xtuner repository. Ensure that all dependencies are correctly installed.

git clone https://github.com/uni-medical/GMAI-VL
cd GMAI-VL
pip install -e .

2. Data Preparation

Prepare your training data in the format shown in examples/example_data.json. To support multiple JSON datasets with different sampling ratios, use the format defined in examples/example_list.json.

Example structure for example_list.json:

{
    "FILE1": {
        "image_dir": "",
        "annotations": "examples/example_data.json",
        "sample_ratio": 1.0,
        "length": 38276,
        "data_augment": true
    },
    ...
}

3. Training

Here is a reference script to start training:

SRUN_ARGS=${SRUN_ARGS:-""}

export PYTHONPATH="$(pwd):$(pwd)/../"
export MASTER_PORT=34220


export NPROC_PER_NODE=${KUBERNETES_CONTAINER_RESOURCE_GPU}
export PORT=${MASTER_PORT}
export NNODES=${WORLD_SIZE}
export NODE_RANK=${RANK}
export ADDR=${MASTER_ADDR}
export HF_HOME=~/.cache
export USE_TRITON_KERNEL=1

torchrun --nnodes=${WORLD_SIZE} --node_rank=${RANK} --nproc_per_node=${NPROC_PER_NODE} --master_addr=${MASTER_ADDR} --master_port=${MASTER_PORT} \
    tools/llava/llava_sft.py \
    --freeze-llm \
    --freeze-vit \
    --llava $base_model_path/ \
    --chat-template internlm2 \
    --datasets examples/examples_list.json \
    --num-workers 6 \
    --mirco-batch-size $MIRCO_BATCH_SIZE \
    --global-batch-size $GLOBAL_BATCH_SIZE \
    --lr 1e-5 \
    --wd 0 \
    --dset-pack-level soft \
    --shard-strategy 'zero2' \
    --group-by-length \
    --resume \
    --max-length 2048 \
    --checkpoint-interval 500 \
    --log-interval 10 \
    --work-dir $work_dir/ \
    --dset-cache-dir $work_dir/cache/ \
    --dset-from-cache

πŸ’‘ Note: Our training follows a multi-stage strategy. At each stage, different components (e.g., LLM or ViT) may be frozen or fine-tuned. Please adjust flags such as --freeze-llm, --freeze-vit, and learning rates accordingly, as described in the paper.

πŸ“ˆ Evaluation

For evaluation, we use VLMEvalKit. GMAI-VL has been evaluated on 7 mainstream medical multimodal benchmarks: OmniMedVQA, GMAI-MMBench, MMMU (Health & Medicine), VQA-RAD, SLAKE, PMC-VQA, and PathVQA. See the paper for full results.

πŸ“¦ Open-Source Resources

ResourceLink
Paper (AAAI 2026)Proceedings
Paper (arXiv)arXiv:2411.14522
GMAI-VL-5.5M DatasetπŸ€— Hugging Face
Training CodeThis repository
Training FrameworkXTuner
Evaluation ToolkitVLMEvalKit

πŸ”— Stay Connected

For inquiries, collaboration opportunities, or access requests, feel free to reach out via email or open a GitHub issue.

Thank you for your interest and support!

πŸ™ Acknowledgements

We would like to express our sincere gratitude to the open-source community. Our work is built upon the excellent contributions of the following toolkits:

  • XTuner: An efficient, flexible, and full-featured toolkit for fine-tuning large language and vision-language models. It served as the core training framework for GMAI-VL.
  • VLMEvalKit: A comprehensive evaluation toolkit for large vision-language models (LVLMs). It enabled us to conduct rigorous and standardized evaluations across multiple benchmarks.

We deeply appreciate the efforts of the developers and contributors behind these projects.

πŸ“„ Citation

If you find our work helpful in your research, please consider citing us:

@inproceedings{li2026gmai,
  title={Gmai-vl \& gmai-vl-5.5 m: A large vision-language model and a comprehensive multimodal dataset towards general medical ai},
  author={Li, Tianbin and Su, Yanzhou and Li, Wei and Fu, Bin and Chen, Zhe and Huang, Ziyan and Wang, Guoan and Ma, Chenglong and Chen, Ying and Hu, Ming and others},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={40},
  number={28},
  pages={23177--23185},
  year={2026}
}

Contributors

tianbinli

11 commits

litianbin

2 commits

uni-medical/GMAI-VL

GMAI-VL & GMAI-VL-5.5M: A Large Vision-Language Model and A Comprehensive Multimodal Dataset Towards General Medical AI.

102

stars

13

commits

Python

primary language

Jun 23, 2026

updated

README

GMAI-VL & GMAI-VL-5.5M: A Large Vision-Language Model and A Comprehensive Multimodal Dataset Towards General Medical AI

arXiv AAAI Hugging Face

Welcome to the official code repository for GMAI-VL & GMAI-VL-5.5M (AAAI 2026). This repository provides the training code needed for reproducing the results and furthering research in medical AI through vision-language models.

  • GMAI-VL: A state-of-the-art general medical vision-language model that achieves 88.48% on OmniMedVQA with only 7B parameters, surpassing models with 34B+ parameters.
  • GMAI-VL-5.5M: The largest open-source medical multimodal dataset with 5.5 million QA pairs from 219 professional medical data sources, covering 13 imaging modalities and 18 clinical departments. Available on Hugging Face.

πŸ“Š GMAI-VL-5.5M Dataset

GMAI-VL-5.5M is systematically constructed from 219 professional medical data sources using an Annotation-Guided Data Generation pipeline β€” all text is grounded in expert annotations, not hallucinated.

Dataset Subsets

SubsetSizeTypeDescription
GMAI-MM-Caption1.7MMultimodalHigh-quality medical image captions
GMAI-MM-Percept1.3MMultimodalMedical image classification & segmentation labels
GMAI-MM-Instrunct0.9MMultimodalMedical image analysis instruction QA
GMAI-Text-Single1.0MText-onlySingle-turn medical text QA
GMAI-Text-Multi0.7MText-onlyMulti-turn medical text QA

Comparison with Existing Datasets

DatasetScaleModalitiesLanguagesTraceableSource
PathVQA32.7KPathologyENβœ—Textbooks
MIMIC-CXR227KX-RayENβœ“Hospital
PMC-OA1.65MMultiENβœ—PubMed
PubMedVision1.29MMultiEN&CNβœ—PubMed
GMAI-VL-5.5M5.5MMulti (13)EN&CNβœ“219 medical datasets

πŸ‘‰ Download: πŸ€— Hugging Face

πŸ₯ GMAI-VL Model

GMAI-VL is built on the LLaVA architecture with InternLM2.5-7B (LLM) + CLIP Vision Encoder + MLP Projector, trained using a three-stage progressive strategy:

StageStrategyTrainable ComponentsLearning Rate
Stage IShallow AlignmentProjector only1e-3
Stage IIDeep AlignmentProjector + Vision Encoder1e-4
Stage IIIInstruction TuningFull model1e-5

Benchmark Results

ModelParamsOmniMedVQAGMAI-MMBenchMMMU H&MVQA-RAD
InternVL240B78.70β€”β€”β€”
HuatuoGPT-Vision34B73.23β€”50.3β€”
medgemma4B81.92β€”43.3β€”
GMAI-VL7B88.4862.4351.366.3

With only 7B parameters, GMAI-VL outperforms models with 34B+ parameters on multiple benchmarks, demonstrating the value of high-quality data + progressive training.

πŸ–₯️ Visualization Demo

A Gradio-based visualization demo is available in demo/gmai_vl_demo. It supports medical image upload, preset multimodal examples, task/body-system controls, and screenshot-friendly model responses.

cd demo/gmai_vl_demo
pip install -r requirements-gmai-vl-demo.txt
export GMAI_VL_MODEL_PATH=./model_weight
PORT=10083 bash run_demo.sh

πŸ› οΈ Model Training Instructions

1. Installation

To set up the environment for training, please follow the instructions in the xtuner repository. Ensure that all dependencies are correctly installed.

git clone https://github.com/uni-medical/GMAI-VL
cd GMAI-VL
pip install -e .

2. Data Preparation

Prepare your training data in the format shown in examples/example_data.json. To support multiple JSON datasets with different sampling ratios, use the format defined in examples/example_list.json.

Example structure for example_list.json:

{
    "FILE1": {
        "image_dir": "",
        "annotations": "examples/example_data.json",
        "sample_ratio": 1.0,
        "length": 38276,
        "data_augment": true
    },
    ...
}

3. Training

Here is a reference script to start training:

SRUN_ARGS=${SRUN_ARGS:-""}

export PYTHONPATH="$(pwd):$(pwd)/../"
export MASTER_PORT=34220


export NPROC_PER_NODE=${KUBERNETES_CONTAINER_RESOURCE_GPU}
export PORT=${MASTER_PORT}
export NNODES=${WORLD_SIZE}
export NODE_RANK=${RANK}
export ADDR=${MASTER_ADDR}
export HF_HOME=~/.cache
export USE_TRITON_KERNEL=1

torchrun --nnodes=${WORLD_SIZE} --node_rank=${RANK} --nproc_per_node=${NPROC_PER_NODE} --master_addr=${MASTER_ADDR} --master_port=${MASTER_PORT} \
    tools/llava/llava_sft.py \
    --freeze-llm \
    --freeze-vit \
    --llava $base_model_path/ \
    --chat-template internlm2 \
    --datasets examples/examples_list.json \
    --num-workers 6 \
    --mirco-batch-size $MIRCO_BATCH_SIZE \
    --global-batch-size $GLOBAL_BATCH_SIZE \
    --lr 1e-5 \
    --wd 0 \
    --dset-pack-level soft \
    --shard-strategy 'zero2' \
    --group-by-length \
    --resume \
    --max-length 2048 \
    --checkpoint-interval 500 \
    --log-interval 10 \
    --work-dir $work_dir/ \
    --dset-cache-dir $work_dir/cache/ \
    --dset-from-cache

πŸ’‘ Note: Our training follows a multi-stage strategy. At each stage, different components (e.g., LLM or ViT) may be frozen or fine-tuned. Please adjust flags such as --freeze-llm, --freeze-vit, and learning rates accordingly, as described in the paper.

πŸ“ˆ Evaluation

For evaluation, we use VLMEvalKit. GMAI-VL has been evaluated on 7 mainstream medical multimodal benchmarks: OmniMedVQA, GMAI-MMBench, MMMU (Health & Medicine), VQA-RAD, SLAKE, PMC-VQA, and PathVQA. See the paper for full results.

πŸ“¦ Open-Source Resources

ResourceLink
Paper (AAAI 2026)Proceedings
Paper (arXiv)arXiv:2411.14522
GMAI-VL-5.5M DatasetπŸ€— Hugging Face
Training CodeThis repository
Training FrameworkXTuner
Evaluation ToolkitVLMEvalKit

πŸ”— Stay Connected

For inquiries, collaboration opportunities, or access requests, feel free to reach out via email or open a GitHub issue.

Thank you for your interest and support!

πŸ™ Acknowledgements

We would like to express our sincere gratitude to the open-source community. Our work is built upon the excellent contributions of the following toolkits:

  • XTuner: An efficient, flexible, and full-featured toolkit for fine-tuning large language and vision-language models. It served as the core training framework for GMAI-VL.
  • VLMEvalKit: A comprehensive evaluation toolkit for large vision-language models (LVLMs). It enabled us to conduct rigorous and standardized evaluations across multiple benchmarks.

We deeply appreciate the efforts of the developers and contributors behind these projects.

πŸ“„ Citation

If you find our work helpful in your research, please consider citing us:

@inproceedings{li2026gmai,
  title={Gmai-vl \& gmai-vl-5.5 m: A large vision-language model and a comprehensive multimodal dataset towards general medical ai},
  author={Li, Tianbin and Su, Yanzhou and Li, Wei and Fu, Bin and Chen, Zhe and Huang, Ziyan and Wang, Guoan and Ma, Chenglong and Chen, Ying and Hu, Ming and others},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={40},
  number={28},
  pages={23177--23185},
  year={2026}
}

Contributors

tianbinli

11 commits

litianbin

2 commits

Languages

Python

100.0%