PCCMT503 · MOD 1 Review of Neural Networks
0 / 8 Mastered

Module 1 — Review of Neural Networks

Official Syllabus (PCCMT503): Biological Neuron vs. Artificial Neuron, Activation Functions (Step, Sign, Sigmoid, Softmax, tanh, ReLU, LReLU, EReLU), Single Layer Perceptron, Linear Separability, XOR Problem, Multilayer Perceptron, Backpropagation algorithm.

Merged Sources: MODULE 1.pdf, M 1.1.pptx (87 images), M 1.2.pdf (4 scans), M 1.3.pdf, M 1.4.pdf (7 scans), M 1.5.pdf (3 scans), M 1.6.pdf, M 1.7.pptx, M 1.8.pdf.

Filter:

1.1 Biological Neuron vs. Artificial Neuron

🔥 HIGH YIELD 3M · 6M · 9M Sources: MODULE 1.pdf, M 1.1.pptx
Simple Intuition (ELI5) Imagine a judge sitting at a desk. Different witnesses whisper clues into the judge's ears (dendrites / inputs). Some witnesses are trustworthy and shout loudly, others aren't (synaptic weights). The judge adds up all the clues inside their head (soma / summation unit Σ), compares the total against their strictness level (bias / threshold), and if convinced, sends a memo down the hallway (axon / output) to the next office!

1. Biological Neuron (BNN Building Block)

The biological neuron is the fundamental living nerve cell of the nervous system (~86–100 billion neurons in the human brain; each connects to ~10,000–200,000 neurons yielding ~$10^{15}$ synaptic connections; cell body 10–80 μm; synaptic gap ~200 nm).

  • Dendrites: Tree-like nerve fibers attached to the cell body that receive incoming electrochemical signals from other neurons.
  • Cell Body (Soma) & Nucleus: Sums all incoming signals over time. Once internal electrical potential crosses a firing threshold, it generates an electrical spike (action potential), then enters a brief refractory period before firing again.
  • Axon (with Myelin Sheath): A single long output fiber carrying electrical impulses away from the soma toward target cells (myelin insulates and speeds up conduction).
  • Axon Terminals & Synapse: Branched endings connecting to other neurons' dendrites across a tiny synaptic gap via neurotransmitters; produces either excitatory (boosts firing) or inhibitory (suppresses firing) effects.

2. Artificial Neuron & Mathematical Model

An artificial neuron (perceptron/node) abstracts the biological neuron into five mathematical parts:

  • Inputs (x₁, x₂, …, xₙ): Numerical feature values entering the neuron.
  • Weights (w₁, w₂, …, wₙ): Synaptic strength multipliers — positive weight = excitatory connection, negative weight = inhibitory connection.
  • Bias (b or w₀ with fixed input x₀ = 1): Shifts the activation curve/threshold left or right (positive bias makes firing easier; negative bias makes it harder).
  • Summation Function (Σ): Computes the weighted net input yin.
  • Activation Function (f or φ): Transforms net input into linear or non-linear output y.
yin = z = b + ∑i=1..n wixi = w0x0 + w1x1 + … + wnxn  (with x0 = 1, w0 = b)
y = f(yin) = φ(b + ∑i=1..n wixi)
A. BIOLOGICAL NEURON Nucleus Dendrites (Receive) Soma (Cell Body) Axon + Myelin Synapses / Terminals B. ARTIFICIAL NEURON x₁ x₂ xₙ +1 w₁ w₂ wₙ b (w₀) Σ yᵢₙ f(·) y = f(yᵢₙ) Inputs (xᵢ) → Weights (wᵢ) → Summation (Σ) → Activation f → Output (y)
Figure 1.1: Biological Neuron vs. Artificial Neuron Architecture & Signal Mapping
Exam Sketch Tip: Draw both side-by-side and add a 4-row mapping table (Dendrites↔x, Soma↔Σ+f, Synapse↔w, Axon↔y) to guarantee full 6M/9M marks!

3. BNN vs. ANN Mapping & Comparison Tables

Biological Term (BNN)Artificial Equivalent (ANN)
DendritesInputs (x₁, …, xₙ)
Soma (Cell Body)Processing Node: Summation (Σ) + Activation (f)
SynapseSynaptic Weights (wᵢ) / Interconnections
AxonOutput (y)
PropertyBiological Neuron (Brain)Artificial Neuron (ANN)
NatureLiving nerve cellMathematical model in software/hardware
SignalsElectrochemical spikesFloating-point numbers
LearningStrengthens/weakens physical synapsesAdjusts numerical weights wᵢ & bias b
Speed / EnergyMilliseconds per cell, ~20 W whole brainNanoseconds per op, high power
Memory & FaultsSynaptic, non-destructive, high fault toleranceAddressable RAM, low tolerance unless designed
Memory Trick: "D-S-S-A ↔ I-N-W-O" Remember Dendrites = Inputs, Soma = Node (Σ + f), Synapse = Weights, Axon = Output!
Model Exam Answers: 3-Mark & 6-Mark (Biological vs. Artificial Neuron)

3-Mark Answer (Compare BNN and ANN / Map components):

  • An artificial neuron mimics a biological neuron mathematically: Dendrites → Inputs (xᵢ), Synapses → Weights (wᵢ), Soma → Summation (Σ) & Activation f, and Axon → Output (y).
  • Formula: y = f(b + ∑ wᵢxᵢ).
  • Brain processes slow (~ms) in massive parallel at ~20 W with high fault tolerance; ANN computes fast (~ns) sequentially/matrix-wise using high power and low fault tolerance.

