uAI NEXUS MedVLM 1.0a 7B RL
简介
核心亮点
- 专注医疗 VQA,精准解析医学影像与文本
- 引入强化学习优化,提升专业回答的可靠性
- 7B 轻量化参数,兼顾部署效率与性能
- Apache-2.0 协议,企业级商用与二次开发友好
使用方法
# 安装 Hugging Face transformers
pip install transformers torch
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL")
tokenizer = AutoTokenizer.from_pretrained("UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL")
Hugging Face 下载
我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 huggingface_hub:
pip install -U huggingface_hub
命令行下载
下载完整模型库
huggingface-cli download UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL config.json --local-dir ./dir
SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL')
Git 下载
请确保 lfs 已经被正确安装
git lfs install
git clone https://huggingface.co/UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL
如果您希望跳过 lfs 大文件下载,可以使用如下命令
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL
模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。
PyTorch / Transformers 使用
安装 Transformers
pip install -U transformers torch
模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL')
tokenizer = AutoTokenizer.from_pretrained('UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL')
完整文档
---
language:
- en
license: apache-2.0
base_model: Qwen/Qwen2.5-VL-7B-Instruct
tags:
- medical
- video understanding
- vision-language
- temporal action localization
- GRPO
- reinforcement learning
pipeline_tag: visual-question-answering
---
uAI-NEXUS-MedVLM-1.0a-7B-RL
> Accepted at CVPR 2026 🎉
Base Model: Qwen2.5-VL-7B-Instruct
uAI-NEXUS-MedVLM-1.0a-7B-RL is a medical-video understanding model fine-tuned from Qwen2.5-VL-7B-Instruct. It is the 7B-RL member of the uAI-NEXUS-MedVLM 1.0 family (variant a = Qwen2.5-VL base; variants b / c use Qwen3-VL-4B and Qwen3.5-4B respectively). Training uses a two-stage pipeline:
1. Supervised Fine-Tuning (SFT) on medical video QA data.
2. Group Relative Policy Optimization (GRPO) with task-specific rewards for temporal precision and clinical semantics.
It achieves state-of-the-art performance on medical video understanding across temporal action localization, spatiotemporal grounding, video summarization, region captioning, and surgical skill/CVS assessment.
- 📄 Paper: arXiv:2512.06581
- 🌐 Project Page: uii-ai.github.io/MedGRPO
- 💻 Code: github.com/UII-AI/MedGRPO-Code
- 🤗 Dataset: UII-AI/MedVidBench
- 📊 Leaderboard: UII-AI/MedVidBench-Leaderboard
Model Details
- Architecture: Qwen2.5-VL (7B parameters) — video + text
- Base Model: Qwen/Qwen2.5-VL-7B-Instruct
- Training: SFT → GRPO
- Domain: Medical and surgical video understanding
- License: Apache 2.0
Supported Tasks
The model handles 8 medical video understanding tasks (11 variants):
| Task Category | Tasks |
|---|---|
| Temporal Understanding | Temporal Action Localization (TAL), Spatiotemporal Grounding (STG), Next Action Prediction |
| Captioning | Dense Captioning (GPT / Gemini), Video Summary (GPT / Gemini), Region Caption (GPT / Gemini) |
| Assessment | Skill Assessment, CVS (Critical View of Safety) |
Training Data
Trained on 51,505 balanced video-instruction pairs (the MedVidBench Standard split), spanning 8 source datasets: AVOS, CholecT50, CholecTrack20, Cholec80-CVS, CoPESD, EgoSurgery, JIGSAWS, NurViD.
Stage 2 (GRPO) uses task-balanced subsets of the Standard split (detailed in the paper).
Training Details
Stage 1 — Supervised Fine-Tuning
- Objective: Learn medical video understanding from human-annotated QA pairs.
- Optimizer: AdamW with linear learning-rate schedule.
Stage 2 — Group Relative Policy Optimization (GRPO)
- Objective: Improve temporal precision and clinical semantic quality with RL.
- Reward functions:
Usage
Install
pip install transformers accelerate torch pillow qwen-vl-utilsInference with Transformers
import torch
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from qwen_vl_utils import process_vision_info
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
"UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL",
torch_dtype=torch.bfloat16,
device_map="auto",
)
processor = AutoProcessor.from_pretrained("UII-AI/uAI-NEXUS-MedVLM-1.0a-7B-RL")
video_frames = ["frame_0001.jpg", "frame_0002.jpg", "frame_0003.jpg"] # list of frame paths
messages = [{
"role": "user",
"content": [
{"type": "video", "video": video_frames},
{"type": "text", "text": "When does the surgeon grasp the gallbladder? Provide start and end times in seconds."},
],
}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text], images=image_inputs, videos=video_inputs,
padding=True, return_tensors="pt",
).to(model.device)
with torch.no_grad():
output_ids = model.generate(inputs, max_new_tokens=256)
generated_ids = [out[len(inp):] for inp, out in zip(inputs.input_ids, output_ids)]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
Example: "The surgeon grasps the gallbladder from 45.2 to 58.7 seconds."
Batch Inference with VLLM
For full batch inference with correct video frame handling, use the reference pipeline at UII-AI/MedGRPO-Code:
git clone https://github.com/UII-AI/MedGRPO-Code
cd MedGRPO-Code
pip install -r requirements.txt
bash run_inference.shPerformance
Evaluated on MedVidBench (6,245 test samples across 8 tasks). GRPO consistently improves the SFT baseline on:
- Temporal precision for TAL / STG (higher IoU).
- Semantic quality for video summaries and region captions.
- Alignment with expert annotations for skill / CVS assessment.
Submit predictions to the MedVidBench Leaderboard to benchmark your own models.
Limitations
- Domain: Optimized for medical / surgical videos; may not generalize to other domains.
- Temporal Resolution: Best on videos sampled at 0.1–1.0 FPS.
- Language: Trained primarily on English medical terminology.
- Video Length**: Optimal for videos of a few minutes; longer videos rely on frame sub-sampling.
License
Released under the Apache 2.0 License.
Citation
If you use this model or the MedVidBench benchmark, please cite:
@inproceedings{su2026medgrpo,
title = {{MedGRPO}: Multi-Task Reinforcement Learning for Heterogeneous Medical Video Understanding},
author = {Su, Yuhao and Choudhuri, Anwesa and Gao, Zhongpai and Planche, Benjamin and
Nguyen, Van Nguyen and Zheng, Meng and Shen, Yuhan and Innanje, Arun and
Chen, Terrence and Elhamifar, Ehsan and Wu, Ziyan},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2026}
}Acknowledgments
- Base model: Qwen2.5-VL-7B-Instruct by Alibaba Cloud.
Contact
Open an issue on the GitHub repository.