Foundations to Frontier
Tests
E. Deep Learning › E8 CNN Architectures (one page each)

RegNet

RegNet (Radosavovic, Kosaraju, Girshick, He and Dollár, 2020) designed design spaces instead of single networks. Starting from a very general space of ResNeXt-like networks, the authors sampled and trained hundreds of models, compared the distributions of their errors, and kept the constraints that made good networks more common. The result is a simple rule: block widths that grow linearly with depth, quantised into a few stages. Its models were competitive with EfficientNet and up to five times faster on GPUs. This page covers design-space thinking, the quantised linear rule, the X and Y blocks, and what the analysis revealed. In the exercises you implement the rule and reproduce four torchvision RegNetX models exactly, from 5.5 M to 15.3 M parameters, from five numbers each.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Find the rule, not just the network

Most architecture papers present one network. The RegNet authors instead asked which rules good networks follow. They generated hundreds of random networks from a very flexible family, trained each briefly, and checked which constraints raised the typical quality of the whole family. Over a few rounds they discovered a simple pattern: good networks get wider steadily as they get deeper. A formula with a handful of numbers now produces a whole range of fast, accurate networks.

Architecture explorer: shapes, parameters and compute
stageoutput C × H × Wparametersmultiply–adds
stem64 × 56 × 56
9.5 k
118.01 M
stage2256 × 56 × 56
205.8 k
634.22 M
stage3512 × 28 × 28
1.20 M
1.09 G
stage41024 × 14 × 14
7.02 M
1.53 G
stage52048 × 7 × 7
14.54 M
865.44 M
head1000 × 1 × 1
2.05 M
2.05 M
Total: 25,028,904 parameters (25.03 M), 4.23 G multiply–adds per image at 224 × 224.
ResNet-5025.56 M parameters4.09 G MACs
ResNeXt-50 (32×4d)25.03 M parameters4.23 G MACs
Bars show each row's share of the total. Convolutions dominate compute because they run at every position; fully connected layers dominate parameters in older designs (AlexNet, VGG). Changing the input size changes the compute of every convolution but not its parameters. Parameter counts include biases and BatchNorm scale and shift and match torchvision's implementations.
Why engineers care

RegNets are simple, fast on GPUs and easy to scale to a compute budget, so they are popular backbones for detection and segmentation in robotics and driving. The design-space method also generalises: study families, not single models.

📝 Quick check (Level 0)
0/3 answered
  1. 1. RegNet's authors designed…
  2. 2. Good networks get…
  3. 3. RegNets are notably fast on…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Quantised linear rule:
    1. Block j (0 ≤ j < d) has width u_j = w₀ + w_a·j.
    2. Write u_j = w₀·w_m^(s_j), round s_j to an integer, and quantise the width to a multiple of 8.
    3. Consecutive blocks with equal widths form a stage.
    4. Round each stage width to a multiple of the group width g.
  • RegNetX-400MF (d = 22, w₀ = 24, w_a = 24.48, w_m = 2.54, g = 16):
    • u₂₁ = 24 + 24.48·21 = 538.08;
    • quantised widths 24, 64, 152, 392 with depths 1, 2, 7, 12;
    • after group rounding, widths 32, 64, 160, 400.
  • X block: a ResNeXt-style bottleneck with bottleneck ratio 1 (1 × 1, then a grouped 3 × 3 with group width g, then 1 × 1). The Y block adds SE.
  • Group count: w/g, so 400/16 = 25 groups.
📝 Quick check (Level 1)
0/3 answered
  1. 1. u_j for w₀ = 24, w_a = 24.48, j = 21:
  2. 2. RegNetY differs from RegNetX by…
  3. 3. Groups at width 400, group width 16:

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

RegNet in code

Exercise 1.

  • The linear rule gave 22 widths from 24 to 538.
  • Quantising left four distinct widths, which became four stages of 1, 2, 7 and 12 blocks.
  • Group rounding then gave 32, 64, 160 and 400.

Practice.

  • torchvision has regnet_x_* and regnet_y_* from 400MF to 32GF (the name gives the multiply–adds); regnet_y_16gf and regnet_y_32gf have SWAG-pretrained weights.
  • The training recipe is simple and standard: SGD with momentum 0.9, cosine schedule, weight decay 5·10⁻⁵, 100 epochs, little augmentation. That makes RegNet a clean baseline.
  • To fit a budget, pick the flops variant, or generate a custom model from (d, w₀, w_a, w_m, g).
