image-feature-extraction Β· ViTModel (vit) Β· CPU WASM q8 (22.70 MB) Β· Apache-2.0

DINO v1 ViT-S/16 β€” Emergent Self-Supervised Patch Explorer

The foundational Caron et al. (ICCV 2021) Self-Distillation with No Labels Vision Transformer (21.7M params, 22.70 MB q8 WASM, 0 register tokens, learned 1D positional embeddings). One forward pass emits [1, 197, 384] β€” a global [CLS] token plus a 14Γ—14 patch grid whose tokens separate foreground objects from background clutter without a single training label.

At a glance

Verified model card and ONNX Hub metadata for DINO v1 ViT-S/16
Upstream model facebook/dino-vits16 (Meta AI Research β€” Caron et al., ICCV 2021, self-supervised on ImageNet-1k)
Browser ONNX repo Xenova/dino-vits16 (onnx/model_quantized.onnx β€” 22,701,541 B / 22.70 MB)
License Apache-2.0 (permissive open-source commercial & research use)
Task & architecture image-feature-extraction Β· ViTModel (vit, 12 layers, 384-d hidden, 6 heads, 1536 MLP, GELU, 224Γ—224 resize, patch 16, learned 1D absolute positional embeddings, 0 register tokens)
Output tensor shape last_hidden_state shape [1, 197, 384]: index 0 = [CLS] (1Γ—384) Β· indices 1..196 = 14Γ—14 = 196 spatial patch tokens (196Γ—384)
Distinct from v2 & v3 Unlike DINOv2-Registers & DINOv3 (which add 4 register tokens to absorb global scratch state), DINO v1 runs with 0 registers β€” revealing both its iconic emergent foreground separation and occasional high-norm outlier background patches.
Runtime & backend Shared Transformers.js pin (../../lib/webai.js) Β· CPU WASM q8 (22.70 MB, universal; runs off-main-thread in worker.js)

1. Live 14Γ—14 Patch Cosine Explorer

Drop an image anywhere in this box, paste from clipboard (Ctrl/⌘+V), capture from webcam, or pick a curated photo below.

Initialise DINO v1 ViT-S/16 above, then click or arrow-key any 14Γ—14 cell to inspect patch cosine similarity.

Photo: – Click or arrow-key any 14Γ—14 cell to probe patch cosine

Live [1, 197, 384] Tensor Anatomy

DINO v1 uses 0 register tokens: index 0 is the global [CLS] vector and indices 1..196 map straight to the 14Γ—14 spatial grid.

Index 0 [CLS] (1Γ—384)
Indices 1..196 14Γ—14 Patches (196Γ—384) Β· 0 Registers

Patch norm spread & top cosine matches will appear here after the forward pass.

Backend–
Tensor Shape–
Infer Latency–
[CLS] L2 Norm–
Patch Norm Spread–
Selected Patch(7, 7)
Patches β‰₯ 0.60 Cos–
Tensor NaN Count–

Why DINO v1 ViT-S/16 matters

Caron et al. (2021) discovered that training a plain ViT-S/16 via self-distillation without labels causes attention heads and patch embeddings to lock onto semantic object boundaries automatically. At 22.70 MB under Apache-2.0 and universal CPU WASM, it powers zero-label visual search, near-duplicate clustering, part matching, and lightweight object re-identification in any browser:

Use-case ladder

How the API works

Load Xenova/dino-vits16 once via the shared Transformers.js image-feature-extraction pipeline on WASM q8, then run pipe.processor(image) + pipe.model(inputs) inside a dedicated Web Worker to unpack last_hidden_state ([1, 197, 384]).

Show the code β€” worker.js: extractFeatures() ([1, 197, 384] unpacking + real nanCount)

References