VioletEqz / rE-ConvNeXt

7 stars 1 forks source link

re-convnext

A re-implementation of ConvNeXt in PyTorch as described in

A ConvNet for the 2020s. CVPR 2022.\ Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell and Saining Xie\ Facebook AI Research, UC Berkeley


What is this about?

The official repository contains the final version of the model (dubbed ConvNeXt) after all the modernizing steps described in the paper, whereas we provide a standalone model for each checkpoint (macro design, resnext, inverted bottleneck, etc.).

This repository mainly serves an introductory and educational purpose as we document the implementation progression from ResNet to ConvNeXt in PyTorch.

Explanation

Here is the modernizing roadmap from the original paper:

There are 7 checkpoints in the implementation roadmap: ResNet, Macro Design, ResNeXt, Inverted Bottleneck, Large Kernel, Micro Design (ConvNeXt).

The implementations are in models folder in the following order:

In each checkpoint, the changes made with respect to the previous checkpoint, except for convnext.py, are documented in the code in NOTE comments, e.g.

# NOTE: Inverted bottleneck
expand_width = planes * self.expansion
self.conv1 = conv1x1(inplanes, expand_width)
self.n1 = norm_layer(expand_width)
self.conv2 = conv3x3(expand_width, expand_width, stride, depthwise=True)
self.n2 = norm_layer(expand_width)
self.conv3 = conv1x1(expand_width, planes)
self.n3 = norm_layer(planes)

References