← All models

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

ConvNeXt β€” a ConvNet that keeps up with transformers

Same job as the ViT demo β€” name what's in an image across ImageNet's 1,000 classes β€” but a completely different machine under the hood. ConvNeXt is a pure convolutional network, a 2020s redesign of the ResNet that matches Vision Transformers on accuracy while keeping a convolution's built-in sense of locality. Drop an image, read the labels, then run it head-to-head against ViT on the very same picture.

At a glance

ModelXenova/convnext-tiny-224
Task / pipelineimage-classification
ArchitectureConvNeXt-Tiny β€” pure ConvNet, ~28M params, 7Γ—7 depthwise convs, LayerNorm + GELU, inverted bottleneck (no attention, no patches)
LabelsImageNet-1k β€” 1,000 fixed classes
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~29 MB, cached after first load
LicenseApache-2.0 (Meta AI Research)
Web APIsWebAssembly, Web Workers, FileReader β€” all Baseline widely available

Run it

Pick or drop an image and hit Classify. The bars are the softmax over ImageNet's 1,000 classes β€” only the top few are shown, drawn from the full distribution.

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

ConvNeXt vs ViT β€” head-to-head

The whole point of this page: run the same image through a ConvNet and a transformer and compare. They were trained on the same 1,000 ImageNet classes but see the world differently β€” ConvNeXt slides convolutional filters across the image (locality first), ViT splits it into 16Γ—16 patches and attends over all of them at once (global from layer one). Where they agree, you can trust the label; where they disagree, the image is genuinely ambiguous. Loading ViT downloads ~88 MB the first time.

See inside

ConvNeXt's final layer produces one raw score β€” a logit β€” per class. A softmax turns those into probabilities that sum to 100%. The table shows the top classes with their raw logit next to the softmax probability. The two numbers below describe the shape of the whole distribution: the top-1 margin (how far the winner leads the runner-up) and the normalised entropy (0 = certain, 1 = spread thin).

Run a classification to see the raw numbers.
Conv vs transformer β€” the inductive-bias contrast

A convolution has two assumptions baked into its wiring: locality (a filter only looks at a small neighbourhood at a time) and translation equivariance (the same filter slides everywhere, so a cat in the corner and a cat in the centre trigger the same features). Those are strong, useful priors for images β€” ConvNeXt keeps them and just modernises everything around them: 7Γ—7 depthwise kernels for a wider receptive field, LayerNorm instead of BatchNorm, GELU instead of ReLU, fewer-but-fatter blocks. A Vision Transformer throws those priors away β€” every patch can attend to every other patch from the first layer β€” and instead learns spatial relationships from data, which is why ViT needs more data (or heavy augmentation) to reach the same accuracy. The result is two networks that hit ~the same ImageNet score by very different routes, which is exactly what the head-to-head above lets you probe.

Why it matters

ConvNeXt proved you don't need attention to hit transformer-level accuracy β€” a well-designed ConvNet still competes, while keeping the convolution's efficiency and locality. For a product, that means a familiar, well-understood architecture with strong accuracy that runs happily on the WASM backend, no GPU required.

Use cases

Basics

Classify a sample and read the top-k β€” feel a ConvNet name what's in an image.

Practical

Fast on-device tagging: classify a batch of images into a searchable tag index.

Wild

Texture vs shape: strip colour and warp the image and watch a ConvNet's bias show.

Multi-model

Ensemble vote: average ConvNeXt and ViT for a more robust, better-calibrated answer.

How the API works

The convenience path is two lines with Transformers.js:

import { pipeline } from "@huggingface/transformers";

const classify = await pipeline(
  "image-classification",
  "Xenova/convnext-tiny-224",
  { dtype: "q8" },
); // downloads + caches ~29 MB once

const output = await classify(imageURL, { top_k: 5 });
// β†’ [{ label: "tiger, Panthera tigris", score: 0.74 }, { label: "tiger cat", score: 0.14 }, …]

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 classes) and compute the softmax, entropy, and margin itself. Same weights, same result β€” it just keeps the intermediate numbers. Inference runs in a Web Worker so the page never janks.

References