AI State of the Art
Fundamentals/Deep Learning: Fundamental Architectures/23 min
Section 18

Classic CNN Architectures: LeNet, AlexNet, VGG, ResNet

Listen as a podcast →

Why tell the history of CNNs?

Imagine you're asked to recognize handwritten digits. You'd simply see the shapes, the curves, effortlessly. For a computer, it's complicated. Traditional neural networks see giant lists of numbers and lose the notion that the image is "an image". Convolutional Neural Networks (CNNs) preserve the spatial structure, the mechanism is explained in CNN: seeing with convolutions. Understanding how CNNs improved since 1998 means understanding how we progressed from "it kind of works" to "it rivals humans".

How to read the numbers on this page

The scores quoted here are top-5 errors on the ImageNet competition (ILSVRC, ImageNet Large Scale Visual Recognition Challenge). Top-5 means the model offers its five most likely labels and is only counted wrong if the correct answer is in none of them. One caveat: the best published results are usually obtained with an ensemble of several networks and several crops of the same image, not with a single network. A single network always does slightly worse than the headline figure.

LeNet-5 (1998): the first victory

Architecture of the LeNet-5 network
This image illustrates the architecture of the LeNet-5 convolutional neural network, a pioneer in handwritten image recognition. It shows the different convolution, subsampling, and fully connected layers typical of CNNs.Source : Towards AI

The pioneer that changed the game

Yann LeCun created LeNet-5 to recognize handwritten digits on bank checks. Simple? Yes. Revolutionary? Absolutely. It was the proof that convolutions (filters that slide over the image) capture visual patterns better than a standard network.

How does it work?

LeNet-5 is tiny compared to today's standards: 32x32 pixels (black and white images), 2 layers looking at 5x5 patterns, then 3 layers that classify: ~60,000 parameters. For 1998, that was a feat.

The key ideas:

  • Weight sharing: the same filter is applied everywhere in the image, reducing parameters
  • Convolutions: capture edges, textures, spatial patterns
  • Hierarchical learning: low layers see simple strokes, high layers combine them
Why CNNs didn't explode immediately

LeNet worked! But computers were slow and data was scarce. Graphics cards already existed, but nobody could yet use them for general-purpose computation: CUDA, NVIDIA's toolkit that made GPUs (Graphics Processing Units) programmable for something other than display, only shipped in 2007. So deep learning slept for about fifteen years. It took two things arriving together: GPUs usable for training, and annotated images in enormous quantity thanks to the Internet, which is exactly what ImageNet supplied.

AlexNet (2012): the awakening

Diagram of the AlexNet architecture
This image illustrates the architecture of the AlexNet convolutional neural network, which won the ImageNet challenge in 2012. It shows the progression of convolution layers (C1 to C5) followed by fully connected layers (FC6 to FC8).Source : Viso.ai

2012, it explodes

AlexNet crushed the ImageNet competition with a top-5 error of 15.3% against 26.2% for the runner-up, which used the earlier methods. Suddenly, everyone said: "oh, deep learning is actually useful now?"

Why AlexNet won

It was 1,000 times larger than LeNet, 60 million parameters against 60,000: 224x224 color pixels, 5 convolutional layers, 60 million parameters. But above all, three major innovations:

  • ReLU (Rectified Linear Unit): instead of the sigmoid, which is slow to train, apply max(0, x), negative values go to zero, positive values pass through unchanged. The authors measured that a 4-layer convolutional network reaches 25% training error on CIFAR-10 six times faster with ReLUs than with tanh units.
  • Dropout: during training, half the neurons in the dense layers are switched off on each pass. This forces the network to distribute information redundantly, reducing overfitting
  • Data augmentation: cropping, flipping, altering the colors of images to virtually get many more

And: 2 GPUs for parallelization, the model did not fit in the memory of a single card of that era.

The domino effect

ImageNet 2012 changed the trajectory of AI. As early as the next edition of the competition, in 2013, nearly every entrant was using deep networks. Within a few years deep learning went from fringe topic to the default method in computer vision.

VGGNet (2014): the simplicity of depth

Detailed VGGNet architecture
This image illustrates the VGGNet architecture, a deep convolutional neural network (CNN). It shows the different convolution layers (conv1 to conv5), pooling layers (max pooling), and fully connected layers (fc6 to fc8) with their respective dimensions.Source : Viso.ai

A simple idea: stack deep

VGG said: "what if we took tiny filters (3x3 only) and stacked a lot of them?" Two 3x3 convolutions one after the other see the same area of the image as a single 5x5 (receptive fields add up: 3 + 2 = 5), but with two non-linearities instead of one, hence more expressive capacity, and fewer weights: 2 x 9 = 18 against 25. VGG-16 and VGG-19 (16 and 19 layers) became stars.

The secret: regularity

The architecture is dead simple:

  • 3x3 filters, nothing else for convolution
  • Blocks: 2-4 3x3 convolutions, then max pooling
  • The number of filters doubles each block (64 → 128 → 256 → 512)
  • ~138 million parameters for VGG-16

The cost of simplicity

VGG is enormous. The step from the last feature map to the first dense layer alone accounts for more than 100 million parameters, most of the network. It's a brick wall, not a feather. Despite this, VGG long remained a standard starting point for "extracting features" from an image, because its representations in the low layers are universal. That is the principle of transfer learning.

