πŸ“š Study Notes / Home / Neural Nets / Exam Notes / CNN Architectures
Exam Notes Β· W4S2

CNN Architectures

LeNet β†’ AlexNet β†’ VGG β†’ Inception β†’ ResNet. Each one fixed a specific limitation of its predecessor. Learn the key innovation of each, plus the five design rules that fall out of the story.

1 The ImageNet timeline


  • Top-5 error = % of images whose correct label is not in the model's top 5 predictions. Lower is better; human β‰ˆ 5%.
  • In 3 years CNNs went from barely competing to surpassing humans: Traditional 2011 = 26% β†’ AlexNet 16% β†’ VGG 7.3% β†’ GoogLeNet 6.7% β†’ ResNet 2015 = 3.6%.
  • Each architecture solved a specific limitation: Scale+GPU (AlexNet) β†’ Deeper (VGG) β†’ Smarter (Inception) β†’ Skip connections (ResNet).

2 LeNet-5 (1998)


  • Yann LeCun, for handwritten digit recognition (32Γ—32 input, 10 classes).
  • ~60K parameters, 5 layers, sigmoid/tanh activations.
  • Established the Conv β†’ Pool β†’ Conv β†’ Pool β†’ FC pattern.
  • The "funnel": spatial shrinks 32β†’28β†’14β†’10β†’5; channels grow 1β†’6β†’16.
  • Core principles: local connectivity (each neuron sees a small patch), weight sharing (same filter everywhere), subsampling (pooling shrinks spatial size).
  • Limitation: too small for natural 224Γ—224 images; sigmoid/tanh cause vanishing gradients when deepened.
Key innovation First working CNN β€” proved local connectivity + weight sharing + subsampling. Set the template every later net builds on.

3 AlexNet (2012)


  • Won ImageNet 2012 with 16.4% top-5 error (runner-up non-DL: 26.2%) β€” the "Big Bang" that convinced everyone NNs work at scale.
  • 5 conv + 3 FC layers (8 deep), 60M parameters, split across 2 GPUs.
  • What it changed (the combination is the lesson, not any one trick):
  • ReLU β€” ~6Γ— faster training than tanh, no saturation.
  • Dropout (0.5) in FC layers β€” regularization without more data.
  • Data augmentation β€” random crops, flips, color jitter.
  • GPU training β€” made 60M params feasible.
  • Local Response Normalization (now obsolete, replaced by BatchNorm).
Key innovation Same recipe as LeNet, 1000Γ— bigger kitchen: ReLU + Dropout + Augmentation + GPU together unlocked deep learning at scale.

4 VGGNet (2014)


  • Oxford VGG. Core idea: use only 3Γ—3 convolutions, stacked deep. VGG-16 = 13 conv + 3 FC; VGG-19 = 16 conv + 3 FC. 7.3% top-5.
  • Receptive-field equivalence: two 3Γ—3 = one 5Γ—5; three 3Γ—3 = one 7Γ—7.
  • Three 3Γ—3 vs one 7Γ—7 (same RF): 45% fewer params + 3Γ— more non-linearity β†’ more expressive.
  • Design rule: halve spatial, double channels each stage β†’ keeps per-layer compute roughly constant.
  • Downside: 138M params, of which ~124M live in the FC layers β€” very wasteful.
One 7Γ—7 filter:   7 Γ— 7 Γ— CΒ²        = 49CΒ²   (1 non-linearity)
Three 3Γ—3 filters: 3 Γ— (3 Γ— 3 Γ— CΒ²)  = 27CΒ²   (3 non-linearities)
Spatial: 224 β†’ 112 β†’ 56 β†’ 28 β†’ 14 β†’ 7
Channels:  64 β†’ 128 β†’ 256 β†’ 512 β†’ 512
Key innovation Small filters + depth beat large filters. Stacking 3Γ—3 gives the same receptive field with fewer params and more non-linearity β€” underpins all modern CNN design.

5 Inception / GoogLeNet (2014)


  • Problem (going wider): run 1Γ—1, 3Γ—3, 5Γ—5 filters in parallel and concatenate β€” but channels explode (e.g. 28Γ—28Γ—256 β†’ 28Γ—28Γ—768, and it keeps growing).
  • 1Γ—1 convolution = a fully-connected layer applied at each pixel; mixes channels without touching spatial dims. Use it to reduce channels cheaply (256 β†’ 64) before the expensive 3Γ—3/5Γ—5 β€” the bottleneck trick (squeeze then process).
  • Inception module: parallel 1Γ—1 / 3Γ—3 / 5Γ—5 / pool paths, each preceded by a 1Γ—1 reduce, concatenated depth-wise. "Don't choose the filter size β€” use them ALL and let the network decide."
  • Result: 22 layers, only 5M params (28Γ— fewer than VGG), 6.7% top-5, won ImageNet 2014. Smarter > bigger.
  • Global Average Pooling: instead of flattening into a huge FC layer, average each channel's spatial map into one number β†’ eliminates millions of params (no large FC layers).
Key innovation 1Γ—1 conv bottlenecks (cheap channel reduction) + parallel multi-scale filters + global average pooling β†’ far fewer params at higher accuracy.

