Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
fundus
ophthalmology
retinal-imaging
medical-vlm
multimodal-large-language-model
reasoning
rag
rlvr
qwen2.5-vl
conversational
text-generation-inference
Instructions to use Kimokcheon/Fundus-R1-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kimokcheon/Fundus-R1-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Kimokcheon/Fundus-R1-3B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Kimokcheon/Fundus-R1-3B") model = AutoModelForMultimodalLM.from_pretrained("Kimokcheon/Fundus-R1-3B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kimokcheon/Fundus-R1-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kimokcheon/Fundus-R1-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kimokcheon/Fundus-R1-3B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Kimokcheon/Fundus-R1-3B
- SGLang
How to use Kimokcheon/Fundus-R1-3B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Kimokcheon/Fundus-R1-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kimokcheon/Fundus-R1-3B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Kimokcheon/Fundus-R1-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kimokcheon/Fundus-R1-3B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Kimokcheon/Fundus-R1-3B with Docker Model Runner:
docker model run hf.co/Kimokcheon/Fundus-R1-3B
File size: 5,771 Bytes
4fde766 | 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 | ---
language:
- en
library_name: transformers
pipeline_tag: image-text-to-text
tags:
- fundus
- ophthalmology
- retinal-imaging
- medical-vlm
- multimodal-large-language-model
- reasoning
- rag
- rlvr
- qwen2.5-vl
- safetensors
arxiv: "2604.08322"
---
# Fundus-R1
Fundus-R1 is a fundus-reading multimodal large language model introduced in the paper:
**Fundus-R1: Training a Fundus-Reading MLLM with Knowledge-Aware Reasoning on Public Data**
Yuchuan Deng, Qijie Wei, Kaiheng Qian, Jiazhen Liu, Zijie Xin, Bangxiang Lan, Jingyu Liu, Jianfeng Dong, Xirong Li
Paper: https://arxiv.org/abs/2604.08322
Fundus-R1 is designed for fundus image understanding, including color fundus photography (CFP), optical coherence tomography (OCT), and ultra-widefield fundus imaging (UWF). The model is trained using publicly available data and aims to improve knowledge-aware reasoning for retinal image analysis.
## Model Variants
| Model | Repository |
|---|---|
| Fundus-R1-3B | `Kimokcheon/Fundus-R1-3B` |
| Fundus-R1-7B | `Kimokcheon/Fundus-R1-7B` |
This model card is shared by the released Fundus-R1 checkpoints. Please select the checkpoint size according to your compute budget and deployment requirement.
## Method Overview
Fundus-R1 addresses the difficulty of training fundus-reading MLLMs without private clinical-report data. According to the paper, the model is trained exclusively on public datasets, where most samples contain only image-level labels rather than detailed diagnostic reports.
The training pipeline contains two key components:
1. **Knowledge-aware reasoning trace construction.** A retrieval-augmented generation (RAG) procedure is used to compose image-specific reasoning traces that connect visual findings to image labels through ophthalmic knowledge.
2. **Reasoning-enhanced RLVR.** Reinforcement learning with verifiable rewards (RLVR) is enhanced with a process reward that encourages self-consistency in the generated reasoning trace.
The paper reports evaluation on three fundus-reading benchmarks: **FunBench**, **Omni-Fundus**, and **GMAI-Fundus**.
## Intended Use
Fundus-R1 is intended for research on fundus-image understanding, medical multimodal reasoning, ophthalmic MLLMs, and public-data-based post-training of medical vision-language models.
Possible research uses include:
- fundus image question answering;
- retinal disease recognition experiments;
- reasoning-trace analysis for medical MLLMs;
- comparison with general-purpose MLLMs and ophthalmology-specific MLLMs;
- studies on RAG-generated medical reasoning traces and RLVR training.
## Important Medical Disclaimer
This model is released for research use. It is **not** a certified medical device and should not be used as the sole basis for clinical diagnosis, treatment planning, triage, or patient management. Outputs should be reviewed by qualified medical professionals before any clinical interpretation or downstream use.
## Example Usage
The exact loading code may depend on the checkpoint configuration and your installed `transformers` version. A typical Qwen2.5-VL-style loading pattern is:
```python
import torch
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
from qwen_vl_utils import process_vision_info
model_id = "Kimokcheon/Fundus-R1-3B" # or "Kimokcheon/Fundus-R1-7B"
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
processor = AutoProcessor.from_pretrained(model_id)
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": "path/to/fundus_image.jpg"},
{"type": "text", "text": "Describe the retinal findings in this fundus image."},
],
}
]
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():
generated_ids = model.generate(**inputs, max_new_tokens=512)
output_ids = generated_ids[:, inputs.input_ids.shape[1]:]
response = processor.batch_decode(
output_ids,
skip_special_tokens=True,
clean_up_tokenization_spaces=False,
)[0]
print(response)
```
Install common dependencies:
```bash
pip install -U transformers accelerate safetensors qwen-vl-utils
```
## Download Through HF Mirror
For users in regions where the official Hugging Face endpoint is slow, the checkpoints can be downloaded through the Hugging Face mirror endpoint:
```bash
export HF_ENDPOINT=https://hf-mirror.com
huggingface-cli download Kimokcheon/Fundus-R1-3B --local-dir ./Fundus-R1-3B
huggingface-cli download Kimokcheon/Fundus-R1-7B --local-dir ./Fundus-R1-7B
```
To verify mirror availability with a lightweight file:
```bash
export HF_ENDPOINT=https://hf-mirror.com
huggingface-cli download Kimokcheon/Fundus-R1-3B config.json --local-dir /tmp/fundus-r1-3b-check
huggingface-cli download Kimokcheon/Fundus-R1-7B config.json --local-dir /tmp/fundus-r1-7b-check
```
## Citation
If you use Fundus-R1, please cite the paper:
```bibtex
@article{deng2026fundusr1,
title={Fundus-R1: Training a Fundus-Reading MLLM with Knowledge-Aware Reasoning on Public Data},
author={Deng, Yuchuan and Wei, Qijie and Qian, Kaiheng and Liu, Jiazhen and Xin, Zijie and Lan, Bangxiang and Liu, Jingyu and Dong, Jianfeng and Li, Xirong},
journal={arXiv preprint arXiv:2604.08322},
year={2026}
}
```
## Links
- Paper: https://arxiv.org/abs/2604.08322
- Fundus-R1-3B: https://huggingface.co/Kimokcheon/Fundus-R1-3B
- Fundus-R1-7B: https://huggingface.co/Kimokcheon/Fundus-R1-7B
|