TL;DR
A residual network is a stack of blocks where each block adds a learned correction to its input. The original design put the ReLU after the addition, which sits on the skip path. This paper shows that when the skip path is a pure identity and the batch normalization and ReLU come before each weight layer, the signal and the gradient flow cleanly through the whole network. The new unit cut error on CIFAR-10 and let a 1001-layer network train. It also cut ImageNet top-1 error for a 200-layer network.
Builds on: Deep Residual Learning for Image Recognition (ResNet), Residual Connection, Batch Normalization, Rectified Linear Unit (ReLU) · Leads to: the pre-activation block as the default residual unit in later vision and language architectures
Why it mattered
Deep convolutional networks were the engine of image recognition in 2016, and depth was the main lever for accuracy. Residual networks deeper than 100 layers had already set accuracy records on ImageNet and COCO, and their authors credited depth for the gains. Yet going much deeper, to a thousand layers, was hard to train. The original 1202-layer network on CIFAR-10 was no better than its 110-layer sibling, and the authors traced the gap to overfitting rather than to a failure to fit the training data.
This paper changed the residual block itself rather than the depth or width. The new block is now the one most people mean when they say a "pre-activation" or "v2" ResNet. The idea of keeping a clean identity path, and the analysis behind it, also shaped how later designs thought about skip connections.
The problem
Start with what is known. A residual network computes in each block, where is a small stack of weight layers with batch normalization and ReLU. The skip connection carries forward unchanged. In the original paper's unit, one more ReLU sits after the addition, so the value passed to the next block is rather than .
The authors ask a precise question: does that extra activation, and any other change on the skip path, slow the flow of information? In a plain network, the signal passes through every layer and is multiplied at each step. In a residual network, the signal has a direct route. Whether the route is clean decides whether early layers still get a learning signal in a very deep stack, which is the vanishing gradient problem in another form.
How it works
Take a tiny instance of the skip-path question first. Imagine a chain of 10 blocks where each block multiplies the skip signal by a fixed number , and the residual part is ignored for simplicity. The signal reaching block 10 is times the input.
-
Identity skip, . Each block passes the signal on unchanged, so the output is times the input. The signal and the gradient both keep their size.
-
Scaled skip, . Each block halves the signal, so the output is times the input. A gradient flowing backwards is cut by the same factor, so early blocks barely learn.
-
Scaled skip, . Now each block grows the signal, so the output is times the input. Over 100 blocks it would be about 13,780 times. Gradients explode instead.
-
Conclusion from the tiny case. Only the identity skip keeps the factor at 1 for any depth. Every other choice of skip multiplies the signal by a number that compounds with depth. This is the first claim of the paper, and it is tested on real networks below.
-
Add the second condition: the activation after the addition. If the ReLU sits after the addition, the value fed to the next block is non-negative and the path is no longer a pure identity. Moving the activation so that it acts only on the residual branch restores the clean path.
-
Place BN and ReLU before each weight layer. This is the pre-activation unit. The skip path has no operation at all except addition, and the activations are applied to the input of each weight layer. The network becomes: input, then BN and ReLU, then convolution, then BN and ReLU, then convolution, then add the input.
flowchart TB
X["Input x"] --> A["BN then ReLU"]
A --> B["3x3 convolution"]
B --> C["BN then ReLU"]
C --> D["3x3 convolution"]
D --> S(("+"))
X -- "identity skip, nothing on this path" --> S
S --> Y["Output x plus F(x)"]
- Check the output. The output of each block is the input plus one residual term, and nothing else touches the skip path. The backward signal likewise has a term that is the upstream gradient unchanged, plus a term through the weight layers.
Worked examples
Setting: a skip path multiplies the signal by at each of 10 blocks, with the residual part set to zero.
- For : .
- For : , which rounds to .
- For : , , , and .
- Interpretation: only keeps the signal the same size.
Answer: the output is 1, about 0.001, and about 2.59 times the input for the three choices.
Setting: a block with a scalar whose derivative with respect to is at the point of interest.
- The derivative of the output with respect to the input is .
- Suppose the gradient arriving from the next block is .
- The gradient passed to the previous block is .
- The identity term contributes of that, and the weight layers contribute .
- Now stack 50 such blocks. The gradient has two kinds of route back to the first block: the direct route through all 50 skip connections, where each skip contributes a factor of , and routes that pass through weight layers, where each block contributes a factor like . The direct route alone carries .
- Interpretation: whatever the weight layers do along the other routes, the direct route keeps a learning signal of size at the earliest block.
Answer: the direct identity route still delivers to the earliest block, however deep the stack.
Setting: ResNet-1001 with the bottleneck pre-activation unit, trained on CIFAR-10 with the original paper's hyper-parameters.
- The 1001-layer network is trained on CIFAR-10 with the original unit and with the pre-activation unit, using the same recipe.
- With the full pre-activation unit, the paper reports a test error of 4.92% on CIFAR-10 and 22.71% on CIFAR-100 for the 1001-layer network. The original unit gave 7.61% and 27.82%.
- The gain is therefore about 2.7 points on CIFAR-10 and 5.1 points on CIFAR-100.
- The gain is the same kind of effect as in the tiny case: the clean skip lets the extra depth pay off instead of stalling.
- Interpretation: the pre-activation unit does not just let the network train; it makes the extra depth pay off.
Try it: on CIFAR-100 at 1001 layers the original unit's error is 27.82% and the pre-activation error is 22.71%. What is the drop in percentage points? Answer: , so about 5.1 points.
The math
Write the residual unit in the general form and , where is the skip map and is the operation after addition. The original design has equal to the identity and equal to ReLU.
A unit is an identity-skip unit when and is also the identity, so . Then the unit reduces to
Here is the input to unit and is the residual function built from weight layers.
Steps 1 and 4 in symbols: the forward signal
Apply the recurrence repeatedly. For any shallower unit and any deeper unit ,
The deep feature is the shallow feature plus a sum of residual terms. This is the paper's first property: information from any unit reaches any later unit without being multiplied by weights along the way.
Step 2 in symbols: the backward signal
Let be the loss. The chain rule from Chain Rule and Backpropagation gives
The first term, , reaches the early unit unchanged. This is why the gradient cannot vanish along the skip path, even if the sum inside the bracket is small.
Steps 2 and 3 in symbols: the scaled skip
Replace the identity skip by a scalar, , so each unit computes . Unrolling from unit to unit gives
The direct term from the input is multiplied by . If every , this product grows exponentially with depth; if every , it shrinks towards zero. This is the algebra behind the tiny example. With the product is at every depth, which is the identity skip.
Steps 5 and 6 in symbols: the pre-activation unit
With the activation placed before each weight layer, the unit can be written as
where is the BN and ReLU applied to the input of the residual branch. The skip path carries with no operation, so the identity-skip formulas above apply exactly.
Results
CIFAR-10 and CIFAR-100, unit comparison. On ResNet-110 the full pre-activation unit had a slightly lower test error than the original unit (6.37% against 6.61%). The gap grows with depth: on the 1001-layer network it is 7.61% to 4.92% on CIFAR-10 and 27.82% to 22.71% on CIFAR-100. The full pre-activation unit is the best of the variants the authors tested, and placing only the ReLU before the weight layers was not as good.
Skip-connection variants. Scaling the skip by a constant, gating it, or replacing it with a 1 by 1 convolution all made training worse than the identity skip. The authors read this as an optimisation problem: the identity skip is easy to train, and the other variants are harder to optimise even when they have more parameters.
ImageNet. The pre-activation unit also improved the 200-layer network on ImageNet, lowering its single-crop top-1 error from 21.8% to 20.7% in the authors' comparison. The gain on the 152-layer network was smaller.
Limits. The main CIFAR experiments use small images and a fixed training recipe, and the ImageNet gain for the 152-layer network is small. Deeper networks cost more compute because the cost grows with the number of layers.
Misreadings to avoid
It is tempting to think that more layers always helps. In fact the original design stopped improving, and even overfitted, at some depths; the pre-activation unit changes that.
It is tempting to think that an extra activation on the skip path is harmless. In fact a ReLU placed after the addition makes the skip path non-linear, which the analysis predicts will hurt, and the experiments confirm it.
It is tempting to think that a learned gate or a 1 by 1 convolution on the skip is an upgrade. In fact those add parameters, yet they train worse than the identity, which points to optimisation as the bottleneck.
Use the pre-activation unit as the default for deep residual networks with batch normalization. It is a small code change with a clear theoretical reason and a measured gain.
Reading guide
Read the paper in this order, with the lessons it needs at each step:
- Section 1, Introduction. Needs Deep Residual Learning for Image Recognition (ResNet) for the original unit and Residual Connection for the skip idea.
- Section 2, Analysis. Needs Chain Rule and Backpropagation for Equations 4 and 5, and Vanishing Gradient Problem for why the identity term matters.
- Section 3, Skip connections. Needs Activation Function and Gradient Descent to follow the training curves, and Overfitting to read the test-versus-training error comparisons.
- Section 4, Activations. Needs Rectified Linear Unit (ReLU) and Batch Normalization, and Convolutional Neural Network for the residual branch.
- Section 5, Results. Needs only the tables; read them with Overfitting in mind.
Chain of ideas in this lesson: a residual block adds to its input; if the skip path is a pure identity, the signal and gradient pass through any depth; a scaling or an activation on the skip breaks that; moving BN and ReLU before the weight layers keeps the skip clean; the result is lower error at every depth tested.
Check yourself
QuestionIn a residual network with 20 blocks, the skip path multiplies the signal by 0.9 at each block. How much of the input reaches the output, to two decimal places?Show answer
The factor is . Compute , then square it: . So about 0.12 of the input reaches the output, and the skip signal has shrunk a great deal.
QuestionA residual block is , and the derivative of at the current point is . If the gradient from the next block is , what gradient reaches the previous block?Show answer
The derivative of the output with respect to the input is . The gradient passed back is .
QuestionWhy does moving the ReLU from after the addition to before the weight layers make the skip path clean, and why does that matter for very deep networks?Show answer
After the addition, the ReLU sits on the skip path, so the value passed forward is non-negative and the gradient through the ReLU can be zeroed for negative inputs. Placing BN and ReLU on the input of the residual branch leaves only the addition on the skip path. The identity term in the backward signal then reaches every earlier block unchanged, so the learning signal survives at depths of hundreds or a thousand layers.
QuestionApplied scenario: a team trains a 150-layer residual network and finds that the loss falls very slowly in the first epochs, while the deeper layers barely change. Which change from the paper targets this, and why?Show answer
Move BN and ReLU to the input of each weight layer, so the skip path is a pure identity. The gradient then reaches early layers through the identity route unchanged, which speeds up early training. The paper's argument is about signal and gradient flow, not about regularisation.
Sources
- He, Zhang, Ren, Sun (2016), Identity Mappings in Deep Residual Networks, arXiv:1603.05027. https://arxiv.org/abs/1603.05027
- DOI for the same paper: https://doi.org/10.48550/arXiv.1603.05027