02 - Introduction to Convolutional Neural Networks (CNNs)
02 - Introduction to Convolutional Neural Networks (CNNs)
Introduction
Convolutional Neural
Networks (CNNs)
What is a CNN?
• CNN stands for Convolutional Neural Network
• Example:
• Original Image (3x3)
• Kernel (3x3)
• Output (Feature Map)
Convolutional Layer
• Types of Padding:
• Valid Padding – No padding (smaller output)
• Same Padding – Keeps the same size
Padding in CNNs
• Valid Padding – No padding (smaller output)
• No extra pixels are added around the input.
• The filter only moves within the original image.
• The output feature map is smaller than the input.
• Example:
• Input: 5×5
• Filter: 3×3
• Stride: 1
• Padding: 0
• 🔹 Output: 3×3 (smaller than input).
Same Padding
• Same Padding – Keeps the same size
• Adds zeros around the input so that the output size = input size (if S=1).
• Used when we want to maiEffect: Preserves spatial dimensions → No loss of edge features.
• 💡 Example:
• Input: 5×5
• Filter: 3×3
• Stride: 1
• Padding: 1
• Types:
• Max Pooling – Takes the highest value in a region
• Average Pooling – Takes the average of the
region
Max Pooling
• Takes the maximum value from each region of the feature map.
• Common Types:
• ReLU (Rectified Linear Unit): Most common, sets negatives to zero
• Sigmoid: Used for binary classification
• Softmax: Used for multi-class classification
Lecture 2
"ResNet: Deep Residual
Learning for Image Recognition"
Introduction to Deep Learning
1. Briefly explain what deep learning is
• Vanishing/exploding gradients
• Image classification