6-Mark / 9-Mark Answer: Draw Figure 1.1 (A & B), explain each of the 4 biological parts (dendrites, soma/threshold/refractory period, axon/myelin, synapse excitatory/inhibitory), derive y = f(b + Σ wᵢxᵢ), and conclude with both the 4-row component mapping table and the 5-row comparison table above.

1.2 Network Topologies, Learning Paradigms & Net-Input Numericals

⭐ MEDIUM YIELD 🧮 4 WORKED PROBLEMS 3M · 6M Source: M 1.1.pptx

1. Five ANN Connection Topologies (from Slides)

  1. Single-layer Feedforward Network: Input layer projects directly onto one output layer of processing elements (PEs); no cycles.
  2. Multilayer Feedforward Network: Unidirectional flow Input → Hidden Layer(s) → Output Layer; hidden units have no direct external environment contact.
  3. Single Node with its Own Feedback: Output feeds back into itself; when a PE feeds back to other PEs in the same layer it is called lateral feedback.
  4. Single-layer Recurrent Network: Output of layer feeds back into its own inputs/same-layer neurons.
  5. Multilayer Recurrent Network: Feedback connections go back to units in the same layer or preceding layers.

2. Three Machine Learning Paradigms in Neural Networks

1. Supervised Learning

Learns from labeled pairs (X, D). An error signal (D − Y) adjusts weights until actual output Y ≈ D. Used for Classification & Regression.

2. Unsupervised Learning

No teacher or target labels! Network discovers hidden structure and self-organizes into clusters. Used for Clustering & Association.

3. Reinforcement Learning

Environment gives a Critic / Reinforcement signal (R); agent learns via trial-and-error to maximize cumulative reward (modeled as a Markov Decision Process).

3. Worked Net-Input & Architecture Matrix Numericals

Worked Numericals 1.2A – 1.2D (Step-by-Step from M 1.1.pptx)
  1. Problem 1 (No Bias): Given X = [0.3, 0.5, 0.6], weights W = [0.2, 0.1, −0.3]. Find net input Yin.
    Yin = 0.3(0.2) + 0.5(0.1) + 0.6(−0.3) = 0.06 + 0.05 − 0.18 = −0.07
  2. Problem 2 (With Bias): Given X = [0.2, 0.6], W = [0.3, 0.7], bias input x₀ = 1, bias b = w₀ = 0.45.
    Yin = 1(0.45) + 0.2(0.3) + 0.6(0.7) = 0.45 + 0.06 + 0.42 = 0.93
  3. Problem 3 (4 Inputs + Bias): Given X = [0.5, 0.9, 0.2, 0.3], W = [0.2, 0.3, −0.6, −0.1], x₀ = 1, w₀ = 0.5.
    Yin = 1(0.5) + 0.5(0.2) + 0.9(0.3) + 0.2(−0.6) + 0.3(−0.1) = 0.5 + 0.10 + 0.27 − 0.12 − 0.03 = 0.72
  4. Problem 4 (4-2-3 Feedforward Architecture Weight Matrices): Consider a feedforward network with 4 inputs (X₁…X₄), 2 hidden neurons (Z₁, Z₂), and 3 output neurons (Y₁, Y₂, Y₃). State weight matrix dimensions:
    • Input-to-Hidden matrix W has size 4 × 2 (8 weights).
    • Hidden-to-Output matrix V has size 2 × 3 (6 weights). Total connection weights (excluding biases) = 14.

1.3 Activation Functions (All 8 Syllabus + 4 Auxiliary)

🔥 VERY HIGH YIELD 3M · 6M · 9M Sources: MODULE 1.pdf, M 1.1.pptx, M 1.2.pdf
Simple Intuition (ELI5): Why Do We Need Activation Functions? If a neural network had NO activation functions (only multiplications and additions), stacking 100 layers is algebraically no smarter than a single straight line (linear regression)! Non-linear activation functions act like hinges and bends that let the network fold space to trace curves, faces, and language.
1. Binary Step {0,1} 1 0 2. Sign {-1, 0, +1} +1 −1 3. Sigmoid (0, 1) 1 0.5 4. tanh (−1, +1) +1 −1 5. ReLU [0, ∞) y=x 6. LReLU (−∞, ∞) αx (α≈0.01) 7. ELU / EReLU (−α, ∞) α(eˣ−1) 8. Softmax Probabilities 0.665 0.245 0.090 ∑pᵢ = 1
Figure 1.2: Visual Curves of All 8 Syllabus Activation Functions (Step, Sign, Sigmoid, tanh, ReLU, LReLU, ELU/EReLU, Softmax)

Complete Mathematical Formulas, Ranges & Exam Analysis

