CNN Architectures Needs review

Residual Network (ResNet)

ResNet

Year of appearance
2015
Researchers
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Organisation
Microsoft Research
Architecture type
Residual convolutional network
Learning mechanism
supervised
Tasks
Image classification, Object detection, Segmentation

Very deep convolutional networks that learn residual functions F(x) = H(x) − x through skip connections, which made it possible to train networks with hundreds of layers.

Displayed configuration: ResNet-50 (bottleneck blocks 3-4-6-3) — A stem, then four stages of bottleneck blocks (3, 4, 6, 3), then global pooling and a linear layer; the first block is detailed.

Layer table (14 nodes)
LayerTypeInputOutputRepetitionParametersFormulaMACs
Inputinput3 × 224 × 22410—
Stem: conv 7×7/2 (64) + BN + ReLU + maxpoolconv3 × 224 × 22464 × 56 × 5619,536From the reference PyTorch implementation118,013,952
conv 1×1 (64) + BN + ReLUpwconv64 × 56 × 5664 × 56 × 5614,224From the reference PyTorch implementation12,845,056
conv 3×3 (64) + BN + ReLUconv64 × 56 × 5664 × 56 × 56136,992From the reference PyTorch implementation115,605,504
conv 1×1 (256) + BNpwconv64 × 56 × 56256 × 56 × 56116,896From the reference PyTorch implementation51,380,224
Skip projection: conv 1×1 (256) + BNpwconv64 × 56 × 56256 × 56 × 56116,896From the reference PyTorch implementation51,380,224
Residual addition + ReLUresidual256 × 56 × 56256 × 56 × 5610—
Two identical bottleneck blocks (stage 1)residual256 × 56 × 56256 × 56 × 56270,400From the reference PyTorch implementation218,365,952
Stage 2: 4 residual blocksresidual256 × 56 × 56512 × 28 × 2811,219,584From the reference PyTorch implementation1,027,604,480
Stage 3: 6 residual blocksresidual512 × 28 × 281024 × 14 × 1417,098,368From the reference PyTorch implementation1,464,336,384
Stage 4: 3 residual blocksresidual1024 × 14 × 142048 × 7 × 7114,964,736From the reference PyTorch implementation809,238,528
Global average poolinggap2048 × 7 × 72048 × 1 × 110From the reference PyTorch implementation0
FC-1000fc2048100012,049,000From the reference PyTorch implementation2,048,000
Softmax → 1000 classesoutput1000100010—

Configuration figures: ResNet-50 (bottleneck blocks 3-4-6-3)

Parameters (computed from the layers)25,557,032 (≈25.56M)
Parameters (published in the source)Unspecified
MACs4,089,184,256 (≈4.09B)
FLOPs ≈ 2 × MACs8,178,368,512 (≈8.18B)
Input shape
3×224×224
Output shape
1000
Depth
50 layers with parameters (49 convolutions + a linear layer)
Complexity
About 4.1 billion multiply-adds per 224×224 image in the torchvision implementation.
MACs note
Computed with torch.utils.flop_counter; the paper (Table 1) reports 3.8×10⁹ FLOPs in the sense of multiply-adds.
Calculation assumptions: Implementation of torchvision.models.resnet50 (stride 2 in the 3×3 convolution inside the block, the “v1.5” change from the paper, which put it in the first 1×1).

MAC = a multiplication followed by an addition. The figures are for one forward pass of one sample with the stated dimensions; they are an analytical calculation, not a measurement of run time.

Scientific explanation

Historical background

Won the ILSVRC and COCO 2015 challenges with a top-5 error of 3.57% (an ensemble), was published at CVPR 2016, and became the most widely used backbone in vision.

The problem it addresses

The degradation problem: deeper networks give a higher training error than shallower ones even though there is no overfitting.

Core idea

Instead of learning the mapping H(x) directly, the layers learn the difference F(x) and the input is added through a skip connection; learning the zero function is easier than learning the identity.

Architecture description

A stem (7×7/2 + pooling), then four stages of residual blocks with 64→128→256→512 channels (×4 in bottleneck blocks), then global average pooling and a linear layer. ResNet-18/34 use basic blocks, and ResNet-50/101/152 use bottleneck blocks.

Data flow

224×224×3 → 56×56×256 → 28×28×512 → 14×14×1024 → 7×7×2048 → 2048 → 1000 (for ResNet-50).

Inputs

An RGB image of size 224×224.

Outputs

A probability distribution over 1000 classes (or features for downstream tasks).

Training procedure

SGD with momentum 0.9, batch 256 and a rate of 0.1 divided by 10 on plateaus, weight decay 10⁻⁴, and BatchNorm after every convolution, with no Dropout.

Loss functions

Multi-class cross-entropy.

Computational complexity

ResNet-50 about 4.1 billion multiply-adds, and ResNet-18 about 1.8 billion.

Computational requirements

ImageNet training needs several GPUs for days.

Advantages

  • Stable training of very deep networks
  • High accuracy at moderate computation
  • A standard backbone for detection and segmentation

Limitations

  • Increasing depth gives diminishing returns
  • Bottleneck blocks increase activation memory use
  • Implementation details (v1 vs v1.5) change the counts slightly

Equations

Residual block Residual block

\mathbf{y} = \mathcal{F}(\mathbf{x}, \{W_i\}) + W_s \mathbf{x}

The output is the sum of the residual function and the input (W_s is a 1×1 projection only when the dimensions differ).

Symbols: F: residual function, W_s: skip projection

Batch normalisation Batch normalization

\hat{x} = \frac{x - \mu_B}{\sqrt{\sigma_B^2 + \epsilon}},\quad y = \gamma \hat{x} + \beta

Normalises each channel with the batch statistics.

Symbols: μ_B, σ²_B: batch mean and variance; γ, β: learned parameters

Gradient flow through the skip connection Gradient through skip

\frac{\partial \mathcal{L}}{\partial \mathbf{x}} = \frac{\partial \mathcal{L}}{\partial \mathbf{y}} \left(1 + \frac{\partial \mathcal{F}}{\partial \mathbf{x}}\right)

The term 1 passes the gradient directly whatever the depth.

Applications

Related models

References

  1. Original paper Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. (2016). Deep residual learning for image recognition. CVPR 2016, 770–778. doi:10.1109/CVPR.2016.90 Verified
Scientific review note: A first scientific draft based on the original paper and reference implementations; it needs review by a specialist before final approval.

Version 1 — last updated 2026-11-15.