Skip to main content
Back

A Decade-Old ResNet-18 Beats Itself With Smarter Training by 1.7%

The timm A1 recipe pushes ResNet-18 to 71.5% top-1 on ImageNet, pulling 1.7M downloads a month as a tiny, feature-backbone workhorse.

Pro

  • timm ResNet-18 retrained with the A1 recipe from ResNet Strikes Back, Apache-2.0.
  • 71.49% top-1 at 224x224, 73.16% at 288x288, versus 69.76% for the torchvision baseline.
  • 11.7M params, 1.8 GMACs, roughly 10K images/sec inference throughput.
  • Training uses LAMB optimizer, binary cross-entropy loss, cosine LR schedule with warmup, 600 epochs.
  • One-line load via timm or Transformers, supports feature-map extraction and embeddings.
  • Currently at 1.77M monthly downloads as a modern drop-in for the aging torchvision ResNet-18 weights.

ResNet-18 is the go-to tiny convnet baseline, but the weights most people load are still the decade-old torchvision checkpoint that tops out at 69.76% top-1 on ImageNet. The timm/resnet18.a1_in1k checkpoint retrains the same architecture with a modern recipe and pushes it noticeably higher. It now pulls roughly 1.77 million downloads a month on Hugging Face while staying at 11.7M parameters.

The architecture itself is unchanged from 2015: ReLU activations, a single 7x7 convolution with pooling, and a 1x1 convolution shortcut downsample. What changed is how it was trained.

Inside the A1 recipe

The weights come from the ResNet Strikes Back paper by Wightman, Touvron and Jegou. The premise was blunt: best practices for training neural networks have moved on significantly since 2015, and novel optimization and data augmentation have made training recipes much more effective. The authors re-trained vanilla ResNets with those advances and showed that a vanilla ResNet-50 reaches 80.4% top-1 accuracy at resolution 224x224 on ImageNet-val without extra data or distillation.

A1 is the heaviest of the three recipes in that paper. It aims at the best performance for ResNet-50 and is the longest in terms of epochs (600), taking 4.6 days on one node with 4 V100 32GB GPUs. For this ResNet-18 checkpoint the ingredients are:

  • LAMB optimizer with binary cross-entropy loss instead of the classic SGD plus softmax cross-entropy setup
  • Cosine learning-rate schedule with warmup
  • Train at 224x224, evaluate at 288x288 (a small test-time resolution bump that trades a bit of compute for accuracy)

BCE with LAMB is the odd choice here. It treats each class score as an independent logistic regression, which pairs cleanly with strong mixup and cutmix augmentation because the targets after mixing are no longer a single one-hot vector.

The accuracy you actually get

On the timm results leaderboard, this checkpoint hits 71.49% top-1 / 90.07% top-5 at 224x224 and 73.16% / 91.03% at 288x288, with 1.8 GMACs and roughly 10,000 images per second of inference throughput at 224. The plain torchvision resnet18.tv_in1k checkpoint sits at 69.76% top-1 on the same table. That is essentially a free 1.7 point accuracy bump for switching a single string in your timm.create_model call.

Calibrate expectations, though. There are three A-recipe variants in the paper, and A3 is the lightest. The A3 version of ResNet-18 lands at only 68.25% top-1 at 224, so the accuracy gains come from spending real compute at training time, not from the recipe itself being magic.

Using it

The model is Apache-2.0 and works both through timm directly and through Transformers pipelines. The three common patterns are one-line loads:

import timm
model = timm.create_model('resnet18.a1_in1k', pretrained=True)
# Feature maps for detection or segmentation heads
backbone = timm.create_model('resnet18.a1_in1k', pretrained=True, features_only=True)
# Pooled embeddings for retrieval / kNN
embedder = timm.create_model('resnet18.a1_in1k', pretrained=True, num_classes=0)

The features_only mode returns the five standard ResNet stages with shapes 64x112x112, 64x56x56, 128x28x28, 256x14x14 and 512x7x7, which is what most downstream detection and segmentation heads expect.

Where it fits

ResNet-18 is not competing with modern ViT or ConvNeXt models on raw accuracy. Its value is elsewhere:

  • Edge and latency-critical inference. 11.7M params and 1.8 GMACs run comfortably on CPUs, mobile NPUs and small GPUs.
  • Feature backbones for downstream tasks. Detection, segmentation and pose pipelines still ship ResNet-18 variants as their smallest configuration, and starting from a stronger backbone tends to carry through to the head.
  • Cheap embedding extractor. The 512-dim pooled feature is a reasonable baseline for image retrieval, dedup, clustering and nearest-neighbor classification.
  • Baselines and ablations. If you are publishing or benchmarking, using an up-to-date ResNet-18 checkpoint avoids the common pitfall of comparing modern architectures to a 2015-era training recipe.

The reason this specific checkpoint keeps trending years after its release is that it embodies a lesson the field has largely absorbed but still fails to apply: architectures and training recipes are entangled, and old baselines are usually undertrained rather than fundamentally weak. Every time someone benchmarks a shiny new backbone against the torchvision ResNet weights, they are attributing recipe gains to architecture gains. Swapping in the A1 checkpoint is a one-line fix, which explains why a decade-old design is still logging seven-figure monthly downloads on the pytorch-image-models hub.