6 ResNet + skip connections (2015)


  • Degradation problem: a 56-layer plain net has higher training error than a 20-layer one. This is NOT overfitting (training error itself is worse) β€” it's an optimization problem: deep plain nets can't even learn the identity in the extra layers.
  • Residual learning: instead of learning H(x) directly, learn the residual F(x) = H(x) βˆ’ x; output is F(x) + x (the skip / shortcut).
  • If the optimal map β‰ˆ identity, learning F(x)=0 (push weights to zero, easy with weight decay) is much easier than learning H(x)=x directly.
  • Why skips work: (1) gradient highway β€” gradients flow straight through the skip, no multiplication chain β†’ no vanishing; (2) easy identity baseline β€” worst case a layer does nothing, no harm; (3) ensemble effect β€” behaves like many shallow paths.
  • Basic block (ResNet-18/34): 3Γ—3 β†’ 3Γ—3 + skip. Bottleneck block (ResNet-50/101/152): 1Γ—1 reduce β†’ 3Γ—3 β†’ 1Γ—1 expand + skip (same 1Γ—1 idea as Inception).
  • ResNet-152: 3.57% top-5 β€” superhuman. Won ImageNet + COCO detection + COCO segmentation. "Deeper IS better β€” when you have skip connections."
Output = F(x) + x        F(x) = H(x) βˆ’ x  (the residual)
ResNet-18  β†’  11M  β†’ 10.9%      ResNet-101 β†’ 44M β†’ 6.0%
ResNet-34  β†’  21M  β†’  7.8%      ResNet-152 β†’ 60M β†’ 3.6%
ResNet-50  β†’  25M  β†’  6.7%
Must-know for exam Skip connection y = F(x) + x solves the degradation problem. Plain deep nets fail to optimize (not overfit); the shortcut gives a gradient highway and makes the identity trivial, enabling 152+ layers.

7 Comparison table


ArchitectureYearDepthParamsTop-5 errKey innovation
LeNet-51998560Kβ€”First CNN: conv+pool+FC, weight sharing
AlexNet2012860M16.4%ReLU + Dropout + augmentation + GPU
VGG-16201416138M7.3%Only 3Γ—3 convs, stacked deep
GoogLeNet2014225M6.7%Inception module + 1Γ—1 bottleneck + GAP
ResNet-152201515260M3.6%Skip connections (residual learning)
  • LeNetβ†’AlexNet: same recipe, 1000Γ— scale. Note GoogLeNet beats VGG with 28Γ— fewer params (5M vs 138M) β€” smarter, not bigger.

8 Architecture design rules


  1. Use small filters (3Γ—3) stacked deep β€” more non-linearity, fewer params.
  2. Halve spatial, double channels at each stage β€” keeps compute balanced.
  3. Use 1Γ—1 convs for channel reduction (bottleneck).
  4. Add skip connections when going beyond ~20 layers.
  5. Global Average Pooling instead of large FC layers at the end.
  • Conv params: each filter = K Γ— K Γ— C_in weights + 1 bias; a layer with C_out filters = C_out Γ— (K Γ— K Γ— C_in + 1) total.

β˜… Likely exam questions


Q1. Why do three stacked 3Γ—3 convs have fewer params than one 7Γ—7, despite the same receptive field?

Three 3Γ—3: 3Γ—(3Γ—3Γ—CΒ²) = 27CΒ². One 7Γ—7: 7Γ—7Γ—CΒ² = 49CΒ². That's 45% fewer, plus 3 ReLU non-linearities instead of 1, making the function more expressive.

Q2. A 56-layer plain net has higher training error than a 20-layer one. Why is this NOT overfitting?

Overfitting = low training error but high test error. Here training error itself is higher β€” the net can't even fit the training data. It's a degradation/optimization problem: deep plain nets can't learn the identity mapping in extra layers. ResNet skip connections fix it.

Q3. What is the role of 1Γ—1 convolutions in the Inception module?

They reduce channel count cheaply (e.g. 256β†’64) before expensive 3Γ—3/5Γ—5 convs. Without them, concatenating parallel paths makes channels explode at each module, making computation infeasible. A 1Γ—1 conv mixes channels per pixel without touching spatial dims.

Q4. In a residual block, if the optimal map β‰ˆ identity, why is learning F(x)=0 easier than learning H(x)=x?

Pushing all weights toward zero (F(x)=0) is trivial with weight decay/L2. Learning H(x)=x in a multi-layer block requires specific non-trivial weight patterns β€” much harder for the optimizer.

Q5. GoogLeNet has 5M params vs VGG-16's 138M, yet has better accuracy. Name two reasons.

(1) Global Average Pooling instead of large FC layers eliminates 100M+ params. (2) 1Γ—1 bottlenecks before expensive convs cut computation per Inception module dramatically.

Q6. Why couldn't LeNet-5 be applied directly to ImageNet, and what single innovation most sped up AlexNet's training?

60K params can't model 1000 classes on 224Γ—224 images β€” too little capacity. ReLU had the biggest impact on training speed (no saturation, ~6Γ— faster than tanh).

Q7. What is the difference between a Basic block and a Bottleneck block in ResNet?

Basic (ResNet-18/34): two 3Γ—3 convs + skip. Bottleneck (ResNet-50/101/152): 1Γ—1 reduce β†’ 3Γ—3 β†’ 1Γ—1 expand + skip β€” uses 1Γ—1 convs (same idea as Inception) to keep computation manageable in very deep nets.