Back to paper library
Paper notesarXiv 2023CVPR 2024

InceptionNeXt

Split into a Cross

Original paper

InceptionNeXt: When Inception Meets ConvNeXt

Paper authors

Weihao Yu · Pan Zhou · Shuicheng Yan · Xinchao Wang

Publication
CVPR 2024Conference
First submitted to arXiv
arXiv:2303.16900
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{classiccnnsinceptionnext2023,
  title = {{InceptionNeXt: When Inception Meets ConvNeXt}},
  author = {Weihao Yu and Pan Zhou and Shuicheng Yan and Xinchao Wang},
  year = {2023},
  eprint = {2303.16900},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.16900}
}
On this page

ConvNeXt-T takes 4.5 GMACs, while ResNet-50 takes 4.1 GMACs. The two are close. Train them on an A100, though, and ResNet-50 processes 969 images per second; ConvNeXt-T manages just 575, about 60% as many.

Why such a large speed gap at similar compute? The bottleneck is the 7×7 depthwise convolution. Each channel works on its own, with few multiply-adds but plenty of data to move, leaving the GPU waiting on memory much of the time. Expanding ConvNeXt's kernel from 3×3 to 7×7 brought better accuracy along with this speed problem.

This paper comes from the National University of Singapore, Singapore Management University, Sea AI Lab, and Skywork AI. First author Weihao Yu also wrote MetaFormer, which broke Transformers down into a “token mixer plus MLP” framework. Here, he applies the same way of breaking things down to ConvNeXt.

Figure 1 from the paper: the horizontal axis is training throughput on an A100 in images per second, and the vertical axis is ImageNet top-1 accuracy. ConvNeXt-T/k7 sits toward the upper left at about 82.1% and 575 images/s; switching to 5×5 and 3×3 kernels moves it rightward while accuracy drops. ResNet-50 is at the lower right, at about 970 images/s but just over 78% accuracy. InceptionNeXt-T sits at the upper right, with a red arrow marking a 1.6× speedup over ConvNeXt-T/k7.
Figure 1 from Yu et al., taken from PDF page 1. The original caption is omitted.

The upper-right corner is where this paper aims to be: accuracy on par with ConvNeXt-T, at a speed close to ResNet-50.

Defining the Problem

MetaNeXt

The authors first abstract the ConvNeXt block.

Figure 2 from the paper: four blocks arranged from left to right. MetaFormer has two residual connections, one enclosing Norm and a dashed Token Mixer box, the other enclosing Norm and MLP. MetaNeXt has one residual connection, with Token Mixer, Norm, and MLP along the same path. ConvNeXt replaces the Token Mixer with a 7×7 DWConv. InceptionNeXt's Token Mixer is a dashed box that splits the input into four parts, applies 3×3, 1×11, and 11×1 DWConv and an identity branch, then concatenates them.
Figure 2 from Yu et al., taken from PDF page 2. The original caption is omitted.

The MetaFormer block on the far left has two residual connections: one for the token mixer and one for the MLP. Transformers use this structure. ConvNeXt has just one residual connection, with spatial mixing, normalization, and the MLP along a single path. The authors call this single-residual framework MetaNeXt. ConvNeXt and the paper's InceptionNeXt are two implementations, differing only in their token mixers.

Where the Time Goes

The authors run a preliminary experiment on ConvNeXt-T, changing only the depthwise convolution:

Table: selected rows from the paper's Table 1. A100, batch size 128, TF32.
Depthwise kernelFraction of channels convolvedTraining (images/s)Inference (images/s)top-1
7×71575241382.1%
5×51675270482.0%
3×31798280281.5%
3×31/4871280881.3%
3×31/8901283380.8%
3×31/16916284680.1%

Shrinking the kernel from 7×7 to 3×3 makes training 39% faster and costs 0.6 percentage points of accuracy. Taking a cue from ShuffleNet V2, the authors then apply the depthwise convolution to only some channels and leave the rest untouched. At a fraction of 1/4, training gets a little faster again, losing just another 0.2 points.

