SlideShare a Scribd company logo
Day 1 Lecture 2
Classification
[course site]
Eva Mohedano
Outline
Image Classification
Train/Test Splits
Metrics
Models
Outline
Image Classification
Train/Test Splits
Metrics
Models
4
Image Classification
Set of predefined categories [eg: table, apple, dog, giraffe]
Binary classification [1, 0]
DOG
5
Image Classification
6
Dog
Image Classification pipeline
Slide credit: Jose M Àlvarez
7Slide credit: Jose M Àlvarez
Dog
Learned
Representation
Image Classification pipeline
8
Dog
Learned
Representation
Part I: End-to-end learning (E2E)
Image Classification pipeline
Slide credit: Jose M Àlvarez
9
Image Classification: Example Datasets
training set of 60,000 examples
test set of 10,000 examples
10
Image Classification: Example Datasets
Outline
Image Classification
Train/Test Splits
Metrics
Models
2.1 3.2 4.8 0.1 0.0 2.6
3.1 1.4 2.5 0.2 1.0 2.0
1.0 2.3 3.2 9.3 6.4 0.3
2.0 5.0 3.2 1.0 6.9 9.1
9.0 3.5 5.4 5.5 3.2 1.0
N training examples
(rows)
D features (columns)
0
1
1
0
0
N
Training set
Dataset
Shuffled
data
shuffle
Training
data
(70%)
Test data
(30%)
split
Learning algorithm
fit(X, y)
Model
Prediction algorithm
predict(X)
Predictions
Compute error/accuracy
score(X, y)
Out-of-sample
error estimate
NO!
Train/Test Splits
Split your dataset into train and test at the very start
● Usually good practice to shuffle data (exception: time series)
Do not look at test data (data snooping)!
● Lock it away at the start to prevent contamination
NB: Never ever train on the test data!
● You have no way to estimate error if you do
● Your model could easily overfit the test data and have poor generalization, you have no way of
knowing without test data
● Model may fail in production
Data hygiene
Outline
Image Classification
Train/Test Splits
Metrics
Models
Confusion matrices provide a by-class comparison between the results of the automatic classifications
with ground truth annotations.
Metrics
Metrics
Correct classifications appear in the diagonal, while the rest of cells correspond to errors.
Prediction
Class 1 Class 2 Class 3
Ground
Truth
Class 1 x(1,1) x(1,2) x(1,3)
Class 2 x(2,1) x(2,2) x(2,3)
Class 3 x(3,1) x(3,2) x(3,3)
Special case: Binary classifiers in terms of “Positive” vs “Negative”.
Prediction
Positives negative
Ground
Truth
Positives
True
positive (TP)
False
negative
(FN)
negative
False
positives (FP)
True negative
(TN)
Metrics
The “accuracy” measures the proportion of correct classifications, not distinguishing between classes.
Binary
Prediction
Class 1 Class 2 Class 3
Ground
Truth
Class 1 x(1,1) x(1,2) x(1,3)
Class 2 x(2,1) x(2,2) x(2,3)
Class 3 x(3,1) x(3,2) x(3,3)
Prediction
Positives negative
Ground
Truth
Positives
True positive
(TP)
False
negative
(FN)
Negative
False positives
(FP)
True negative
(TN)
Metrics
Given a reference class, its Precision (P) and Recall (R) are
complementary measures of relevance.
Prediction
Positives Negatives
Ground
Truth
Positives
True
positive
(TP)
False
negative
(FN)
Negatives
False
positives
(FP)
"Precisionrecall" by Walber - Own work. Licensed under Creative
Commons Attribution-Share Alike 4.0 via Wikimedia Commons -
http://commons.wikimedia.org/wiki/File:Precisionrecall.
svg#mediaviewer/File:Precisionrecall.svg
Example: Relevant class is “Positive” in a binary classifier.
Metrics
Binary classification results often depend from a parameter (eg. decision threshold) whose value
directly impacts precision and recall.
For this reason, in many cases a Receiver Operating Curve (ROC curve) is provided as a result.
TruePositiveRate
Metrics
Outline
Image Classification
Train/Test Splits
Metrics
Models
23
Dog
Image Classification pipeline
Slide credit: Jose M Àlvarez
Mapping function to predict a score for the class label
Linear Models
f(x, w) = (wT
x + b)
CS231n: Convolutional Neural Networks for Visual Recognition
Sigmoid
f(x, w) = g(wT
x + b)
Activation function: Turn score into probabilities
Logistic Regression
Neuron
Summary
Image classification aims to build a model to automatically
predict the content of an image.
When presented as supervised problem, data should be
structured in Train/Test splits to learn the model.
Important to have a way to asses the performance of the
models
Easiest models classification are linear models. Linear models
with a non-linearity on top represent the the “neuron”, the basic
element of Neural Networks.