FunctionEquation & DerivativeOutput RangeKey Properties, Pros & Cons
1. Binary Step f(x) = 1 if x ≥ θ (usually 0); else 0.
Derivative: 0 everywhere (undefined at θ).
{0, 1} Simple threshold for SLP binary classification. Cannot use Backprop (zero gradient); no multi-class output.
2. Sign (Signum) f(x) = +1 (x>0), 0 (x=0), −1 (x<0). {−1, 0, +1} Bipolar output. Same flaw: zero gradient almost everywhere, non-differentiable at 0.
3. Logistic / Binary Sigmoid σ(x) = 11 + e−λx (usually λ=1)
σ′(x) = λ σ(x)[1 − σ(x)]
(0, 1) Smooth, differentiable, gives probability (binary output layer). Flaws: Vanishing gradient for large |x|, not zero-centered (centered at 0.5), expensive e−x.
3b. Bipolar Sigmoid (M 1.2) f(x) = 21 + e−λx − 1 = 1 − e−λx1 + e−λx (−1, +1) Scaled/shifted sigmoid when negative activations are needed in shallow nets.
4. Softmax f(xᵢ) = exᵢ∑j=1..n exⱼ (0, 1) with ∑ f(xᵢ)=1 Multi-class output layer activation! Amplifies largest logit and outputs normalized probability distribution.
5. tanh tanh(x) = ex − e−xex + e−x = 21 + e−2x − 1
tanh′(x) = 1 − tanh²(x)
(−1, +1) Zero-centered! Stronger gradients than sigmoid; speeds up optimization; widely used in RNNs. Still has vanishing gradient at saturation.
6. ReLU f(x) = max(0, x) (x if x≥0, 0 if x<0)
f′(x) = 1 (x>0), 0 (x<0)
[0, ∞) Default hidden-layer activation in CNNs/MLPs. Fast, sparse activations, no vanishing gradient for x>0. Flaw: Dying ReLU (dead neurons stuck at 0); not zero-centered.
7. Leaky ReLU (LReLU) f(x) = x (x>0), αx (x≤0) (typically α = 0.01).
(PReLU learns α via training.)
(−∞, +∞) Fixes Dying ReLU by giving small non-zero slope α in negative region so gradients keep flowing.
8. ELU / EReLU f(x) = x (x>0), α(ex − 1) (x≤0) (usually α = 1).
f′(x) = 1 (x>0), f(x)+α (x≤0)
(−α, ∞) Smooth negative curve pushes mean activations closer to zero → faster convergence, noise robustness & no Dying ReLU. Slightly slower due to ex.
Syllabus Naming Alert: EReLU = ELU The KTU syllabus writes EReLU, referring to Exponential Linear Unit (ELU). Always write “ELU (EReLU — Exponential Linear Unit)” and state its piecewise formula with α(eˣ − 1) for x ≤ 0! Also remember 4 auxiliary functions from M 1.1.pptx: Identity f(x)=x, Ramp (0 for x<0; x for 0≤x≤1; 1 for x>1), ArcTan tan⁻¹(x), and SoftPlus ln(1+eˣ).
Model Exam Answers: 3-Mark & 9-Mark (Activation Functions)

3-Mark Q: Why do we need non-linear activation functions? What is Dying ReLU?
Without non-linearity, multiple linear layers collapse algebraically into a single linear transformation Weqx + beq, making deep networks incapable of learning XOR or complex curves. Dying ReLU occurs when large negative updates push a neuron's net input < 0 for all data; since ReLU′(x)=0 for x<0, its weights never update again. LReLU/EReLU solve this with non-zero negative slopes.

9-Mark Q: Define and sketch any 6 (or all 8) activation functions with formula, range, pros/cons.
Group cleanly into 3 categories: (1) Non-differentiable Binary/Bipolar (Step, Sign), (2) Classic Saturating Smooth (Sigmoid, tanh, Softmax — noting zero-centered tanh & multi-class Softmax), and (3) Modern Non-saturating ReLU Family (ReLU, LReLU, EReLU/ELU). Draw miniature x-y graphs for each and finish with a summary table comparing Range and Vanishing Gradient / Dying ReLU behavior.

1.4 Worked Activation Function Numericals (All 5 Notes Problems + Softmax)

🔥 EXAM FAVORITE 🧮 6 COMPLETE WORKED NUMERICALS 3M · 6M Sources: M 1.2.pdf, M 1.1.pptx
Numerical A (M 1.2.pdf pp. 1–2): 3 Inputs + Bias → Binary Sigmoid

Given: Inputs (x₁, x₂, x₃) = (0.8, 0.6, 0.4), Weights (w₁, w₂, w₃) = (0.2, 0.1, −0.3), Bias b = 0.35.

  1. Net input: yin = b + w₁x₁ + w₂x₂ + w₃x₃ = 0.35 + (0.2)(0.8) + (0.1)(0.6) + (−0.3)(0.4)
    = 0.35 + 0.16 + 0.06 − 0.12 = 0.45
  2. Binary Sigmoid: σ(0.45) = 1 / (1 + e−0.45) = 1 / (1 + 0.6376) = 0.611
Numerical B (M 1.2.pdf pp. 2–3 & M 1.1.pptx Q1): Binary & Bipolar Sigmoid

Given: (x₁, x₂, x₃) = (0.8, 0.6, 0.4), (w₁, w₂, w₃) = (0.1, 0.3, −0.2), b = 0.35.

  1. Net input: yin = 0.35 + 0.8(0.1) + 0.6(0.3) + 0.4(−0.2) = 0.35 + 0.08 + 0.18 − 0.08 = 0.53
  2. Binary Sigmoid: σ(0.53) = 1 / (1 + e−0.53). Since e−0.53 ≈ 0.5886, exact value = 0.6295.
    Note: Both M 1.2.pdf & M 1.1.pptx round e−0.53 ≈ 0.6 to print 1/(1+0.6) = 0.625 — write both to be safe!
  3. Bipolar Sigmoid: f(0.53) = 21 + e−0.53 − 1 = 2(0.6295) − 1 = 0.259
Numerical C (M 1.2.pdf p. 4): Binary & Bipolar Sigmoid

