MedFrame-R1-4B-SFT
a medical multimodal model with reasoning
2 min read
MedFrame-R1-4B-SFT is a specialized medical multimodal model built on Qwen/Qwen3-VL-4B-Instruct. Trained using the MedFrame-R1 framework, it tackles visual-text analysis tasks in the medical domain. The model generates step-by-step reasoning (Chain-of-Thought, a logical sequence of steps before delivering the final answer) prior to giving its conclusion. It is built for researchers studying image-and-text diagnostics and is strictly not for clinical use.
Key features
- Built on the Qwen/Qwen3-VL-4B-Instruct model.
- Trained via supervised cold-start on Chain-of-Thought targets.
- Uses weighted cross-entropy with Adaptive Early-Stop Loss.
- Trained on the MBZUAI/medix-rl-data dataset (51,335 examples).
What you can do
- Integrate the model into image processing research pipelines via the transformers library.
- Analyze medical scans while capturing intermediate logical reasoning.
- Evaluate the model on medical benchmarks to measure VQA and QA performance.
Example
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "Shayannasiri/MedFrame-R1-4B-SFT"
model = AutoModelForImageTextToText.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
processor = AutoProcessor.from_pretrained(model_id)
messages = [{ "role": "user", "content": [
{ "type": "image", "image": "image.png" },
{ "type": "text", "text": "Is there evidence of pneumothorax?" },
]}]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=1024)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))Read more
DetailsTraining: 1 epoch with Adaptive Early-Stop Loss
Data: MBZUAI/medix-rl-data and Shayannasiri/MedFrame-R1-CoT
Benchmarks: 17 medical benchmarks (19,200 items, evaluated via rules and judge)
Limitations: For research purposes only, not for clinical decisions










Comments