Skip to content
StackDecode
AI & ML Atlas
Deep LearningarchitectureInteractive simulation

ResNet

Very deep CNNs made trainable by skip connections that add the input to the output.

The idea

A residual block learns a correction F(x) and outputs x + F(x). The shortcut gives gradients a direct path back through the network, which solved the degradation problem where deeper plain networks trained worse. ResNet-152 won ImageNet 2015 and residual connections are now everywhere, including transformers.

y = F(x) + x

Watch it run

This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.

Plain deep networkWith skip connections (ResNet)out12345678910111213141516171819in
  • plain
  • with skip connections

The learning signal (gradient) starts at the output and travels backwards through 20 layers. Bar height shows its size at each layer on a log scale.

layers back:
0
1/7

A residual block computes x + F(x). The "+ x" is a shortcut the gradient can travel along.

Step by step

  1. 1Pass x through two or three convolutional layers to get F(x).
  2. 2Add the original x (the skip connection).
  3. 3Apply the activation.
  4. 4Stack many blocks, using 1×1 convolutions to match shapes when needed.

Where it is used

Backbone for classification, detection and segmentation.

Watch out for

Heavier than efficiency-focused designs such as MobileNet.

Related