use case · basics · 768-d 16×16 patch PCA & artifact norms · Apache-2.0

Inside DINOv2-Base: 768-d Patch PCA & L2-Norm Artifact Map

Project all 256 spatial patch embeddings ([256, 768] → [16, 16, 3]) onto their top 3 principal axes to reveal emergent unsupervised foreground segmentation, alongside a live Patch L2-Norm Artifact Map exposing the large-norm background "artifact" tokens that appear in register-free DINOv2 models before register tokens were introduced.

1. Initialise DINOv2-Base & Tune Emergent PCA

Initialise DINOv2-Base above to inspect 16×16 RGB PCA and patch L2-norm artifact tokens.

PCA Top-3 Variance–
Foreground Patches–
[CLS] L2 Norm–
Patch Norm Median–
Patch Norm Max–
Artifacts (>1.5× Med)–
Tensor NaN Count–

2. Emergent Foreground PCA vs Patch L2-Norm Artifact Map

3-Component RGB PCA ([256, 768] → [16, 16, 3])

Colors map PC1→R, PC2→G, PC3→B across the 256 patch embeddings — foreground objects separate from the background without labels.

Waiting for DINOv2-Base inference…

Patch L2-Norm Artifact Map (0 Register Tokens)

Gold outlines mark patches whose L2 norm exceeds 1.5× median or mean + 2σ — where register-free DINOv2 models stash global scratch information in low-texture background patches.

Waiting for DINOv2-Base inference…

Token Norm Spread

Without register tokens, DINOv2-Base exhibits high-norm spatial artifacts on redundant background patches (Darcet et al., ICLR 2024). Compare with DINOv2-Registers and DINOv3 ViT-S/16 where 4 register tokens absorb that global state.

Export Diagnostics

Download the exact 256-patch PCA projections, L2 norms, and artifact flags.

Top-8 highest L2-norm patches in the 16×16 DINOv2-Base grid
Rank Grid Cell (row, col) Patch L2 Norm Ratio to Median Artifact Flag
Run DINOv2-Base above to inspect top-norm patches.

Show the code

Show the code — dinov2-core.mjs: computePatchPcaRgb() (3-component power-iteration PCA)
Show the code — dinov2-core.mjs: computeNormDiagnostics() (register-free artifact spike detection)
Show the code — worker.js: ensureLoaded() (shared Transformers.js q8 WASM load)