timm's EfficientNetV2 Hits 84.8% Accuracy and 830K Downloads
A compact 53M-parameter EfficientNetV2 variant trained with adaptive gradient clipping continues to dominate ImageNet classification downloads on Hugging Face.
Takeaways
- efficientnetv2_rw_m.agc_in1k is a 53.2M-param EfficientNetV2 variant trending on Hugging Face.
- Trained on ImageNet-1k only, Apache 2.0, 12.7 GMACs, 320x320 train / 416x416 test resolution.
- Uses SGD+Nesterov with Adaptive Gradient Clipping and cosine LR, based on ResNet Strikes Back recipe C.
- Ross Wightman's own medium-sized reinterpretation of the EfficientNetV2 architecture, hitting 84.8 top-1.
- Works as classifier, feature pyramid backbone, or embedding model via the timm API.
- Over 830k downloads and 3k likes, popular as a drop-in CNN backbone for detection and segmentation.
The model page for efficientnetv2_rw_m.agc_in1k has passed 830,000 downloads and 3,000 likes. The checkpoint pairs a medium-sized EfficientNetV2 architecture with an ImageNet-1k training recipe built around adaptive gradient clipping.
Developers choosing a vision backbone get a 53.2 million-parameter convolutional model with reported 84.8% ImageNet-1k top-1 accuracy, multiscale feature extraction, standard timm interfaces, and an Apache 2.0 license. Its training-only optimization techniques add no custom inference operations.
The suffixes tell the story
The EfficientNetV2 paper introduced fused MBConv blocks and progressive learning to improve training speed and parameter efficiency. Early stages use fused blocks that combine expansion and spatial convolution, while later stages retain efficient MBConv blocks.
The checkpoint name records both the implementation and recipe. rw_m identifies Ross Wightman’s independently developed medium variant, whose model and weights began before Google released its official code. The agc_in1k suffix indicates adaptive gradient clipping and ImageNet-1k training.
Wightman reports that this variant reached 84.8% top-1 accuracy using the C.1 procedure from the training study commonly called “ResNet Strikes Back.”
| Property | Reported value |
|---|---|
| Parameters | 53.2 million |
| ImageNet-1k top-1 | 84.8% |
| Compute | 12.7 GMACs at the configured evaluation size |
| Activations | 47.1 million |
| Training crop | 320 × 320 pixels |
| Evaluation crop | 416 × 416 pixels |
| Pooled embedding | 2,152 dimensions |
| License | Apache 2.0 |
AGC stops at training time
Adaptive gradient clipping came from the NFNet paper. During optimization, AGC compares each parameter unit’s gradient norm with the norm of its associated weights. Gradients whose ratio exceeds a threshold are rescaled, which helps stabilize large learning rates and aggressive augmentation.
The C.1 procedure combines stochastic gradient descent, Nesterov momentum, learning-rate warmup, cosine decay, AGC, and stronger augmentation and regularization than conventional ResNet-50 recipes. EfficientNetV2 RW M retains its own normalization layers; AGC supplies the optimizer-side stabilization.
The EfficientNetV2 family also supports changing crop size and regularization during training. This checkpoint records a 320-pixel training crop and a 416-pixel evaluation crop. The larger evaluation size improves spatial detail while increasing compute and memory use.
Preserve the model’s preprocessing
The pretrained configuration defines the expected resize, crop, interpolation, color normalization, and input dimensions. Resolving those settings through timm prevents silent accuracy losses caused by generic preprocessing.
pip install timm torch pillow
import torch
import timm
from PIL import Image
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = timm.create_model(
"efficientnetv2_rw_m.agc_in1k",
pretrained=True,
).eval().to(device)
data_config = timm.data.resolve_model_data_config(model)
transform = timm.data.create_transform(
**data_config,
is_training=False,
)
image = Image.open("cat.jpg").convert("RGB")
batch = transform(image).unsqueeze(0).to(device)
with torch.inference_mode():
probabilities = model(batch).softmax(dim=1)
scores, class_ids = probabilities.topk(k=5, dim=1)
The output contains ImageNet-1k class indices and probabilities. Multiply scores by 100 for percentages, then map class_ids through an ImageNet-1k label file when human-readable names are required.
Turn the classifier into a backbone
Creating the model with features_only=True returns multiscale feature maps for feature pyramids, detection heads, and segmentation decoders. Channel counts and output strides remain available through feature_info, which avoids hard-coding architecture details.
backbone = timm.create_model(
"efficientnetv2_rw_m.agc_in1k",
pretrained=True,
features_only=True,
out_indices=(1, 2, 3, 4),
)
channels = backbone.feature_info.channels()
strides = backbone.feature_info.reduction()
A feature-only model can feed FPN-based systems and architectures modeled on the EfficientDet repository. Downstream heads still need channel adapters that match the values returned by feature_info.
features_only=Truereturns selected intermediate feature maps.out_indicescontrols which stages appear in the output list.num_classes=0removes the classifier and returns a pooled 2,152-dimensional embedding.- Feature and embedding modes should use separate model instances because these options configure the network at creation time.
Pick it for the right workload
The checkpoint’s tradeoffs follow from its supervised ImageNet training, convolutional architecture, and 416-pixel evaluation configuration.
| Workload | Suitability | Reason |
|---|---|---|
| Closed-set classification | Strong | High ImageNet-1k accuracy with straightforward fine-tuning. |
| Detection and segmentation | Strong | Multiscale stage outputs integrate with feature pyramids and decoder heads. |
| Domain-specific embeddings | Useful with validation | The pooled vector can support retrieval or clustering after task-specific evaluation or fine-tuning. |
| Open-vocabulary retrieval | Limited | The training objective provides no text alignment or CLIP-style shared embedding space. |
| Memory-constrained edge inference | Hardware-dependent | 53.2 million parameters and 12.7 GMACs may exceed mobile latency or memory budgets. |
| Hosted Hugging Face inference | Unavailable on the model page | Deployment requires a self-managed runtime or another serving platform. |
Latency depends on input size, precision, batch size, memory bandwidth, and backend kernel support. GMAC counts alone cannot predict runtime. Benchmarking the intended PyTorch, ONNX, or TensorRT path remains necessary, especially when reducing the input from 416 to 320 pixels.
Maturity keeps it in circulation
The model continues to benefit from the surrounding timm repository: stable loading APIs, pretrained transforms, feature extraction, mixed-precision support, and familiar export paths. Those properties reduce integration work for classification, OCR preprocessing, moderation, visual indexing, detection, and segmentation systems.
Hugging Face download counters can include automated builds, cache refreshes, and repeated pulls, so they do not measure unique production deployments. The totals still show sustained use of a checkpoint released well before the latest generation of vision transformers.
A practical selection rule is to choose this model when supervised visual features, multiscale CNN outputs, permissive licensing, and conventional deployment tools matter more than text alignment or transformer-scale pretraining.