image-feature-extraction · Dinov2Model (ViT-B/14) · CPU WASM q8 (90.95 MB) · MIT

RAD-DINO — Thoracic Radiograph 37×37 Spatial Feature Encoder

Microsoft Health Futures' self-supervised DINOv2 ViT-B/14 encoder (microsoft/rad-dino, 86.6M params, 90.95 MB q8 WASM) continued-pretrained exclusively on chest radiographs at 518×518. Every forward pass emits [1, 1370, 768]: a global [CLS] descriptor (index 0) plus 37×37 = 1,369 dense spatial patch tokens (indices 1..1369, zero registers), running 100% locally in a Web Worker.

At a glance

Verified model card and ONNX Hub metadata for microsoft/rad-dino
Upstream model microsoft/rad-dino (Microsoft Health Futures — Pérez-García et al., Nature Machine Intelligence 2025, fine-tuned from facebook/dinov2-base)
Browser ONNX repo onnx-community/rad-dino-ONNX (onnx/model_quantized.onnx 90,948,899 B + config.json 986 B + preprocessor_config.json 442 B = 90,950,327 B / 90.95 MB, catalogue 91.0 MB)
License & intended use MIT · Research purposes only (not intended for clinical diagnosis or patient care)
Task & architecture image-feature-extraction · Dinov2Model (dinov2, 86.6M params, 12 layers, 768-d hidden, 12 heads, 3072 MLP, GELU, QKV bias, patch size 14, 0 register tokens)
Radiograph preprocessing BitImageProcessor: bicubic resize shortest edge 518, center crop 518×518, rescale 1/255, radiograph normalization mean [0.5307, 0.5307, 0.5307], std [0.2583, 0.2583, 0.2583]
Output tensor shape last_hidden_state shape [1, 1370, 768] (1,052,160 floats): index 0 = [CLS] (1×768) · indices 1..1369 = 37×37 = 1,369 spatial patch tokens (1369×768)
Runtime & backend Shared Transformers.js pin (../../lib/webai.js, @huggingface/transformers@3.7.5 ) · CPU WASM q8 (90.95 MB, universal; off-main-thread Web Worker in worker.js)

1. Live 37×37 Thoracic Phantom Encoder

Choose a procedural 518×518 thoracic X-ray phantom below, drop a local research PNG/JPEG here, or paste from clipboard (Ctrl/⌘+V). All inference stays strictly on your device.

Initialise RAD-DINO above to encode the 518×518 procedural phantom into [1, 1370, 768] features.

Phantom: Symmetric Baseline (518×518) Click or arrow-key any 37×37 cell to inspect spatial patch features

See Inside · Live [1, 1370, 768] Tensor Anatomy

RAD-DINO emits 1,370 tokens (0 registers): index 0 is the global [CLS] token (768-d) and indices 1..1369 map directly to the 37×37 radiograph patch grid (each patch = 14×14 px).

Index 0 [CLS] (1×768)
Indices 1..1369 37×37 Spatial Patches (1,369×768) · 0 Registers

Anatomical Lung-Zone Mean Patch Norms

CLS[0..4] sample and bilateral hemithorax symmetry will appear after inference.

Backend–
Tensor Shape–
Infer Latency–
[CLS] L2 Norm–
PCA Variance (3 PCs)–
L/R Hemithorax Cos–
Selected Patch(18, 11)
Tensor NaN Count–

Why RAD-DINO matters for research

Unlike text-supervised vision-language models that learn only what radiology reports mention, microsoft/rad-dino applies pure image-only DINOv2 self-supervised learning at high 518×518 resolution over chest radiographs. At 90.95 MB in MIT-licensed CPU WASM, researchers can inspect dense radiograph features locally with zero cloud upload:

Use-case ladder

How the API works

Load onnx-community/rad-dino-ONNX once via the shared Transformers.js image-feature-extraction pipeline on WASM q8, pass a RawImage.fromCanvas(...) inside a dedicated Web Worker, and slice [1, 1370, 768] into [CLS] (index 0) and 37×37 spatial patches (indices 1..1369).

Show the code — worker.js: extractFeatures() ([1, 1370, 768] slicing + off-main-thread 3-PC PCA)

References