More Related Content

PPTX
Image Classification using deep learning
PPTX
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
PPTX
Computer Vision image classification
PPTX
Object Detection using Deep Neural Networks
PPTX
Tutorial on Object Detection (Faster R-CNN)
PDF
Object Detection Using R-CNN Deep Learning Framework
PPTX
Convolutional Neural Network
PPTX
Image classification using CNN
Image Classification using deep learning
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Computer Vision image classification
Object Detection using Deep Neural Networks
Tutorial on Object Detection (Faster R-CNN)
Object Detection Using R-CNN Deep Learning Framework
Convolutional Neural Network
Image classification using CNN

What's hot (20)

PDF
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
PDF
Image Classification with Deep Learning | DevFest + GDay, George Town, Mala...
PPTX
Image captioning
PPTX
cnn ppt.pptx
PPTX
Introduction to CNN
PPTX
Image classification using convolutional neural network
PPTX
Deep Learning in Computer Vision
PPTX
Image Processing and Computer Vision
PPTX
Convolutional Neural Network (CNN)of Deep Learning
PDF
Deep Learning - Convolutional Neural Networks
PPTX
Convolutional neural network
PPTX
Convolutional Neural Networks
PPTX
Transfer Learning and Fine-tuning Deep Neural Networks
PPTX
Introduction to Deep learning
PPTX
Image classification with Deep Neural Networks
PPTX
Deep learning.pptx
PPTX
CNN and its applications by ketaki
PPTX
Deep Learning With Python | Deep Learning And Neural Networks | Deep Learning...
PDF
Deep Learning for Computer Vision: Data Augmentation (UPC 2016)
PPTX
Image recognition
“An Introduction to Data Augmentation Techniques in ML Frameworks,” a Present...
Image Classification with Deep Learning | DevFest + GDay, George Town, Mala...
Image captioning
cnn ppt.pptx
Introduction to CNN
Image classification using convolutional neural network
Deep Learning in Computer Vision
Image Processing and Computer Vision
Convolutional Neural Network (CNN)of Deep Learning
Deep Learning - Convolutional Neural Networks
Convolutional neural network
Convolutional Neural Networks
Transfer Learning and Fine-tuning Deep Neural Networks
Introduction to Deep learning
Image classification with Deep Neural Networks
Deep learning.pptx
CNN and its applications by ketaki
Deep Learning With Python | Deep Learning And Neural Networks | Deep Learning...
Deep Learning for Computer Vision: Data Augmentation (UPC 2016)
Image recognition
Ad

Similar to Deep Learning for Computer Vision: Image Classification (UPC 2016) (20)

PDF
introducatio to ml introducatio to ml introducatio to ml
PPTX
Machine Learning Unit 2 Semester 3 MSc IT Part 2 Mumbai University
DOCX
Performance of the classification algorithm
PDF
The Perceptron (D1L2 Deep Learning for Speech and Language)
PDF
02_pytorch_classification.pdf might be the
PPTX
04-Machine-Learning-Overview pros and cons
PDF
Lecture 12 binary classifier confusion matrix
PPTX
Machine-Learning-Overview a statistical approach
PDF
Machine Learning Basics for Web Application Developers
PPTX
machine Learning subject of third year information technology unit 2.pptx
PPTX
ML-ChapterFour-ModelEvaluation.pptx
PPTX
Unit 4 Classification of data and more info on it
PPT
Data mining techniques unit iv
PDF
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
PPT
confusion data mining algorithm _updated.ppt
PDF
Ch 1-2 NN classifier
PDF
Classification
PDF
Confusion matrix and classification evaluation metrics
PPTX
Building and deploying analytics
introducatio to ml introducatio to ml introducatio to ml
Machine Learning Unit 2 Semester 3 MSc IT Part 2 Mumbai University
Performance of the classification algorithm
The Perceptron (D1L2 Deep Learning for Speech and Language)
02_pytorch_classification.pdf might be the
04-Machine-Learning-Overview pros and cons
Lecture 12 binary classifier confusion matrix
Machine-Learning-Overview a statistical approach
Machine Learning Basics for Web Application Developers
machine Learning subject of third year information technology unit 2.pptx
ML-ChapterFour-ModelEvaluation.pptx
Unit 4 Classification of data and more info on it
Data mining techniques unit iv
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
confusion data mining algorithm _updated.ppt
Ch 1-2 NN classifier
Classification
Confusion matrix and classification evaluation metrics
Building and deploying analytics
Ad

