CLM vision heads for FracAtlas radiographs
Research prototype. Not a medical device and not for clinical use. These heads must not be used to diagnose, treat or triage patients.
State heads that let a Contrastive Language Model (CLM) answer typed questions
about an X-ray image: a frozen image encoder (MedSigLIP-448 or Qwen3-VL-4B) and a trained state_head replace
the text state tower, while the released CLM-v0.1-8B action tower (Qwen3-8B + action_head) embeds the answer
options. A question's answer is the softmax of 100 × cosine between the projected image and each projected option.
This is an independent extension of CLM (vision is on the CLM authors' roadmap). Code, pre-registered protocols, results and the research log: https://github.com/HarvinderBhullar/CLM.
Contents
| path | what |
|---|---|
deployed/fracatlas-medsiglip.pt | fracture head on MedSigLIP-448, seed 0, calibrated on val (Platt scaling + Youden threshold in cfg["calibration"]) |
deployed/fracatlas-qwen3-vl-4b.pt | the same on Qwen3-VL-4B |
experiments/binary/<encoder>/clm/s{0,1,2}.pt | fracture heads (three seeds), results/fracatlas.md |
experiments/binary/<encoder>/ablation_*/ | ablations (trainable scale, no standardisation, no class weights, random option vectors) |
experiments/multiq/<encoder>/shared/ | one head for five questions (views held out), results/fracatlas_multiq_*.md |
experiments/multiq/<encoder>/random_options/, single_<question>/ | controls: random option vectors; one head per question |
experiments/probes/<encoder>/*.npz | logistic-regression probes (mean, scale, coef, intercept, C) |
experiments/align/ | pre-registered text-only alignment experiment (A1–A3), MedSigLIP |
experiments/distill/ | pre-registered distillation experiment (D1–D3, weight interpolation W), MedSigLIP |
splits/ | the FracAtlas train / val / test split used throughout (4,022 images, 61 dropped; see split_meta.json) |
Every .pt is a CLM checkpoint dict: state_head, action_head (the released CLM-v0.1-8B one, unchanged),
logit_scale, and cfg (encoder, embedding recipe, questions, training settings). Input standardisation is folded
into the first layer, so a head takes the encoder's L2-normalised embedding directly.
Results (FracAtlas test split, 600 images, 109 fractured)
| MedSigLIP-448 | Qwen3-VL-4B | |
|---|---|---|
| fracture AUROC, CLM head (3 seeds) | 0.898 ± 0.012 | 0.887 ± 0.012 |
| fracture AUROC, linear probe | 0.898 | 0.890 |
| deployed head, calibrated: sensitivity / specificity | 0.835 / 0.772 | 0.798 / 0.809 |
| five questions, one shared head, macro AUROC | 0.952 | 0.951 |
| same, unseen paraphrases of the options | 0.919 / 0.845 | 0.915 / 0.844 |
| three held-out view questions, zero-shot | 0.496 | 0.495 |
The head matches a linear probe on trained questions; its value is one interface for many typed questions and
robustness to reworded options. It does not answer new questions zero-shot; distillation (experiments/distill/)
lifts held-out questions only to 0.54. Full tables, cross-validation and limitations are in the
repository's results/.
Use
pip install contrastive-lm # or: pip install -e . from the GitHub repo
huggingface-cli download harvinderbhullar/CLM-vision-fracatlas deployed/fracatlas-medsiglip.pt --local-dir checkpoints
vllm serve Qwen/Qwen3-8B --served-model-name qwen3-8b --runner pooling --max-model-len 2048 --port 8090 &
clm-serve --model fracatlas-medsiglip=checkpoints/deployed/fracatlas-medsiglip.pt
Then send an image state ({"type": "image", "image": <base64>}) with a typed question, for example
{"type": "choice", "instructions": "Is there a bone fracture?", "criteria": {...}}; see the repository README.
Checkpoints are pickled PyTorch dicts (torch.load(..., weights_only=False)); load them only from sources you trust.
Training data and limitations
Trained on FracAtlas (Abedeen et al., 2023, CC BY 4.0): 4,083 musculoskeletal radiographs from three hospitals in Bangladesh, of which 4,022 were used. One dataset; splits are per image (no patient ids), approximated by blocks of consecutive ids in the cross-validation; the test set has 109 fractured images (AUROC intervals about ±0.04). Performance on other populations, scanners, body parts or modalities is unknown.
Licence
- Code and Qwen3-VL-4B heads: Apache 2.0 (
LICENSE-APACHE-2.0). The included CLM-v0.1-8Baction_headis Apache 2.0 (Kwok et al., 2026). - MedSigLIP heads (including all of
experiments/align/andexperiments/distill/): Model Derivatives of a Health AI Developer Foundations model, subject to the HAI-DEF Terms of Use; seeNOTICE-HAI-DEF.md. splits/: derived from FracAtlas, CC BY 4.0.
Citation
If you use these heads, please cite the repository (https://github.com/HarvinderBhullar/CLM) and the original CLM work (Kwok et al., 2026, https://contrastive-lm.notion.site).