← All models

image-classification Β· vision Β· WASM Β· ~15 MB

MobileNetV4 β€” the 2024 backbone built to run anywhere

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.

At a glance

Modelonnx-community/mobilenetv4_conv_small.e2400_r224_in1k
Task / pipelineimage-classification
ArchitectureMobileNetV4-Conv-Small β€” 3.8M params, universal inverted bottleneck (UIB) blocks, hardware-aware NAS; timm e2400_r224 recipe (2,400-epoch training at 224Γ—224)
LabelsImageNet-1k = 1,000 outputs
Quantizationfp32 (see note) β€” the canonical q8 export produced semantically broken labels in browser testing
BackendWebAssembly (runs without WebGPU)
Download~15 MB β€” vs ~29 MB (ConvNeXt) and ~88 MB (ViT)
LicenseApache-2.0 (exact upstream timm checkpoint)
Web APIsWebAssembly, Web Workers, FileReader, getUserMedia (webcam demo) β€” all Baseline widely available
Why fp32 and not q8?

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.

Run it

Pick or drop an image and hit Classify. Watch the latency read-out β€” MobileNetV4 is built to be quick.

Drop an image here, or click to choose
Two cats sleeping on a pink couch A cozy sunlit bedroom with a bookshelf A riverside at golden hour with a swan
Selected image preview

5 labels

See inside

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.

Run a classification to see the raw numbers.

Size & latency: mobile backbone vs the heavier ones

Download size and parameter counts are fixed facts. The "latency here" cell fills in with a real measured run once you classify above.

ModelParamsDownloadOutputsLatency here
MobileNetV4-Conv-Small3.8M~15 MB1,000run above ↑
ConvNeXt-Tiny~28M~29 MB1,0007Γ— the params
ViT-B/16~86M~88 MB1,00023Γ— the params

Why it matters

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.

Use cases

Basics

Classify a sample and read the top-k with a real latency read-out.

Practical

Real-time webcam tagging β€” the mobile use case: classify live camera frames.

Wild

Torture test: shrink and JPEG-crush an image and find where the tiny model breaks.

Multi-model

Fast prefilter β†’ confirm: MobileNetV4 triages, ViT double-checks only the uncertain ones.

How the API works

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.

References