More from Universitat Politècnica de Catalunya (20)

PDF
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
PDF
Deep Generative Learning for All
PDF
The Transformer in Vision | Xavier Giro | Master in Computer Vision Barcelona...
PDF
Towards Sign Language Translation & Production | Xavier Giro-i-Nieto
PDF
The Transformer - Xavier Giró - UPC Barcelona 2021
PDF
Learning Representations for Sign Language Videos - Xavier Giro - NIST TRECVI...
PDF
Open challenges in sign language translation and production
PPTX
Generation of Synthetic Referring Expressions for Object Segmentation in Videos
PPTX
Discovery and Learning of Navigation Goals from Pixels in Minecraft
PDF
Learn2Sign : Sign language recognition and translation using human keypoint e...
PDF
Intepretability / Explainable AI for Deep Neural Networks
PDF
Convolutional Neural Networks - Xavier Giro - UPC TelecomBCN Barcelona 2020
PDF
Self-Supervised Audio-Visual Learning - Xavier Giro - UPC TelecomBCN Barcelon...
PDF
Attention for Deep Learning - Xavier Giro - UPC TelecomBCN Barcelona 2020
PDF
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
PDF
Q-Learning with a Neural Network - Xavier Giró - UPC Barcelona 2020
PDF
Language and Vision with Deep Learning - Xavier Giró - ACM ICMR 2020 (Tutorial)
PDF
Image Segmentation with Deep Learning - Xavier Giro & Carles Ventura - ISSonD...
PDF
Curriculum Learning for Recurrent Video Object Segmentation
PDF
Deep Self-supervised Learning for All - Xavier Giro - X-Europe 2020
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All
The Transformer in Vision | Xavier Giro | Master in Computer Vision Barcelona...
Towards Sign Language Translation & Production | Xavier Giro-i-Nieto
The Transformer - Xavier Giró - UPC Barcelona 2021
Learning Representations for Sign Language Videos - Xavier Giro - NIST TRECVI...
Open challenges in sign language translation and production
Generation of Synthetic Referring Expressions for Object Segmentation in Videos
Discovery and Learning of Navigation Goals from Pixels in Minecraft
Learn2Sign : Sign language recognition and translation using human keypoint e...
Intepretability / Explainable AI for Deep Neural Networks
Convolutional Neural Networks - Xavier Giro - UPC TelecomBCN Barcelona 2020
Self-Supervised Audio-Visual Learning - Xavier Giro - UPC TelecomBCN Barcelon...
Attention for Deep Learning - Xavier Giro - UPC TelecomBCN Barcelona 2020
Generative Adversarial Networks GAN - Xavier Giro - UPC TelecomBCN Barcelona ...
Q-Learning with a Neural Network - Xavier Giró - UPC Barcelona 2020
Language and Vision with Deep Learning - Xavier Giró - ACM ICMR 2020 (Tutorial)
Image Segmentation with Deep Learning - Xavier Giro & Carles Ventura - ISSonD...
Curriculum Learning for Recurrent Video Object Segmentation
Deep Self-supervised Learning for All - Xavier Giro - X-Europe 2020

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Review of recent advances in non-invasive hemoglobin estimation
KodekX | Application Modernization Development
NewMind AI Monthly Chronicles - July 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation

Deep Learning for Computer Vision: Image Classification (UPC 2016)