At a glance
| 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.
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.
[CLS] (1Γ384)
Patch norm spread & top cosine matches will appear here after the forward pass.
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:
- Zero-shot visual search & dedup: index user photo galleries client-side using 384-d cosine similarity with zero server upload.
- Emergent part correspondence: match semantic parts across scenes or viewpoints using raw
14Γ14patch vectors. - Architectural baseline: inspect high-norm outlier patches firsthand to see why DINOv2-Registers and DINOv3 introduced register tokens.
- Crop re-identification: pair a
11.3 MBdetector with DINO v1 (34.0 MBtotal) to match repeated objects across a scene.
Use-case ladder
1. Basics Β· Emergent PCA & Outlier Lab
3-component RGB PCA over all 196 patch tokens plus a Patch L2-Norm Outlier Map exposing register-free artifacts.
2. Practical Β· Visual Search & Dedup
Multi-photo upload, mid-batch Cancel, cosine ranking, near-duplicate cluster slider, and formula-safe CSV/JSON export.
3. Wild Β· Patch Correspondence & Invariance
Click Photo A to highlight top-K matching patches on Photo B via 196Γ196 cosine matrix + live flip/crop/blur retention.
4. Multi-model Β· D-FINE 365 β DINO v1 Re-ID
Chain 11.33 MB 365-class object detection with 22.70 MB DINO v1 crop embeddings (34.0 MB total) for visual twin matching.
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]).