model = torchvision.models.regnet_y_800mf(weights="IMAGENET1K_V2")
# custom: torchvision.models.regnet.BlockParams.from_init_params(depth=22, w_0=24, w_a=24.48, w_m=2.54, group_width=16)
🐍 Exercise 1: the quantised linear rule
Generate linear widths, quantise them and group equal widths into stages.
📝 Quick check (Level 2)
0/3 answered
  1. 1. '400MF' in RegNetX-400MF means…
  2. 2. RegNet's training recipe is…
  3. 3. torchvision function for custom RegNet parameters:

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Design spaces and error distributions. A design space is a parameterised family of networks. The authors compared spaces by sampling about 500 models from each, training each briefly, and plotting the empirical distribution function (EDF) of their errors. A better space has more of its mass at low error. Successive constraints were kept only when the EDF improved:

  • shared bottleneck ratio;
  • shared group width;
  • increasing widths;
  • increasing depths.

This turned AnyNetX, with about 10¹⁸ configurations, into RegNet, which is far smaller.

What the analysis found.

  • Good networks’ widths are well fit by a quantised linear function of block index.
  • The best models had about 20 blocks, fairly independent of compute budget, against the common belief that deeper is better.
  • A bottleneck ratio of 1 (no bottleneck) was best.
  • Inverted bottlenecks and depthwise convolutions hurt in this regime.
  • Runtime on GPUs tracks the number of activations (output elements) better than FLOPs, so RegNets keep activations low.

Comparison. At similar FLOPs RegNetY matched EfficientNet’s accuracy and trained and ran up to five times faster on GPUs, because EfficientNet’s depthwise convolutions and high-resolution maps produce many activations.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Design spaces were compared by…
  2. 2. Best depth found was about…
  3. 3. GPU runtime tracked best with…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

Can five numbers rebuild a network?

History.

  • I. Radosavovic, J. Johnson, S. Xie, W.-Y. Lo and P. Dollár (2019) introduced design-space comparison with error distributions.
  • I. Radosavovic, R. P. Kosaraju, R. Girshick, K. He and P. Dollár (2020) introduced RegNet at CVPR.
  • RegNetY backbones were used in self-supervised models such as SEER (Goyal et al., 2021), trained on a billion uncurated images.

Exercise 2. This is a calculation, not a training run. For four published RegNetX models it generates the stage widths and depths from (d, w₀, w_a, w_m, g), counts the parameters of the resulting networks, and compares with torchvision:

model stage widths stage depths parameters (ours) torchvision
400MF 32, 64, 160, 400 1, 2, 7, 12 5,495,976 5,495,976
800MF 64, 128, 288, 672 1, 3, 7, 5 7,259,656 7,259,656
1.6GF 72, 168, 408, 912 2, 4, 10, 2 9,190,136 9,190,136
3.2GF 96, 192, 432, 1008 2, 6, 15, 2 15,296,552 15,296,552
  • Five numbers each reproduce the networks exactly. Widths, depths and every parameter match torchvision.
  • Widths always increase across stages, one of the constraints the design-space analysis found in good networks. Depths, however, are not monotone (800MF ends with 5 blocks after 7); the analysis favoured increasing depths only on average.
  • A rounding detail mattered: making 392 divisible by 16 must round halves up (to 400); NumPy’s round-half-to-even gives 384 and a 6% smaller model. Reproducing a published model requires its exact conventions.
🐍 Exercise 2 (research): can five numbers rebuild a network?
Generate RegNetX stage widths and depths from the quantised linear rule and check parameter counts against torchvision.

RegNet in AI, robotics and aerospace

  • GPU-friendly backbones: RegNets’ low activation counts make them fast on the embedded GPUs used in autonomous vehicles and robots.
  • Self-supervised pretraining: RegNetY backbones trained on huge unlabelled image sets transfer well to specialised imagery.
  • Method: evaluating design choices over distributions of models, not single runs, is a sound way to compare options for any onboard model.

References

  1. I. Radosavovic, R. P. Kosaraju, R. Girshick, K. He, P. Dollár (2020). “Designing network design spaces.” Proc. CVPR.
  2. I. Radosavovic, J. Johnson, S. Xie, W.-Y. Lo, P. Dollár (2019). “On network design spaces for visual recognition.” Proc. ICCV.
  3. P. Goyal et al. (2021). “Self-supervised pretraining of visual features in the wild.” arXiv:2103.01988.