Views
No views yet
Qwen2-VL-2B-Instruct that grades diabetic retinopathy (0-4)
and produces a structured clinical explanation (grade, lesions, reasoning,
recommendation). Fine-tuned with 4-bit QLoRA (Unsloth) on the
IDRiD-VQA dataset, entirely on a
single 6 GB consumer GPU (NVIDIA RTX 4050).⚠️ Research use only. Not a medical device. Not for clinical use.
| Model | Accuracy | QWK | ROUGE-L | BERTScore | s/img |
|---|---|---|---|---|---|
| Qwen2-VL-2B (zero-shot) | 31.1% | 0.00 | 0.081 | 0.000 | 10.6 |
| + QLoRA (this model) | 66.0% | 0.76 | 0.253 | 0.309 | 5.6 |
1from unsloth import FastVisionModel
2from PIL import Image
3
4model, tok = FastVisionModel.from_pretrained("vermayuvraj/idrid-qwen2vl-2b-qlora", load_in_4bit=True)
5FastVisionModel.for_inference(model)
6
7img = Image.open("fundus.jpg").convert("RGB")
8q = "What is the diabetic retinopathy severity grade (0-4) shown in this fundus image?"
9msgs = [{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": q}]}]
10text = tok.apply_chat_template(msgs, add_generation_prompt=True)
11inputs = tok(img, text, add_special_tokens=False, return_tensors="pt").to("cuda")
12out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
13print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))1@misc{verma2026idridvqa,
2 title = {IDRiD-VQA: Fine-Tuning a 2B Vision-Language Model for Explainable
3 Diabetic Retinopathy Grading on Consumer Hardware},
4 author = {Verma, Yuvraj},
5 year = {2026}
6}