LECTURE PROGRESS
Introduction
out

📚 Lecture Script · Deep Learning Fundamentals

Why Neural
Networks?

A 2-hour journey from a single biological neuron all the way to CNNs, RNNs, and the architecture of modern AI — built for beginners, rich with analogies.

Perceptrons Artificial Neural Networks Convolutional Neural Networks Recurrent Neural Networks

Lecture Roadmap

00Welcome & Framing0:00 01The McCulloch–Pitts Neuron0:10 02The Perceptron0:25 03Where Perceptron Fails0:45 04Multi-Layer ANN1:00 05Forward Propagation1:15 06Why Backpropagation?1:30 07Text, Speech, Images1:45 08CNN, RNN & Big Picture1:55
SECTION 00
Welcome & Why Are We Here?
⏱ 0:00 – 0:10 · 10 min

Good [morning/afternoon], everyone. Before we dive in, I want to start with a very human question: Why does your phone recognize your face? Why can you talk to a speaker on your kitchen counter and it understands you? Why can a program beat world champions at chess, Go, and StarCraft?

The answer isn't magic. It's a set of ideas that started in the 1940s — ideas borrowed directly from how your brain works. By the end of today, you'll understand those ideas from the ground up. We start incredibly small — with one fake neuron — and build piece by piece until we can see why the massive networks powering modern AI are designed the way they are. Every step will make logical sense.

🍳 OPENING ANALOGY
Think of today's lecture like building a recipe for intelligence. We start with one ingredient — a single artificial neuron — and by the end we have a full dish. Each ingredient we add will solve a problem the previous version couldn't.
🎙 SPEAKER NOTE
Ask: "Raise your hand if you've used a voice assistant this week. Keep it up if you know roughly how it works." The contrast gets a laugh and sets up the motivation.
SECTION 01
The McCulloch–Pitts Neuron
⏱ 0:10 – 0:25 · 15 min

Let's go back to 1943. Two scientists — Warren McCulloch, a neuroscientist, and Walter Pitts, a mathematician — asked a wild question: Can we model what a brain cell does using pure math?

A neuron in your brain receives signals through dendrites, collects them in the soma, and if the total signal is strong enough, it fires — it sends a signal down the axon to the next neuron. McCulloch and Pitts built a math version of that.

The model: inputs are either 0 or 1. We add them all up. If the sum crosses a threshold (θ), the neuron fires (output = 1). Otherwise it stays silent (output = 0).

🧠 Interactive — McCulloch–Pitts NeuronTOUCH / CLICK

Toggle each input ON or OFF. Change the threshold. Watch the neuron fire or stay silent.

INPUTS (click to toggle)
2
Sum = 2  /  θ = 2
🔥 NEURON FIRES! Output = 1

Fig 1.1 — The McP neuron. Inputs are 0 or 1. Sum crosses threshold → fires. Even this tiny model can compute AND, OR, NOT logic!

The McP Neuron in Friendly Math
Output = 1  if  (x₁ + x₂ + x₃ + ...) ≥ θ
Output = 0  otherwise
→ Add up the inputs. Compare to a threshold. Decide yes or no. That's it.
🍸 ANALOGY — The "Party Rule"
Imagine you open your door if at least 3 friends ring. Each friend ringing = input of 1. Threshold = 3. That's a McCulloch–Pitts neuron.
⚠️ BIG LIMITATION
No learning. The threshold θ is set by hand. Every input weight is the same — 1. It's a fixed rule machine, not a learning machine. This is where our journey gets interesting…
SECTION 02
The Perceptron — Weights & Learning
⏱ 0:25 – 0:45 · 20 min

Frank Rosenblatt (1957) makes one crucial upgrade: weights. Each input gets a number — a weight — saying how much to trust it. When deciding whether to carry an umbrella, "is it already raining?" matters far more than "is the sky slightly cloudy?"

The second upgrade: the perceptron can learn those weights by itself. It looks at examples, makes a prediction, sees if it's wrong, and nudges the weights to do better. This is the core idea of machine learning.

The perceptron draws a decision line — everything on one side is YES, the other NO. Try dragging the weights below and watch the line move.

⚖️ Interactive — Perceptron Decision BoundaryDRAG SLIDERS

Adjust weights and bias to move the decision boundary. See how a perceptron draws a straight line to separate two classes.

1.5
-1.0
0.0
Line: 1.5·x₁ + -1.0·x₂ + 0.0 = 0
Class A   Class B

Fig 2.1 — The perceptron draws one straight line. Points above = one class, below = another. The weights control the line's angle, the bias shifts it up/down.

