CNN Architectures

GATE Relevance: High

🎯 Learning Objectives

  • Trace the historical evolution of CNN architectures from LeNet-5 to EfficientNet
  • Understand the key innovation behind each architecture
  • Count parameters in convolutional and fully-connected layers
  • Calculate receptive fields across stacked convolutional layers
  • Explain residual connections and why they solve the vanishing gradient problem
  • Compare architectures by depth, parameter count, and accuracy

1. Evolution of CNN Architectures

CNN architectures have evolved rapidly since the late 1990s. The major trend has been increasing depth while adding architectural innovations to make deeper networks trainable. ImageNet Large-Scale Visual Recognition Challenge (ILSVRC) results drove much of this progress.

Timeline: LeNet-5 (1998) → AlexNet (2012) → VGGNet (2014) → GoogLeNet (2014) → ResNet (2015) → DenseNet (2017) → MobileNet (2017) → EfficientNet (2019)

2. Parameter Counting

Conv Layer Parameters: For a convolutional layer with Cin input channels, Cout output channels (filters), and kernel size k × k:
Params = Cout × (Cin × k × k + 1)
The +1 accounts for the bias term per filter.
FC Layer Parameters: For a fully-connected layer with nin input neurons and nout output neurons:
Params = nout × (nin + 1)

Example — Parameter Count

Conv layer: 64 filters, 3×3 kernel, 3 input channels:

Params = 64 × (3 × 3 × 3 + 1) = 64 × 28 = 1,792

FC layer: 4096 inputs, 1000 outputs:

Params = 1000 × (4096 + 1) = 4,097,000

3. Receptive Field Calculation

Definition — Receptive Field: The region in the input image that influences a particular neuron in a deeper layer. Larger receptive fields let the network capture more global context.
Receptive Field Formula (layer by layer): Starting from layer L back to the input, if layer l has kernel kl and stride sl:
rl−1 = rl + (kl − 1) × ∏j=1l−1 sj
With rL = 1 at the deepest layer. For a simpler sequential stack with all strides = 1:
RF = 1 + ∑l (kl − 1)

Example — Three stacked 3×3 conv layers (stride 1)

RF = 1 + (3−1) + (3−1) + (3−1) = 1 + 2 + 2 + 2 = 7

Three 3×3 layers have the same receptive field as one 7×7 layer but with far fewer parameters: 3 × (C × 3 × 3 × C) = 27C² vs 1 × (C × 7 × 7 × C) = 49C².

4. LeNet-5 (1998)

Designed by Yann LeCun for handwritten digit recognition (MNIST). One of the first successful CNNs.

LayerConfigOutputParams
Input—32 × 32 × 1—
Conv16 filters, 5×528 × 28 × 6156
AvgPool12×2, stride 214 × 14 × 60
Conv216 filters, 5×510 × 10 × 162,416
AvgPool22×2, stride 25 × 5 × 160
FC1120 neurons12048,120
FC284 neurons8410,164
Output10 neurons10850

Total: ~61,706 parameters. Key features: used average pooling and tanh/sigmoid activations (ReLU was not yet popular).

5. AlexNet (2012)

Won ILSVRC 2012 with a dramatic drop in top-5 error (26.2% → 15.3%). Launched the deep learning revolution in computer vision.

Key Innovations:
  • ReLU activation instead of sigmoid/tanh — faster training, reduces vanishing gradients
  • Dropout (p = 0.5) in FC layers for regularisation
  • Data augmentation (random crops, horizontal flips, colour jitter)
  • Trained on 2 GPUs with model parallelism
  • Local Response Normalisation (LRN) — later superseded by Batch Norm

Architecture: 5 conv layers + 3 FC layers. Input: 227 × 227 × 3. ~60 million parameters. Most parameters are in FC layers (FC6 alone has ≈ 37M parameters).

6. VGGNet (2014)

Key idea: use only 3 × 3 convolutions stacked deeply. Simple, uniform architecture.

VGG Design Principle: Replace large filters with stacks of small 3×3 filters. Three 3×3 conv layers have a 7×7 receptive field but only 27C² parameters vs 49C² for a single 7×7 layer, plus three non-linearities instead of one.
BlockVGG-16 LayersVGG-19 LayersFiltersOutput
Block 12 × Conv3-642 × Conv3-6464112 × 112
Block 22 × Conv3-1282 × Conv3-12812856 × 56
Block 33 × Conv3-2564 × Conv3-25625628 × 28
Block 43 × Conv3-5124 × Conv3-51251214 × 14
Block 53 × Conv3-5124 × Conv3-5125127 × 7
FC layersFC-4096, FC-4096, FC-1000—1000

VGG-16: ~138M parameters. VGG-19: ~144M parameters. Most parameters still in FC layers.

⚠ Drawback: Very memory-intensive due to large feature maps and massive FC layers. Slow to train and deploy.

7. GoogLeNet / Inception (2014)

Won ILSVRC 2014. Introduced the Inception module — parallel branches with different filter sizes concatenated together.

Inception Module: Four parallel branches in each module:
  1. 1 × 1 convolution
  2. 1 × 1 conv → 3 × 3 conv
  3. 1 × 1 conv → 5 × 5 conv
  4. 3 × 3 max pool → 1 × 1 conv
Outputs are concatenated along the channel dimension. The 1 × 1 convolutions act as bottleneck layers to reduce dimensionality before expensive 3×3 and 5×5 operations.

Example — 1×1 Convolution as Bottleneck