Given: (x₁, x₂, x₃) = (0.6, 0.5, 0.8), (w₁, w₂, w₃) = (0.3, 0.7, 0.5), b = 0.1.

  1. Net input: yin = 0.1 + 0.6(0.3) + 0.5(0.7) + 0.8(0.5) = 0.1 + 0.18 + 0.35 + 0.40 = 1.03
  2. Binary Sigmoid: 1 / (1 + e−1.03) = 1 / (1 + 0.357) = 0.737
  3. Bipolar Sigmoid: 2(0.737) − 1 = 0.474
Numerical D (M 1.1.pptx Q2) & Numerical E (Univ. Question Jan 2022)

Problem D: X = [0.7, 0.8], W = [0.2, 0.3], b = 0.9.

  1. yin = 0.9 + 0.7(0.2) + 0.8(0.3) = 0.9 + 0.14 + 0.24 = 1.28
  2. Binary Sigmoid: 0.7824 (rounded 0.78 in slides); Bipolar Sigmoid: 0.5649 (rounded 0.56).

Problem E (University Question — Jan 2022): X = [0.7, 0.3], W = [0.6, 0.2], b = 0.45.

  1. yin = 0.45 + 0.7(0.6) + 0.3(0.2) = 0.45 + 0.42 + 0.06 = 0.93
  2. Binary Sigmoid: 1 / (1 + e−0.93) = 1 / (1 + 0.3946) = 0.717 ≈ 0.72
Numerical F: Softmax Probabilities for Logits [2, 1, 0]

Given: Raw logit vector z = [2, 1, 0].

  1. Compute exponentials: e² ≈ 7.389, e¹ ≈ 2.718, e⁰ = 1.000.
  2. Sum: ∑ ezⱼ = 7.389 + 2.718 + 1.000 = 11.107.
  3. Divide each by 11.107: p = [7.389/11.107, 2.718/11.107, 1.000/11.107] = [0.665, 0.245, 0.090] (Sum = 1.000).

1.5 Single Layer Perceptron (SLP) & Perceptron Learning Algorithm

🔥 HIGH YIELD 🧮 PLA TRAINING + BOOLEAN GATES 3M · 6M · 9M Sources: M 1.3.pdf, M 1.5.pdf, MODULE 1.pdf
Simple Intuition (ELI5) A Single Layer Perceptron (invented by Frank Rosenblatt in 1958) is the simplest decision machine: it draws one straight line on a sheet of paper. Whenever a training point ends up on the wrong side of the line, the Perceptron nudges its line weights slightly in that point's direction until every linearly separable point sits on the right side!

1. Architecture & Perceptron Model

  • Contains only an input layer and an output layer (zero hidden layers); directly computes:
    yin = b + ∑i=1..n wixi,    y = f(yin) = { 1 if yin > 0 (or ≥ 0), else 0 }
  • Functions exclusively as a binary linear classifier.

2. Perceptron Learning Algorithm (PLA) — Step-by-Step

  1. Initialize weights wᵢ = 0 (or small random numbers), bias b = 0, and choose learning rate η > 0.
  2. For each training sample (x₁, …, xₙ) with target label t:
    • Compute net input yin = b + ∑ wᵢxᵢ and predicted output y = f(yin).
    • If y ≠ t (misclassified), apply weight & bias update:
      wi(new) = wi(old) + η (t − y) xi,     b(new) = b(old) + η (t − y)
    • If y = t, make no change.
  3. Repeat epochs until all training patterns produce zero error (or maximum epochs reached).
Worked PLA Numerical (M 1.3.pdf): Training Logical AND Gate

Given: Targets (0,0)→0, (0,1)→0, (1,0)→0, (1,1)→1. Initial w₁ = 0, w₂ = 0, b = 0, η = 1, step rule y = 1 if yin > 0 else 0.

Epoch(x₁, x₂)Target tyin = w₁x₁ + w₂x₂ + bOutput yError (t−y)Updated (w₁, w₂, b)
1(0, 0)00(0)+0(0)+0 = 000(0, 0, 0) — no change
1(0, 1)0000(0, 0, 0) — no change
1(1, 0)0000(0, 0, 0) — no change
1(1, 1)100+1w₁=1, w₂=1, b=1
2(0, 0)00 + 0 + 1 = 11−1w₁=1, w₂=1, b=0
2(0, 1)00 + 1 + 0 = 11−1w₁=1, w₂=0, b=−1
2(1, 0)01 + 0 − 1 = 000(1, 0, −1) — no change
2(1, 1)11 + 0 − 1 = 00+1w₁=2, w₂=1, b=0

Continuing subsequent epochs converges to a separating hyperplane such as w₁ = 1, w₂ = 1, b = −1.5 (so x₁ + x₂ − 1.5 > 0 only at (1,1)).

3. Representational Power of Single Perceptron (M 1.5.pdf — Bipolar Logic Gates)

Using bipolar threshold outputs +1 (True) and −1 (False), a single perceptron directly implements any linearly separable Boolean gate simply by choosing (b, w₁, w₂):

Logic GateBias (b)Weights (w₁, w₂)yin Values for (0,0), (0,1), (1,0), (1,1)Output y
AND−0.8(0.5, 0.5)−0.8, −0.3, −0.3, +0.2−1, −1, −1, +1
OR−0.3(0.5, 0.5)−0.3, +0.2, +0.2, +0.7−1, +1, +1, +1
NAND+0.8(−0.5, −0.5)+0.8, +0.3, +0.3, −0.2+1, +1, +1, −1
NOR+0.3(−0.5, −0.5)+0.3, −0.2, −0.2, −0.7+1, −1, −1, −1

1.6 Linear Separability & The XOR Problem

