Opens in a new tab

ResNet Explained: How Residual Networks Work

Subscribe

ResNet Explained: How Residual Networks Work

A residual neural network uses skip connections to train deep neural networks. Learn ResNet architecture, residual blocks, and modern uses.
RESNET

Subscribe to the viso blog

Stay connected with viso.ai and receive new blog posts straight to your inbox.
Subscribe

A residual neural network (ResNet) is a convolutional architecture that stacks residual blocks, each one carrying a shortcut connection that lets information bypass one or more convolutional layers. That single structural idea solved a problem that had capped the depth of artificial neural networks for years, and it remains embedded in almost every production vision system operating today.

What Is a Residual Neural Network?

ResNet stands for Residual Network. The architecture was introduced by Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun in the 2015 paper Deep Residual Learning for Image Recognition, and it reshaped how the computer vision field thinks about depth.

The core insight is a reframing of what a layer should learn. Rather than asking a block of layers to learn a complete mapping from input to output, a residual block asks it to learn only the difference, or residual, between the two. The original input is then added back through a shortcut connection. If the ideal transformation for a given block happens to be no transformation at all, the block can simply push its weights toward zero and pass the input through unchanged, which is the identity mapping.

Learning a residual function is easier than learning an unreferenced mapping. When the optimal function is close to identity, the solver only needs to find small adjustments rather than reconstruct the entire transformation from scratch.

The results were emphatic. An ensemble of ResNet models won first place at the ILSVRC 2015 classification competition with a 3.57% top-5 test error on the ImageNet dataset, and the same architecture took first place in ImageNet detection and localization along with COCO detection and segmentation.

Workers in high-visibility vests and helmets inspecting an electrical panel with AI-based object detection overlays
ResNet backbones underpin many PPE detection models deployed in energy and utilities environments, where residual connections allow deep feature extractors to run reliably on live camera feeds.
Self-building AI vision

Bring a new AI vision application to life.

Turn ideas into real-world computer vision systems.

The Degradation Problem ResNets Introduced Skip Connections to Solve

Before 2015, the working assumption was that adding depth to a deep model would improve accuracy, at worst leading to overfitting. What researchers observed instead was stranger and more troubling.

When a 56-Layer Network Loses to a Shallow Network

He and colleagues trained plain convolutional networks of increasing depth on CIFAR-10 and found that a 56-layer network produced higher training error than a 20-layer shallow network. Higher training error, not just test error, which rules out overfitting as the cause. The deeper model simply could not be optimized as effectively. This is the degradation problem, and it meant that increasing the number of layers past a certain threshold actively harmed performance.

Logically, this should not happen. A deeper network can always replicate a shallower one by setting its extra layers to identity mappings. The fact that gradient descent could not find that solution revealed a limitation in the optimization process rather than in model capacity.

The Vanishing Gradient Problem

Part of the difficulty traces to the vanishing gradient problem. During backpropagation, gradients are multiplied through every layer on the way back to the input. When those multiplicative factors are small, the signal reaching the earliest layers shrinks toward zero, and those layers barely update. Batch normalization and careful initialization helped, but neither eliminated the ceiling on trainable depth.

Skip connections address this directly. Because a shortcut connection adds the input to the block output, gradients have an unobstructed route backward through the network. Residual connections effectively create a gradient highway that bypasses the multiplicative chain entirely.

Inside a Residual Block

A basic residual block performs a small, well-defined sequence of operations:

  1. The input passes through two or three convolutional layers, each followed by batch normalization and a ReLU activation function.
  2. The original input is added to the output of that stack through the skip connection.
  3. A final activation function is applied to the sum.

When input and output dimensions match, the shortcut is a pure identity mapping with no parameters and no computational cost. When a block changes the spatial resolution or channel count, the shortcut needs adjusting, and the authors tested two options: zero-padding the extra channels, or applying a 1×1 projection convolution. Projection shortcuts perform marginally better at a small parameter cost, and they are what most implementations use.

ResNet Architecture Variants

All variants share the same design rules. Layers producing the same output feature map size carry the same number of filters, and whenever the feature map is halved, the filter count doubles to preserve per-layer time complexity.

Variant Block Type Depth FLOPs
ResNet-18 2-layer basic 18 layers 1.8 billion
ResNet-34 2-layer basic 34 layers 3.6 billion
ResNet-50 3-layer bottleneck 50 layers 3.8 billion
ResNet-101 3-layer bottleneck 101 layers 7.6 billion
ResNet-152 3-layer bottleneck 152 layers 11.3 billion

