image-classification Β· vision Β· WASM Β· ~15 MB
Same 1,000-way ImageNet job as the ViT and ConvNeXt demos, but with the newest mobile-first design. MobileNetV4-Conv-Small is a 3.8M-parameter universal inverted bottleneck (UIB) network β one block family that spans classic inverted residuals through attention β tuned by neural architecture search for real hardware. Classify an image and read the real millisecond latency; the story here is one architecture, every device.
| Model | onnx-community/mobilenetv4_conv_small.e2400_r224_in1k |
|---|---|
| Task / pipeline | image-classification |
| Architecture | MobileNetV4-Conv-Small β 3.8M params, universal inverted bottleneck (UIB) blocks, hardware-aware NAS; timm e2400_r224 recipe (2,400-epoch training at 224Γ224) |
| Labels | ImageNet-1k = 1,000 outputs |
| Quantization | fp32 (see note) β the canonical q8 export produced semantically broken labels in browser testing |
| Backend | WebAssembly (runs without WebGPU) |
| Download | ~15 MB β vs ~29 MB (ConvNeXt) and ~88 MB (ViT) |
| License | Apache-2.0 (exact upstream timm checkpoint) |
| Web APIs | WebAssembly, Web Workers, FileReader, getUserMedia (webcam demo) β all Baseline widely available |
This repo prefers 8-bit weights, but the canonical q8 conversion failed semantic sanity in the exact browser probe: a rights-cleared dog fixture (Wikimedia Commons, CC-BY-4.0) came back as greenhouse / cello / ocarina, and a citrus still-life as knee pad. The canonical fp32 graph classified the same images as Brittany spaniel (79.9%) and lemon (60.0%). fp32 is therefore the honest choice and is still only ~15 MB.
Pick or drop an image and hit Classify. Watch the latency read-out β MobileNetV4 is built to be quick.

5 labels
MobileNetV4's final layer produces one raw logit per class, and a softmax turns those into probabilities. The table shows the top classes with their raw logit next to the softmax probability, plus the shape of the distribution: top-1 margin and normalised entropy.
| Class | logit | softmax |
|---|
Confidence (low β β high):
Download size and parameter counts are fixed facts. The "latency here" cell fills in with a real measured run once you classify above.
| Model | Params | Download | Outputs | Latency here |
|---|---|---|---|---|
| MobileNetV4-Conv-Small | 3.8M | ~15 MB | 1,000 | run above β |
| ConvNeXt-Tiny | ~28M | ~29 MB | 1,000 | 7Γ the params |
| ViT-B/16 | ~86M | ~88 MB | 1,000 | 23Γ the params |
MobileNetV4 is the latest step in the on-device vision lineage: a single universal inverted bottleneck design that the authors show scales from microcontrollers and phones to servers, with accuracy that rivals models several times its size. When the constraint is battery, bandwidth, or latency β not the last point of accuracy β this is the modern backbone you reach for.
Classify a sample and read the top-k with a real latency read-out.
Real-time webcam tagging β the mobile use case: classify live camera frames.
Torture test: shrink and JPEG-crush an image and find where the tiny model breaks.
Fast prefilter β confirm: MobileNetV4 triages, ViT double-checks only the uncertain ones.
The convenience path is two lines with Transformers.js:
import { pipeline } from "@huggingface/transformers";
const classify = await pipeline(
"image-classification",
"onnx-community/mobilenetv4_conv_small.e2400_r224_in1k",
{ dtype: "fp32" },
); // downloads + caches ~15 MB once
const output = await classify(imageURL, { top_k: 5 });
// β [{ label: "Brittany spaniel", score: 0.80 }, { label: "Welsh springer spaniel", score: 0.04 }, β¦]
This page goes one level deeper for "See inside": instead of the pipeline it runs the model's
own processor then model() in a single forward pass, so it can read the
raw logits tensor (all 1,000 ImageNet classes) and compute the softmax, entropy,
and margin itself. Inference runs in a Web Worker so the page remains responsive.