🔥 GUARANTEED EXAM TOPIC 3M · 6M · 9M Sources: M 1.4.pdf, MODULE 1.pdf

1. Linear Separability & Decision Boundary Derivation

A dataset is linearly separable if two classes can be cleanly separated with zero errors by a single straight line (2D), plane (3D), or hyperplane (n-D):

wTx + b = 0  (Decision Hyperplane)   |   wTx + b > 0  (Class +1)   |   wTx + b < 0  (Class −1 / 0)
Derivation (M 1.4.pdf pp. 4–6): 2D Decision Line Equation & Intercepts
  1. Start with the two-input decision boundary: w₁x₁ + w₂x₂ + b = 0.
  2. Solve for x₂ in slope-intercept form (y = mx + c):
    x₂ = −(w₁w₂) x₁ − bw₂
  3. Intercepts: Putting x₂ = 0 gives x₁ = −b/w₁; putting x₁ = 0 gives x₂ = −b/w₂.
Handwritten Source Slip Alert (M 1.4.pdf p. 4 vs p. 6) Handwritten page 4 accidentally wrote slope −w₂/w₁, which was corrected on page 6 to x₂ = −(w₁/w₂)x₁ − b/w₂. Always write w₁/w₂ in the exam!

2. The XOR Problem — Why a Single Layer Perceptron Fails

XOR Truth Table: (0,0) → 0, (0,1) → 1, (1,0) → 1, (1,1) → 0.

  • On the (x₁, x₂) plane, the two Class-0 points (0,0) and (1,1) sit on one diagonal while the two Class-1 points (0,1) and (1,0) sit on the opposite diagonal.
  • Geometric Proof of Failure: No single straight line can keep both Class-1 points on one side and both Class-0 points on the other side → XOR is not linearly separable!
  • MLP Solution: Adding just one hidden layer (e.g., a 2–2–1 network computing h₁ = OR(x₁, x₂) and h₂ = NAND(x₁, x₂), then output AND(h₁, h₂)) draws two straight boundaries whose intersection encloses Class 1 cleanly.
AND: Linearly Separable ✓ x₁+x₂=1.5 (0,0):0 (1,0):0 (0,1):0 (1,1):1 XOR: SLP Fails (No Single Line) ✗ Impossible! (0,0):0 (1,1):0 (1,0):1 (0,1):1 MLP (2 Hidden Units): Solves XOR ✓ Two hyperplanes form band → Class 1
Figure 1.3: Linear Separability (AND), XOR Failure of SLP, and 2-Hyperplane Solution via MLP
Model Exam Answer (6M / 9M): Explain Linear Separability & Why SLP Cannot Solve XOR

Define linear separability with wᵀx + b = 0, derive the 2D boundary line x₂ = −(w₁/w₂)x₁ − b/w₂, draw the truth tables & 2D coordinate plots of AND (one line separates (1,1)) and XOR (diagonal opposite classes (0,0),(1,1) vs (0,1),(1,0)), show algebraically/geometrically why a single line cannot separate both diagonals, and show how adding a hidden layer in a 2-2-1 MLP creates two linear boundaries whose combination isolates Class 1.

1.7 Multilayer Perceptron (MLP) & Applications

⭐ MEDIUM YIELD 3M · 6M Sources: MODULE 1.pdf, M 1.8.pdf

1. Architecture of a Multilayer Perceptron

An MLP is a feedforward ANN with unidirectional information flow (no feedback loops) comprising three types of layers:

  • Input Layer: Receives raw feature vector x and distributes values forward (performs no weighted summation/activation).
  • Hidden Layer(s) (1 or more): Extract hierarchical features via zj(L) = ∑ wij(L) ai(L−1) + bj(L) and non-linear activation aj(L) = φ(zj(L)).
  • Output Layer: Produces final predictions (Sigmoid for binary, Softmax for multi-class, Linear for regression).

2. Single Layer Perceptron vs. Multilayer Perceptron

FeatureSingle Layer Perceptron (SLP)Multilayer Perceptron (MLP)
Hidden LayersNone (Input → Output only)One or more hidden layers
Decision BoundaryStrictly linear (single hyperplane)Non-linear & arbitrarily complex boundaries
XOR ProblemCannot solve XORSolves XOR & complex non-linear patterns
ActivationStep / Sign thresholdDifferentiable (Sigmoid, tanh, ReLU, LReLU, EReLU)
Training RulePerceptron Learning Rule (PLA)Backpropagation + Gradient Descent
Supplementary Note (M 1.8.pdf): Real-World Neural Network Applications Facial Recognition (CNN feature extraction), Stock Market Prediction (MLP/LSTM trend modeling), Social Media Analytics (user behavior & fake news detection), Aerospace (autopilot & fault diagnosis using Time-Delay NN), Defence (UAV/UUV mine detection via CNN), and Healthcare (disease diagnosis & medical imaging).

1.8 Backpropagation Algorithm & 2 Full Worked Numericals

🔥 TOP PRIORITY (PART B) 🧮 2 COMPLETE WORKED EXAMPLES 6M · 9M Sources: MODULE 1.pdf, M 1.6.pdf, M 1.7.pptx
Simple Intuition (ELI5): The Blame Assignment Chain Suppose a relay team finishes 2 seconds late. Backpropagation asks at the finish line: "How much of that 2-second error came from the final runner's weights, and how much came from the earlier hidden runners?" Using calculus's Chain Rule, it sends blame signals (δ) backward from Output → Hidden layers so every weight adjusts proportionally!