Two findings emerge. Large-kernel depthwise convolution is the speed bottleneck, and each depthwise layer needs to process only a fraction of the channels. The problem is that a smaller kernel also shrinks the receptive field. Where can those 0.6 points be recovered?

Solving the Problem

Inception Depthwise Convolution

The authors split the channels into four groups, each doing something different:

  • A 3×3 depthwise convolution
  • A 1×11 horizontal band convolution
  • An 11×1 vertical band convolution
  • An unchanged identity path

Each of the three convolution branches gets C/8C/8 channels; the remaining 5C/85C/8 pass straight through. The four groups are concatenated at the end. Splitting k×kk\times k into 1×k1\times k and k×1k\times 1 is an old Inception-v3 trick, which explains the name.

The parameter count goes from k2Ck^2C for a depthwise convolution to (2k+9)C/8(2k+9)C/8: 2k2k comes from the two bands, and 9 from the 3×3 square. Its dependence on kernel size becomes linear. Let's write the PyTorch implementation supplied in the paper and count the parameters:

Python
import torch
import torch.nn as nn

class InceptionDWConv2d(nn.Module):
    def __init__(self, c, square=3, band=11, ratio=1/8):
        super().__init__()
        g = int(c * ratio)                                    # Channels in each convolution branch
        self.hw = nn.Conv2d(g, g, square, padding=square // 2, groups=g)
        self.w = nn.Conv2d(g, g, (1, band), padding=(0, band // 2), groups=g)
        self.h = nn.Conv2d(g, g, (band, 1), padding=(band // 2, 0), groups=g)
        self.split = (g, g, g, c - 3 * g)                     # 3×3, 1×11, 11×1, identity

    def forward(self, x):
        x_hw, x_w, x_h, x_id = torch.split(x, self.split, dim=1)
        return torch.cat((self.hw(x_hw), self.w(x_w), self.h(x_h), x_id), dim=1)

c = 96                                                        # Channels in InceptionNeXt-T's first stage
params = lambda m: sum(p.numel() for p in m.parameters())
print("7×7 depthwise:", params(nn.Conv2d(c, c, 7, padding=3, groups=c)))
print("3×3 depthwise:", params(nn.Conv2d(c, c, 3, padding=1, groups=c)))
print("Inception depthwise:", params(InceptionDWConv2d(c)))
Text
7×7 depthwise: 4800
3×3 depthwise: 960
Inception depthwise: 408

Inception depthwise convolution has fewer parameters than even a 3×3 depthwise convolution, because five eighths of the channels do no convolution at all.

A Cross-Shaped Receptive Field

At this point, it may seem like a poor trade. A 7×7 kernel lets every channel see a full 7×7 region. Now each channel sees only a small 3×3 square, a horizontal line, or a vertical line.

Someone asked on GitHub whether this “decomposition” is mathematically equivalent to a 7×7 convolution. The author answered that it is not; “decompose” here is closer to “replace.” How much can the replacement actually see?

The MLP is the key. The 1×1 convolution after the depthwise convolution mixes channels. Features processed by a horizontal band in one block may enter a vertical-band branch in the next. With one block, Inception depthwise sees a cross: a 3×3 center plus two lines of length 11, totaling 25 positions. In the second block, horizontal lines meet vertical lines to fill an 11×11 square, with four arms extending outward, totaling 149 positions. Two 7×7 layers cover 169 positions in a 13×13 square: a similar count, across a smaller span.

Building the Network

The number of blocks and channels per stage follows ConvNeXt, as does the four-stage structure. There are two differences. Normalization uses BatchNorm because speed is a priority here and BN can be merged into a convolution at inference. The final stage's MLP expansion ratio drops from 4 to 3, shifting the saved parameters into the classifier head. The smallest Atto variant increases each branch's fraction to 1/4 and uses bands of length 9.

Discussion

ImageNet-1K

Training follows the DeiT and ConvNeXt recipes for 300 epochs. Throughput is measured on an A100 with TF32:

Table: selected rows from the paper's Table 4. RSB-ResNet-50 is ResNet-50 retrained with the newer “ResNet strikes back” recipe. Training and inference throughput are in images per second.
ModelParamsMACsTrainInfertop-1
RSB-ResNet-5026M4.1G969314979.8%
ConvNeXt-T29M4.5G575241382.1%
InceptionNeXt-T28M4.2G901290082.3%
ConvNeXt-S50M8.7G361153583.1%
InceptionNeXt-S49M8.4G521175083.5%
ConvNeXt-B89M15.4G267112283.8%
InceptionNeXt-B87M14.9G375124484.0%

InceptionNeXt-T gains 0.2 percentage points over ConvNeXt-T, with 57% faster training and 20% faster inference. Against ResNet-50, it reaches 93% of the training throughput and 92% of the inference throughput. Calling that “ResNet-50 speed” is a little optimistic, though it is already close.

The speedup shrinks as models get larger: training is 57% faster for T, 44% for S, and 40% for B. Depthwise convolution scales linearly with channel count, while the MLP scales quadratically. Wider models spend more time in the MLP, leaving a smaller fraction to save by changing only the token mixer.

The smallest Atto variant goes the other way: training becomes 219% faster, but accuracy falls 0.4 percentage points below ConvNeXt-A.

Speed also depends on the hardware. In the same table, measured with FP32 on a 2080Ti, T's inference is 39% faster, more than the 20% on an A100. The later RDNet paper independently measures inference latency at batch size 128: 132 ms for InceptionNeXt-T and 150 ms for ConvNeXt-T, equivalent to a 14% speedup.

MetaNeXt Cannot Accommodate Attention

Since MetaNeXt simplifies MetaFormer, the authors also try putting self-attention into the single-residual block, producing MetaNeXt-Attn. It fails to train properly, reaching just 3.9% ImageNet accuracy, against 79.8% for a similarly sized DeiT-S.

Merging two residual connections into one saves time, but limits the complexity of the token mixer. This framework accommodates convolution; attention fails in this experiment.

Semantic Segmentation

With UperNet on ADE20K, trained for 160K iterations:

Table: from the paper's Table 6; values are mIoU.
SizeSwinConvNeXtInceptionNeXt
T45.846.747.9
S49.549.650.0
B49.749.950.6

The T gap is 1.2, much larger than the 0.2 in classification. The test protocol matters, though. A GitHub user reported that plugging InceptionNeXt into their segmentation model gave results close to ConvNeXt. The author replied that the table follows ConvNeXt in reporting multi-scale test mIoU; with single-scale testing, InceptionNeXt and ConvNeXt are close. The segmentation training code was also not released, and several users ask for it in the issue.

Ablation

Starting from InceptionNeXt-T, change one thing at a time:

Table: selected rows from the paper's Table 8.
ChangeTraining (images/s)Inference (images/s)top-1
Baseline901290082.3%
Remove horizontal band947309381.9%
Remove vertical band954317381.9%
Remove 3×3 square940300482.0%
Put the two bands in sequence903297182.1%
Increase band length from 11 to 13896289582.0%
Increase branch fraction from 1/8 to 1/4834249982.2%
Decrease branch fraction from 1/8 to 1/16936309781.8%
Replace BatchNorm with LayerNorm721264682.4%

The two bands matter most. Removing either costs 0.4 points; they sustain the receptive field. Removing the 3×3 square costs just 0.3, so the authors suggest a square-free variant if speed matters more. Raising the branch fraction to 1/4 brings no gain and only slows things down; lowering it to 1/16 costs 0.5 points.

LayerNorm adds 0.1 percentage points while cutting training throughput by 20%, so the authors choose BatchNorm.

Conclusion

InceptionNeXt replaces a 7×7 depthwise convolution with a small square, two bands, and a large group of idle channels. It preserves ConvNeXt-T's accuracy and brings training speed back close to ResNet-50.

It uses only PyTorch's built-in depthwise convolutions, with no custom operators, and timm provides pretrained weights such as inception_next_tiny. To speed up a ConvNeXt-style model, swapping out the token mixer is an easy experiment.

As for those 1.2 points in the segmentation table, ask whether the test is single-scale or multi-scale before deciding to change backbones.