Phase 3: Deep Learning Core · 60 min · PyTorch · torchvision
CNNs for Computer Vision
Convolutions encode a prior: nearby pixels relate, and features repeat. That prior is why CNNs win on images.
Hiring signal: Understands convolutional inductive bias and uses transfer learning effectively
What you will learn
- Explain convolution, filters, stride, padding, and pooling
- Describe the inductive biases of CNNs vs fully-connected nets
- Build a small CNN in PyTorch and reason about feature-map shapes
- Apply transfer learning with a pretrained backbone
- Use data augmentation to fight overfitting on images
The Problem
Flatten a 224×224 RGB image and feed it to a fully-connected net: the first layer alone needs ~150,000 weights per neuron, ignores the 2D structure entirely, and has to relearn "an edge" separately in every position. It overfits and barely works. Convolutional neural networks fix this with a structural prior tuned to images — and even though transformers now compete in vision, CNNs remain the workhorse for most practical image tasks and a standard interview topic. The trap is using them as a black box without understanding why the convolution is the right inductive bias.
The Concept
A convolution slides a small learnable filter across the image, computing a dot product at each position. This builds in two assumptions that match how images work:
Locality : a pixel's meaning comes from its neighbors -> small filters
Translation equiv.: a cat is a cat anywhere -> SHARE the filter across positions
Weight sharing is the magic: one 3×3 filter (9 weights) detects its pattern everywhere, so the network has far fewer parameters and generalizes across position.
A fully-connected layer processing a 224×224 image has 224×224×128 = 6.4M weights (one per pixel per neuron). A 3×3 conv with 128 filters has only 3×3×128 = 1,152 weights. Why does the conv still work well?
A conv filter slides across the image, applying the same 9 weights at every position. This weight sharing means the network learns a pattern detector that works regardless of location — which is exactly the translation invariance we want in vision. Far fewer parameters, better generalization.
Filter / kernel : small weight grid (e.g., 3×3) learned to detect a pattern
Stride : step size of the slide (2 = downsample by half)
Padding : add border so output keeps spatial size
Pooling : downsample (max/avg) -> shrink maps, add invariance
Channels : stack many filters -> many feature maps per layer
Stacked layers learn a hierarchy: edges → textures → parts → objects.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Build It, Use It, Ship It, Evaluation, Exercises, Key Terms, Common Pitfalls, Interview Framing — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy