VGG: Stacks of Small Filters
Depth from simple 3x3 blocks.
VGG: Stacks of Small Filters is a free Deep Learning Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Deep Learning Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
One Filter Size to Rule
VGG made a bold bet: use only tiny 3x3 convolutions everywhere, and just stack a lot of them.
Why Small Wins
Two stacked 3x3 layers see the same area as one 5x5, but with fewer parameters and an extra nonlinearity in between.
Depth Over Width
Instead of fat layers, VGG chose to go deep, reaching 16 or 19 layers and learning richer feature hierarchies.
Uniform and Predictable
Every conv keeps the same padding and size, so shapes stay easy to reason about. This uniformity made VGG simple to copy.
Pool to Shrink
After each block of convs, a 2x2 max pool halves the spatial size while doubling the channel count.
import torch.nn as nn
pool = nn.MaxPool2d(kernel_size=2, stride=2)A VGG Block
The repeating unit is conv, ReLU, conv, ReLU, pool. Chain these blocks and you have most of VGG.
import torch.nn as nn
block = nn.Sequential(nn.Conv2d(64, 128, 3, padding=1), nn.ReLU(), nn.MaxPool2d(2))A Heavy Classifier Head
VGG ends with three large dense layers. They hold most of its weights, which is why the model is so big on disk.
The Memory Cost
That elegance has a price: VGG is slow and memory-hungry. Beauty in design did not mean cheap to run.
A Strong Feature Extractor
Even today, VGGs early layers make excellent reusable features for transfer learning and style transfer.
Build It with Loops
Because the pattern repeats, you can generate VGG from a config list, looping to add each layer programmatically.
cfg = [64, 64, "M", 128, 128, "M"]
# "M" means insert a max-pool hereThe Lasting Lesson
VGGs gift was a clear principle: prefer many small filters over a few large ones. Modern nets still follow it.
Quick Check
Recall the central design choice behind VGG.
Recap: Small but Mighty
VGG proved that depth built from simple 3x3 blocks beats clever big filters. Simple, repeatable, and influential. Well done!
Frequently asked questions
Is the “VGG: Stacks of Small Filters” lesson free?
Yes — the full text of “VGG: Stacks of Small Filters” is free to read here on the web, and the Deep Learning Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Deep Learning Academy course, upgrade to CoddyKit PRO.
What will I learn in “VGG: Stacks of Small Filters”?
Depth from simple 3x3 blocks. You practise Deep Learning Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Deep Learning Academy?
No prior experience is required. Deep Learning Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “VGG: Stacks of Small Filters” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Deep Learning Academy lesson?
Yes. Every Deep Learning Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- LeNet & AlexNet: The First Wins
- VGG: Stacks of Small Filters
- ResNet: Skip Connections Go Deep
- Load torchvision Models