Skip to content
module

ConvNeXt

18 members
lucid.models.vision.convnext

ConvNeXt family — Liu et al., 2022.

Image Classification
Paper

Liu, Zhuang, et al. "A ConvNet for the 2020s." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, pp. 11976-11986.

Overview

ConvNeXt is a pure convolutional architecture obtained by systematically modernizing a ResNet using design choices borrowed from the Swin Transformer. Starting from a ResNet-50 the authors apply a one-at-a-time roadmap: change the stage compute ratio to (3,3,9,3)(3, 3, 9, 3), swap the stem for a non-overlapping 4×44 \times 4 patchify convolution, replace the bottleneck with a depthwise 7×77 \times 7 convolution followed by an inverted bottleneck, move the activation and normalization to a single GELU + LayerNorm after the depthwise conv, and replace BatchNorm with LayerNorm. The resulting block is

Block(x)=x+γ⊙Linear4d→d ⁣(GELU ⁣(Lineard→4d ⁣(LN(DWConv7×7(x))))),\mathrm{Block}(x) = x + \gamma \odot \mathrm{Linear}_{4d \to d}\!\bigl( \mathrm{GELU}\!\bigl(\mathrm{Linear}_{d \to 4d}\!\bigl( \mathrm{LN}(\mathrm{DWConv}_{7 \times 7}(x))\bigr)\bigr)\bigr),

where γ∈Rd\gamma \in \mathbb{R}^d is a layer-scale parameter initialized to 10−610^{-6} (Touvron et al., 2021).

The pyramid follows the four-stage Swin layout — channel widths (C,2C,4C,8C)(C, 2C, 4C, 8C) with downsampling between stages — and the canonical variants Tiny / Small / Base / Large / XLarge scale the stem width CC and the depth of stage 3 from 99 to 2727. The paper's headline result is that the modernised ConvNet matches or exceeds Swin's ImageNet accuracy at the same FLOPs while remaining a simple all-convolutional design.

Classes

Functions

Weights