ResNet, short for residual network, is a family of deep convolutional neural networks in which each block learns a residual function added to its own input through a shortcut, or skip, connection. Introduced in 2015 by Kaiming He and colleagues at Microsoft Research, it made networks of more than 100 layers trainable and became one of the most influential designs in neural networks and in artificial intelligence as a whole.
ResNet won the ILSVRC 2015 image classification challenge and remains a standard baseline and backbone for computer vision. Its central idea, the residual connection, now appears in almost every deep architecture, including the Transformer.
The degradation problem that ResNet solved
ResNet was designed to fix the degradation problem: before 2015, adding layers to a plain convolutional network beyond roughly 20 to 30 layers made training error rise, not fall. This was not overfitting, because the deeper network performed worse even on its own training data.
In theory a deeper network should never be worse, since extra layers could simply learn the identity mapping. In practice, stacks of nonlinear layers trained with gradient descent find identity mappings hard to approximate, and optimization stalls. Batch normalization had already eased the vanishing gradient problem, so the obstacle was primarily one of optimization difficulty.
How a residual block works
A residual block computes y = F(x) + x, where F is a small stack of convolutional layers and x is the block input passed unchanged through a shortcut. The layers therefore learn only the residual F(x) = H(x) – x, the difference between the desired mapping and the input.
If the best mapping is close to identity, the network only needs to push F toward zero, which is easy. During backpropagation the shortcut also provides a direct gradient path, so error signals reach early layers without being repeatedly shrunk by weight matrices and activation functions.
ResNet uses two block types, compared in the table below. The bottleneck design reduces computation in deep variants by compressing channels before the expensive 3×3 convolution.
| Property | Basic block | Bottleneck block |
|---|---|---|
| Layer sequence | 3×3 conv, 3×3 conv | 1×1 conv, 3×3 conv, 1×1 conv |
| Used in | ResNet-18 and ResNet-34 | ResNet-50, ResNet-101, ResNet-152 |
| Channel expansion | None | Output is 4 times the inner width |
| Main advantage | Simple, fast on small models | Depth at modest compute cost |
When a block changes resolution or channel count, the identity shortcut cannot be added directly. ResNet then uses a projection shortcut, a 1×1 convolution with stride 2, so that both branches have matching tensor shapes.
Standard ResNet variants and their scale
The original ResNet family differs mainly in depth and block type, while sharing the same overall layout. Every variant starts with a 7×7 convolutional stem and max pooling, passes through four stages that halve resolution and widen channels, and ends with global average pooling and one fully connected classifier.
The table shows approximate size, compute and ImageNet top-1 accuracy for the commonly published reference weights. Exact accuracy varies by training recipe, and modern recipes add several points.
| Variant | Parameters | Compute per image | Top-1 accuracy |
|---|---|---|---|
| ResNet-18 | About 11.7 million | About 1.8 GFLOPs | About 70% |
| ResNet-34 | About 21.8 million | About 3.6 GFLOPs | About 73% |
| ResNet-50 | About 25.6 million | About 4.1 GFLOPs | About 76% |
| ResNet-101 | About 44.5 million | About 7.8 GFLOPs | About 77% |
| ResNet-152 | About 60.2 million | About 11.3 GFLOPs | About 78% |
ResNet-50 is the most widely used member, because it offers a good balance of accuracy and cost and serves as a common benchmark for hardware and training throughput.
ResNet compared with other architectures
ResNet sits between the plain deep CNNs that preceded it and the attention-based models that followed. The comparison below places it among neighboring designs.
| Architecture | Key mechanism | Relation to ResNet |
|---|---|---|
| VGG | Plain stacks of 3×3 convolutions | Earlier design; deeper versions suffered degradation |
| ResNet v2 | Pre-activation blocks with clean identity paths | Refinement that trained 1,000-layer networks |
| ResNeXt | Grouped convolutions inside residual blocks | Adds width through parallel paths |
| DenseNet | Concatenates outputs of all earlier layers | Feature reuse instead of addition |
| U-Net | Encoder-decoder with long skip connections | Often uses a ResNet encoder |
| Vision Transformer | Self-attention over image patches | Keeps residual connections around every sublayer |
The residual connection outlived the original model. Transformers, diffusion U-Nets and state space models all wrap their layers in residual paths, which shows that ResNet contributed a general principle of deep network design, not only a single vision model.
Practical use, limitations and common mistakes
ResNet is used today mostly as a pretrained backbone for transfer learning, for example in object detection, segmentation and medical imaging. Its features are well understood, it runs efficiently on many accelerators, and its behavior is predictable and easy to debug.
The architecture also has known limits. Its receptive field grows only locally, so it captures global context less directly than attention models, and on very large datasets Vision Transformers and ConvNeXt often reach higher accuracy for similar compute.
| Symptom | Likely cause | Fix |
|---|---|---|
| Poor accuracy after fine-tuning | Input not normalized like pretraining data | Apply the original mean and standard deviation |
| Unstable training with small batches | Batch normalization statistics are noisy | Freeze BN layers or use group normalization |
| Overfitting on a tiny dataset | Too many trainable parameters | Freeze early stages or choose ResNet-18 |
| Slow inference on edge devices | Deep variant chosen by default | Use a smaller ResNet or a mobile architecture |
A frequent misconception is that residual connections eliminate vanishing gradients entirely. They greatly improve gradient flow and optimization, but deep ResNets still depend on careful weight initialization and normalization to train well.
The idea in brief
ResNet is a way of building very deep image-recognition networks that still learn well. Each small part of the network gets a shortcut that carries its input straight past it. The part only has to learn what to add or change, not rebuild everything from scratch.
Think of editing a document with tracked changes instead of retyping it. If a section is already fine, no edits are needed. This simple trick allowed networks to grow from about 20 layers to more than 150 while becoming more accurate, not less.
A practical scenario
A quality-control team at an electronics factory needs to detect defective solder joints on circuit boards. They have only 6,000 labeled photos, far too few to train a large network from scratch.
The engineers take a ResNet-50 pretrained on ImageNet, replace its final classification layer with a two-class output, freeze the first two stages and fine-tune the rest for 20 epochs. They resize images to 224 by 224 pixels and normalize them with the same statistics used during pretraining.
On a held-out test set the model reaches about 97% accuracy and runs in roughly 10 milliseconds per image on a single inspection GPU. The result shows why ResNet remains a dependable starting point for industrial vision tasks with limited data.