Inferensys

Glossary

ResNet

ResNet (Residual Network) is a deep convolutional neural network architecture that introduced residual connections (skip connections) to solve the vanishing gradient problem, enabling the training of networks with hundreds or thousands of layers.
Architect reviewing LLM integration architecture on laptop, system diagrams visible, modern technical office setup.
COMPUTER VISION

What is ResNet?

ResNet (Residual Network) is a foundational deep convolutional neural network architecture that introduced residual connections to enable the training of networks with hundreds or thousands of layers.

ResNet is a deep neural network architecture that solves the vanishing gradient problem in very deep networks through the use of skip connections or residual blocks. These blocks implement identity mappings that allow gradients to flow directly through the network, enabling the successful training of architectures with over 1,000 layers. This breakthrough won the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) in 2015 and became a standard backbone for computer vision tasks.

The core innovation is the residual function F(x) = H(x) - x, where the network learns the difference from the identity, rather than the complete transformation H(x). This formulation makes it easier to optimize extremely deep models. ResNet variants (ResNet-50, ResNet-101) are ubiquitous feature extractors in modern multimodal architectures, providing robust visual representations for downstream tasks like object detection and image segmentation.

RESNET

Key Architectural Features

ResNet's core innovation lies in its architectural design, which introduced a simple yet powerful mechanism to enable the training of networks that are substantially deeper than was previously feasible.

01

Residual Blocks & Skip Connections

The fundamental unit of a ResNet is the residual block. Instead of a stack of layers learning a desired underlying mapping H(x), the block is designed to learn a residual function F(x) = H(x) - x. The original input x is passed forward via an identity skip connection and added to the output of the block's layers: Output = F(x) + x. This structure mitigates the vanishing gradient problem by providing a direct, unmodified path for gradients to flow backward through the network during training.

  • Identity Mapping: The skip connection performs an element-wise addition, not a concatenation.
  • Ease of Optimization: The network can learn to drive the residual F(x) towards zero, making it easier to train layers as the network depth increases.
02

Bottleneck Design

For very deep networks (e.g., ResNet-50, 101, 152), a bottleneck block is used to improve computational efficiency. This design reduces the number of parameters and FLOPs. A standard bottleneck block for ResNet-50/101/152 has the structure:

  1. 1x1 Convolution: Reduces the channel dimensionality (e.g., from 256 to 64).
  2. 3x3 Convolution: Performs spatial feature extraction on the reduced channel set.
  3. 1x1 Convolution: Expands the channel dimensionality back up (e.g., from 64 to 256).

This 1x1 -> 3x3 -> 1x1 pattern creates a computational bottleneck, allowing for deeper networks without a prohibitive increase in cost. The skip connection connects the input to the output of this three-layer stack.

03

Downsampling & Projection Shortcuts

When the spatial dimensions are halved (e.g., from 56x56 to 28x28) and the number of channels is doubled, the identity mapping from the input x cannot be directly added to the output F(x) due to dimension mismatch. ResNet handles this in two ways:

  • Option A: The shortcut still performs an identity mapping, but extra zero entries are padded to increase channels. This adds no extra parameters.
  • Option B (Projection Shortcut): A 1x1 convolutional layer with a stride of 2 is used in the shortcut path. This layer projects the input to the correct dimensions (channels and spatial size) and is parameterized. This is the more common approach in modern implementations as it provides a learned projection.

These mechanisms allow the residual learning framework to be applied consistently across the entire network, even when changing feature map dimensions.

04

Global Average Pooling

Prior architectures like VGG and AlexNet used one or more fully connected (dense) layers at the end of the convolutional feature extractor for classification. ResNet popularized the use of Global Average Pooling (GAP) as the final layer before the classification head. Instead of flattening the feature map, GAP takes the spatial average of each channel in the final convolutional feature map.

  • Reduces Parameters: Eliminates the need for massive dense layers, drastically cutting the number of parameters.
  • Improves Generalization: Acts as a regularizer, reducing overfitting.
  • Input Size Flexibility: Makes the network more robust to varying input spatial sizes, as the pooling operation is adaptive.

The output of GAP is a single vector per channel, which is then fed into a single, small fully connected layer for final class prediction.

05

Batch Normalization Integration

ResNet architectures integrate Batch Normalization (BN) after every convolutional layer and before the activation function (typically ReLU). This was a key design choice for stable training of very deep networks.

  • Standard Order: The common pattern within a residual block is Conv -> BN -> ReLU.
  • Stabilizes Activations: BN normalizes the activations of the previous layer, reducing internal covariate shift. This allows for higher learning rates and provides a mild regularization effect.
  • Critical for Depth: The combination of BN and residual connections was instrumental in enabling the successful training of networks with over 100 layers. The original ResNet paper placed BN after the addition of the skip connection, but common practice now places it inside the residual path before the addition.
