Understanding ResNet: The Essence and Applications of Residual Neural Networks

This article will cover the essence of ResNetthe principles of ResNetand the applications of ResNet to help you understand Residual Neural Networks (ResNet).

Understanding ResNet: The Essence and Applications of Residual Neural Networks

Residual Neural Network ResNet

1. The essence of ResNetResNet’s definition:

Residual Neural Network (ResNet) is an architecture of deep convolutional neural networks (CNN) that addresses the degradation problem in training deep networks by introducing “residual learning”.By bypassing certain intermediate layers, the activation values of the layers are directly linked to subsequent layers, creating a residual block. These residual blocks are stacked together to form ResNet.

Degradation Problem:As the number of layers in the network increases, the performance of the network does not continuously improve, but rather saturates and even declines after reaching a certain depth. This phenomenon contradicts intuition, as generally, more layers imply a stronger learning capacity for the network, enabling it to learn more complex function mappings.

Understanding ResNet: The Essence and Applications of Residual Neural Networks
Degradation Problem:
Residual Learning:It is a technique for training deep neural networks aimed at addressing the degradation problem that arises with increasing network depth.
In ResNet, residual learning is achieved through the introduction of “shortcut connections” or “skip connections,” which allow inputs from earlier layers of the network to be directly passed to later layers.
Understanding ResNet: The Essence and Applications of Residual Neural Networks
Residual Learning
The essence of ResNet:The strategy behind residual networks is to have the network fit the residual mappings instead of having the layers learn the underlying mappings.Thus, the network does not fit the initial mapping, such as H(x), but instead fits the residual mapping H(x) – x.
F(x) = H(x) – x, thus derivingH(x) = F(x) + x.
Understanding ResNet: The Essence and Applications of Residual Neural Networks
The essence of ResNet

2. Principles of ResNet:

ResNet architecture: ResNet34 uses a 34-layer ordinary network architecture inspired by VGG-19, followed by the addition of shortcut connections. This architecture is then transformed into a residual network through these shortcut connections, as shown below:

Understanding ResNet: The Essence and Applications of Residual Neural Networks
Architecture of ResNet34

Residual Block::In the ResNet architecture, multiple residual learning blocks are typically concatenated together.

Understanding ResNet: The Essence and Applications of Residual Neural Networks

Residual Block

In different versions of ResNet, such as ResNet18, ResNet34, ResNet50, ResNet101, ResNet152, etc., the number of residual blocks is determined by the total number of layers in the network.

Understanding ResNet: The Essence and Applications of Residual Neural Networks
Different Versions of ResNet

Taking ResNet34 as an example, it contains 34 layers, including a 7×7 convolutional layer (counted as one layer), followed by 16 residual blocks (each containing two convolutional layers), and finally connected to a fully connected layer (the last layer), making a total of 34 layers.

Understanding ResNet: The Essence and Applications of Residual Neural Networks

Architecture of ResNet34

How ResNet works: ResNet mitigates the vanishing gradient problem through residual blocks and skip connections, utilizing downsampling and global pooling to extract key features, classifying or regressing through fully connected layers, and accelerating training and generalization with batch normalization and ReLU.

Understanding ResNet: The Essence and Applications of Residual Neural Networks
Working Process of ResNet34

The workflow of ResNet34 can be briefly summarized as follows:

  1. Input Layer: First, image data is fed into the first convolutional layer of ResNet34, which is typically a 7×7 convolutional layer used for initial feature extraction.

  2. Residual Block: Subsequently, the image data passes through a series of residual blocks. Each residual block contains two convolutional layers for further feature extraction. Importantly, each residual block achieves this through skip connections, meaning the input of each residual block is directly added to its output.

  3. Downsampling: Between residual blocks, downsampling operations may be implemented by altering the stride of the convolution or using additional convolutional layers to reduce the size of the feature maps while preserving spatial hierarchies.

  4. Fully Connected Layer: After all residual blocks, the global average pooling layer reduces the spatial dimensions of the feature maps to 1×1, generating a feature vector. This feature vector is then passed to one or more fully connected layers (also known as dense layers or linear layers) for classification or regression tasks.

  5. Output: Finally, ResNet34 outputs prediction results. For classification tasks, the output is usually a probability distribution vector indicating the probabilities that the image belongs to various categories; for regression tasks, the output may be specific numerical values.

Throughout the workflow, batch normalization and the ReLU activation function are typically used after each convolutional layer and fully connected layer to accelerate training and improve the model’s generalization ability.

Understanding ResNet: The Essence and Applications of Residual Neural Networks

Workflow of ResNet34

3. Applications of ResNet:

Computer Vision: A field that studies how to make machines “see,” further referring to using cameras and computers to replace human eyes for tasks such as recognizing, tracking, and measuring targets, and further processing images to make them more suitable for human observation or transmission to instruments for detection.
Understanding ResNet: The Essence and Applications of Residual Neural Networks
Computer Vision
ResNet has wide and significant applications in the field of computer vision, especially in key tasks such asimage recognition, object detection, and image segmentation where it demonstrates outstanding performance.
Understanding ResNet: The Essence and Applications of Residual Neural Networks
Applications of ResNet in Computer Vision

The following are three main applications of ResNet in computer vision:

Image Recognition:: ResNet, through its deep learning and residual learning mechanisms, can accurately recognize objects, scenes, or text in images, providing strong support for image classification and recognition tasks.
Understanding ResNet: The Essence and Applications of Residual Neural Networks
Image Recognition

Object Detection:: In object detection tasks, ResNet can effectively extract features of objects in images and accurately detect and locate multiple objects in the image by combining methods such as Region Proposal Networks (RPN).

Understanding ResNet: The Essence and Applications of Residual Neural Networks
Object Detection

Image Segmentation:: For image segmentation tasks, ResNet, through its powerful feature extraction capabilities, can achieve fine segmentation of different areas in images, providing important support for applications in medical image analysis, autonomous driving, and more.

Understanding ResNet: The Essence and Applications of Residual Neural Networks
Image Segmentation

Leave a Comment