Skanda-0
Reads chest X-ray, CT and MRI, writes the report, and outlines the findings it reports
Results · By disease · Limitations · How it works · Architecture · Training · Files · Memory · int8 / int4 · Licence
[!WARNING] Research use only. Skanda drafts findings for a radiologist to review. It is not a medical device and has not been cleared or approved for clinical use by any regulator.
✨ At a glance
🏁 Results
All numbers are percentages on held-out test cases. No test patient was seen in training.
Percent, higher is better; bold = best per row. MAIRA-2 reads chest X-rays only, so it has no CT or MRI numbers. † An earlier development checkpoint, shown for comparison; it is not published. Skanda-0 is the run-3 checkpoint.
💡 What the numbers say
- 🫁🧠 On CT and MRI, Skanda is well ahead of MedGemma.
- It names the right finding 72% / 89% of the time, against 49% / 42% for MedGemma 27B.
- It clears 91% / 94% of lesion-free cases, where MedGemma clears 6% / 2%: it calls nearly every case abnormal.
- 🩻 On chest X-ray, Skanda-0 is a trade-off against the earlier run 2.
- Finding type rose from 37% to 40.5%, but it clears fewer normals than run 2 (69% vs 83%) and finds fewer boxes (recall 10% vs 15.5%).
- Each X-ray number moves about ±10 points by chance across 111 films. On the 106 dev films the same checkpoint cleared 74% of normals at 15.5% recall.
- 🎯 Skanda outlines; the baselines write coordinates. MedGemma and MAIRA-2 give boxes only as text. Skanda's box precision is 4× MedGemma's on X-ray, 22× on CT and 12× on MRI.
- 🩻 On X-ray boxes, MAIRA-2 alone is ahead. Read on the same 111 films in a later benchmark, MAIRA-2 reached box precision 30% and recall 13%, against Skanda's 24.5% and 9.5% (see the quantized builds below). MAIRA-2 is licensed for research use only.
| Metric | Meaning |
|---|---|
| Abnormal flagged | abnormal cases the model calls abnormal |
| Normals called normal | normal or lesion-free cases the model clears |
| Right finding type | abnormal cases where the model names a ground-truth finding class |
| Box precision / recall | X-ray: a predicted box counts when its centre lies inside a radiologist box of the same class. CT/MRI: box IoU ≥ 0.3 with a radiologist outline, matched one-to-one |
- Chest X-ray: ChestX-Det test films, scored by the Skanda Radiology app's own benchmark. The same runner is used for every model. Skanda's numbers are the mean of two passes.
- CT and MRI: a fixed sample of held-out slices and volumes, with and without lesions. One script scores every model.
- Two reads of the same cases. The table above is from 1 November 2026. The quantized-build table below and the int8 / int4 cards use a later re-read (8 November), with every baseline served at bf16, 8-bit and 4-bit through the same stack. On X-ray the two reads differ by a few points (MedGemma 27B finding type 41% here, 36% there), within the ±10-point chance range of 111 films; CT and MRI reads of Skanda were identical.
🦠 Detection by disease
How often each model names each kind of finding, on the same held-out cases as the table above.
| Skanda leads | MedGemma leads | |
|---|---|---|
| 🩻 X-ray | consolidation 78% vs 69% · effusion 64% vs 30% (53% fused) · cardiomegaly 75% vs 25% · diffuse nodule 50% vs 0% | pneumothorax 100% vs 15% · atelectasis · nodule · mass · fibrosis · emphysema |
| 🫁 CT | lung 92% vs 76% · liver 74% vs 57% · pancreas 46% vs 0% · mediastinum 69% vs 38% | colon 20% vs 13% |
| 🧠 MRI | brain tumour 96% vs 74% · acute stroke 47 of 60 found vs 0 | – |
Groups under about 15 cases (kidney, mediastinum, colon, most rare X-ray labels) are directional only.
🔍 Side by side
⚠️ Limitations
- Rare X-ray findings are weak. Skanda named pneumothorax on 15% of the films that have it (MedGemma 27B: 100%), and trails MedGemma on atelectasis, nodule, mass, fibrosis and emphysema. Do not use it for triage.
- It misses findings. The report often names fewer findings than a film has, and X-ray box recall is about 10%.
- CT outlines can follow enhanced vessels instead of the lesion, and CT box recall is 16%.
- Small, internal test sets. 111 X-ray films (about ±10 points by chance) and held-out cases from the training sources. There has been no external test set, no reader study and no radiologist review of its reports.
- Template reports. Evidence sentences come from measured masks and fixed templates; severity is a per-class constant.
🧠 How it works
- Read. Qwen3-VL looks at the image and writes a JSON report, word by word.
- Point. Every finding's
"mask"field holds a special[SEG]token. The model's last hidden state at that token is its idea of "the thing I am describing now" (the idea comes from LISA). - Outline. A small projector turns that state into a prompt for SAM 2's mask decoder, which draws the outline. Sa2VA had already trained this SAM 2 to take such prompts.
- Score. A linear head on the last prompt token gives p(abnormal) and 13 X-ray class scores. They write a short "likely / possible …" hint line before X-ray reports and drive a calibrated gate that can overrule a wrong normal/abnormal call.
- Explain. Every number in a finding's
evidence(side, zone, extent, size in mm, volume in mL, HU) was measured from radiologist masks during training, so the model learns to describe the region it outlines.
{
"normal": false,
"findings": [
{
"title": "Effusion, right",
"evidence": "Homogeneous opacity at the patient's right costophrenic angle, lower zone, about 18% of the right lung field, rounded upper margin.",
"location": "right lower zone",
"severity": "moderate",
"mask": "[SEG]"
}
],
"impression": "Right pleural effusion."
}
Each "mask": "[SEG]" becomes one outline; a finding's box is its outline's extent.
🏗️ Architecture
| Part | Source | Size | Trained | Licence |
|---|---|---|---|---|
| Vision encoder | Qwen3-VL-30B-A3B-Instruct | ViT, 27 blocks | LoRA on the last 11 blocks + mergers | Apache-2.0 |
| Language model | Qwen3-VL-30B-A3B-Instruct | 48 layers, 128 experts (8 active), 31 B total / ~3 B active | LoRA r=64 on attention q/k/v/o; the [SEG] embedding and output rows | Apache-2.0 |
| Outline model | SAM 2.1 Hiera-L, weights from Sa2VA-Qwen3-VL-4B | ~224 M | mask decoder and its object score; image encoder frozen | Apache-2.0 |
[SEG] projector | new | MLP 2048 → 2048 → 256 | from scratch | CC BY-NC 4.0 (this model) |
| Score head | new | linear 2048 → 1 + 13 | from scratch | CC BY-NC 4.0 (this model) |
[SEG]token: id 151669, already inside Qwen3-VL's padded vocabulary. Its input and output rows train at 20× the learning rate; every other row's gradient is zeroed, so the rest of the vocabulary is untouched.- Images: up to 1024² for both Qwen3-VL and SAM 2. Volumes: 32 evenly spaced slices + the key slice at 320² for
Qwen3-VL; SAM 2 decodes each
[SEG]on the slices. CT is rendered from HU as lung / soft-tissue / bone windows in R / G / B; MRI as up to three sequences; patient right on image left. - Code: github.com/Hitheshkaranth/Skanda-0 (
skanda/model.py: model and losses).
🏋️ Training
loss = text cross-entropy (JSON boilerplate tokens × 0.3)
+ 2.0 × outline BCE + 0.5 × outline Dice one per [SEG], against the radiologist mask (3D Dice for volumes)
+ 0.2 × object-score BCE does the target mask exist (on this slice)?
+ 0.5 × score-head BCE p(abnormal) + 13 X-ray classes; unknown labels skipped
| Stage | Trains | Data | Settings |
|---|---|---|---|
| 0 · Connector | projector, SAM 2 mask decoder | "Outline the heart / right lung / liver lesion …" → [SEG] | lr 1e-4 |
| 1 · 2D SFT | + LoRA on language model and vision encoder, [SEG] rows | reports on X-rays and CT/MRI slices, with hint lines | lr 5e-5, r=64 |
| 2 · 3D volumes | same | CT/MRI volumes with lesion-free volumes, 40% 2D replay | lr 5e-5 |
| 3 · X-ray polish | same | X-ray reports, 15% 3D replay | lr 1.5e-5 |
Batch 1 × accumulation 8, AdamW, OneCycle (3% warm-up), grad-clip 1.0, bf16, gradient checkpointing. SAM 2's frozen image encoder runs once into a feature cache (~8 MB per image). Rare findings are drawn more often (inverse square-root class frequency).
Exact recipe of the published Skanda-0
Skanda-0 is the polish checkpoint of the third training run. Its weights went through six training passes in two runs.
Run 2 started from the base models, and run 3 continued from run 2's final checkpoint. Every pass below was kept by the
check.
| # | Run | Stage | Started from | Train data | Epochs | lr | Notes |
|---|---|---|---|---|---|---|---|
| 1 | 2 | 0 · connector | Qwen3-VL-30B-A3B + Sa2VA's SAM 2 + new projector and score head | outline prompts: ChestX-Det findings and CheXmask lungs/heart; MSD lesions and organs (brain tumour, heart, liver, prostate, lung, pancreas, hepatic vessel, spleen, colon); ISLES 2022; 3,000 prompts for findings that are absent (empty mask) | 2 | 1e-4 | language model frozen |
| 2 | 2 | 1 · 2D SFT | pass 1 | reports: ChestX-Det, NIH ChestX-ray14, MSD, ISLES 2022, DeepLesion, autoPET | 2 | 5e-5 | LoRA r=64 + vision LoRA, [SEG] rows |
| 3 | 2 | 2 · 3D | pass 2 | MSD, ISLES and autoPET volumes, with and without lesions; 40% 2D replay of pass 2's data | 3 | 5e-5 | |
| 4 | 3 | 1 · 2D SFT | pass 3 | as pass 2, with X-ray targets rebuilt: one finding + [SEG] per radiologist outline, and NIH rare-label films with text-only reports | 1 | 5e-5 | + hint lines (--hints) |
| 5 | 3 | 2 · 3D | pass 4 | as pass 3 | 1 | 5e-5 | hints |
| 6 | 3 | 3 · X-ray polish | pass 5 | ChestX-Det + NIH reports; 15% replay of the volumes | 1 | 1.5e-5 | hints → Skanda-0 |
After pass 6, the abnormal-score gate (skanda/calibrate.py) and the hint thresholds (skanda/calibrate_hints.py)
were chosen on validation records and dev films and written into skanda_config.json.
The check. After every pass, a score is computed on dev films and validation records, never on test data: 0.35 × X-ray balanced accuracy + 0.15 × right finding type + 0.15 × X-ray box recall + 0.20 × CT/MRI balanced accuracy + 0.15 × CT/MRI outline recall. A pass is kept when its score is at least the best so far − 0.01. Skanda-0 scored 0.616 (run 2's best: 0.598). An earlier run 1 (3D volumes that all had a lesion, then GRPO) ended with a model that called every X-ray abnormal; run 2's GRPO stage was dropped by this check, and run 3 did not run one.Code, record format and how to train on your own data: github.com/Hitheshkaranth/Skanda-0 (docs/TRAINING.md).
📦 Files and loading
| File | What it is |
|---|---|
vlm/ | Merged Qwen3-VL-30B-A3B (bf16 safetensors, 17 shards, LoRA merged) with tokenizer, processor and chat template |
skanda_heads.pt | SAM 2.1 (image encoder and trained mask decoder), the [SEG] projector and the score head |
skanda_config.json | [SEG] token id 151669, training arguments, calibrated gate thresholds per modality, hint thresholds |
hint_scores.jsonl | Score-head outputs the hint thresholds were chosen on (validation and dev only, never test) |
62.6 GB in total (58.3 GiB); see memory and quantization. The model, training and inference code is open source (Apache-2.0): github.com/Hitheshkaranth/Skanda-0.
huggingface-cli download hitheshkaranth/Skanda-0 --local-dir skanda-0 # bf16
huggingface-cli download hitheshkaranth/Skanda-0-int8 --local-dir skanda-0-int8 # int8 build of main
huggingface-cli download hitheshkaranth/Skanda-0-int4 --local-dir skanda-0-int4 # int4 build of main
# in a checkout of github.com/Hitheshkaranth/Skanda-0
from PIL import Image
from skanda.serve import Skanda
sk = Skanda("skanda-0") # vlm/ + skanda_heads.pt + skanda_config.json; int8/int4 load the same way
report, raw_text, finished, n_tokens = sk.read(Image.open("chest.png").convert("RGB"))
python -m skanda.serve --model skanda-0 --port 1234 # the HTTP server the Skanda Radiology app calls
💾 Memory and quantization
Memory (bf16, measured)
| Size | Notes | |
|---|---|---|
| Download / disk | 62.6 GB | 58.3 GiB: vlm/ 57.9 GiB + skanda_heads.pt 0.43 GiB |
| Inference, steady | ~68 GB | chest X-ray, CT/MRI slices and 32-slice volumes alike; one read at a time |
| Inference, peak | ~93 GB | while loading the checkpoint and on the largest volumes |
Measured on an NVIDIA DGX Spark (GB10, 128 GB unified memory) from node memory during run 3's test evaluation and app benchmark, minus the idle baseline. The server runs in a container capped at 112 GB.
| Hardware | Fits? |
|---|---|
| DGX Spark / GB10, 128 GB unified | ✅ tested: everything here was trained and benchmarked on one |
| 1 × 80 GB GPU (A100 / H100 80 GB) | ⚠️ expected to fit: 62 GB of weights + activations; not tested |
2 × 48 GB GPUs (device_map="auto") | ⚠️ expected to fit; not tested |
| 24–48 GB GPUs | ❌ not at bf16; needs a quantized build (below) |
Quantized builds
Weight-only builds of this checkpoint, with gates re-calibrated per build. Only the language model is
quantized; the SAM 2.1 decoder, [SEG] projector and score head stay bf16. Each build's card has the full benchmark
against MedGemma 27B, MAIRA-2 and MedGemma + MAIRA-2 at the matching precision.
| bf16 (this repo) | int8 | int4 | |
|---|---|---|---|
| Download | 62.6 GB | 32.8 GB | 18.2 GB |
| Method | – | int8 per-row | int4 group-128 |
| 🩻 X-ray right finding type | 39 | 40.5 | 36 |
| 🩻 X-ray box precision | 24.5 | 24 | 17.5 |
| 🩻 X-ray box recall | 9.5 | 8.5 | 8.5 |
| 🫁 CT normals called normal | 91 | 85 | 78 |
| 🫁 CT right finding type | 72 | 72 | 74 |
| 🫁 CT box precision | 22 | 21 | 19 |
| 🧠 MRI right finding type | 89 | 87 | 80 |
| 🧠 MRI box recall | 65 | 67 | 49 |
| Loss per token on bf16's own replies | 0.0823 | 0.0824 | 0.1181 |
Percent on the held-out test cases above (bf16 re-read with the same code and calibration as the builds). int8 is effectively lossless and is the recommended smaller build; int4 loses accuracy, most on MRI box recall.
📜 Licence
CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0):
free for research and other non-commercial use, with attribution. Commercial use requires written permission from
the author: open a request in this repository's Discussions.
The licence text is in LICENSE; upstream licences and data attributions (Qwen3-VL, Sa2VA, SAM 2 and the
training datasets) are in NOTICE. Research use only; not a medical device.