CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 24 – Classifiers 1.

Slides:



Advertisements
Similar presentations
Applications of one-class classification
Advertisements

ECG Signal processing (2)
Image classification Given the bag-of-features representations of images from different classes, how do we learn a model for distinguishing them?
ONLINE ARABIC HANDWRITING RECOGNITION By George Kour Supervised by Dr. Raid Saabne.
Appearance-based recognition & detection II Kristen Grauman UT-Austin Tuesday, Nov 11.
Data Mining Classification: Alternative Techniques
An Introduction of Support Vector Machine
Support Vector Machines and Kernels Adapted from slides by Tim Oates Cognition, Robotics, and Learning (CORAL) Lab University of Maryland Baltimore County.
Support Vector Machines
Quiz 1 on Wednesday ~20 multiple choice or short answer questions
Support vector machine
Search Engines Information Retrieval in Practice All slides ©Addison Wesley, 2008.
Machine learning continued Image source:
CSCI 347 / CS 4206: Data Mining Module 07: Implementations Topic 03: Linear Models.
Classification and Decision Boundaries
Discriminative and generative methods for bags of features
Support Vector Machine
Image classification Given the bag-of-features representations of images from different classes, how do we learn a model for distinguishing them?
Support Vector Machines (SVMs) Chapter 5 (Duda et al.)
University of Texas at Austin Machine Learning Group Department of Computer Sciences University of Texas at Austin Support Vector Machines.
1 Classification: Definition Given a collection of records (training set ) Each record contains a set of attributes, one of the attributes is the class.
Margins, support vectors, and linear programming Thanks to Terran Lane and S. Dreiseitl.
Support Vector Machines Kernel Machines
Sketched Derivation of error bound using VC-dimension (1) Bound our usual PAC expression by the probability that an algorithm has 0 error on the training.
Classifiers for Recognition Reading: Chapter 22 (skip 22.3) Slide credits for this chapter: Frank Dellaert, Forsyth & Ponce, Paul Viola, Christopher Rasmussen.
Support Vector Machines
SVMs Finalized. Where we are Last time Support vector machines in grungy detail The SVM objective function and QP Today Last details on SVMs Putting it.
Lecture XI: Object Recognition (2)
SVMs, cont’d Intro to Bayesian learning. Quadratic programming Problems of the form Minimize: Subject to: are called “quadratic programming” problems.
Review Rong Jin. Comparison of Different Classification Models  The goal of all classifiers Predicating class label y for an input x Estimate p(y|x)
Discriminative and generative methods for bags of features
Classification III Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
Ch. Eick: Support Vector Machines: The Main Ideas Reading Material Support Vector Machines: 1.Textbook 2. First 3 columns of Smola/Schönkopf article on.
Step 3: Classification Learn a decision rule (classifier) assigning bag-of-features representations of images to different classes Decision boundary Zebra.
Classification 2: discriminative models
Support Vector Machine & Image Classification Applications
Support Vector Machines Mei-Chen Yeh 04/20/2010. The Classification Problem Label instances, usually represented by feature vectors, into one of the predefined.
1 SUPPORT VECTOR MACHINES İsmail GÜNEŞ. 2 What is SVM? A new generation learning system. A new generation learning system. Based on recent advances in.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE Massimo Poesio LECTURE: Support Vector Machines.
An Introduction to Support Vector Machine (SVM) Presenter : Ahey Date : 2007/07/20 The slides are based on lecture notes of Prof. 林智仁 and Daniel Yeung.
Kernel Methods A B M Shawkat Ali 1 2 Data Mining ¤ DM or KDD (Knowledge Discovery in Databases) Extracting previously unknown, valid, and actionable.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
Classifiers Given a feature representation for images, how do we learn a model for distinguishing features from different classes? Zebra Non-zebra Decision.
An Introduction to Support Vector Machines (M. Law)
1 Chapter 6. Classification and Prediction Overview Classification algorithms and methods Decision tree induction Bayesian classification Lazy learning.
Lecture 27: Recognition Basics CS4670/5670: Computer Vision Kavita Bala Slides from Andrej Karpathy and Fei-Fei Li
Handwritten digit recognition
Visual Categorization With Bags of Keypoints Original Authors: G. Csurka, C.R. Dance, L. Fan, J. Willamowski, C. Bray ECCV Workshop on Statistical Learning.
Methods for classification and image representation
CS 1699: Intro to Computer Vision Support Vector Machines Prof. Adriana Kovashka University of Pittsburgh October 29, 2015.
Classification (slides adapted from Rob Schapire) Eran Segal Weizmann Institute.
University of Texas at Austin Machine Learning Group Department of Computer Sciences University of Texas at Austin Support Vector Machines.
Support vector machine LING 572 Fei Xia Week 8: 2/23/2010 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A 1.
Chapter1: Introduction Chapter2: Overview of Supervised Learning
Classification Course web page: vision.cis.udel.edu/~cv May 14, 2003  Lecture 34.
Supervised Machine Learning: Classification Techniques Chaleece Sandberg Chris Bradley Kyle Walsh.
CS 2750: Machine Learning Support Vector Machines Prof. Adriana Kovashka University of Pittsburgh February 17, 2016.
Support Vector Machines Optimization objective Machine Learning.
CSSE463: Image Recognition Day 15 Today: Today: Your feedback: Your feedback: Projects/labs reinforce theory; interesting examples, topics, presentation;
1 Kernel Machines A relatively new learning methodology (1992) derived from statistical learning theory. Became famous when it gave accuracy comparable.
Roughly overview of Support vector machines Reference: 1.Support vector machines and machine learning on documents. Christopher D. Manning, Prabhakar Raghavan.
A Brief Introduction to Support Vector Machine (SVM) Most slides were from Prof. A. W. Moore, School of Computer Science, Carnegie Mellon University.
Non-separable SVM's, and non-linear classification using kernels Jakob Verbeek December 16, 2011 Course website:
Support Vector Machines (SVMs) Chapter 5 (Duda et al.) CS479/679 Pattern Recognition Dr. George Bebis.
Copyright 2005 by David Helmbold1 Support Vector Machines (SVMs) References: Cristianini & Shawe-Taylor book; Vapnik’s book; and “A Tutorial on Support.
Lecture IX: Object Recognition (2)
Neural networks and support vector machines
Support Vector Machines
CS 2770: Computer Vision Intro to Visual Recognition
CS 2750: Machine Learning Support Vector Machines
Presentation transcript:

CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 24 – Classifiers 1

Schedule Last class – We continued on segmentation, specifically mean field and graph cuts but could not finish  Today – Classifiers Readings for today: – Forsyth and Ponce chapter 16 2

Classifiers Given a feature representation for images, how do we learn a model for distinguishing features from different classes? Take a measurement x, predict a bit (yes/no; 1/-1; 1/0; etc) Today: Nearest neighbor classifiers Linear classifiers: support vector machines Other techniques: Boosting, Decision trees and forests, Deep neural networks

Image classification The big problems – Image classification eg this picture contains a parrot – Object detection eg in this box in the picture is a parrot Strategy – Generate features from image (there are many quite complex strategies) – Put in one or more classifiers 4

Image classification - scenes

Image classification - material

Classifiers Given a feature representation for images, how do we learn a model for distinguishing features from different classes? Zebra Non-zebra Decision boundary

Nearest Neighbor Classifier Assign label of nearest training data point to each test data point from Duda et al.

Classifiers Take a measurement x, predict a bit (yes/no; 1/-1; 1/0; etc) Strategies: – non-parametric nearest neighbor – probabilistic histogram logistic regression – decision boundary SVM

K-Nearest Neighbors For a new point, find the k closest points from training data Labels of the k points “vote” to classify k = 5

Histogram based classifiers Represent class-conditional densities with histogram Advantage: – estimates become quite good (with enough data!) Disadvantage: – Histogram becomes big with high dimension but maybe we can assume feature independence?

Example: Finding skin Skin has a very small range of (intensity independent) colours, and little texture – Compute an intensity-independent colour measure, check if colour is in this range, check if there is little texture (median filter) – See this as a classifier - we can set up the tests by hand, or learn them.

Histogram classifier for skin

Curse of dimension Can’t build a histogram based classifier for when feature space is high-dimensional – try R, G, B, and some texture features – Fails when there are too many histogram buckets

Distance functions for bags of features Euclidean distance: L1 distance: χ 2 distance: Histogram intersection (similarity): Hellinger kernel (similarity):

Linear classifiers Find linear function (hyperplane) to separate positive and negative examples Which hyperplane is best?

Support vector machines Find hyperplane that maximizes the margin between the positive and negative examples Margin Support vectors C. Burges, A Tutorial on Support Vector Machines for Pattern Recognition, Data Mining and Knowledge Discovery, 1998A Tutorial on Support Vector Machines for Pattern Recognition Distance between point and hyperplane: For support vectors, Therefore, the margin is 2 / ||w||