1. Core Backpropagation Equations (with Sigmoid f′(yin) = y(1 − y))

Error (Loss): E = 12 ∑k (tk − yk)²   |   Gradient Descent Rule: wnew = wold − η ∂E∂w = wold + η δ · input
Output Layer Delta (δk): δk = (tk − yk) · f′(yin,k) = (tk − yk) yk(1 − yk)
Hidden Layer Delta (δj): δj = f′(zin,j) · ∑k δk vjk = zj(1 − zj) · ∑k δk vjk
Weight & Bias Updates: Δvjk = η δk zj,   Δbo,k = η δk  |  Δwij = η δj xi,   Δbh,j = η δj
BACKPROPAGATION 2-2-1 TOPOLOGY + FORWARD (SOLID BLUE) & BACKWARD PASS (DASHED RED) x₁ x₂ h₁ (z₁) h₂ (z₂) y (out) w₁₁ w₁₂ w₂₁ w₂₂ v₁ (W₃₅) v₂ (W₄₅) Loss E = ½(t − y)² Compute δ_out ← Backward Error δ_hidden = z(1−z) Σ δ_out·v (Stops before input!)
Figure 1.4: Backpropagation Signal Flow (Forward Activation in Blue; Error Delta in Dashed Red)

2. Six Algorithm Steps + Pros & Limitations

  1. Initialize all weights and biases to small random values; set learning rate η.
  2. Forward Pass: Compute net inputs zin, yin and activations z, y up to the output layer.
  3. Error Calculation: Evaluate error (t − y) and total error E = ½(t − y)².
  4. Backward Pass (Chain Rule): Compute δoutput, then propagate errors backward to compute δhidden (note: errors are not propagated back to raw inputs).
  5. Update Weights & Biases: Add η · δ · activation to each weight and η · δ to each bias.
  6. Repeat until convergence criterion (|t − y| < ε or max epochs reached).

Advantages: Computationally efficient O(W) per pass, works with any differentiable activation, learns complex non-linear patterns. Limitations: Needs differentiable activations, vulnerable to local minima, sensitive to η & initialization, vanishing gradients in very deep nets.

Full Worked Example 1 (M 1.6.pdf pp. 4–5): 2–2–1 Sigmoid MLP With Biases

Given: Inputs (x₁, x₂) = (0.05, 0.10), Target t = 0.01, Learning rate η = 0.5.
Hidden weights: w₁₁=0.15, w₂₁=0.20, bh1=0.35 (to h₁); w₁₂=0.25, w₂₂=0.30, bh2=0.35 (to h₂).
Output weights: v₁=0.40, v₂=0.45, bo=0.60.

  1. Forward Pass:
    • zin1 = 0.05(0.15) + 0.10(0.20) + 0.35 = 0.3775 ⇒ z₁ = 1/(1 + e−0.3775) = 0.59327
    • zin2 = 0.05(0.25) + 0.10(0.30) + 0.35 = 0.3925 ⇒ z₂ = 1/(1 + e−0.3925) = 0.59688
    • yin = 0.59327(0.40) + 0.59688(0.45) + 0.60 = 1.1059 ⇒ y = 1/(1 + e−1.1059) = 0.75136
    • Squared Error: E = ½(0.01 − 0.75136)² = 0.2748
  2. Backward Pass (Deltas):
    • δo = (t − y)·y(1 − y) = (0.01 − 0.75136)(0.75136)(0.24864) = −0.1385
    • δh1 = z₁(1 − z₁)(δo · v₁) = (0.59327)(0.40673)(−0.1385 × 0.40) = −0.01335
    • δh2 = z₂(1 − z₂)(δo · v₂) = (0.59688)(0.40312)(−0.1385 × 0.45) = −0.01497
  3. Weight & Bias Updates (wnew = wold + η·δ·input):
    • v₁new = 0.40 + 0.5(−0.1385)(0.59327) = 0.35893
    • v₂new = 0.45 + 0.5(−0.1385)(0.59688) = 0.40865
    • bonew = 0.60 + 0.5(−0.1385) = 0.53075
    • w₁₁new = 0.15 + 0.5(−0.01335)(0.05) = 0.14967  |  w₂₁new = 0.20 + 0.5(−0.01335)(0.10) = 0.19933  |  bh1new = 0.34333
    • w₁₂new = 0.25 + 0.5(−0.01497)(0.05) = 0.24963  |  w₂₂new = 0.30 + 0.5(−0.01497)(0.10) = 0.29925  |  bh2new = 0.34252
Full Worked Example 2 (M 1.7.pptx Slides 2–11, Mahesh Huddar): 2–2–1 Sigmoid (No Bias)