ResNet-34

The plain baseline that ResNet-34 was built from drew its structure from VGG networks, using stacks of 3×3 filters. Compared with VGGNets, however, ResNets use fewer filters and carry lower complexity throughout. Adding shortcut connections to that 34-weighted-layer baseline was enough to reverse the degradation trend entirely.

ResNet-50

ResNet-50 replaces each 2-layer block with a 3-layer bottleneck: a 1×1 convolution that reduces channel depth, a 3×3 convolution that does the spatial work, and a 1×1 convolution that restores depth. The bottleneck keeps training time manageable while increasing representational power, which is why ResNet-50 became the default backbone for object detection frameworks including Mask R-CNN and RetinaNet.

ResNet-101 and ResNet-152

Deeper variants extend the same bottleneck pattern. Notably, the ResNet model with 152 layers requires 11.3 billion FLOPs, still well below VGG-16 and VGG-19 at 15.3 and 19.6 billion, respectively. Depth and efficiency turned out not to be in tension.

Construction site with computer vision bounding boxes tracking workers and heavy equipment
Deeper ResNet variants improve detection of small or partially occluded objects, a common requirement in construction site monitoring where workers and equipment overlap in frame. Built with Viso Suite.

Identity Mappings and the Pre-Activation Refinement

A year after the original paper, the same team published Identity Mappings in Deep Residual Networks, analyzing what makes the shortcut work. They concluded that the cleaner the identity path, the better the network trains. Moving batch normalization and the activation function ahead of the convolutions, an arrangement called pre-activation, leaves the shortcut completely unobstructed and makes it practical to train networks beyond 1,000 layers.

That principle propagated well past ResNet itself. Residual connections are a load-bearing component of the transformer block, which means they sit inside vision transformers, large language models, and vision language models alike.

Where ResNet Models Fit in Agentic Computer Vision

Modern systems increasingly do more than classify frames. Agentic computer vision systems interpret a scene, reason about what is happening across time, and decide which action to trigger. Those pipelines still depend on fast, reliable perception at the bottom of the stack, and ResNet backbones continue to fill that role for several practical reasons:

Research has also kept the architecture current. The 2021 study ResNet Strikes Back demonstrated that ResNet-50 trained with contemporary augmentation and optimization recipes reaches above 80% ImageNet top-1 accuracy, closing much of the apparent gap with newer designs. A meaningful share of what looked like architectural progress was training methodology.

Bottles being inspected on an industrial production line.
Bottleneck residual blocks reduce channel depth before the expensive 3×3 convolution, which keeps manufacturing inspection models fast enough for line-rate throughput.

How to Use a ResNet Model Today

Getting a residual network into production is far simpler than it was in 2015. A typical path looks like this:

  1. Load a pretrained backbone. Both PyTorch and Keras Applications ship ResNet-50 and its siblings with ImageNet weights. Our comparison of PyTorch and TensorFlow covers the tradeoffs.
  2. Replace the classification head with one sized to your classes, then decide which convolutional layers to freeze based on how much labelled data you hold.
  3. Fine-tune and evaluate using precision and recall rather than accuracy alone, particularly for imbalanced industrial datasets.
  4. Deploy and monitor for data drift, since camera positions, lighting, and site conditions change over time.
Forklift-warehouse-near-miss-unsafe-proximity-tracking
Skip connections preserve fine-grained spatial detail across depth, which supports proximity and near-miss detection in busy logistics environments.

Building With Residual Architectures

The residual network changed the trajectory of deep learning by removing depth as a constraint. Its influence now runs from lightweight edge detectors to the largest multimodal models in deployment.

FAQs

It is a neural network where blocks of layers learn adjustments to their input rather than complete transformations, with the original input added back through a shortcut connection. This makes very deep networks trainable.

They address both the vanishing gradient problem and the degradation problem, giving gradients a direct route backward and letting layers default to an identity mapping when no transformation is needed.

Because optimization becomes harder as depth grows. The 56-layer plain network in the original experiments produced higher training error than a 20-layer network, showing the issue was optimizability rather than capacity.

Yes, in two ways. ResNet-18 through ResNet-50 remain practical backbones for edge deployment, and residual connections themselves are standard in transformers and foundation models.

ResNet-34 uses 2-layer basic blocks. ResNet-50 uses 3-layer bottleneck blocks, which raise accuracy while keeping training cost close to that of the shallower model.