File size: 6,889 Bytes
63fba53 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | <h3 align="center">
π©Ί MedEvalKit: A Unified Medical Evaluation Framework
</h3>
<p align="center">
<a href="https://arxiv.org/abs/2506.07044" target="_blank">π arXiv Paper</a> β’
<a href="https://huggingface.co/collections/lingshu-medical-mllm/lingshu-mllms-6847974ca5b5df750f017dad" target="_blank">π€ Lingshu Models</a> β’
<a href="https://alibaba-damo-academy.github.io/lingshu/" target="_blank">π Lingshu Project Page</a>
</p>
<p align="center">
<a href="https://opensource.org/license/apache-2-0">
<img src="https://img.shields.io/badge/Code%20License-Apache_2.0-green.svg" alt="License">
</a>
<a href="https://github.com/alibaba-damo-academy">
<img src="https://img.shields.io/badge/Institution-DAMO-red" alt="Institution">
</a>
<a>
<img src="https://img.shields.io/badge/PRs-Welcome-red" alt="PRs Welcome">
</a>
</p>
---
## π Introduction
A comprehensive evaluation framework for **Large Medical Models (LMMs/LLMs)** in the healthcare domain.
We welcome contributions of new models, benchmarks, or enhanced evaluation metrics!
---
## Eval Results
### MultiModal Eval Results
<p align="center">
<a>
<img src="assets/mm_eval.png">
</a>
</p>
### Text-Only Eval Results
<p align="center">
<a>
<img src="assets/text_eval.png">
</a>
</p>
## π₯ Latest News
* **2025-06-12** - Initial release of MedEvalKit v1.0!
---
## π§ͺ Supported Benchmarks
| Multimodal Medical Benchmarks | Text-Only Medical Benchmarks |
|-----------------------|----------------------|
| MMMU-Medical-test | MedQA-USMLE |
| MMMU-Medical-val | MedMCQA |
| PMC_VQA | PubMedQA |
| OmniMedVQA | Medbullets-op4 |
| IU XRAY | Medbullets-op5 |
| MedXpertQA-Multimodal | MedXpertQA-Text |
| CheXpert Plus | SuperGPQA |
| MIMIC-CXR | HealthBench |
| VQA-RAD | CMB |
| SLAKE | CMExam |
| PATH-VQA | CMMLU |
| MedFrameQA | MedQA-MCMLE |
---
## π€ Supported Models
### HuggingFace Exclusive
<div style="column-count: 2;">
* BiMediX2
* BiomedGPT
* HealthGPT
* Janus
* Med_Flamingo
* MedDr
* MedGemma
* NVILA
* VILA_M3
</div>
### HF + vLLM Compatible
<div style="column-count: 2;">
* HuatuoGPT-vision
* InternVL
* Llama_3.2-vision
* LLava
* LLava_Med
* Qwen2_5_VL
* Qwen2_VL
</div>
---
## π οΈ Installation
```bash
# Clone repository
git clone https://github.com/DAMO-NLP-SG/MedEvalKit
cd MedEvalKit
# Install dependencies
pip install -r requirements.txt
pip install 'open_clip_torch[training]'
pip install flash-attn --no-build-isolation
# For LLaVA-like models
git clone https://github.com/LLaVA-VL/LLaVA-NeXT.git
cd LLaVA-NeXT && pip install -e .
```
---
## π Dataset Preparation
### HuggingFace Datasets (Direct Access)
```python
# Set DATASETS_PATH='hf'
VQA-RAD: flaviagiammarino/vqa-rad
SuperGPQA: m-a-p/SuperGPQA
PubMedQA: openlifescienceai/pubmedqa
PATHVQA: flaviagiammarino/path-vqa
MMMU: MMMU/MMMU
MedQA-USMLE: GBaker/MedQA-USMLE-4-options
MedQA-MCMLE: shuyuej/MedQA-MCMLE-Benchmark
Medbullets_op4: tuenguyen/Medical-Eval-MedBullets_op4
Medbullets_op5: LangAGI-Lab/medbullets_op5
CMMMU: haonan-li/cmmlu
CMExam: fzkuji/CMExam
CMB: FreedomIntelligence/CMB
MedFrameQA: SuhaoYu1020/MedFrameQA
```
### Local Datasets (Manual Download Required)
| Dataset | Source |
|------------------|--------|
| MedXpertQA | [TsinghuaC3I](https://huggingface.co/datasets/TsinghuaC3I/MedXpertQA) |
| SLAKE | [BoKelvin](https://huggingface.co/datasets/BoKelvin/SLAKE) |
| PMCVQA | [RadGenome](https://huggingface.co/datasets/RadGenome/PMC-VQA) |
| OmniMedVQA | [foreverbeliever](https://huggingface.co/datasets/foreverbeliever/OmniMedVQA) |
| MIMIC_CXR | [MIMIC_CXR](https://physionet.org/content/mimic-cxr/2.1.0/) |
| IU_Xray | [IU_Xray](https://openi.nlm.nih.gov/faq?download=true) |
| CheXpert Plus | [CheXpert Plus](https://aimi.stanford.edu/datasets/chexpert-plus) |
| HealthBench | [Normal](https://openaipublic.blob.core.windows.net/simple-evals/healthbench/2025-05-07-06-14-12_oss_eval.jsonl),[Hard](https://openaipublic.blob.core.windows.net/simple-evals/healthbench/hard_2025-05-08-21-00-10.jsonl),[Consensus](https://openaipublic.blob.core.windows.net/simple-evals/healthbench/consensus_2025-05-09-20-00-46.jsonl) |
---
## π Quick Start
### 1. Configure `eval.sh`
```bash
#!/bin/bash
export HF_ENDPOINT=https://hf-mirror.com
# MMMU-Medical-test,MMMU-Medical-val,PMC_VQA,MedQA_USMLE,MedMCQA,PubMedQA,OmniMedVQA,Medbullets_op4,Medbullets_op5,MedXpertQA-Text,MedXpertQA-MM,SuperGPQA,HealthBench,IU_XRAY,CheXpert_Plus,MIMIC_CXR,CMB,CMExam,CMMLU,MedQA_MCMLE,VQA_RAD,SLAKE,PATH_VQA,MedFrameQA
EVAL_DATASETS="Medbullets_op4"
DATASETS_PATH="hf"
OUTPUT_PATH="eval_results/{}"
# TestModel,Qwen2-VL,Qwen2.5-VL,BiMediX2,LLava_Med,Huatuo,InternVL,Llama-3.2,LLava,Janus,HealthGPT,BiomedGPT,Vllm_Text,MedGemma,Med_Flamingo,MedDr
MODEL_NAME="Qwen2.5-VL"
MODEL_PATH="Qwen2.5-VL-7B-Instruct"
#vllm setting
CUDA_VISIBLE_DEVICES="0"
TENSOR_PARALLEL_SIZE="1"
USE_VLLM="False"
#Eval setting
SEED=42
REASONING="False"
TEST_TIMES=1
# Eval LLM setting
MAX_NEW_TOKENS=8192
MAX_IMAGE_NUM=6
TEMPERATURE=0
TOP_P=0.0001
REPETITION_PENALTY=1
# LLM judge setting
USE_LLM_JUDGE="True"
# gpt api model name
GPT_MODEL="gpt-4.1-2025-04-14"
OPENAI_API_KEY=""
# pass hyperparameters and run python sccript
python eval.py \
--eval_datasets "$EVAL_DATASETS" \
--datasets_path "$DATASETS_PATH" \
--output_path "$OUTPUT_PATH" \
--model_name "$MODEL_NAME" \
--model_path "$MODEL_PATH" \
--seed $SEED \
--cuda_visible_devices "$CUDA_VISIBLE_DEVICES" \
--tensor_parallel_size "$TENSOR_PARALLEL_SIZE" \
--use_vllm "$USE_VLLM" \
--max_new_tokens "$MAX_NEW_TOKENS" \
--max_image_num "$MAX_IMAGE_NUM" \
--temperature "$TEMPERATURE" \
--top_p "$TOP_P" \
--repetition_penalty "$REPETITION_PENALTY" \
--reasoning "$REASONING" \
--use_llm_judge "$USE_LLM_JUDGE" \
--judge_gpt_model "$GPT_MODEL" \
--openai_api_key "$OPENAI_API_KEY" \
--test_times "$TEST_TIMES"
```
### 2. Run Evaluation
```bash
chmod +x eval.sh # Add execute permission
./eval.sh
```
---
## π Citation
```bibtex
@article{xu2025lingshu,
title={Lingshu: A Generalist Foundation Model for Unified Multimodal Medical Understanding and Reasoning},
author={Xu, Weiwen and Chan, Hou Pong and Li, Long and Aljunied, Mahani and Yuan, Ruifeng and Wang, Jianyu and Xiao, Chenghao and Chen, Guizhen and Liu, Chaoqun and Li, Zhaodonghui and others},
journal={arXiv preprint arXiv:2506.07044},
year={2025}
}
```
<div align="center">
<sub>Built with β€οΈ by the DAMO Academy Medical AI Team</sub>
</div>
|