← All models

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

ResNet-50 β€” the network that made deep deep learning

Same job as the ViT and ConvNeXt demos β€” name what's in an image across ImageNet's 1,000 classes β€” but this is the 2015 original that made 50-layer networks trainable at all. ResNet's trick is the skip connection: each block learns a small residual on top of an identity shortcut, so gradients flow through dozens of layers without vanishing. Drop an image, read the labels, then run the backbone lineage race β€” ResNet 2015 vs ConvNeXt 2022 vs ViT β€” on one picture.

At a glance

ModelXenova/resnet-50
Task / pipelineimage-classification
ArchitectureResNet-50 β€” deep residual CNN, ~25.6M params, bottleneck blocks (1Γ—1 β†’ 3Γ—3 β†’ 1Γ—1) wired with identity skip connections, BatchNorm + ReLU, 4 stages (3/4/6/3 blocks)
LabelsImageNet-1k β€” 1,000 fixed classes
Quantizationq8 (8-bit) ONNX β€” verified non-degenerate (plain convs quantise cleanly)
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~26 MB, cached after first load
LicenseApache-2.0 (Microsoft Research; original by He, Zhang, Ren & Sun)
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

Backbone lineage race β€” ResNet vs ConvNeXt vs ViT

The whole point of this page: run the same image through three generations of ImageNet backbone and watch how the field evolved. ResNet-50 (2015) is the residual CNN that everything else was measured against; ConvNeXt (2022) is a ResNet modernised block-by-block to match transformers; ViT is the pure transformer that dropped convolutions entirely. Same 1,000 classes, three very different machines. Where all three agree, trust the label; where they split, the image is genuinely hard. Loading ConvNeXt adds ~29 MB and ViT ~88 MB the first time.

See inside

ResNet'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.
The residual block & skip connection β€” why 50 layers works

Before ResNet, stacking more layers made networks worse, not better β€” gradients vanished on the way back and deep plain nets were harder to optimise than shallow ones. The fix is almost embarrassingly simple: instead of asking a block to learn a full transformation H(x), ask it to learn the residual F(x) = H(x) βˆ’ x, then add the untouched input back: output = F(x) + x. That + x is the skip (identity) connection. It gives gradients a direct highway to every earlier layer, so a 50-layer network trains as easily as a shallow one, and any block that has nothing useful to add can fall back to the identity for free. ResNet-50 stacks bottleneck blocks β€” a 1Γ—1 conv squeezes the channels, a 3Γ—3 conv does the spatial work, a 1Γ—1 conv expands them back β€” across four stages (3, 4, 6, 3 blocks). This one idea unlocked networks with hundreds of layers and is still wired into ConvNeXt, every transformer's residual stream, and most modern architectures. The race above lets you watch how much (or how little) accuracy the seven years since bought on any given image.

Why it matters

ResNet-50 is the reference backbone of computer vision β€” the model almost every detector, segmenter, and feature extractor of the late 2010s was built on top of, and the number every new architecture still reports against. It's small, fast on the WASM backend, extremely well understood, and its ImageNet features transfer to almost any vision task.

Use cases

Basics

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

Practical

Dependable 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 CNN's texture bias show.

Multi-model

Three-way vote: ResNet + ConvNeXt + ViT on one image for a robust majority 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/resnet-50",
  { dtype: "q8" },
); // downloads + caches ~26 MB once

const output = await classify(imageURL, { top_k: 5 });
// β†’ [{ label: "tiger cat", score: 0.96 }, { label: "tabby, tabby cat", score: 0.01 }, …]

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