# ResNet: Residual connections make very deep networks trainable

> ResNet recasts layers as residual functions with identity shortcuts, addressing deep-network degradation. Its 152-layer model reports 3.57% ImageNet top-5 error and residual learning became a default building block.

- URL: https://dmxsf.com/en/blog/deep-residual-learning-for-image-recognition/
- [DMXSF](https://dmxsf.com/en/about/)
- Published: 2015-12-20
- Updated: 2026-11-13
- Paper notes
- Paper: [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385) (Kaiming He, Xiangyu Zhang, Shaoqing Ren, et al. · CVPR 2016, 2015)

ResNet observes that adding plain layers can increase training error, so the issue is not merely vanishing gradients. Shortcuts let extra layers reproduce the identity and learn only a correction.

## How it works

A block computes y=F(x)+x, using projection when dimensions differ. Bottlenecks reduce channels with 1x1 convolution, apply 3x3 convolution and restore width. Plain/residual comparisons expose the optimization benefit.

## What the evidence shows

ResNet-152 reports 3.57% ImageNet top-5 error, and ensembles won ILSVRC 2015 classification. Training curves provide central evidence beyond leaderboard results.

## A reproducible check

This snippet checks a public formula or configuration; it does not reproduce full training.

```python
import torch
x = torch.tensor([1.0, -2.0, 3.0])
F = torch.tensor([0.2, 0.1, -0.5])
y = F + x
print("residual F(x) =", F.tolist())
print("input x =", x.tolist())
print("output y =", y.tolist())
```

```text
residual F(x) = [0.20000000298023224, 0.10000000149011612, -0.5]
input x = [1.0, -2.0, 3.0]
output y = [1.2000000476837158, -1.899999976158142, 2.5]
```

The arithmetic is reproducible, but model quality still depends on the full experiments in the paper.

## Limitations and common misreadings

Residuals do not eliminate every optimization issue; normalization and initialization still matter. The 3.57% figure belongs to a specific evaluation setup.

## The key takeaway

The deep insight is to make doing nothing easy to represent. Identity paths improve information and gradient flow across deep networks.

## Further reading

- [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385)
- [Vision Transformer](https://dmxsf.com/en/blog/vit-an-image-is-worth-16x16-words/)
- [Residuals in Transformer](https://dmxsf.com/en/blog/attention-is-all-you-need/)

## FAQ

### Does ResNet only address vanishing gradients?

No. Its central target is degradation, where deeper plain networks have higher training error.

### Why residual learning?

A block learns F(x)=H(x)-x and adds x back through a shortcut.

### What is the reported ImageNet result?

ResNet-152 reports 3.57% top-5 error under the paper’s evaluation setup.
