🖼️ Convolutional Neural Networks
294 words
1 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# 🖼️ Convolutional Neural Networks ## 1. 🎯 Learning Objectives - Compute convolution output dimensions: $(n+2p-f)/s + 1$ - Explain the purpose of padding and stride - Compare pooling types: max vs average - Identify key architectural innovations in LeNet, AlexNet, VGG ## 2.

🖼️ Convolutional Neural Networks
1. 🎯 Learning Objectives
- Compute convolution output dimensions: (n+2p−f)/s+1
- Explain the purpose of padding and stride
- Compare pooling types: max vs average
- Identify key architectural innovations in LeNet, AlexNet, VGG
2. 📖 Core Content
3.1 Convolution Operation
A convolution applies a kernel (filter) across the input:
3.2 Output Size Formula
Hout=⌊sHin+2p−f+1⌋Where:
- Hin: Input height
- f: Filter/kernel size
- p: Padding
- s: Stride Example: Input 32×32, filter 5×5, padding 0, stride 1: (32+0-5)/1+1 = 28. Output: 28×28.
3.3 Padding
- Valid padding (p=0): No padding. Output smaller than input.
- Same padding: p=(f−1)/2. Output same size as input.
- Only possible with odd filter sizes (3, 5, 7...).
3.4 Stride
Stride s > 1 downsamples the input. Higher stride = smaller output.
3.5 Pooling
Max pooling: Take maximum value in each window. Average pooling: Take average value in each window.
Typically 2×2 with stride 2: halves spatial dimensions.
3.6 CNN Architectures
| Architecture | Year | Key Innovation | Parameters |
|---|---|---|---|
| LeNet-5 | 1998 | First successful CNN | 60K |
| AlexNet | 2012 | Deep CNN + ReLU + Dropout + GPU | 60M |
| VGG-16 | 2014 | Very deep (16 layers), 3×3 conv only | 138M |
| GoogLeNet | 2014 | Inception modules, efficient | 4M |
| ResNet | 2015 | Skip connections (residual blocks) | 25M |
4. 📝 Practice Questions
Q1: Input 224×224×3, filters 64 of size 7×7, padding 3, stride 2. Output size?Answer: H_out = (224 + 2×3 - 7)/2 + 1 = (224+6-7)/2 + 1 = 223/2 + 1 = 111.5 + 1 = 112 (assuming integer division). Actually: (224+6-7)/2 + 1 = 223/2 + 1 = 111.5 + 1 = 112.5 → floor 112. Output: 112×112×64. Join Discord PreviousCNN OperationsNextCNN Architectures