At a glance
| Upstream model | facebook/convnextv2-tiny-1k-224 |
|---|---|
| Loaded ONNX repo |
Xenova/convnextv2-tiny-1k-224
(onnx/model_quantized.onnx)
|
| Pipeline task | image-classification · { top_k: 3–10 } (1,000 ImageNet-1k labels) |
| Architecture |
ConvNextV2ForImageClassification — 28.6M params, 4 stages [3, 3, 9, 3],
channels [96, 192, 384, 768], 7×7 depthwise conv + GRN, zero self-attention
|
| Image processor |
ConvNextImageProcessor — shortest_edge: 224, crop_pct: 0.875,
bicubic resample, rescale 1/255, ImageNet mean/std
|
| Backend & size |
CPU WASM q8 — 29.54 MB (29,538,332 B) via shared
@huggingface/transformers@3.7.5 in lib/webai.js (~221 ms typical CPU WASM latency)
|
| License | Apache-2.0 (upstream weights and ONNX build) |
Live ImageNet-1k Inspector
Choose a multi-domain starter photo, upload or drop your own image, press Ctrl/Cmd+V to paste from clipboard, or capture a live webcam snapshot. Everything executes locally in a dedicated Web Worker.
Camera frames stay strictly on your device. Approve permission when prompted, then capture a frame.
Camera idle.
Initialising model loader…
No photo selected yet.
Raw pipeline output (exact ImageNet-1k label/score pairs)
[]
Why ConvNeXt V2 Tiny is distinct from ViT, ResNet-50, and MobileNet
Unlike Vision Transformers (which split images into fixed patches with global quadratic self-attention)
or classic ResNet-50 (3×3 bottlenecks with BatchNorm), ConvNeXt V2 modernises pure convolutions:
7×7 depthwise kernels give a wide local receptive field with genuine spatial translation equivariance,
FCMAE self-supervised pretraining prevents feature collapse during masked training, and
Global Response Normalization (GRN) adds inter-channel feature competition across stages
[3, 3, 9, 3].
| Architecture | Core primitive | Params | WASM q8 footprint | Inductive bias |
|---|---|---|---|---|
| ConvNeXt V2 Tiny | 7×7 depthwise conv + FCMAE + GRN | 28.6M | 29.54 MB | Translation equivariant, strong local-to-global hierarchy |
| ViT-Base/16 | 16×16 patch tokens + global self-attention | 86.6M | ~87 MB | Global token mixing, weaker translation bias |
| ResNet-50 | 3×3 conv bottlenecks + BatchNorm | 25.6M | ~26 MB | Narrower 3×3 receptive field, supervised pretraining |
| MobileNet V2/V4 | Lightweight inverted residuals | ~3.5M–9M | ~4–10 MB | Ultra-low compute, lower fine-grained capacity |
How the API works
Transformers.js runs ConvNeXt V2 Tiny through the standard image-classification pipeline
inside a Web Worker. ConvNextImageProcessor automatically applies the 87.5% shortest-edge
crop, 224×224 bicubic resize, and ImageNet channel normalisation:
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const classifier = await pipeline("image-classification", "Xenova/convnextv2-tiny-1k-224", {
device: "wasm",
dtype: "q8",
});
const results = await classifier(image, { top_k: 5 });
See inside the code
Inspect the exact ES modules powering this page — off-main-thread inference and pure ranking/entropy maths.
Show the code — worker.js: ensureLoaded() (shared 3.7.5 WASM q8 + epoch guards)
Show the code — worker.js: classifyImage() (white-flatten, top_k, real nanCount)
Show the code — convnext-core.mjs: analyzeClassification() (ranking, margin, Shannon entropy)
Explore the 5-route use-case ladder
Basics: Occlusion Heatmap & Crop
Sweep a live 4×4 56×56 patch mask across 16 forward passes to map which pixels drive the top-1 prediction.
Practical: Batch Classifier & Triage
Classify multi-photo uploads sequentially with mid-batch Cancel, High/Ambiguous/Low triage, and CSV/JSON export.
Wild: Shift & Perturbation Lab
Probe ConvNet translation equivariance (±16px, ±32px), 90°/180° rotations, blur, grayscale, and contrast.
Multi-model: D-FINE 365 → ConvNeXt V2
Detect coarse objects (11.33 MB D-FINE) and refine every crop into 1,000 fine-grained ImageNet labels (40.9 MB total).