The Perceptron — Two Key Equations
z = (w₁·x₁) + (w₂·x₂) + ... + b
output = 1 if z ≥ 0, else 0
→ z is the "score". Positive = lean YES. Negative = lean NO. The line is exactly where z = 0.
⚖️ ANALOGY — The Weighted Jury
Three jurors vote, but not one-person-one-vote — the senior judge's opinion counts 0.8, the junior's 0.3, the expert's 0.5. Total score crosses a threshold → GUILTY. After each wrong verdict, their influence weights are adjusted.
💡 KEY INSIGHT
The perceptron draws a straight line (or flat plane in higher dimensions) to separate two classes. Keep this image — it's the key to understanding why perceptrons fail.
SECTION 03
Where the Perceptron Fails — The XOR Problem
⏱ 0:45 – 1:00 · 15 min

In 1969, Minsky and Papert dropped a bombshell: a single perceptron cannot solve XOR. XOR outputs 1 if inputs are different, 0 if they're the same: (0,1)→1, (1,0)→1, but (0,0)→0 and (1,1)→0.

Plot those four points. Can you draw one straight line separating the 1s from the 0s? Try below — you literally can't. The 1s are diagonally opposite. This killed research funding for a decade — the "AI winter."

But the conclusion wasn't that neural networks were bad. It was that one layer isn't enough. The solution was right there: use more layers.

🚫 Interactive — XOR: Try to Draw a LineDRAG THE LINE

Drag the line endpoints — try to separate ✓ (output=1) from ✕ (output=0). You'll find it's impossible!

Accuracy: 50% — try harder!

Fig 3.1 — No single straight line can separate XOR. Two lines (two hidden neurons) working together carve out exactly the right region.

🗺️ ANALOGY — Drawing a Border
Draw one road to separate checkerboard-patterned villages (red-blue-red-blue alternating). You can't. You need two roads that together carve a region. That's what a multi-layer network does — multiple boundaries creating complex shapes.
"A single perceptron can't solve XOR. But two can. The question was never whether neurons could learn — it was how many layers they needed."
SECTION 04
Multi-Layer Perceptrons & Activation Functions
⏱ 1:00 – 1:15 · 15 min

Stack perceptrons in layers — that's an ANN. Three layer types: Input (raw data, no computation), Hidden (where the thinking happens), Output (final answer).

But there's one crucial ingredient: activation functions. The step function — fire or don't fire — is terrible for learning. We replace it with smoother functions. Without non-linearity, 100 stacked layers would mathematically collapse into one. Non-linearity is what gives deep networks their power.

Explore the four main activation functions below, then drag the point to feel how each one responds.

📈 Interactive — Activation Functions ExplorerDRAG POINT / TAP TABS

← Drag the dot left/right to explore the function

CURRENT FUNCTION
Sigmoid
σ(z) = 1/(1+e⁻ᶻ)

INPUT z =
0.00
OUTPUT =
0.50

Squashes any input to between 0 and 1 smoothly. Perfect for "what's the probability?" at the output layer.

Fig 4.1 — Activation functions add non-linearity. Without them, stacking layers does nothing new. The sigmoid is the S-shaped "probability squasher." ReLU is the workhorse of modern deep learning.

ActivationWhat it doesCommon use
StepHard 0 or 1 — no gradient, can't learnMcP neuron (old school)
SigmoidSquashes to 0–1 smoothly (S-curve)Binary classification output
ReLUPositive: keep it. Negative: zero it.Hidden layers (fast, works well)
SoftmaxConverts scores to probabilities summing to 1Multi-class classification output
SECTION 05
Forward Propagation — How Data Flows Through
⏱ 1:15 – 1:30 · 15 min

Let's trace data through an ANN — this is forward propagation. Our example: predict if a student will pass an exam, given hours studied and hours slept. Watch the signal pulse through the network below.

⚡ Interactive — Forward Propagation LiveANIMATED

Set the inputs and watch data flow forward layer by layer. Each circle lights up as the signal arrives.

5.0
7.0
Prediction: —

Fig 5.1 — Forward propagation. The input values flow layer by layer (left to right), each neuron computes a weighted sum + activation, until a final prediction emerges at the output.

Forward Pass — Step by Step
z = W · x + b    ← weighted sum
a = ReLU(z)     ← activation
→ repeat for each layer →
ŷ = sigmoid(z_final) ← final probability
→ Conceptually: multiply each input by its importance, add them up, squash through a function. Repeat per layer.
🏀 ANALOGY — A Basketball Play
Each layer is a player passing the ball. Each player takes it, does something to it (activation), and passes along. The final player shoots (output). Forward prop is just watching the ball move — no adjustments yet.
SECTION 06
Why Backpropagation? Teaching the Network to Improve
⏱ 1:30 – 1:45 · 15 min

We predicted 83% chance of passing — but the student actually failed. Now we need to go back and fix the weights. But in a network with millions of weights, which ones caused the mistake, and by how much?

Backpropagation solves this with calculus (the chain rule): it figures out exactly how much each weight contributed to the error, then nudges every weight in the direction that would reduce it.

Think of it like hiking to find the lowest valley blindfolded — feel which way is downhill, take a step, repeat. The visualization below shows this "loss landscape."

🏔️ Interactive — Gradient Descent on the Loss LandscapeDRAG THE BALL

