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

Slides:



Advertisements
Similar presentations
Introduction to Support Vector Machines (SVM)
Advertisements

Lecture 9 Support Vector Machines
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?
Support Vector Machine & Its Applications Mingyue Tan The University of British Columbia Nov 26, 2004 A portion (1/3) of the slides are taken from Prof.
SVM - Support Vector Machines A new classification method for both linear and nonlinear data It uses a nonlinear mapping to transform the original training.
An Introduction of Support Vector Machine
Appearance-based recognition & detection II Kristen Grauman UT-Austin Tuesday, Nov 11.

An Introduction of Support Vector Machine
Support Vector Machines
Quiz 1 on Wednesday ~20 multiple choice or short answer questions
Support vector machine
Machine learning continued Image source:
Groundwater 3D Geological Modeling: Solving as Classification Problem with Support Vector Machine A. Smirnoff, E. Boisvert, S. J.Paradis Earth Sciences.
LPP-HOG: A New Local Image Descriptor for Fast Human Detection Andy Qing Jun Wang and Ru Bo Zhang IEEE International Symposium.
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.
Support Vector Machines and Kernel Methods
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.
Discriminative and generative methods for bags of features
An Introduction to Support Vector Machines Martin Law.
Classification III Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
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
CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 24 – Classifiers 1.
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.
计算机学院 计算感知 Support Vector Machines. 2 University of Texas at Austin Machine Learning Group 计算感知 计算机学院 Perceptron Revisited: Linear Separators Binary classification.
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.
SVM Support Vector Machines Presented by: Anas Assiri Supervisor Prof. Dr. Mohamed Batouche.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
An Introduction to Support Vector Machines (M. Law)
Lecture 27: Recognition Basics CS4670/5670: Computer Vision Kavita Bala Slides from Andrej Karpathy and Fei-Fei Li
An Introduction to Support Vector Machine (SVM)
CS 1699: Intro to Computer Vision Support Vector Machines Prof. Adriana Kovashka University of Pittsburgh October 29, 2015.
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.
Support Vector Machines. Notation Assume a binary classification problem. –Instances are represented by vector x   n. –Training examples: x = (x 1,
Support Vector Machines (SVM): A Tool for Machine Learning Yixin Chen Ph.D Candidate, CSE 1/10/2002.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
Greg GrudicIntro AI1 Support Vector Machine (SVM) Classification Greg Grudic.
CS 2750: Machine Learning Support Vector Machines Prof. Adriana Kovashka University of Pittsburgh February 17, 2016.
Support Vector Machines Optimization objective Machine Learning.
An Introduction of Support Vector Machine In part from of Jinwei Gu.
Roughly overview of Support vector machines Reference: 1.Support vector machines and machine learning on documents. Christopher D. Manning, Prabhakar Raghavan.
An Introduction of Support Vector Machine Courtesy of Jinwei Gu.
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.
Lecture IX: Object Recognition (2)
Neural networks and support vector machines
An Introduction to Support Vector Machines
Support Vector Machines
CS 2770: Computer Vision Intro to Visual Recognition
CS 2750: Machine Learning Support Vector Machines
COSC 4335: Other Classification Techniques
Presentation transcript:

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

Classifiers Given a feature representation for images, how do we learn a model for distinguishing features from different classes? Today: Nearest neighbor classifiers Linear classifiers: support vector machines Later: Boosting Decision trees and forests Deep neural networks (hopefully)

Review: Nearest Neighbor Classifier

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

Review: 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

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

Review: 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 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

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||

Finding the maximum margin hyperplane 1.Maximize margin 2 / ||w|| 2.Correctly classify all training data: Quadratic optimization problem: 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

Finding the maximum margin hyperplane Solution: 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 Learned weight (nonzero only for support vectors)

Finding the maximum margin hyperplane Solution: b = y i – w·x i for any support vector Classification function (decision boundary): Notice that it relies on an inner product between the test point x and the support vectors x i Solving the optimization problem also involves computing the inner products x i · x j between all pairs of training points 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

What if the data is not linearly separable? Separable: Non-separable: C: tradeoff constant, ξ i : slack variable (positive) Whenever margin is ≥ 1, ξ i = 0 Whenever margin is < 1,

What if the data is not linearly separable? Maximize margin Minimize classification mistakes

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) (to be valid, the kernel function must satisfy Mercer’s condition) 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

Gaussian kernel Also known as the radial basis function (RBF) kernel: The corresponding mapping φ(x) is infinite- dimensional! What is the role of parameter σ ? What if σ is close to zero? What if σ is very large?

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, PEGASOSLIBLINEARPEGASOS 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)

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 Of course, there are many other classifiers out there Neural networks, boosting, decision trees/forests, …