Lec 11
Lec 11
Image Classification
Input:
o Image
Output:
o Assign image to one of a fixed set of categories
Problem:
o Semantic Gap
Viewpoint Variation.
Intraclass Variation.
Fine-Grained Categories.
Background Clutter.
Illumination Changes.
Deformation.
Occlusion.
1|Page
Image Classification Applications
Object detection.
Disease diagnosis based on medical image analysis.
Image captioning.
Playing games (such as GO).
Activity analysis.
10 classes : Digits 0 to 9
28 x 28 grayscale images
50k training images
10k test images
2|Page
Image Classification Datasets: CIFAR100
100 classes
50k training images
10k testing images (100 per class)
32 x 32 RGB images
20 superclass with 5 classes each :-
Aquatic mammals: beaver, dolphin, otter, seal, whale
Trees : Maple, oak, palm, pine, willow
1000 classes
1.3M training images (1.3k per class)
50k validation images (50 per class)
100k test images (100 per class)
Performance metric: Top 5 accuracy Algorithm predicts 5 labels for each image,
one of them needs to be right
3|Page
Comparison between Image classification Datasets:-
Training:
o Memorize all data and labels.
Testing/Prediction:
o Predict the label of the most similar training image.
4|Page
Nearest Neighbor Decision Boundaries
K-Nearest Neighbors
5|Page
K-Nearest Neighbors (cont’d)
Instead of copying label from nearest neighbor,
o take majority vote from k closest points.
6|Page
KNN: Hyperparameters
What is the best
o value of K to use?
o distance metric to use?
examples of hyperparameters:
o choices about ourlearning algorithm that we don’t learn from the training
data
o instead we set them at the start of the learning process.
Very problem-dependent.
o In general need to try them all and see what works best for our data/task
General Notes
Universal Approximation:
o As the number of training samples goes to infinity,
KNN can represent any function
Curse of dimensionality:
o For uniform coverage of space,
number of training points needed grows exponentially with
dimension.
7|Page
Neural Networks
Backpropagation Model
8|Page
Deep Neural Networks
Deep Learning: Hierarchical learning algorithms with many
Activation Functions
ReLU is a good default choice for most problems.
9|Page
Components of a Convolutional Network
Fully-Connected-Layers
Activation Function
Convolution Layers
Pooling Layers
Normalization
10 | P a g e
Convolution Layer
Filters always extend the full depth of the input volume
Convolve the filter with the image spatially
computing dot products
11 | P a g e
Stacking Convolutions
12 | P a g e
What do convolutional filters learn?
Linear classifier:
o One template per class
13 | P a g e
Receptive Fields
Convolution Summary
14 | P a g e
Pooling Layers
Max Pooling
15 | P a g e
Pooling Summary
Convolutional Networks
16 | P a g e
Example: LeNet-5
Batch Normalization
Idea :
o Normalize the outputs of a layer so they have zero mean and unit
variance
Why?
o Helps reduce internal covariate shift
o Improve optimization
17 | P a g e
We can normalize a batch of activations like this :
18 | P a g e
Batch Normalization for ConvNets
Batch Normalization
19 | P a g e
Group Normalization
20 | P a g e