Given: Nodes 1,2 (Input: x₁=0.35, x₂=0.9), Nodes 3,4 (Hidden), Node 5 (Output). Target ytarget = 0.5, η = 1.
Initial weights: W₁₃ = 0.1, W₂₃ = 0.8, W₁₄ = 0.4, W₂₄ = 0.6, W₃₅ = 0.3, W₄₅ = 0.9.

  1. Forward Pass 1:
    • a₃ = 0.35(0.1) + 0.9(0.8) = 0.755 ⇒ y₃ = σ(0.755) = 0.68
    • a₄ = 0.35(0.4) + 0.9(0.6) = 0.68 ⇒ y₄ = σ(0.68) = 0.6637
    • a₅ = 0.68(0.3) + 0.6637(0.9) = 0.801 ⇒ y₅ = σ(0.801) = 0.69
    • Error: e = ytarget − y₅ = 0.5 − 0.69 = −0.19
  2. Backward Pass (Deltas):
    • δ₅ = (0.5 − 0.69)(0.69)(1 − 0.69) = −0.0406
    • δ₃ = 0.68(1 − 0.68)(−0.0406 × 0.3) = −0.00265
    • δ₄ = 0.6637(1 − 0.6637)(−0.0406 × 0.9) = −0.0082
  3. Updated Weights (η = 1):
    • W₃₅new = 0.3 + (−0.0406)(0.68) = 0.2724  |  W₄₅new = 0.9 + (−0.0406)(0.6637) = 0.8731
    • W₁₃new = 0.1 + (−0.00265)(0.35) = 0.0991  |  W₂₃new = 0.8 + (−0.00265)(0.9) = 0.7976
    • W₁₄new = 0.4 + (−0.0082)(0.35) = 0.3971  |  W₂₄new = 0.6 + (−0.0082)(0.9) = 0.5926
  4. Forward Pass 2 (Verification): Using new weights gives y₃ = 0.6797, y₄ = 0.6620, y₅ = 0.6820 ⇒ Error dropped from −0.19 to −0.182!
Model Exam Answer (9M): Derive & Explain the Backpropagation Algorithm

Draw the 2-2-1 MLP flow diagram (Figure 1.4), state MSE error E = ½(t−y)², explain all 6 steps (Init → Forward → Error → Backward Chain Rule → Weight Update → Iterate), explicitly derive δk = (tk−yk)f′(yin,k) and δj = f′(zin,j)∑ δkvjk via partial derivatives ∂E/∂vjk and ∂E/∂wij, and conclude with advantages + limitations (local minima, differentiable activations, η sensitivity).

Module 1 Revision (A–D): Checklist, Definitions & Master Comparisons

Exam Revision Suite

A. Official Syllabus Coverage Checklist

  • ✅ Biological Neuron vs. Artificial Neuron (anatomy, mapping, comparison, net input, topologies, learning types)
  • ✅ Activation Functions: Step, Sign, Sigmoid (+ Bipolar), Softmax, tanh, ReLU, LReLU (+ PReLU), EReLU/ELU (+ 5 worked numericals)
  • ✅ Single Layer Perceptron (Rosenblatt model, PLA training with AND gate, bipolar logic gates)
  • ✅ Linear Separability (hyperplane equation, 2D line slope derivation −w₁/w₂, AND example)
  • ✅ XOR Problem (truth table, geometric proof why SLP fails, 2-2-1 MLP solution)
  • ✅ Multilayer Perceptron (architecture, SLP vs MLP, real-world NN applications)
  • ✅ Backpropagation Algorithm (chain rule, 6 steps, advantages/limitations, BOTH full 2-2-1 worked numericals)

B. Top 3-Mark Definitions

Synapse / Bias

A synapse connects neurons and corresponds to a weight wᵢ (positive = excitatory, negative = inhibitory). Bias (b = w₀ with x₀ = 1) shifts the activation threshold so neurons can fire even with zero inputs.

Linear Separability

A classification problem is linearly separable if one straight line (2D) or hyperplane wᵀx + b = 0 divides all instances of Class 1 and Class 2 with zero errors.

Dying ReLU

A failure mode where a ReLU neuron receives large negative net inputs across all data, producing constant 0 output and zero gradient, permanently stopping weight updates.

Lateral Feedback

Feedback connections from a processing element directly to other processing elements situated within the same neural layer.

C. Diagrams to Practice for Module 1

1. Biological Neuron vs Artificial Neuron side-by-side (dendrites, soma, axon, synapse ↔ x, w, Σ, f, y). 2. Curves of all 8 Activation Functions. 3. Linearly Separable AND vs Non-Separable XOR + 2-hyperplane MLP solve. 4. Backpropagation 2-2-1 Forward/Backward signal diagram.

Module 1 Revision (E): Master Formula & Equation Sheet

1. Net Input: yin = b + ∑ wᵢxᵢ  |  2D Line: x₂ = −(w₁/w₂)x₁ − b/w₂
2. Sigmoid: σ(x) = 1/(1+e−λx),   σ′(x) = λσ(1−σ)  |  Bipolar: 2/(1+e−λx) − 1
3. Softmax: pᵢ = exᵢ / ∑ exⱼ  |  tanh: (ex−e−x)/(ex+e−x),   tanh′ = 1 − tanh²
4. ReLU / LReLU / EReLU: max(0,x)  |  x if x>0 else αx  |  x if x>0 else α(ex−1)
5. PLA Rule: wnew = wold + η(t − y)x,    bnew = bold + η(t − y)
6. Backprop (Sigmoid): δk = (tk − yk)yk(1−yk),    δj = zj(1−zj)∑k δkvjk,    Δw = ηδ·input

Module 1 Revision (F): Exhaustive 3M / 6M / 9M Question Bank

Q1 [3M]: Compute net input and binary/bipolar sigmoid for X=[0.7, 0.3], W=[0.6, 0.2], b=0.45. (Jan 2022)3 Marks
Show Answer

yin = 0.45 + 0.7(0.6) + 0.3(0.2) = 0.93. Binary sigmoid = 1/(1+e−0.93) = 0.717 ≈ 0.72; Bipolar sigmoid = 2(0.717) − 1 = 0.434.

Q2 [3M]: Why is tanh often preferred over Sigmoid in hidden layers, and Softmax in multi-class outputs?3 Marks
Show Answer