Input: 28 × 28 × 192. Apply 5×5 conv with 32 filters directly:

Params = 32 × (192 × 5 × 5 + 1) = 153,632

With bottleneck: 1×1 conv to 16 channels, then 5×5 conv with 32 filters:

Params = 16 × (192 + 1) + 32 × (16 × 25 + 1) = 3,088 + 12,832 = 15,920

Reduction: ~10× fewer parameters!

GoogLeNet: 22 layers deep, only ~5M parameters (27× fewer than AlexNet). Uses Global Average Pooling instead of FC layers at the end, drastically reducing parameter count. Also uses auxiliary classifiers during training to combat vanishing gradients.

8. ResNet (2015)

Won ILSVRC 2015. Key breakthrough: residual connections (skip connections) that enable training of extremely deep networks (up to 152+ layers).

Residual Block: Instead of learning a mapping H(x), the network learns the residual F(x) = H(x) − x, so the output is:
y = F(x) + x
The identity shortcut x is added to the output of stacked layers. If the optimal mapping is close to identity, it is easier to learn F(x) ≈ 0 than to learn H(x) ≈ x.
Why It Works: Skip connections create “gradient highways” that allow gradients to flow directly from deep layers to shallow layers during backpropagation. This mitigates the vanishing gradient problem in very deep networks.

Bottleneck Block (ResNet-50+)

For deeper variants, a bottleneck design is used: 1×1 conv (reduce channels) → 3×3 conv → 1×1 conv (expand channels). This reduces computation while maintaining capacity.

ModelLayersBlock TypeParamsTop-5 Error
ResNet-1818Basic (2-layer)11.7M10.92%
ResNet-3434Basic (2-layer)21.8M10.15%
ResNet-5050Bottleneck (3-layer)25.6M7.71%
ResNet-101101Bottleneck (3-layer)44.5M7.10%
ResNet-152152Bottleneck (3-layer)60.2M6.71%

9. DenseNet (2017)

Takes skip connections to the extreme: every layer is connected to every subsequent layer within a dense block.

Dense Connectivity: Layer l receives feature maps from all preceding layers [x0, x1, …, xl−1] concatenated along the channel dimension. Each layer adds k new feature maps (the growth rate k is typically 12–32).

Advantages: Feature reuse, stronger gradient flow, fewer parameters than ResNet for similar accuracy. Transition layers (1×1 conv + 2×2 avg pool) between dense blocks reduce spatial dimensions and channel count.

10. MobileNet (2017)

Designed for mobile and embedded devices. Uses depthwise separable convolutions to dramatically reduce computation.

Depthwise Separable Convolution: Factorises a standard convolution into two steps:
  1. Depthwise convolution: One k × k filter per input channel — spatial filtering only. Params = Cin × k × k.
  2. Pointwise convolution: 1 × 1 conv to combine channels. Params = Cin × Cout.

Example — Computation Saving

Standard conv: Cin = 64, Cout = 128, k = 3.

Standard params = 128 × 64 × 3 × 3 = 73,728

Depthwise separable params = 64 × 9 + 64 × 128 = 576 + 8,192 = 8,768

Reduction factor ≈ 73,728 / 8,768 ≈ 8.4×

General reduction: 1/Cout + 1/k² ≈ 1/k² for large Cout (about 8–9× for 3×3 kernels).

11. EfficientNet (2019)

Uses compound scaling to uniformly scale network depth, width, and resolution with a fixed ratio.

Compound Scaling: Given a coefficient φ:
Depth: d = αφ,   Width: w = βφ,   Resolution: r = γφ
Subject to α · β² · γ² ≈ 2 (to roughly double FLOPs). The base EfficientNet-B0 uses neural architecture search (NAS) for the baseline architecture.

EfficientNet-B7 achieves state-of-the-art accuracy on ImageNet (84.3% top-1) with 8.4× fewer parameters than the best GPipe model at the time.

12. Architecture Comparison

ArchitectureYearDepthParamsKey InnovationTop-5 Err.
LeNet-519987~60KFirst practical CNNN/A (MNIST)
AlexNet20128~60MReLU, Dropout, GPU training15.3%
VGG-16201416138MUniform 3×3 filters7.3%
GoogLeNet2014225MInception module, GAP6.7%
ResNet-5020155025.6MSkip connections7.7%
ResNet-152201515260.2MDeep residual learning6.7%
DenseNet-12120171218MDense connectivity~7.0%
MobileNet-v12017284.2MDepthwise separable conv~10.5%
EfficientNet-B02019—5.3MCompound scaling + NAS~6.4%

13. Summary

  • LeNet-5 pioneered CNNs for digit recognition.
  • AlexNet proved deep CNNs could win large-scale competitions with ReLU, Dropout, and GPU acceleration.
  • VGGNet showed that depth with small 3×3 filters outperforms shallow networks with large filters.
  • GoogLeNet introduced Inception modules and 1×1 bottleneck convolutions to reduce parameters.
  • ResNet solved the degradation problem with skip connections, enabling 100+ layer networks.
  • DenseNet maximises feature reuse with dense connectivity within blocks.
  • MobileNet uses depthwise separable convolutions for mobile deployment.
  • EfficientNet balances depth, width, and resolution via compound scaling.
  • Parameter counting: Conv params = Cout × (Cin × k² + 1); FC params = nout × (nin + 1).
  • Receptive field (all strides 1): RF = 1 + ∑(kl − 1).