Qwen3-VL-2B FracAtlas LoRA
X-ray analysis adapter
2 min read
This model is an educational LoRA adapter (a small add-on over a base model for fine-tuning) based on the compact visual-language model Qwen/Qwen3-VL-2B-Instruct. The adapter is trained to read musculoskeletal X-rays and generate a structured four-line report: body part, projection, hardware presence, and fracture presence. The project was created for the RSNA 2026 Deep Learning Lab to demonstrate the fine-tuning process. The model is strictly educational and not intended for clinical use.
Key features
- Created as educational material for the RSNA 2026 Deep Learning Lab (Lab 07).
- Trained on the FracAtlas dataset (3,258 images at 512-pixel resolution).
- Fine-tuned using LoRA only on the language part of the model, while the visual encoder and projector are frozen.
- Showed a significant improvement in report format adherence (100% vs. 0% for the base) and fracture detection accuracy on the test set.
What you can do
- Test the model in Google Colab on free GPUs (such as T4 in fp16) for X-ray analysis using a given prompt.
- Use the training scripts and results from the repository to study fine-tuning methods for multimodal AI models.
- Automate the generation of standardized four-line bone X-ray reports for research purposes.
Example
import torch
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor
base = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3-VL-2B-Instruct", dtype=torch.float16).to("cuda")
model = PeftModel.from_pretrained(base, "magnooj/qwen3-vl-2b-fracatlas-lora").eval()
processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-2B-Instruct")
msgs = [{"role": "user", "content": [{"type": "image", "image": image}, {"type": "text", "text": PROMPT}]}]
enc = processor.apply_chat_template(msgs, tokenize=True, add_generation_prompt=True,
return_dict=True, return_tensors="pt").to("cuda")
out = model.generate(**enc, max_new_tokens=64, do_sample=False)
print(processor.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))Read more
DetailsBenchmarks (421 test images): format adherence — 100% (base — 0%), correct body part — 97% (base — 52%), fracture sensitivity — 51% (base — 10%), fracture AUC — 0.84 (base — 0.60).
Training: LoRA rank — 16, alpha — 32, dropout — 0.05 (17.4M trainable weights, 0.8% of the model), AdamW, learning rate 2e-4.
Limitations: the model misses about half of the fractures in the test set, can hallucinate on empty images or noise, is sensitive to image rotations, and has not undergone external validation. License: Apache-2.0.










Comments