The purple ball is the current weight setting. Drag it anywhere on the loss landscape — then press "Take Steps Downhill" to watch gradient descent find the minimum.

0.10
Loss = —  ·  Drag the ball to start!

Fig 6.1 — Gradient descent finds the valley (minimum loss). Too high a learning rate = overshoots. Too low = takes forever. Watch what happens when you try different rates!

The Weight Update — One Line of Learning
w_new = w_old − (learning_rate × gradient)
→ "gradient" = how much this weight contributed to the error. Move it in the opposite direction. That minus sign is the entire secret to learning.
💡 KEY INSIGHT
Forward prop = making a prediction. Backward prop = learning from the mistake. Together, repeated thousands of times, the network figures out what a cat looks like without ever being told explicitly.
SECTION 07
What Changes for Images, Text, Speech?
⏱ 1:45 – 1:55 · 10 min

Our examples used simple tabular data. But a 256×256 image has ~200,000 numbers — a plain ANN treats every pixel independently, ignoring that pixel (100,100) is next to (101,100). It can't "see" spatial relationships.

Text? "I love this movie" vs "I hate this movie" — one word flips the meaning. Word order and context are everything. Speech? Audio is a sequence over time — timing matters enormously.

Different data types need different inductive biases — architectural assumptions baked into the network that match the structure of the data.

Input TypeKey StructureProblem with Plain ANNSolution
📊 TabularIndependent featuresNone — ANN works greatANN/MLP
🖼️ ImagesSpatial locality, translation invarianceIgnores pixel neighbors; too many weightsCNN
📝 TextSequential order, long-range contextNo sense of word order or dependenciesRNN → Transformer
🎙️ SpeechTime-series, variable lengthFixed-length input, no temporal memoryRNN / CNN+RNN
🔍 ANALOGY — Different Tools for Different Jobs
You wouldn't use a hammer to tighten a screw. CNN is right for images because it looks at local patches — like your eyes. RNNs are right for sequences because they have "memory" of what came before. The tool must match the shape of the problem.
SECTION 08
CNN, RNN & The Big Picture
⏱ 1:55 – 2:00 · 5 min

CNNs use a small filter (e.g. 3×3 pixels) that slides across the image, detecting local patterns. The same filter reused everywhere = weight sharing = far fewer parameters. Early layers detect edges. Middle: shapes/textures. Deep: faces, objects.

RNNs process one element at a time (one word, one audio frame), maintaining a hidden state — short-term memory carrying info from previous steps. Click words in the sentence below and watch memory accumulate.

🖼️ Interactive — CNN Filter Sliding Over an ImageCLICK CELLS / DRAG

Click pixels to draw on the image grid. Watch the 3×3 filter slide across and detect edges. The output feature map shows what the filter "sees."

INPUT IMAGE (click to draw)
FILTER (3×3 edge detector)
OUTPUT FEATURE MAP

Fig 8.1 — CNN filter convolution. The 3×3 filter slides across the image (step by step), computing a dot product at each position. The result is a feature map highlighting patterns the filter responds to.

🔁 Interactive — RNN Memory Accumulating Over TimeCLICK WORDS

Click each word in order to "feed" it to the RNN. Watch the hidden state (memory) accumulate and influence the network's understanding.

Fig 8.2 — RNN unrolled. Each word updates the hidden state (memory). By the time we reach the last word, the network's understanding is informed by all previous words — context accumulates.

These architectures — CNN, RNN, and modern Transformers — are all built on the same foundation we've covered. The Transformer replaced RNN's sequential memory with attention: every word looks at every other word simultaneously. That's what made large language models possible.

But you now understand the foundation. A single artificial neuron → weights → activation functions → layers → forward propagation → backpropagation. The rest is evolution of these same ideas.

"From one McCulloch–Pitts neuron firing 0 or 1 in 1943, to GPT-4 generating coherent essays in 2023 — it's the same core idea, scaled up by 80 years of ingenuity."
🗺️ THE FULL JOURNEY
McP

McCulloch–Pitts (1943)

First artificial neuron. Binary, no learning, manually set.

P

Perceptron (1957)

Added weights and a learning rule. Could learn from examples.

MLP

Multi-Layer Perceptron (1980s)

Multiple layers + backpropagation. Could solve non-linear problems.

CNN

Convolutional Net (1998–2012)

Spatial filters for images. ImageNet breakthrough in 2012.

RNN

Recurrent Net (1980s–2015)

Sequential memory for text and speech. LSTM solved long-term memory.

🤖

Transformers (2017 → now)

Attention mechanism. Powers GPT, BERT, DALL-E, Gemini, Claude.

🎙 CLOSING
End with: "You now have the mental model most people using AI never have. You know why neural networks exist, what they're doing inside, and why different architectures exist for different data. Everything in deep learning — attention, embeddings, transformers — is built on exactly what we covered today. Thank you."

Leave 3–5 min for Q&A. Common questions: "How many layers?" (start with 2–3, experiment). "DL vs ML?" (deep learning = multi-layer neural nets, a subset of ML).