A ConvNet for the 2020s

Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, Saining Xie

Abstract

In the early 2020s, Vision Transformers (ViTs) began to eclipse Convolutional Neural Networks (ConvNets) as the state-of-the-art in computer vision. This paper investigates whether this shift is due to the inherent superiority of Transformers or the modern training and architectural techniques they employ. By incrementally "modernizing" a standard ResNet, we introduce ConvNeXt: a pure ConvNet that competes with and often outperforms Swin Transformers across major benchmarks while maintaining the simplicity and efficiency of standard convolutions.

Introduction: The Rise of Transformers

The dominance of ConvNets, established by AlexNet and solidified by ResNet, faced its first major challenge with the introduction of Vision Transformers. Hierarchical Transformers, like the Swin Transformer, successfully integrated inductive biases—such as local receptive fields and hierarchical structures—back into the Transformer framework, achieving superior performance on tasks like ImageNet classification and COCO object detection.

This transition raised a fundamental question: Is the self-attention mechanism in Transformers truly better than convolutions, or have ConvNets simply fallen behind in architectural design and training recipes? To answer this, we systematically upgrade a ResNet-50 to see if a pure convolutional model can match the performance of the latest Transformers.

The Modernization Roadmap

Our approach follows a deliberate path from a standard ResNet-50 toward a modern architecture inspired by the design choices of the Swin Transformer.

The modernization roadmap from ResNet-50 to ConvNeXt-T, showing incremental accuracy gains for each design change.
  1. Modern Training Techniques: We first updated the training recipe to match ViTs, using 300 epochs, the AdamW optimizer, and advanced data augmentations like Mixup and Cutmix. This baseline improvement alone raised ResNet-50 performance from 76.1% to 78.8%.
  2. Macro Design Changes: We adjusted the stage compute ratio and replaced the traditional ResNet "stem" with a 4x4 "patchify" layer, mimicking the initial tokenization step in Transformers.
  3. ResNeXt-ify: We adopted depthwise convolutions to separate spatial and channel mixing, a core characteristic of Transformer attention layers.
  4. Inverted Bottleneck: We implemented the "inverted bottleneck" design, where the hidden dimension of the block is four times wider than the input, a strategy common in both Transformers and MobileNetV2.
  5. Large Kernel Sizes: While ConvNets trended toward small 3x3 kernels, Transformers use larger global or window-based attention. We found that increasing the convolutional kernel size to 7x7 significantly improved performance and spatial coverage.
  6. Micro Design Refinements: We replaced ReLU with GELU activations, reduced the number of activation and normalization layers, and switched from BatchNorm to LayerNorm.

The culmination of these changes is ConvNeXt, a simplified, high-performance convolutional architecture.

Experimental Results

We evaluated ConvNeXt across several standard vision benchmarks, comparing it directly against the Swin Transformer family and other state-of-the-art models.

ImageNet-1K accuracy vs. model complexity (GFLOPs) for ConvNeXt and other architectures.
  • ImageNet Classification: ConvNeXt-T achieved 82.1% top-1 accuracy on ImageNet-1K, surpassing Swin-T (81.3%) at a similar FLOP count. When scaled to larger datasets like ImageNet-22K, ConvNeXt-XL reached 87.8%, demonstrating that ConvNets scale as effectively as Transformers.
  • Inference Efficiency: On modern hardware like the A100 GPU, ConvNeXt models exhibit significantly higher throughput than Swin Transformers. For instance, ConvNeXt-T is up to 49% faster in inference than Swin-T.
  • Downstream Tasks: In object detection (COCO) and semantic segmentation (ADE20K), ConvNeXt consistently outperformed Swin Transformers. On COCO, ConvNeXt-B achieved a 1.1 AP lead over Swin-B.

Key Insights and Conclusion

Our findings suggest that the "Transformer advantage" is largely a result of modern architectural design choices rather than the self-attention mechanism itself. ConvNeXt proves that pure ConvNets remain elite contenders in the 2020s. They offer a simpler, more efficient alternative to Transformers without sacrificing scalability or performance on downstream tasks.

While Transformers may still hold an advantage in multi-modal learning due to the flexibility of cross-attention, ConvNeXt re-establishes the convolution as a powerful and relevant primitive for computer vision. Future work will explore extending these modernized convolutional designs to multi-modal and generative applications.

Summary updated

BibTeX
@misc{liu2022convnet,
  author = {Zhuang Liu and Hanzi Mao and Chao-Yuan Wu and Christoph Feichtenhofer and Trevor Darrell and Saining Xie},
  title = {{A ConvNet for the 2020s}},
  year = {2022},
  eprint = {2201.03545},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.03545},
}
Figure