πŸ“š Study Notes / Home / Neural Nets / Exam Notes / Why Deep Learning
Exam Notes Β· W1S1

Why Deep Learning?

From hand-crafted features to learned representations: why classical pipelines break, what the Universal Approximation Theorem really promises, and how deep nets build their own feature hierarchy.

1 The classical ML pipeline


  • Flow: Raw Data β†’ Hand-Crafted Features β†’ ML Model β†’ Prediction. The features step is the bottleneck.
  • Model quality is bounded by feature quality β€” a great model on bad features still fails.
  • Feature design needs deep domain expertise + months of iteration.
  • Every new task = build the feature pipeline from scratch (digit vs cat photo vs chest X-ray each need totally different expertise).
  • Examples: images β†’ pixel counts per region, color histograms, hand-coded edge detectors; text/audio β†’ word counts, keyword checks, pitch/loudness.

2 Where hand-crafted features break


  • Brittleness: features tuned for one setting fail when conditions change even slightly.
  • No invariance: shift or rotate an object β†’ many classical features break.
  • No transfer: features for one task/domain (medical, satellite, audio) don't carry over β€” each needs entirely new features.
  • As data complexity grows, the feature engineer becomes the bottleneck, not the algorithm.

3 The scaling problem


  • Classical ML plateaus as data grows β€” fixed features can't absorb more information.
  • Deep learning keeps scaling β€” more data β†’ better learned representations.
  • Curves cross: classical wins on small data, deep learning overtakes once data is large.

4 What if the model learned its own features?


  • Flow becomes: Raw Data β†’ Neural Network (learns features + mapping) β†’ Prediction.
  • No hand-crafted features β€” the network discovers what matters.
  • Same architecture works across images, text, audio; features improve automatically with more data.
  • Open question this raises: can a network really learn any function we need? β†’ leads to UAT.

5 Universal Approximation Theorem (UAT)


Must-know for exam Cybenko, 1989: a feedforward network with a single hidden layer and a finite number of neurons can approximate any continuous function on a compact subset of ℝⁿ to arbitrary accuracy.
  • Plain English: give it any smooth inputβ†’output relationship, a one-hidden-layer net can get arbitrarily close β€” but may need a lot of neurons.
  • NNs are universal function approximators: in principle they represent any mapping.
  • LEGO analogy: each neuron = one brick producing one simple bump/step; stack enough β†’ build any shape. More neurons = finer detail. The network learns which bricks to place and where.
  • UAT in action: 1 neuron (line-ish) β†’ 5 β†’ 20 β†’ 100 neurons progressively fit a wavy target. More neurons = better fit.
  • Caveat: the theorem guarantees existence only β€” it says nothing about how to find the right configuration.

6 The catch & the 23-year gap


What UAT does NOT tell you:

  • How many neurons (could be astronomically large).
  • How to train β€” no learning algorithm is guaranteed.
  • How to generalize β€” fitting training data β‰  working on new data.
  • How to choose the architecture (depth, width, activation).
Must-know for exam UAT proved in 1989, but deep learning only took off in 2012 (AlexNet). The missing pieces: Data (ImageNet), Compute (GPUs), and Training tricks (ReLU, Dropout, BatchNorm). The breakthrough was the combination β€” no single idea was new.

7 The big idea: representation learning


  • Deep nets build their own feature pipeline, raw pixels β†’ high-level concepts, automatically.
  • Vision hierarchy (simple β†’ complex): L1 edges/gradients β†’ L2 textures/patterns β†’ L3 parts (eyes, wheels, wings) β†’ L4–5 objects (faces, cars, birds).
  • Audio analogy: phonemes β†’ syllables β†’ words β†’ meaning. Deep networks discover these hierarchical levels on their own.

8 What a CNN actually learns (VGG16)


  • First conv layer: 64 filters of 3Γ—3 pixels; detect edges, color gradients, simple textures. Discovered, not programmed β€” they resemble hand-crafted Gabor filters but the net found them itself.
  • Depth progression: Layer 0 = raw pixels (no abstraction) β†’ Layer 7 = corners/contours β†’ Layer 14 = textures/repeating patterns β†’ Layer 28 = class-specific parts (eyes, wheels, feathers).
Must-know for exam Early layers are generic (an airplane and a frog share the same edge detectors); deep layers are class-specific. This is why early features transfer across tasks/domains.

9 The power of learned features


FeaturesModelAccuracy
Raw pixelsLogistic Regression31%
Raw pixelsRandom Forest42%
VGG features (pretrained)Logistic Regression84%
  • Same data; only difference is better features.
  • A simple classifier on learned features beats a complex classifier on raw data β€” that's representation learning.

β˜… Likely exam questions


Q1. Why do raw pixel features fail for image classification?

Raw pixels have no spatial structure β€” a one-pixel shift produces a completely different feature vector. They also lack invariance to rotation, scale, and lighting.

Q2. True or False: "Adding more features always improves model performance."

False. More features can add noise, redundancy, and the curse of dimensionality. Without careful selection, extra features often hurt performance.

Q3. State the Universal Approximation Theorem and one thing it does NOT guarantee.

A single-hidden-layer feedforward net with finitely many neurons can approximate any continuous function on a compact subset of ℝⁿ to arbitrary accuracy (Cybenko, 1989). It does NOT tell you how many neurons, how to train, how to generalize, or how to choose the architecture β€” it only guarantees existence.

Q4. Why did it take 23 years (1989 β†’ 2012) for deep learning to take off?

UAT guaranteed existence but the enablers were missing: large Data (ImageNet), Compute (GPUs), and Training tricks (ReLU, Dropout, BatchNorm). AlexNet's win came from combining these, not from one new idea.

Q5. Why does classical ML plateau while deep learning keeps improving as data grows?

Classical models use fixed hand-crafted features that can't absorb more information, so performance saturates. Deep nets learn richer representations from more data, so accuracy keeps rising.

Q6. What's the difference between early and deep layers of a CNN, and why does it matter?

Early layers learn generic features (edges, gradients) shared across all classes; deep layers learn class-specific parts. Because early features are generic, they transfer across tasks/domains (basis of transfer learning).