GoogLeNet / Inception (2014): doing multiple things in parallel

GoogLeNet architecture with Inception layers
Diagram of the GoogLeNet architecture illustrating the Inception modules that combine multiple convolution and pooling operations in parallel to extract features at different levels.Source : Viso.ai

The inverted idea

Google said: "instead of stacking deep, let's go wide: apply multiple convolutions in parallel on the same input."

An Inception block simultaneously performs:

  • 1x1 convolution (inexpensive, reduces the number of channels)
  • 3x3 convolution (captures medium-scale patterns)
  • 5x5 convolution (captures large-scale patterns)
  • 3x3 max pooling

All results are concatenated. It's like looking at the same scene with multiple camera lenses of different focal lengths at the same time, then combining what each one sees.

The result is striking: GoogLeNet edges past VGG with only about 5 million parameters. That figure comes from the paper itself, which reports 12 times fewer parameters than AlexNet: 60 million / 12 = 5 million. Against VGG's 138 million, that is 27 times fewer. This isn't magic, it's proof that a well-designed architecture can do more with much less. Where VGG went at it by brute force, Inception did slightly better through a leaner design.

ResNet (2015): the connections that save

Comparison of ResNet, plain ResNet, and VGG-19 architectures
The image illustrates ResNet architectures (with residual connections), plain ResNet (without residual connections), and VGG-19, highlighting the impact of residual connections on the depth of convolutional neural networks.Source : Sik-Ho Tsang, Medium

The weird problem of 2015

Deeper = better? No! Beyond a few dozen layers, adding layers degraded results, even on the training data. So it was not overfitting, just... optimization became impossible. The error signal, travelling back layer by layer, was multiplied by factors smaller than 1 and eventually died out: this is the vanishing gradient, covered in detail in Backpropagation.

The elegant solution: residual connections

Kaiming He had a simple idea: instead of asking a block of layers to compute the desired output directly, ask it to compute only the difference from the input (the "residual"), then add the input back:

y=F(x)+xy = F(x) + x

Every symbol: xx is what goes into the block of layers; F(x)F(x) is what the block computes, i.e. the correction it proposes; yy is what comes out of the block. In one sentence: the block's output is its input plus a correction, instead of a value rebuilt from nothing. The direct path that short-circuits the block is called a residual connection, or a skip connection.

Two consequences. First, a block that is useless now only has to learn F(x)=0F(x) = 0 to make itself transparent, which is easy: adding layers can no longer make the network worse. Second, on the way back, the direct path carries the gradient without multiplying it by the block's weights, hence without attenuating it. 152 layers of depth become possible.

Deep Residual Learning for Image Recognition

ResNet variants

ResNet-18/34/50/101/152: the number gives the depth, i.e. the layer count. The deeper ones use bottleneck blocks: 1x1 → 3x3 → 1x1. First reduce the number of channels with a 1x1 convolution, apply the expensive 3x3 convolution to that compressed version, then return to the original channel count with another 1x1. Same job, far less computation.

ResNet beat the human reference on ImageNet

The ResNet paper reports a top-5 error of 3.57% on ImageNet in 2015, obtained with an ensemble of several networks; a single ResNet-152 is somewhat above that. The human reference usually quoted for this task is 5.1%, measured by Russakovsky and colleagues on a trained human annotator picking among the 1,000 categories. For the first time a machine did better than a person on this precise protocol, which is not the same as seeing better in general. And residual connections became the foundation of almost all modern architectures, well beyond CNNs: they sit inside every transformer block.

Summary table: the visible evolution

ArchitectureYearDepthParametersTop-5 Error
LeNet-51998760K–
AlexNet2012860M15.3%
VGG-16201416138M7.3%
GoogLeNet2014225M6.7%
ResNet-152201515260M3.6%

(Top-5 errors on ImageNet as reported by each paper, see the caveat at the top of this page about model ensembles.)

The trend

This table tells a clear story: depth and size alone aren't enough. VGG has 28 times more parameters than GoogLeNet (138 / 5) and does slightly worse. ResNet is deep but smart, 152 layers become possible thanks to residual connections, not despite them. Architectural efficiency has become a criterion as important as raw accuracy.

After ResNet, the same logic continued: DenseNet extended residual connections to all preceding layers, EfficientNet systematically balanced width, depth, and resolution, and Vision Transformers, from 2020 onward, abandoned convolutions in favor of attention, they are the ones leading large vision tasks today. Each one solves the previous one's problem. All build on what came before.

Today

In practice, you'll never train these models from scratch. You'll download them pre-trained on ImageNet and adapt them to your task in a few hours: that's transfer learning, the normal way to do computer vision since the mid-2010s. One point of calendar: the architectures on this page are still used as a starting point, but for tasks with plenty of data the usual starting point is now a Vision Transformer rather than a ResNet.

Check your understanding0 / 5

1. A paper reports a « top-5 error of 3.57% » on ImageNet. How should you read that number?

2. LeNet-5 already worked in 1998. Why did deep learning then sleep for about fifteen years?

3. Why does VGG stack two 3x3 convolutions instead of using a single 5x5 one?

4. Before ResNet, adding layers beyond a few dozen made results worse. What was the cause?

5. ResNet reached 3.57% top-5 error against a human reference of 5.1%. What can you conclude?