06

Architecture Variants & Depth

The ResNet design spawned a family of models defined by their depth, measured in the number of weighted layers. The key variants demonstrate the scalability of the architecture:

  • ResNet-18/34: Use basic blocks containing two 3x3 convolutional layers.
  • ResNet-50/101/152: Use bottleneck blocks (1x1, 3x3, 1x1 convs) for efficiency.
  • Performance Scaling: Deeper models (ResNet-152) generally achieve higher accuracy on benchmarks like ImageNet, showing that the residual framework effectively counteracts degradation.

Later Evolutions:

  • ResNeXt: Introduces a cardinality dimension, using grouped convolutions within the bottleneck block for a multi-branch design.
  • Wide ResNet: Increases the width (number of filters) per layer instead of depth, often yielding better performance with fewer layers.
  • ResNet-D: A refined version that tweaks the downsampling block and stem for improved accuracy.
ARCHITECTURE

How ResNet Works: The Residual Learning Framework

ResNet (Residual Network) is a seminal deep convolutional neural network architecture that introduced residual connections to solve the vanishing gradient problem, enabling the training of networks with hundreds or thousands of layers.

A Residual Network (ResNet) is defined by its core innovation: the residual block. Instead of a stack of layers learning an underlying mapping H(x), the block is designed to learn a residual function F(x) = H(x) - x. The original input x is added back to the output of the block via a skip connection (or identity connection), producing H(x) = F(x) + x. This simple reformulation allows gradients to flow directly through the identity path, mitigating the vanishing gradient problem that stunts the training of very deep networks.

The architecture popularized the bottleneck block for deeper variants, which uses 1x1 convolutions to reduce and then restore dimensionality, making the 3x3 convolution more computationally efficient. ResNet's residual learning framework demonstrated that extremely deep networks (e.g., ResNet-152) could be optimized effectively, leading to state-of-the-art performance on ImageNet and establishing a foundational design pattern used in nearly all subsequent deep architectures, including those for natural language processing and beyond.

ARCHITECTURE VARIANTS

Common ResNet Variants and Applications

The original ResNet architecture has been adapted into numerous variants, each optimized for specific computational constraints, data types, or performance objectives. These variants demonstrate the flexibility of the residual learning principle.

ARCHITECTURAL COMPARISON

ResNet vs. Other CNN Architectures

A technical comparison of ResNet's core innovations against preceding and contemporary convolutional neural network architectures, focusing on mechanisms for enabling depth and feature reuse.

Architectural FeatureResNet (Residual Networks)VGGNetInception (GoogLeNet)

Core Innovation

Residual connections (skip connections)

Very deep stacks of small (3x3) convolutional filters

Inception modules with parallel convolutions

Primary Goal

Solve vanishing/exploding gradients to enable extreme depth (>100 layers)

Increase depth with simple, uniform layers for better representation

Increase width and computational efficiency within layers

Key Building Block

Residual block: F(x) + x

Stack of 3x3 conv layers + ReLU

Inception module: 1x1, 3x3, 5x5 conv & pooling in parallel

Gradient Flow

Unimpeded via identity shortcut paths

Sequential, can degrade with depth

Dispersed across parallel paths

Parameter Efficiency

High (reuses features via identity mapping)

Low (very high parameter count in FC layers)

Moderate (uses 1x1 conv for dimensionality reduction)

Representative Depth

ResNet-50, ResNet-101, ResNet-152

VGG-16, VGG-19

GoogLeNet (22 layers with inception modules)

ILSVRC 2015 Result

1st place (3.57% top-5 error)

2nd place (7.3% top-5 error in 2014)

1st place (6.67% top-5 error in 2014)

RESNET

Frequently Asked Questions

ResNet (Residual Network) is a foundational deep learning architecture that revolutionized the training of very deep neural networks. These questions address its core mechanics, applications, and significance.

ResNet (Residual Network) is a deep convolutional neural network architecture that introduced residual connections (or skip connections) to enable the successful training of networks with hundreds or thousands of layers. It works by reformulating the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. A residual block implements this by adding the input of the block (x) to the output of a stack of layers (F(x)), producing H(x) = F(x) + x. This identity shortcut connection allows gradients to flow directly through the network during backpropagation, mitigating the vanishing gradient problem that previously prevented the training of extremely deep models.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.