image-classification Β· vision Β· WASM Β· ~14 MB
Same 1,000-way ImageNet job as the ViT and ConvNeXt demos, but with a model a fraction of their size. MobileNetV2 is ~3.5M parameters of depthwise-separable convolutions β designed for on-device, real-time inference. Classify an image and read the real millisecond latency; the story here is tiny + fast.
| Model | onnx-community/mobilenet_v2_1.0_224 |
|---|---|
| Task / pipeline | image-classification |
| Architecture | MobileNetV2 β ~3.5M params, depthwise-separable convs + inverted residuals with linear bottlenecks |
| Labels | ImageNet-1k + a background class = 1,001 outputs (the ViT/ConvNeXt demos have 1,000) |
| Quantization | fp32 (see note) β q8 is degenerate for this model |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~14 MB β vs ~29 MB (ConvNeXt) and ~88 MB (ViT) |
| License | other (Google, per the original model card) |
| Web APIs | WebAssembly, Web Workers, FileReader, getUserMedia (webcam demo) β all Baseline widely available |
This repo prefers 8-bit (q8) weights, but MobileNetV2's depthwise-separable convolutions
quantise degenerately with the generic int8 export: the ConvInteger
operator has no WebAssembly kernel, and the uint8/q8 builds emit garbage labels (verified β
a tiger photo comes back "envelope"). fp32 is the honest, correct choice and is still tiny at
~14 MB β a fraction of the heavier backbones, which is exactly the point.
Pick or drop an image and hit Classify. Watch the latency read-out β MobileNet is built to be quick.

5 labels
MobileNet'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 |
|---|---|---|---|---|
| MobileNetV2 | ~3.5M | ~14 MB | 1,001 | run above β |
| ConvNeXt-Tiny | ~28M | ~29 MB | 1,000 | 8Γ the params |
| ViT-B/16 | ~86M | ~88 MB | 1,000 | 25Γ the params |
MobileNet is the workhorse of on-device vision: small enough to ship inside an app or a web page, fast enough to run on every frame of a camera feed, and accurate enough for a huge range of real tasks. When the constraint is battery, bandwidth, or latency β not the last point of accuracy β this is the 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: MobileNet 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/mobilenet_v2_1.0_224",
{ dtype: "fp32" },
); // downloads + caches ~14 MB once
const output = await classify(imageURL, { top_k: 5 });
// β [{ label: "tiger, Panthera tigris", score: 0.70 }, { label: "tiger cat", score: 0.21 }, β¦]
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,001 classes, including the background class at
index 0) and compute the softmax, entropy, and margin itself. Inference runs in a Web Worker so
the page never janks.