DeepLearning_Notes_Unit1-4
DeepLearning_Notes_Unit1-4
[Link] VI Sem, AI & Data Science, RGPV Bhopal | Based on syllabus + PYQs (2023, May 2024, June 2025)
Star rating = PYQ importance DON'T CONFUSE = common mix-up MEMORY TRICK DRAW THIS IN EXAM
UNIT I — Introduction to Deep Learning
PYQ: 2023 Q1a (8), 2023 Q6a "Role of DL in Data Science" (9), 2023 Q8d "AI vs DL" (14), 2024 Q1b "ML vs AI" (5), 2024 Q6a "Types of DL" (8),
2025 Q6b "AI vs ML vs DL"
Definition
Deep Learning is a subfield of Machine Learning that uses artificial neural networks with many layers to automatically learn hierarchical
feature representations directly from raw data, without manual feature engineering.
Keywords
Neural Network, Layers, Weights, Bias, Activation Function, Forward Propagation, Loss Function, Backpropagation,
Hierarchical Feature Learning, Representation Learning
AI vs ML vs DL
______________________________________
| Artificial Intelligence (AI) |
| ___________________________ |
| | Machine Learning (ML) | |
| | ______________________ | |
| | | Deep Learning (DL) | | |
| | |______________________| | |
| |___________________________| |
|______________________________________|
Feature AI ML DL
Definition Machines mimicking human intelligence Systems that learn patterns from data ML using multi-layer neural networks
Example Chess-playing computer Spam filter (Naive Bayes, SVM) Self-driving car vision, ChatGPT
Mathematics
where w=weights, x=inputs, b=bias, f=activation function, z=weighted sum (pre-activation), y=neuron output.
Advantages
Automatic feature learning — no manual feature engineering
Handles unstructured data (images, audio, text) very well
Accuracy keeps improving as data grows (scales well)
Limitations
Needs huge labeled data and heavy compute (GPU)
"Black box" — hard to interpret why a decision was made
Prone to overfitting on small datasets
Long training time
Applications
Image processing (object detection), Speech recognition, Natural Language Processing (chatbots, translation), Self-driving cars, Medical
diagnosis, Recommendation systems.
EXAM-READY ANSWER (7–8 marks): "What is Deep Learning? / Significance of depth in DL"
1. Start with the 2–4 line definition above.
2. Draw the AI ⊃ ML ⊃ DL nested-circle diagram.
3. Draw the Input→Hidden→Hidden→Output neural network diagram, label weights/bias/activation.
4. Explain forward propagation → loss → backpropagation → weight update as a cycle.
5. Write the equations z = Σwx + b, y = f(z) and explain each symbol.
6. State 2 advantages, 2 limitations, and 2–3 applications.
7. Conclude: "Deep Learning's power comes from depth — each layer builds increasingly abstract, hierarchical features, which is
why increasing layers (depth) generally improves performance until overfitting/vanishing-gradient issues appear."
QUICK REVISION: DL = ML with multi-layer neural nets that learn features automatically. AI ⊃ ML ⊃ DL. Flow: Input → Forward Prop →
Prediction → Loss → Backprop → Weight Update. Formula: z=Σwx+b, y=f(z).
PYQ: 2023 Q1a "Structure and units of Biological Neuron" (8), 2025 Q1b "Compare biological vs artificial neural networks", 2024 Q1a (McCulloch-
Pitts references neuron)
Definition
A biological neuron is the basic unit of the human brain and nervous system that receives, processes, and transmits information using
electrical and chemical signals.
Keywords
Visualization
Dendrites ---> Cell Body (Soma) ---> Axon ---> Synapse ---> (next neuron's dendrites)
(receive (processes/sums (carries (transmits signal
signals) the signals) signal) to next neuron)
Working
Dendrites receive electrical/chemical signals from neighbouring neurons.
Cell body (Soma) sums up (integrates) all incoming signals.
If the summed signal crosses a threshold, the neuron "fires" — generates an electrical pulse.
The Axon carries this pulse away from the cell body.
The Synapse is the junction where the signal passes to the next neuron (with some strength — this inspired the idea of "weight").
Speed Slow (ms) but massively parallel Fast (ns) per operation, needs many units for same power
Learning Synaptic plasticity (biological learning) Weight update via backpropagation/gradient descent
Scale ~86 billion neurons in human brain Millions to billions of parameters in large models
EXAM-READY ANSWER (7–8 marks): "Compare biological and artificial neural networks"
1. Define biological neuron (2 lines) and artificial neuron (2 lines).
2. Draw Dendrites→Soma→Axon→Synapse diagram AND the artificial neuron diagram (x→w→Σ→f→y).
3. Give the mapping table (Dendrite=Input, Synapse=Weight, Soma=Summation, Firing=Activation, Axon=Output).
4. Give the full comparison table above.
5. Conclude with 3–4 limitations of current DL models vs the human brain (data efficiency, energy, generalization, continual
learning).
QUICK REVISION: Dendrite=Input, Synapse=Weight, Soma=Sum, Firing=Activation, Axon=Output. Brain is data/energy efficient and
generalizes; DL models need huge data/compute and are task-specific.
Definition
A computational unit (artificial neuron) is the basic building block of a neural network that takes multiple weighted inputs, sums them with
a bias, and passes the result through an activation function to produce an output.
Keywords
Visualization
x1 --w1--\
x2 --w2---> [ Summation Σ(wi xi) + b ] ---> [ Activation f(z) ] ---> Output y
x3 --w3--/
Mathematics
z = Σ(wi * xi) + b y = f(z)
xi = i-th input, wi = weight of i-th input (importance), b = bias (shifts decision boundary), z = net input/pre-activation, f = activation
function (Sigmoid/ReLU/tanh/Step), y = final output of the neuron.
Example
If x1=1, x2=0, w1=0.6, w2=0.8, b=-0.5, then z = (0.6*1 + 0.8*0) - 0.5 = 0.1. If activation is step function (fires if z>0), output y=1.
Applications
Basic unit for every neural network — perceptrons, MLPs, CNNs, RNNs are all built by connecting many computational units in layers.
PYQ: 2024 Q1a "Define Neuron. Explain McCulloch-Pitts Neural Model in detail" (9 marks) — directly asked, very high priority.
Definition
The McCulloch–Pitts (MCP) neuron (1943) is the earliest mathematical model of a neuron. It takes binary inputs (0/1), sums excitatory
and inhibitory inputs, and fires (outputs 1) only if the sum meets or exceeds a fixed threshold, and there is no inhibitory input active.
Keywords
Binary inputs, Threshold (θ), Excitatory input, Inhibitory input, Step activation, Fixed weights
It was the first attempt to show that a simple neuron-like unit could perform logical operations (AND, OR, NOT) — proving that networks of
such units could, in principle, compute anything a digital computer could.
Visualization
Architecture / Rule
Inputs are binary (0 or 1) only.
Two types of inputs: Excitatory (normal, positive contribution) and Inhibitory (if even ONE inhibitory input is 1, neuron output is
forced to 0, no matter what).
All excitatory weights are equal (usually taken as 1, fixed, not learned).
Neuron fires (y=1) only if: sum of excitatory inputs ≥ threshold θ AND no inhibitory input is active.
Mathematics
AND (x1,x2) w1=1, w2=1 θ=2 Fires only when x1=1 AND x2=1 (sum=2 ≥ 2)
OR (x1,x2) w1=1, w2=1 θ=1 Fires when at least one input is 1 (sum ≥ 1)
NOT (x1) w1 = −1 (inhibitory) θ=0 x1=1 (inhibitory) forces output 0; x1=0 gives output 1
0 0 0 No 0
0 1 1 No 0
1 0 1 No 0
1 1 2 Yes 1
Limitations
Only works with binary inputs/outputs — cannot handle real-valued data.
Weights and threshold are fixed (hand-set), not learned from data.
Cannot solve non-linearly separable problems like XOR.
All excitatory weights must be equal — cannot give different importance to different inputs.
DON'T CONFUSE: MCP neuron has fixed, non-learnable weights/threshold set by a human. Perceptron has weights that are learned
automatically from training data. This is the single most important difference between the two.
EXAM-READY ANSWER (7–9 marks): "Define Neuron. Explain McCulloch-Pitts Model in detail"
1. Give the general neuron definition (from Topic 3) in 2 lines.
2. Give the MCP definition (2–3 lines).
3. Draw the excitatory/inhibitory input diagram.
4. Write the firing rule: y=1 if Σxi≥θ and no inhibitory input active.
5. Show AND, OR, NOT gate tables with weights and threshold (pick at least AND with the truth table).
6. List 3–4 limitations, especially "cannot learn weights" and "cannot solve XOR".
7. Conclude: "MCP neuron was the foundation of neural computing, but its fixed, binary, non-learning nature led to development of
the trainable Perceptron."
QUICK REVISION: MCP = binary in/out, fixed weights (usually 1), threshold θ, one active inhibitory input ⇒ output 0. Can implement
AND/OR/NOT. Cannot learn, cannot do XOR.
PYQ: 2024 Q2b "Write about Linear and Multilayer Perceptron in detail" (7 marks), 2025 Q2a "What is MLP? overcome limitations of single-layer
perceptrons"
Definition
A linear perceptron is a single-layer neural network that computes a weighted sum of inputs and passes it through a step (threshold)
activation function to classify inputs into one of two classes, and whose weights can be learned from training data.
Keywords
Weighted sum, Threshold activation, Decision boundary, Linear separability, Learnable weights
Visualization
x1 --w1--\
x2 --w2---> Σ(wi xi) + b ---> Step Function ---> Output (0 or 1)
x3 --w3--/
Working
Compute z = Σ(wi xi) + b (same as any artificial neuron).
Pass through a step function: output 1 if z ≥ 0, else 0.
Geometrically, the perceptron draws a straight line/hyperplane (decision boundary) that separates two classes.
Works only if data is linearly separable (a single straight line can separate the classes).
QUICK REVISION: Perceptron = weighted sum + step function, learnable weights, draws a linear decision boundary, works only for
linearly separable data.
Core algorithm topic — base for MLP/Backprop questions asked every year.
Definition
Perceptron Learning is a supervised algorithm that adjusts the perceptron's weights step by step, based on the error between predicted
and actual output, until the perceptron correctly classifies all (linearly separable) training examples.
w(new) = w(old) + η (t − y) x
η (eta) = learning rate (controls step size), t = target/desired output, y = predicted output, x = input, (t−y) = error.
Epoch x1,x2 Target t w1,w2,b (before) y (predicted) Error (t-y) w1,w2,b (after)
Training continues over more epochs, refining weights until all 4 AND-gate examples are classified correctly.
DON'T CONFUSE: This is one of the most commonly asked conceptual questions.
XOR output is 1 only when inputs differ (0,1)→1 and (1,0)→1, but (0,0)→0 and (1,1)→0. Plotting these points, no single straight line can
separate the 1-outputs from the 0-outputs — XOR is not linearly separable. Since a single-layer perceptron can only draw one straight
decision boundary, it fundamentally cannot represent XOR. This limitation (highlighted by Minsky & Papert, 1969) led directly to the
development of Multi-Layer Perceptrons (MLPs), which use hidden layers to create non-linear decision boundaries.
x2
1 | (0,1)=1 (1,1)=0
|
0 | (0,0)=0 (1,0)=1
+------------------------ x1
0 1
No single straight line separates the 1's from the 0's!
QUICK REVISION: w(new)=w(old)+η(t−y)x. Update only when prediction is wrong. Single-layer perceptron = 1 straight decision
boundary ⇒ cannot solve XOR (not linearly separable) ⇒ need MLP.
PYQ: 2023 Q8c "Feed forward Network" (in choice of 2, 14 marks total), 2025 Q4a "Diff CNN and RNN" (uses FFN as base concept)
Definition
A Feed Forward Neural Network (FFNN) is a neural network in which information moves in only one direction — from input layer, through
hidden layer(s), to the output layer — with no loops or cycles.
Keywords
Unidirectional flow, No cycles/loops, Single-layer FFN, Multi-layer FFN (MLP)
Visualization
Because there are no feedback/recurrent connections — each layer's output becomes the next layer's input, and information is never sent
back to an earlier layer. This is different from RNNs, which do have feedback loops (Unit IV).
Applications
Basic classification/regression problems, base building block used inside CNNs (fully-connected layers) and many other networks.
QUICK REVISION: FFN = one-directional Input→Hidden→Output, no loops. Single-layer = perceptron (linear only). Multi-layer = MLP
(non-linear, solves XOR).
PYQ: 2024 Q2b "Backpropagation algorithm in detail" (7 marks) — extremely important, base of Unit II as well.
Definition
Backpropagation is a supervised learning algorithm that trains a multi-layer neural network by computing the gradient of the loss function
with respect to each weight (using the chain rule), and propagating this error backward from the output layer to the input layer to update
the weights.
Keywords
Forward pass, Loss/Error, Backward pass, Chain rule, Gradient, Gradient Descent, Weight update, Learning rate
A single perceptron cannot learn complex, non-linear patterns (like XOR). MLPs (with hidden layers) can — but we need an efficient way to
figure out how much each weight, in every layer, contributed to the final error. Backpropagation solves this using calculus (chain
rule).
Input
|
v
Forward Propagation (compute outputs layer by layer)
|
v
Prediction (y_hat)
|
v
Loss / Error (compare y_hat with actual y)
|
v
Backward Propagation (send error backward through layers)
|
v
Gradient Calculation (chain rule: dLoss/dWeight for every weight)
|
v
Weight Update (Gradient Descent: w = w - eta * dLoss/dw)
|
v
Repeat (many epochs, until loss is minimum)
Mathematics
L = Loss function, ∂L/∂w = gradient of loss w.r.t. that weight (how much loss changes if weight changes slightly), η = learning rate.
MEMORY TRICK: "F-L-B-G-W-R" = Forward → Loss → Backward → Gradient → Weight update → Repeat.
Advantages
Efficiently computes gradients for every weight in deep networks (reuses computation via chain rule)
Enables training of multi-layer, non-linear networks (solves XOR-type problems)
Works for any differentiable activation/loss function
Limitations
Can suffer from vanishing gradient problem in very deep networks
Can get stuck in local minima
Computationally expensive for very large networks
Requires labeled data (supervised)
QUICK REVISION: Forward pass → Loss → Backward pass (chain rule) → Gradients → w = w − η(∂L/∂w) → Repeat. Solves the "how
much did each weight cause the error" problem.
D. DEFINITIONS SHEET: Neuron, MCP Neuron, Perceptron, Weight, Bias, Activation Function, Threshold, Backpropagation, Gradient
Descent, Learning Rate.
E. DIAGRAM SHEET: Neuron architecture, Biological neuron, AI/ML/DL circles, MCP AND/OR/NOT gates, Perceptron diagram, XOR non-
separability plot, Backprop full cycle.
F. FORMULA SHEET: z=Σwx+b, y=f(z), MCP firing rule, w(new)=w(old)+η(t−y)x, w(new)=w(old)−η(∂L/∂w).
G. COMPARISON SHEET: Biological vs Artificial Neuron; MCP Neuron vs Perceptron; Single vs Multi-layer FFN; AI vs ML vs DL.
UNIT II — Feedforward Networks (MLP, Gradient Descent, Backpropagation,
ERM, Regularization, Autoencoders)
Syllabus (from your course file): Multilayer Perceptron, Gradient Descent, Backpropagation, Empirical Risk Minimization, Regularization,
Autoencoders.
PYQ: 2024 Q2b "Linear and Multilayer Perceptron in detail" (7), 2025 Q2a "What is MLP? How does it overcome limitations of single-layer
perceptrons?"
Definition
A Multilayer Perceptron is a feed-forward neural network with one or more hidden layers between the input and output layers, where
each neuron uses a non-linear activation function, enabling it to learn complex, non-linearly separable patterns.
Visualization
Hidden layers 0 ≥1
QUICK REVISION: MLP = FFN with ≥1 hidden layer + non-linear activations, trained via backpropagation, overcomes linear-
separability limit of single perceptron.
PYQ: 2023 Q2a "Importance of Gradient Descent" (7), 2025 Q2b "Optimization techniques: GD, SGD, Adam" (7), 2025 Q5a "Batch GD vs SGD" (7),
2024 Q6b (ERM, related)
Definition
Gradient Descent is an optimization algorithm that iteratively updates a model's weights in the direction opposite to the gradient of the
loss function, in order to reach the minimum loss (best-fit weights).
After backpropagation gives us the gradient (∂L/∂w) for every weight, we need a rule to actually change the weights so that the loss
decreases. Gradient Descent is that rule — think of it as walking downhill on the "loss surface" toward the lowest point (minimum error).
Visualization
Loss
|\ /|
| \ / |
| \ start (high loss) / |
| \ o / |
| \ \ step 1 / |
| \ v / |
| \ o / |
| \ \ step2 / |
| \ v o(minimum) /
|_________\_______________ ____/______ weight (w)
Mathematics
η (learning rate) = step size; too large → overshoots minimum, too small → very slow convergence. ∂L/∂w = slope of loss curve at current
weight (tells direction of steepest increase; we move opposite to it).
Data used per update Entire training dataset One random sample Small batch (e.g. 32, 64 samples)
Used in practice? Rarely (large data) Sometimes Most common in deep learning
Adam = Adaptive Moment Estimation. It combines Momentum (keeps track of past gradients to smooth updates) and RMSProp (adapts
the learning rate for each weight individually). It generally converges faster and more reliably than plain SGD, and is the most widely used
optimizer in modern deep learning.
QUICK REVISION: w=w−η(∂L/∂w). Batch=whole data (slow,smooth), SGD=1 sample (fast,noisy), Mini-batch=small group (best of
both). Adam = momentum + adaptive learning rate.
See Unit I Topic 8 for full detail — same algorithm, asked repeatedly (2024, 2025).
In the Feedforward Networks unit, Backpropagation is studied as the training algorithm for MLPs: it uses the chain rule to propagate
the error gradient from the output layer back to every hidden layer, so that Gradient Descent can update all the weights. See Unit I →
"Back Propagation Network" for the full diagram, steps, and equations — they are identical to what is expected here, just applied
specifically to MLP training.
QUICK REVISION: Backprop = chain-rule gradient computation; Gradient Descent = the update step that uses those gradients. They
always work together.
PYQ: 2024 Q6b "Objective of Empirical Risk Minimization, explain principle" (6 marks)
Definition
Empirical Risk Minimization is the principle of training a model by minimizing the average loss (empirical risk) calculated over the
available training data, as a practical stand-in for minimizing the true (but unknown) risk over the entire data distribution.
Keywords
Empirical risk, True risk, Loss function, Training data, Overfitting, Generalization
Mathematics
N = number of training examples, L = loss function, y_i = true label, f(x_i;w) = model prediction for example i, w = model weights.
Training = find w that minimizes R_emp(w).
Visualization
True Risk (over ALL possible data) -- unknown, cannot compute directly
|
| approximate using training sample
v
Empirical Risk (average loss over N training examples) -- ERM minimizes THIS
|
v
Model learns weights w that minimize training loss
Limitations
Minimizing empirical risk too aggressively can cause overfitting — model memorizes training data but performs poorly on
new/unseen data.
This is exactly why Regularization (next topic) is added to the ERM objective.
QUICK REVISION: ERM = minimize average training loss (1/N)ΣL(y,f(x)) as a proxy for true risk. Risk: overfitting → solved by
regularization.
5. Regularization ⭐⭐⭐
Definition
Regularization is a set of techniques that add a penalty or constraint to the training process to reduce overfitting and improve a model's
ability to generalize to unseen data.
Keywords
Visualization
Common Techniques
Technique Idea
L1 Regularization (Lasso) Adds sum of |weights| to loss — pushes some weights to exactly 0 (feature selection)
L2 Regularization (Ridge/Weight Adds sum of weights² to loss — keeps weights small and smooth
Decay)
Dropout Randomly "turns off" a fraction of neurons during each training step, forcing the network not to rely too heavily
on any one neuron
Early Stopping Stop training when validation loss starts increasing (even if training loss still decreasing)
Data Augmentation Artificially increase training data variety (flips, crops, noise) so the model generalizes better
Applications
Used in almost every deep network (MLP, CNN, RNN) to prevent overfitting, especially when training data is limited.
QUICK REVISION: Regularization = penalty added to loss to avoid overfitting. Key methods: L1 (sparsity), L2 (small weights), Dropout
(random neuron drop), Early stopping.
6. Autoencoders ⭐⭐⭐⭐
PYQ: 2024 Q2a "Explain different types of Autoencoders" (7), 2024 Q5b "Diff Autoencoders and RBM" (7), 2023 Q8a "Deep Generic Models" choice,
2025 Q8d "Autoencoder Architecture" choice
Definition
An Autoencoder is an unsupervised neural network that learns to compress input data into a smaller latent representation (encoding) and
then reconstruct the original input from that representation (decoding), with the goal of learning efficient, meaningful features.
Keywords
Visualization
Input (x) --> [ ENCODER ] --> Latent/Bottleneck (z, small) --> [ DECODER ] --> Output (x_hat)
|____________________________________________________________________________________|
Goal: x_hat should be as close to x as possible
(Reconstruction Loss = difference between x and x_hat)
Working
1. Encoder compresses input x into a lower-dimensional latent vector z (forces the network to learn only the most important features).
2. Decoder reconstructs the original input from z, producing x_hat.
3. Network is trained to minimize reconstruction loss (e.g. MSE between x and x_hat) — no labels needed, so training is
unsupervised.
Types of Autoencoders
Type Idea
Denoising Autoencoder Trained to reconstruct clean input from a noisy/corrupted version — learns robust features
Sparse Autoencoder Adds a sparsity penalty so only a few neurons activate at a time
Convolutional Autoencoder Uses convolution layers instead of fully-connected — good for images
Variational Autoencoder (VAE) Learns a probability distribution over the latent space (not a fixed point) — can generate new data by sampling
Autoencoders vs RBM
Structure Encoder + Decoder (feed-forward, deterministic) Bipartite graph of visible + hidden units, stochastic
Direction One-directional (encoder→decoder) Bidirectional connections between visible & hidden layers
Applications
Dimensionality reduction, denoising, anomaly detection, feature learning, image compression, pretraining for deep networks.
QUICK REVISION: Autoencoder = Encoder (compress) + Decoder (reconstruct), unsupervised, minimizes reconstruction loss. Types:
vanilla, denoising, sparse, convolutional, VAE (generative).
D. DEFINITIONS SHEET: MLP, Gradient Descent, SGD, Adam, Empirical Risk, Regularization, Dropout, Autoencoder, Encoder, Decoder,
Latent space.
E. DIAGRAM SHEET: MLP architecture, Gradient descent bowl curve, ERM flow, Autoencoder encoder-decoder diagram.
F. FORMULA SHEET: w=w−η(∂L/∂w); R_emp(w)=(1/N)ΣL(y_i,f(x_i;w)); Regularized loss = R_emp(w)+λPenalty(w).
G. COMPARISON SHEET: Single vs Multi-layer Perceptron; Batch vs SGD vs Mini-batch; Autoencoder vs RBM; L1 vs L2 regularization.
UNIT III — Convolutional Networks
PYQ: 2023 Q7a "Convolution Operation, explain in detail" (8), 2024 Q7a "Why convolution network in DL" (7), 2025 Q3b "Significance of
convolution operation in CNNs" (7), 2025 Q3a "Briefly discuss CNN with Deep Learning" (7)
Definition
A Convolutional Neural Network (CNN) is a deep learning architecture designed for grid-like data (especially images) that uses the
convolution operation to automatically extract spatial features (edges, textures, shapes) using small filters that scan across the input.
Keywords
Kernel/Filter, Feature Map, Local Connectivity, Weight Sharing, Stride, Padding, Pooling, ReLU, Flatten, Fully Connected
Layer
Image
|
v
Convolution (filters slide over image)
|
v
Feature Map (highlights detected patterns)
|
v
ReLU (adds non-linearity, removes negative values)
|
v
Pooling (downsamples, keeps important info, reduces size)
|
v
(Repeat Conv+ReLU+Pool blocks several times)
|
v
Flatten (convert 2D feature maps to 1D vector)
|
v
Fully Connected Layer (like a normal MLP)
|
v
Output (class probabilities)
Mathematics
I = input image, K = kernel/filter, S = output feature map (sum of element-wise multiplication of filter with the region it covers, slid across
the whole image).
Advantages
Far fewer parameters than fully-connected MLP for images (weight sharing)
Preserves spatial structure
Automatically learns hierarchical features (edges → shapes → objects)
Translation invariance (can detect a feature anywhere in the image)
Limitations
Needs large labeled datasets and heavy compute
Not naturally rotation/scale invariant (needs augmentation)
Struggles with very long-range spatial relationships (large receptive field needed)
Applications
Image classification, object detection, face recognition, medical image analysis, self-driving car vision.
EXAM-READY ANSWER (7–8 marks): "What is Convolution Operation? / Why CNN for Deep Learning?"
1. Define CNN and convolution (2–3 lines).
2. Explain why plain MLP fails on images (destroys spatial info, too many params).
3. Draw the CNN architecture pipeline diagram (Image→Conv→ReLU→Pool→...→FC→Output).
4. Show a small numerical convolution example (like above).
5. Write the convolution formula, explain I, K, S.
6. Mention weight sharing + local connectivity as key ideas.
7. Give 2 advantages, 2 limitations, 2 applications.
QUICK REVISION: CNN pipeline: Image→Conv→ReLU→Pool→Flatten→FC→Output. Convolution = filter slides + element-wise multiply +
sum. Key ideas: local connectivity + weight sharing.
PYQ: 2023 Q3b "Explain variants of the basic convolution function in detail" (7) — directly asked, must-do.
Definition
The basic convolution operation can be modified in several ways — padding, stride, dilation, and connectivity pattern — to control the
output size, computation cost, and receptive field of a CNN.
Padding Adding extra (usually zero) pixels around the input Controls output size; preserves border information that
border before convolution would otherwise be lost
Valid Convolution No padding used — output is smaller than input Simplest, but shrinks feature map every layer and loses
border info
Same Convolution Padding added so output size = input size Keeps spatial dimensions constant across layers
Stride Number of pixels the filter moves at each step Larger stride = more downsampling, less computation
Strided Convolution Convolution with stride > 1 Reduces output size while extracting features (acts like
pooling)
Dilated Convolution Filter has "gaps" between its weights (dilation rate > 1) Increases receptive field without increasing
parameters/computation
Locally Connected / Like convolution, but each location uses a different filter Useful when different image regions have very different
Unshared Convolution (no weight sharing) statistics (e.g. face parts)
Tiled Convolution A middle ground: a set of filters is learned and cycled Balances parameter efficiency of shared convolution
across locations (partial weight sharing) with flexibility of unshared convolution
PADDING (zero border added): STRIDE (filter jump = 2): DILATION (filter with gaps):
0 0 0 0 0 X . X . X X . X
0 1 2 3 0 <- zeros added (filter moves 2 steps . . . <- filter "spread out"
0 4 5 6 0 around border at a time, skips 1 pixel) X . X covers wider area,
0 7 8 9 0 same # of weights
0 0 0 0 0
QUICK REVISION: Padding=border pixels added (valid=none, same=output size preserved). Stride=step size of filter. Dilation=filter
with gaps (bigger receptive field, same params). Locally-connected=no weight sharing. Tiled=partial sharing.
PYQ: 2024 Q8a & 2025 Q8a "Structured output in Convolutional Network" (choice question, 7–14 marks)
Definition
Structured output refers to CNN tasks where the model must output a structured, high-dimensional prediction (like a label for every
pixel) instead of just a single class label for the whole image.
Ordinary classification: Image ---> CNN ---> ONE label (e.g. "cat")
Structured output: Image ---> CNN ---> label for EVERY pixel/region
(e.g. pixel-wise segmentation map)
Key Ideas
Pixel-wise prediction: CNN outputs a full 2D map, same spatial size as input, where each pixel has its own predicted class.
Semantic Segmentation: classic structured-output task — every pixel labeled (e.g. "road", "car", "sky").
Spatial relationships between output elements must be respected (e.g. neighbouring pixels usually belong to the same object) —
this makes structured output harder than simple classification.
CNNs are well suited because their convolutional feature maps are already spatially organized — they naturally preserve the "where"
information needed for pixel-wise output.
Applications
Semantic segmentation (self-driving cars, medical imaging), pose estimation, image captioning (structured sequence output).
QUICK REVISION: Structured output = one label per pixel/region (not one label for whole image). Main example: semantic
segmentation. CNNs work well because feature maps preserve spatial layout.
A direct/naive convolution requires sliding the filter across every position of a (potentially large) input and computing element-wise
multiply + sum at each position — for large images, many channels, and many filters, this becomes a very large number of multiply-add
operations, especially in deep CNNs with many layers.
Key Approaches
Approach Idea
im2col + Matrix Rearrange overlapping image patches into columns of a matrix, then convolution becomes a single big matrix
Multiplication multiplication — which GPUs are extremely optimized for
FFT-based Convolution in the spatial domain = multiplication in the frequency domain. Convert input & filter using Fast Fourier
Convolution Transform, multiply, then inverse-transform — much faster for large filters
Separable Split a 2D filter into two 1D filters (one horizontal, one vertical) applied sequentially — reduces multiplications from O(k²) to
Convolution O(2k) per pixel
Visualization
im2col approach:
Image patches ---> flattened into columns ---> Matrix Multiply (with filter matrix) ---> Feature Map
(fast on GPU hardware)
Separable convolution:
2D filter (k x k) = 1D vertical filter (k x 1) followed by 1D horizontal filter (1 x k)
Why efficient convolution matters
Modern CNNs (like AlexNet, ResNet) have millions of parameters and are trained on millions of images — without efficient convolution
algorithms, training would be computationally infeasible even with GPUs.
QUICK REVISION: Convolution is expensive due to sliding-window multiply-adds. Solutions: im2col+matmul (GPU-friendly), FFT-based
(fast for large filters), separable convolution (splits 2D filter into two 1D filters).
Definition
Instead of learning all convolution filters through backpropagation on labeled data, CNN filters can also be obtained using randomly
initialized (and fixed) filters or via unsupervised feature learning methods that don't require labels.
Key Ideas
Random features: surprisingly, even randomly generated filters (never trained) can extract somewhat useful low-level features
(like edge detectors) — useful as a fast baseline.
Unsupervised feature learning: learn filters from unlabeled data using clustering (e.g. k-means on patches), sparse coding, or
autoencoders — useful since labeled data is expensive but unlabeled data is abundant.
Quality of features Best (task-specific) Good (general-purpose) Weak but surprisingly non-zero
Labeled data is expensive and limited, while unlabeled data (raw images, text) is abundant. Unsupervised/random feature methods let us
leverage this abundant unlabeled data to build useful initial representations, which can then be fine-tuned with a smaller labeled dataset.
QUICK REVISION: Random features = fixed, untrained filters (surprisingly usable as a baseline). Unsupervised features = learned
without labels (clustering, sparse coding, autoencoders). Motivation: unlabeled data is cheap and abundant.
6. LeNet ⭐⭐⭐⭐⭐
PYQ: 2024 Q3b "What is LeNet? Explain the usage of LeNet in object recognition" (7), 2023 Q3a "Role of LeNet in Convolutional Networks" (7)
Definition
LeNet (LeNet-5, by Yann LeCun, 1998) is one of the earliest CNN architectures, originally designed to recognize handwritten digits (e.g.
postal codes, bank cheques), consisting of alternating convolution and subsampling (pooling) layers followed by fully connected layers.
32x32 Input
|
v
C1: Convolution -> 6@28x28
|
v
S2: Subsampling/Pooling -> 6@14x14
|
v
C3: Convolution -> 16@10x10
|
v
S4: Subsampling/Pooling -> 16@5x5
|
v
C5: Convolution (fully connected) -> 120
|
v
F6: Fully Connected -> 84
|
v
Output -> 10 classes (digits 0-9)
MEMORY TRICK: "6 gets Sweet 16, makes 120 Rupees in 84 Ten-paisa coins" → 6 → 16 → 120 → 84 → 10
Layer-by-layer Explanation
Input: 32×32 grayscale image
C1 (Conv): 6 filters → produces 6 feature maps of size 28×28 (extracts basic features like edges)
S2 (Pooling): subsamples to 6@14×14 (reduces size, keeps important info)
C3 (Conv): 16 filters → 16@10×10 (extracts more complex features)
S4 (Pooling): subsamples to 16@5×5
C5 (Conv, acts as FC): 120 feature maps (essentially fully connected at this point since spatial size is 1×1 after this)
F6 (Fully Connected): 84 neurons
Output: 10 neurons (digit classes 0–9), using softmax/RBF
LeNet was used to automatically read handwritten/printed digits for postal mail sorting and bank cheque processing — demonstrating that
CNNs could outperform traditional hand-crafted feature methods for image recognition, and set the template (Conv+Pool blocks → FC
layers) followed by almost all later CNNs.
QUICK REVISION: LeNet-5: 32x32 input → C1(6@28x28) → S2(6@14x14) → C3(16@10x10) → S4(16@5x5) → C5(120) → F6(84) →
Output(10). Used for handwritten digit recognition.
7. AlexNet ⭐⭐⭐⭐⭐
PYQ: 2024 Q8b & 2025 Q8b "AlexNet" (choice question, 7–14 marks) — repeatedly asked in choice questions.
Definition
AlexNet (Krizhevsky, Sutskever, Hinton, 2012) is a deep CNN that won the ImageNet Large Scale Visual Recognition Challenge (ILSVRC)
2012 by a huge margin, and is widely credited with sparking the modern deep learning revolution in computer vision.
Architecture
5 Convolutional layers + 3 Fully Connected layers
Uses ReLU activation (instead of sigmoid/tanh) — trains much faster
Uses Max Pooling layers to downsample feature maps
Uses Dropout in fully-connected layers to reduce overfitting
Uses Data Augmentation (crops, flips) to artificially increase training data
Trained on GPUs (2 GPUs in parallel) — showed GPUs could make deep CNN training practical
DRAW THIS IN EXAM — simplified block diagram
MEMORY TRICK: "AlexNet = 2012 + ImageNet + 5 Conv + 3 FC + ReLU + Max Pooling + Dropout + GPU"
LeNet vs AlexNet
Dataset Small (MNIST digits) Large (ImageNet, 1.2M images, 1000 classes)
Impact First successful CNN template Triggered the deep learning boom in computer vision
QUICK REVISION: AlexNet (2012, ImageNet winner): 5 Conv + 3 FC, ReLU, Max Pooling, Dropout, Data Augmentation, trained on
GPUs. Sparked the deep learning revolution.
D. DEFINITIONS SHEET: Convolution, Kernel/Filter, Feature Map, Padding, Stride, Dilation, Pooling, Structured output, im2col, LeNet,
AlexNet.
E. DIAGRAM SHEET: CNN pipeline, padding/stride/dilation diagrams, ordinary vs structured output, LeNet-5 full architecture, AlexNet
block diagram.
F. FORMULA SHEET: S(i,j)=ΣΣI(i+m,j+n)K(m,n); Output=((Input+2Padding−Kernel)/Stride)+1.
G. COMPARISON SHEET: Valid vs Same convolution; LeNet vs AlexNet; Supervised vs Unsupervised vs Random features.
UNIT IV — Recurrent Neural Networks
PYQ: 2024 Q4a "Diff CNN and RNN" (7), 2025 Q4a "Diff CNN and RNN" (7) — appears every year
Definition
A Recurrent Neural Network (RNN) is a neural network designed for sequential data, where the output of a neuron at one time step is fed
back as input at the next time step, giving the network a form of "memory" of past information.
Keywords
Sequential data, Hidden state, Memory, Recurrent connection, Temporal dependency, Weight sharing across time,
Unrolling, BPTT, Vanishing/Exploding gradient
FFNs treat every input independently — they have no memory of previous inputs. But for sequences (text, speech, time-series), the order
and context matter (e.g. meaning of a word depends on previous words). RNNs solve this by maintaining a hidden state that carries
information forward through time.
x1 x2 x3
| | |
v v v
[h0]-->[h1]-->[h2]-->[h3] (hidden state passed forward through time)
| | |
v v v
y1 y2 y3
Mathematics
x_t = input at time t, h_(t-1) = previous hidden state (memory), h_t = new hidden state, W_xh = weight matrix from input to hidden,
W_hh = weight matrix from previous hidden to current hidden (same weights reused at every time step — weight sharing), b = bias, tanh
= activation function.
Working
1. At each time step t, RNN takes current input x_t AND previous hidden state h_(t-1).
2. Combines them to compute new hidden state h_t (the "memory").
3. h_t can be used to produce output y_t, and is also passed to the next time step.
4. Same weights (W_xh, W_hh) are reused at every time step (weight sharing across time).
5. Training uses Backpropagation Through Time (BPTT) — the network is "unrolled" across time steps and normal backpropagation
is applied across this unrolled graph.
DON'T CONFUSE: this problem is why LSTM was invented — make sure to link RNN's weakness directly to LSTM's motivation in your answer.
Long Sequence
|
v
Gradients multiplied repeatedly through many time steps (chain rule)
|
v
Gradients shrink toward 0 (Vanishing) or grow huge (Exploding)
|
v
RNN forgets distant/old information (can't learn long-term dependencies)
|
v
Solution: LSTM (adds Cell State + Gates for better long-term memory)
CNN vs RNN
Best suited for Spatial data (images) Sequential data (text, speech, time-series)
Key operation Convolution (filters over space) Recurrence (loop over time)
Memory of past No (each region processed independently) Yes (hidden state carries memory)
Weight sharing Shared across spatial locations Shared across time steps
Common problem Overfitting on small datasets Vanishing/exploding gradient over long sequences
QUICK REVISION: h_t = tanh(W_xh x_t + W_hh h_(t-1) + b). RNN has memory via hidden state, trained via BPTT. Long sequences →
vanishing gradient → forgets old info → motivates LSTM.
PYQ: 2023 Q4a "What are Bidirectional RNNs? Explain in detail" (7), 2024 Q7b "Diff RNN and Bidirectional RNN" (7)
Definition
A Bidirectional RNN processes a sequence in both directions — one RNN reads left-to-right (forward, using past context) and another
reads right-to-left (backward, using future context) — and combines both hidden states to make predictions.
Visualization
Working
Forward RNN processes the sequence from start to end, capturing past context.
Backward RNN processes the sequence from end to start, capturing future context.
At each time step, the forward hidden state and backward hidden state are combined (usually concatenated) to form the final
representation, so each output depends on the entire sequence (both before and after).
Context used Only past (left-to-right) Both past and future (left-to-right + right-to-left)
Real-time/streaming use Yes (works as data arrives) No (needs entire sequence available first)
Accuracy for offline tasks Lower (missing future context) Higher (full context)
Advantages
Captures full context (past + future) → better accuracy for tasks like translation, named entity recognition, speech recognition.
Limitations
Cannot be used for real-time/streaming prediction (needs the whole sequence first); more computation (2 RNNs).
Applications
PYQ: 2023 Q4b "Define Recurrent Network? Discuss about Deep Recurrent Networks" (7)
Definition
A Deep Recurrent Network stacks multiple RNN layers on top of each other, so that the output (hidden state sequence) of one RNN layer
becomes the input sequence to the next RNN layer — adding depth in the "vertical" direction in addition to the usual "horizontal" flow
through time.
Visualization
Working
Horizontal flow: within each layer, hidden state flows through time (t=1,2,3...) like a normal RNN.
Vertical flow: at each time step, the hidden state of layer 1 becomes the input to layer 2, and so on — building hierarchical,
increasingly abstract sequence representations.
Advantages
Learns more abstract/complex temporal patterns; generally better performance on complex sequence tasks than a single-layer RNN.
Limitations
Harder to train (deeper network = more prone to vanishing gradient); more computation and parameters.
QUICK REVISION: Deep RNN = multiple RNN layers stacked; horizontal flow=through time, vertical flow=through layers. More
abstract features but harder to train.
Definition
A Recursive Neural Network applies the same set of weights repeatedly over a tree-structured input (instead of a linear sequence),
combining child node representations to build a parent representation, recursively, up to the root of the tree.
DON'T CONFUSE: Recurrent NN operates over a linear sequence (chain, time steps). Recursive NN operates over a tree structure
(hierarchical). "Recurrent" repeats over TIME; "Recursive" repeats over TREE STRUCTURE.
RNN vs Recursive NN
Typical use case Speech, time-series, general text Parsing sentence structure, sentiment on parse trees (NLP)
Applications
Natural Language Processing tasks that use parse trees — sentence structure analysis, sentiment analysis with syntactic trees.
QUICK REVISION: Recursive NN = same weights applied recursively over a TREE (not a sequence). parent = f(W[child1;child2]+b).
Used in NLP parse-tree tasks.
PYQ: 2024 Q4b "What is Long Short Term Memory? Explain" (7), 2025 Q4b "LSTM explain" (7) — asked EVERY year, top priority.
Motivation
Basic RNN
|
v
Vanishing Gradient (over long sequences)
|
v
Long-Term Dependency Problem (forgets old information)
|
v
LSTM (solves this using a separate Cell State + Gates)
Definition
LSTM is a special type of RNN that introduces a cell state (a long-term memory highway) and three gates (Forget, Input, Output) that
control what information is added, removed, or output at each time step — allowing it to retain important information over long sequences
and avoid the vanishing gradient problem.
Keywords
Cell state, Hidden state, Forget gate, Input gate, Candidate cell state, Output gate, Sigmoid gate
MEMORY TRICK: F-I-O — Forget: "What should I remove?" Input: "What should I store?" Output: "What should I expose/output?"
Mathematics
σ = sigmoid function (squashes values 0–1, acts as a "gate"/filter), [h(t-1),x_t] = concatenation of previous hidden state and current
input, W, b = learnable weights/biases for each gate, * = element-wise multiplication.
Memory Single hidden state only Cell state (long-term) + Hidden state (short-term)
Long-term dependency Poor (vanishing gradient) Good (cell state acts as a gradient "highway")
Training speed Faster per step Slower per step (more computation)
QUICK REVISION: LSTM = Cell state + 3 gates (F-I-O). f_t=σ(...), i_t=σ(...), C~_t=tanh(...), C_t=f_t*C(t-1)+i_t*C~_t, o_t=σ(...),
h_t=o_t*tanh(C_t). Solves vanishing gradient / long-term dependency problem.
Definition
GRU (Gated Recurrent Unit) is a simplified alternative to LSTM that uses only two gates (Update gate and Reset gate) and merges the
cell state and hidden state into one, achieving similar performance to LSTM with fewer parameters and faster training.
Keywords
Update gate, Reset gate, Single hidden state (no separate cell state)
Visualization
h(t-1), x_t
|
+----> Reset Gate (r_t) -- controls how much past info to forget when computing candidate
|
+----> Update Gate (z_t) -- controls balance between old hidden state and new candidate
|
v
h_t = (1 - z_t) * h(t-1) + z_t * h~_t (blend of old and new)
Memory type Hidden state only Cell state + Hidden state Hidden state only (merged)
When to prefer Very short Complex, long sequences, more data Good middle ground; smaller datasets/faster training
sequences available needed
QUICK REVISION: GRU = 2 gates (Update, Reset), no separate cell state, simpler/faster than LSTM. h_t = (1−z_t)h(t-1) + z_t*h~_t.
D. DEFINITIONS SHEET: RNN, Hidden state, BPTT, Bidirectional RNN, Deep RNN, Recursive NN, LSTM, Cell state, Forget/Input/Output
gate, GRU, Update/Reset gate.
E. DIAGRAM SHEET: Unrolled RNN, Bidirectional RNN (forward+backward), Deep RNN (stacked layers), Recursive NN tree, LSTM cell
(full gates), GRU cell.
F. FORMULA SHEET: h_t=tanh(W_xh x_t+W_hh h_(t-1)+b); LSTM's 6 equations (f_t, i_t, C~_t, C_t, o_t, h_t); GRU's h_t=(1−z_t)h(t-
1)+z_t h~_t.
G. COMPARISON SHEET: CNN vs RNN; RNN vs Bidirectional RNN; Recurrent vs Recursive NN; RNN vs LSTM vs GRU.
End of Notes — Units I to IV. Good luck for AD-601 Deep Learning!