All models

repvgg_d2se

Trains as a multi-branch network, runs as a plain stack of 3x3 convolutions and ReLU.

Image classification · 1,037 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (19 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
RepVGG
Parameters
133.3M
Operations
1,037
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2021)
Authors
Xiaohan Ding, Xiangyu Zhang, Ningning Ma and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8790
Graph hash
345ad76e81d322d724f0d6abf27450507f3ddec643f6118f96270e7b15bdc345
Skeleton hash
37c595b1d894ed62e54fa07835e55bdbcf2e08ac318219fb80b6703cbf2e0e6d
Architecture hash
7618c6fb6d065310e862ce5cbdd5121e10ec6939234c68014f11a9872b91d5b0
Diagram SHA-256
9f869049b6cd9478feb141110e21faf97d912af03e6cd7e084f1ab1a6b338379
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('repvgg_d2se', pretrained=False)

What it is

About this model's family

RepVGG is a convolutional network whose inference-time body is nothing but a stack of 3 × 3 convolution and ReLU, VGG-style, while the training-time model has a multi-branch topology. That decoupling is done by structural re-parameterization, which is where the name comes from. The motivation is that complicated multi-branch designs like residual addition in ResNet and branch concatenation in Inception make a model hard to implement and customize, slow down inference and reduce memory utilization.

During training, RepVGG uses identity and 1×1 branches inspired by ResNet, but arranged so that the branches can be removed afterwards. After training, simple algebra folds the identity branch, viewed as a degraded 1×1 conv, and the 1×1 branch, viewed as a degraded 3 × 3 conv, into a single 3 × 3 kernel. A body with one operator type, 3 × 3 conv followed by ReLU, makes RepVGG fast on generic computing devices like GPUs.

The network has 5 stages and downsamples with a stride-2 convolution at the beginning of each stage. RepVGG-A puts 1, 2, 4, 14, 1 layers in its five stages, and RepVGG-B is deeper, with 2 more layers in stages 2, 3 and 4. Widths come from uniformly scaling the classic [64, 128, 256, 512] setting with a multiplier a for the first four stages and b for the last. The g4 suffix on the captured repvgg_b1g4, repvgg_b2g4 and repvgg_b3g4 marks interleaved groupwise layers.

On ImageNet, RepVGG-A0 is 1.25% and 33% better than ResNet-18 in accuracy and speed. With groupwise layers, RepVGG-B1g4 is 0.37%/101% better than ResNet-101. Trained for 200 epochs, RepVGG models pass 80% top-1 accuracy, which the authors describe as the first time for plain models to catch up with the state of the art, to the best of their knowledge. In timm, the captured repvgg_a0 through repvgg_d2se are built on the ByobNet framework, with the original weights remapped and accuracies verified. The paper also uses RepVGG as a PSPNet backbone for semantic segmentation on Cityscapes.

Key idea. RepVGG uses structural re-parameterization to decouple a training-time multi-branch topology from an inference-time plain stack of 3 × 3 conv and ReLU.

  • repvgg
  • rep vgg
  • structural re-parameterization
  • reparameterization
  • making vgg-style convnets great again
  • repvgg_a0
  • repvgg_b1g4
  • repvgg_d2se
  • megvii
  • image classification
  • plain convnet

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{ding2021repvggmakingvggstyleconvnets,
      title={RepVGG: Making VGG-style ConvNets Great Again}, 
      author={Xiaohan Ding and Xiangyu Zhang and Ningning Ma and Jungong Han and Guiguang Ding and Jian Sun},
      year={2021},
      eprint={2101.03697},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2101.03697}, 
}