Skip to main content
QUICK REVIEW

[Paper Review] Scaling Up Your Kernels to 31x31: Revisiting Large Kernel Design in CNNs

Xiaohan Ding, Xiangyu Zhang|arXiv (Cornell University)|Mar 13, 2022
Advanced Neural Network ApplicationsComputer Science76 citations
TL;DR

The paper shows that incorporating a few very large depth-wise kernels (up to 31x31) in CNNs, with re-parameterization and identity shortcuts, can close the gap with ViTs in performance and efficiency, and improve downstream tasks.

ABSTRACT

We revisit large kernel design in modern convolutional neural networks (CNNs). Inspired by recent advances in vision transformers (ViTs), in this paper, we demonstrate that using a few large convolutional kernels instead of a stack of small kernels could be a more powerful paradigm. We suggested five guidelines, e.g., applying re-parameterized large depth-wise convolutions, to design efficient high-performance large-kernel CNNs. Following the guidelines, we propose RepLKNet, a pure CNN architecture whose kernel size is as large as 31x31, in contrast to commonly used 3x3. RepLKNet greatly closes the performance gap between CNNs and ViTs, e.g., achieving comparable or superior results than Swin Transformer on ImageNet and a few typical downstream tasks, with lower latency. RepLKNet also shows nice scalability to big data and large models, obtaining 87.8% top-1 accuracy on ImageNet and 56.0% mIoU on ADE20K, which is very competitive among the state-of-the-arts with similar model sizes. Our study further reveals that, in contrast to small-kernel CNNs, large-kernel CNNs have much larger effective receptive fields and higher shape bias rather than texture bias. Code & models at https://github.com/megvii-research/RepLKNet.

Motivation & Objective

  • Motivate and investigate whether very large CNN kernels can offer advantages over stacking small kernels in modern CNNs.
  • Systematically study design guidelines for effective large-kernel CNNs, including efficiency, optimization, and transferability.
  • Propose RepLKNet, a pure CNN architecture with re-parameterized large depth-wise convolutions to build large receptive fields.
  • Evaluate large-kernel CNNs on ImageNet, COCO, ADE20K, Cityscapes, and COCO object detection to compare with ViTs and baselines.

Proposed method

  • Survey existing large-kernel CNN literature and ViT mechanisms to identify questions about receptive fields and shape bias.
  • Propose five empirical guidelines for large convolutions: efficiency of large depth-wise kernels, importance of identity shortcuts, re-parameterization to address optimization, larger kernels benefiting downstream tasks, and usefulness on small feature maps.
  • Introduce RepLKNet, a pure CNN with large depth-wise convolutions (up to 31x31) and re-parameterized small kernels, following a Swin-like macro structure.
  • Use re-parameterization to merge small-kernel branches into large kernels during training for inference efficiency.
  • Conduct extensive experiments across ImageNet classification, ADE20K, Cityscapes, and COCO to compare against Swin Transformer and ResNet/ResNeXt baselines.

Experimental results

Research questions

  • RQ1Can a CNN with a few very large kernels match or beat ViTs on ImageNet and downstream tasks?
  • RQ2How do large kernels affect effective receptive field and shape bias in CNNs compared to small-kernel CNNs?
  • RQ3What design choices (shortcuts, re-parameterization, architecture) are essential to make large kernels practical and beneficial?
  • RQ4Do large kernels provide greater gains on downstream tasks than on ImageNet classification, and how does pretraining data influence this?
  • RQ5Is large-kernel design scalable to large models and datasets?

Key findings

  • Very large depth-wise kernels can be efficient with proper optimization and transform-based implementations.
  • Identity shortcuts are vital for networks with very large kernels to preserve accuracy.
  • Re-parameterization with small kernels helps mitigate optimization issues and improves transfer performance.
  • Large kernels yield greater gains on downstream tasks (COCO, ADE20K, Cityscapes) than on ImageNet classification.
  • RepLKNet-31B achieves 84.8% top-1 on ImageNet (1K) with lower latency than Swin-B and shows competitive or superior downstream performance; larger variants (RepLKNet-31L/XL) achieve strong results on ADE20K and COCO, indicating good scalability.
  • On ADE20K, increasing kernel sizes from [13,13,13,13] to [31,29,27,13] yields a 0.82 mIoU improvement with modest parameter and FLOP increases, highlighting downstream task benefits.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.