Entdecken Sie, wie ResNets das Deep Learning revolutionieren, indem sie das Problem verschwindender Gradienten lösen und ultratiefe Netzwerke für Bildanalyse, NLP und mehr ermöglichen.
Residual Networks, widely known as ResNets, are a specific type of artificial neural network (ANN) architecture designed to enable the training of extremely deep networks. Introduced by researchers at Microsoft in 2015, ResNet solved a critical bottleneck in deep learning known as the vanishing gradient problem. In traditional networks, stacking more layers often led to performance saturation or degradation because the signal required to update model weights would fade away as it propagated backward through the layers. ResNet introduced "skip connections" (or residual connections), which allow data to bypass one or more layers and flow directly to subsequent processing stages. This innovation proved that deeper networks could be trained effectively, leading to significant breakthroughs in computer vision (CV) and becoming a foundational concept for modern architectures.
The defining feature of a ResNet is the "residual block." In a standard convolutional neural network (CNN), each layer attempts to learn a direct mapping from input to output. As networks grow deeper, learning this direct mapping becomes increasingly difficult.
ResNet changes this approach by formulating the learning objective differently. Instead of hoping each stack of layers learns the entire underlying mapping, the residual block forces the layers to learn the "residual"—or the difference—between the input and the desired output. The original input is then added back to the learned residual through a skip connection. This structural change implies that if an identity mapping (passing the input unchanged) is optimal, the network can easily learn to push the residuals to zero. This makes deep learning (DL) models much easier to optimize, allowing them to scale from dozens to hundreds or even thousands of layers.
Since its inception, several variations of ResNet have become standard benchmarks in the AI community.
The robustness of ResNet architectures has made them a go-to choice for a wide array of visual tasks.
It is helpful to distinguish ResNet from other popular architectures to understand its specific utility.
Modern deep learning libraries like PyTorch make it simple to access pre-trained ResNet models. These models are invaluable for transfer learning, where a model trained on a large dataset like ImageNet is fine-tuned for a specific task.
The following Python snippet demonstrates how to load a pre-trained ResNet-50 model using
torchvision (part of the PyTorch ecosystem) and perform a simple forward pass. While users of the
Ultralytics might often use
YOLO26 for detection, understanding the underlying backbone
concepts like ResNet is crucial for advanced customization.
import torch
import torchvision.models as models
# Load a pre-trained ResNet-50 model
resnet50 = models.resnet50(weights=models.ResNet50_Weights.DEFAULT)
resnet50.eval() # Set model to evaluation mode
# Create a dummy input tensor (batch_size, channels, height, width)
input_tensor = torch.randn(1, 3, 224, 224)
# Perform a forward pass to get predictions
with torch.no_grad():
output = resnet50(input_tensor)
print(f"Output shape: {output.shape}") # Expect [1, 1000] for ImageNet classes
Although newer architectures like YOLO26 employ highly optimized structures for maximum speed and accuracy, the principles of residual learning remain ubiquitous. The concept of skip connections is now a standard component in many advanced networks, including transformers used in natural language processing (NLP) and the latest object detection models. By enabling information to flow more freely through the network, ResNet paved the way for the deep, complex models that power today's artificial intelligence.