tanh is zero-centered (−1, +1) with steeper gradient 1 − tanh² near 0, preventing zig-zag updates caused by all-positive sigmoid outputs (0,1). Softmax normalizes raw logits via exponentials into probabilities summing to 1, allowing mutual exclusion across K classes.

Q3 [6M]: Differentiate Biological vs Artificial Neural Networks and explain the three learning paradigms.6 Marks
Show Answer

Draw Figure 1.1, give 4-row component mapping (Dendrite→x, Soma→Σ+f, Synapse→w, Axon→y) + 5-row comparison (signal type, speed, power, memory, fault tolerance), and define Supervised (labeled error), Unsupervised (clustering without labels), and Reinforcement Learning (environment reward/MDP).

Q4 [9M]: Explain ReLU, Leaky ReLU, and EReLU/ELU with equations and curves, then train a Single Layer Perceptron for AND gate (η=1, initial 0).9 Marks
Show Answer

Part (a): Write formulas, derivatives, Dying ReLU problem, LReLU αx fix, and EReLU smooth negative curve α(ex−1) + graphs (4M). Part (b): Show full Epoch 1 & Epoch 2 PLA update table reaching convergence (5M — see Topic 1.5 worked table).

Q5 [9M]: Perform one complete Forward and Backward pass for inputs (0.05, 0.10), target 0.01, η=0.5 using Backpropagation.9 Marks
Show Answer

Follow Topic 1.8 Worked Example 1: z₁=0.59327, z₂=0.59688, y=0.75136, E=0.2748, δo=−0.1385, δh1=−0.01335, δh2=−0.01497, giving updated v₁=0.35893, v₂=0.40865, w₁₁=0.14967, etc.

Module 1 Revision (G): 10-Minute Last-Minute Cheat Sheet

  • BNN ↔ ANN: Dendrites=x, Synapse=w (+ excitatory / − inhibitory), Soma=Σ+f, Axon=y.
  • 2D Boundary: x₂ = −(w₁/w₂)x₁ − b/w₂ (never flip w₂/w₁!).
  • Why SLP fails XOR: Opposite diagonals on unit square cannot be split by 1 straight line; needs ≥1 hidden layer (MLP).
  • Activations fast recall: Step {0,1}; Sign {−1,0,1}; Sigmoid (0,1) not zero-centered; tanh (−1,1) zero-centered; ReLU kills negative neurons; LReLU uses αx; EReLU/ELU uses α(ex−1); Softmax sums to 1.
  • PLA Update: Add η(t − y)x only on errors. Backprop Sigmoid Delta: Output (t−y)y(1−y); Hidden z(1−z)∑ δoutv.

Module 1 Revision (H): KTU 2024 Pattern Module 1 Mock Exam (15 Marks)

KTU PCCMT503 DEEP LEARNING CONCEPTS — MODULE 1 MOCK TEST
Max Marks: 15 (Part A: 2×3 = 6M · Part B: 1×9 = 9M) · Recommended Time: 35 Minutes
PART A (Answer BOTH questions)2 × 3 = 6 Marks

1. Map the four main parts of a Biological Neuron to an Artificial Neuron and state the mathematical output equation with bias. [3 Marks]

2. Distinguish between ReLU, Leaky ReLU, and EReLU (ELU) functions with formulas and explain how LReLU solves Dying ReLU. [3 Marks]

PART B (Answer EITHER Question 3 OR Question 4)1 × 9 = 9 Marks

3. (a) Derive the 2D linear decision boundary equation and prove geometrically why a Single Layer Perceptron cannot solve the XOR problem, showing how an MLP fixes it. [5 Marks]
(b) For a 4-input neuron with X=[0.5, 0.9, 0.2, 0.3], W=[0.2, 0.3, −0.6, −0.1], bias b=0.5, compute yin and Binary Sigmoid output. [4 Marks]

— OR —

4. (a) Explain the Backpropagation algorithm with its 6 steps, Chain Rule delta formulas, advantages, and limitations. [5 Marks]
(b) Given x₁=0.35, x₂=0.9, target t=0.5, η=1, weights W₁₃=0.1, W₂₃=0.8, W₁₄=0.4, W₂₄=0.6, W₃₅=0.3, W₄₅=0.9 (no bias), compute Forward Pass 1 output y₅ and Backward delta δ₅. [4 Marks]

Show Complete Mock Exam Marking Guide & Answers
  • Q1 [3M]: Dendrites→xᵢ, Soma→Σ+f, Synapse→wᵢ, Axon→y (1.5M) + y = f(b + Σ wᵢxᵢ) (1.5M).
  • Q2 [3M]: ReLU max(0,x), LReLU αx for x≤0, EReLU α(eˣ−1) for x≤0 (2M) + Dying ReLU zero-gradient explanation (1M).
  • Q3(a) [5M]: x₂ = −(w₁/w₂)x₁ − b/w₂ (2M) + XOR truth table & opposite diagonal plot (2M) + 2-hidden-node MLP fix (1M).
  • Q3(b) [4M]: yin = 0.5 + 0.10 + 0.27 − 0.12 − 0.03 = 0.72 (2M); Binary Sigmoid 1/(1+e−0.72) = 0.6726 (2M).
  • Q4(a) [5M]: Init → Forward → Error → Backward Chain Rule deltas (δk, δj) → Update → Iterate + 2 Pros/Cons.
  • Q4(b) [4M]: y₃=0.68, y₄=0.6637, a₅=0.801 ⇒ y₅=0.69 (2M); δ₅ = (0.5−0.69)(0.69)(0.31) = −0.0406 (2M).