What if the data is not linearly separable? Demo: Margin +1 0

Datasets that are linearly separable work out great: But what if the dataset is just too hard? We can map it to a higher-dimensional space: 0x 0 x 0 x x2x2 Nonlinear SVMs Slide credit: Andrew Moore

Φ: x → φ(x) Nonlinear SVMs General idea: the original input space can always be mapped to some higher- dimensional feature space where the training set is separable: Slide credit: Andrew Moore

Nonlinear SVMs The kernel trick: instead of explicitly computing the lifting transformation φ(x), define a kernel function K such that K(x, y) = φ(x) · φ(y) This gives a nonlinear decision boundary in the original feature space: C. Burges, A Tutorial on Support Vector Machines for Pattern Recognition, Data Mining and Knowledge Discovery, 1998A Tutorial on Support Vector Machines for Pattern Recognition

Nonlinear kernel: Example Consider the mapping x2x2

Polynomial kernel:

Gaussian kernel Also known as the radial basis function (RBF) kernel: The corresponding mapping φ(x) is infinite- dimensional!

Gaussian kernel SV’s

Kernels for bags of features Histogram intersection kernel: Hellinger kernel: Generalized Gaussian kernel: D can be L1, Euclidean, χ 2 distance, etc. J. Zhang, M. Marszalek, S. Lazebnik, and C. Schmid, Local Features and Kernels for Classifcation of Texture and Object Categories: A Comprehensive Study, IJCV 2007Local Features and Kernels for Classifcation of Texture and Object Categories: A Comprehensive Study

Summary: SVMs for image classification 1.Pick an image representation (in our case, bag of features) 2.Pick a kernel function for that representation 3.Compute the matrix of kernel values between every pair of training examples 4.Feed the kernel matrix into your favorite SVM solver to obtain support vectors and weights 5.At test time: compute kernel values for your test example and each support vector, and combine them with the learned weights to get the value of the decision function

What about multi-class SVMs? Unfortunately, there is no “definitive” multi-class SVM formulation In practice, we have to obtain a multi-class SVM by combining multiple two-class SVMs One vs. others – Traning: learn an SVM for each class vs. the others – Testing: apply each SVM to test example and assign to it the class of the SVM that returns the highest decision value One vs. one – Training: learn an SVM for each pair of classes – Testing: each learned SVM “votes” for a class to assign to the test example

SVMs: Pros and cons Pros – Many publicly available SVM packages: – Kernel-based framework is very powerful, flexible – SVMs work very well in practice, even with very small training sample sizes Cons – No “direct” multi-class SVM, must combine two-class SVMs – Computation, memory During training time, must compute matrix of kernel values for every pair of examples Learning can take a very long time for large-scale problems

SVMs for large-scale datasets Efficient linear solvers LIBLINEAR, PEGASOS LIBLINEARPEGASOS Explicit approximate embeddings: define an explicit mapping φ(x) such that φ(x) · φ(y) approximates K(x, y) and train a linear SVM on top of that embedding Random Fourier features for the Gaussian kernel (Rahimi and Recht, 2007) Embeddings for additive kernels, e.g., histogram intersection (Maji et al., 2013, Vedaldi and Zisserman, 2012)

Evaluating classifiers Always – train on training set, evaluate on test set test set performance might/should be worse than training set Options – Total error rate always less than 50% for two class – Receiver operating curve because we might use different thresholds – Class confusion matrix for multiclass

Receiver operating curve

Classifiers: Crucial Points Classifiers accept features, return decision – and are often trained using data Very mature training processes now – Always try standard methods first SVM kNN Logistic regression Evaluate with separate test data – look at total error rate – ROC – class confusion matrix – (occasionally) total risk typically when one has a loss model

Summary: Classifiers Nearest-neighbor and k-nearest-neighbor classifiers Support vector machines – Linear classifiers – Margin maximization – Non-separable case – The kernel trick – Multi-class SVMs – Large-scale SVMs There are so many other classifiers out there – Neural networks, boosting, decision trees/forests, …

Slide Credits Svetlana Lazebnik – UIUC David Forsyth - UIUC 37

Next class Object recognition Readings for next lecture: – Forsyth and Ponce chapter 17 Readings for today: – Forsyth and Ponce chapter 16 38

Questions 39