Step 3: Classification Learn a decision rule (classifier) assigning bag-of-features representations of images to different classes Decision boundary Zebra.

Slides:



Advertisements
Similar presentations
Introduction to Support Vector Machines (SVM)
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?
Appearance-based recognition & detection II Kristen Grauman UT-Austin Tuesday, Nov 11.
Data Mining Classification: Alternative Techniques
Data Mining Classification: Alternative Techniques
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:
The Pyramid Match Kernel: Discriminative Classification with Sets of Image Features Kristen Grauman Trevor Darrell MIT.
Generative learning methods for bags of features
CS4670 / 5670: Computer Vision Bag-of-words models Noah Snavely Object
Bag-of-features models. Origin 1: Texture recognition Texture is characterized by the repetition of basic elements or textons For stochastic textures,
Classification and Decision Boundaries
Discriminative and generative methods for bags of features
Bag-of-features models Many slides adapted from Fei-Fei Li, Rob Fergus, and Antonio Torralba.
Image classification Given the bag-of-features representations of images from different classes, how do we learn a model for distinguishing them?
University of Texas at Austin Machine Learning Group Department of Computer Sciences University of Texas at Austin Support Vector Machines.
Chapter 5: Linear Discriminant Functions
Lecture 28: Bag-of-words models
Agenda Introduction Bag-of-words model Visual words with spatial location Part-based models Discriminative methods Segmentation and recognition Recognition-based.
1 Classification: Definition Given a collection of records (training set ) Each record contains a set of attributes, one of the attributes is the class.
Beyond bags of features: Adding spatial information Many slides adapted from Fei-Fei Li, Rob Fergus, and Antonio Torralba.
Bag-of-features models
Generative learning methods for bags of features
Support Vector Machines
Lecture XI: Object Recognition (2)
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
An Introduction to Support Vector Machines Martin Law.
Review: Intro to recognition Recognition tasks Machine learning approach: training, testing, generalization Example classifiers Nearest neighbor Linear.
Classification III Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
Classification 2: discriminative models
Support Vector Machine & Image Classification Applications
DATA MINING LECTURE 10 Classification k-nearest neighbor classifier Naïve Bayes Logistic Regression Support Vector Machines.
Discriminative classification methods, kernels, and topic models Jakob Verbeek January 8, 2010.
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.
Bag-of-features models. Origin 1: Texture recognition Texture is characterized by the repetition of basic elements or textons For stochastic textures,
计算机学院 计算感知 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.
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)
Classification 1: generative and non-parameteric methods Jakob Verbeek January 7, 2011 Course website:
Visual Categorization With Bags of Keypoints Original Authors: G. Csurka, C.R. Dance, L. Fan, J. Willamowski, C. Bray ECCV Workshop on Statistical Learning.
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.
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.
Final Exam Review CS479/679 Pattern Recognition Dr. George Bebis 1.
Classification Course web page: vision.cis.udel.edu/~cv May 14, 2003  Lecture 34.
CS654: Digital Image Analysis
DATA MINING LECTURE 10b Classification k-nearest neighbor classifier
Supervised Machine Learning: Classification Techniques Chaleece Sandberg Chris Bradley Kyle Walsh.
Lecture 5: Statistical Methods for Classification CAP 5415: Computer Vision Fall 2006.
Support Vector Machines Reading: Ben-Hur and Weston, “A User’s Guide to Support Vector Machines” (linked from class web page)
CS 2750: Machine Learning Support Vector Machines Prof. Adriana Kovashka University of Pittsburgh February 17, 2016.
1 Kernel Machines A relatively new learning methodology (1992) derived from statistical learning theory. Became famous when it gave accuracy comparable.
Non-separable SVM's, and non-linear classification using kernels Jakob Verbeek December 16, 2011 Course website:
Lecture IX: Object Recognition (2)
Neural networks and support vector machines
The topic discovery models
The topic discovery models
CS 2770: Computer Vision Intro to Visual Recognition
CS 2750: Machine Learning Support Vector Machines
The topic discovery models
COSC 4335: Other Classification Techniques
Presentation transcript:

Step 3: Classification Learn a decision rule (classifier) assigning bag-of-features representations of images to different classes Decision boundary Zebra Non-zebra

Classification Assign input vector to one of two or more classes Any decision rule divides input space into decision regions separated by decision boundaries

Nearest Neighbor Classifier Assign label of nearest training data point to each test data point from Duda et al. Voronoi partitioning of feature space for 2-category 2-D and 3-D data Source: D. Lowe

K-Nearest Neighbors For a new point, find the k closest points from training data Labels of the k points “vote” to classify Works well provided there is lots of data and the distance function is good k = 5 Source: D. Lowe

Functions for comparing histograms L1 distance χ2 distance Quadratic distance (cross-bin)

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

Linear classifiers - margin Generalization is not good in this case: Better if a margin is introduced:

Support vector machines Find hyperplane that maximizes the margin between the positive and negative examples For support, vectors, The margin is 2 / ||w|| Support vectors Margin

Finding the maximum margin hyperplane Maximize margin 2/||w|| Correctly classify all training data: Quadratic optimization problem: Minimize Subject to yi(w·xi+b) ≥ 1 Solution based on Lagrange multipliers

Finding the maximum margin hyperplane Solution: learned weight Support vector

Finding the maximum margin hyperplane Solution: b = yi – w·xi 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 xi Solving the optimization problem also involves computing the inner products xi · xj between all pairs of training points

Nonlinear SVMs 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: x x x2 x Slide credit: Andrew Moore

Nonlinear SVMs General idea: the original input space can always be mapped to some higher-dimensional feature space where the training set is separable: Φ: x → φ(x) 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(xi , xjj) = φ(xi ) · φ(xj) (to be valid, the kernel function must satisfy Mercer’s condition) This gives a nonlinear decision boundary in the original feature space: Mercer’s condition positive definite

Kernels for bags of features Histogram intersection kernel: Generalized Gaussian kernel: D can be Euclidean distance, χ2 distance, Earth Mover’s Distance, etc.

SVM classifier SMV with multi-channel chi-square kernel Channel c is a combination of detector, descriptor is the chi-square distance between histograms is the mean value of the distances between all training sample Extension: learning of the weights, for example with MKL J. Zhang, M. Marszalek, S. Lazebnik, and C. Schmid, Local Features and Kernels for Classifcation of Texture and Object Categories: A Comprehensive Study, IJCV 2007

optimal partial matching between sets of features Pyramid match kernel Weighted sum of histogram intersections at mutliple resolutions (linear in the number of features instead of cubic) optimal partial matching between sets of features K. Grauman and T. Darrell.  The Pyramid Match Kernel: Discriminative Classification with Sets of Image Features, ICCV 2005.

Pyramid Match Histogram intersection

Pyramid Match Histogram intersection matches at this level matches at previous level Difference in histogram intersections across levels counts number of new pairs matched

Pyramid match kernel Weights inversely proportional to bin size histogram pyramids number of newly matched pairs at level i measure of difficulty of a match at level i Weights inversely proportional to bin size Normalize kernel values to avoid favoring large sets

Example pyramid match Level 0

Example pyramid match Level 1

Example pyramid match Level 2

Example pyramid match pyramid match optimal match

Summary: Pyramid match kernel optimal partial matching between sets of features difficulty of a match at level i number of new matches at level i

Review: Discriminative methods Nearest-neighbor and k-nearest-neighbor classifiers L1 distance, χ2 distance, quadratic distance, Support vector machines Linear classifiers Margin maximization The kernel trick Kernel functions: histogram intersection, generalized Gaussian, pyramid match Of course, there are many other classifiers out there Neural networks, boosting, decision trees, …

Summary: SVMs for image classification Pick an image representation (in our case, bag of features) Pick a kernel function for that representation Compute the matrix of kernel values between every pair of training examples Feed the kernel matrix into your favorite SVM solver to obtain support vectors and weights 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

SVMs: Pros and cons Pros Cons Many publicly available SVM packages: http://www.kernel-machines.org/software 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

Generative methods Model the probability distribution that produced a given bag of features We will cover two models, both inspired by text document analysis: Naïve Bayes Probabilistic Latent Semantic Analysis

The Naïve Bayes model Assume that each feature is conditionally independent given the class Csurka et al. 2004

Likelihood of ith visual word The Naïve Bayes model Assume that each feature is conditionally independent given the class Likelihood of ith visual word given the class MAP decision Prior prob. of the object classes Estimated by empirical frequencies of visual words in images from a given class Csurka et al. 2004

The Naïve Bayes model Assume that each feature is conditionally independent given the class “Graphical model”: c w N Csurka et al. 2004

Probabilistic Latent Semantic Analysis zebra “visual topics” grass tree T. Hofmann, Probabilistic Latent Semantic Analysis, UAI 1999

Probabilistic Latent Semantic Analysis = α1 + α2 + α3 New image grass tree zebra T. Hofmann, Probabilistic Latent Semantic Analysis, UAI 1999

Probabilistic Latent Semantic Analysis Unsupervised technique Two-level generative model: a document is a mixture of topics, and each topic has its own characteristic word distribution w d z document topic word P(z|d) P(w|z) T. Hofmann, Probabilistic Latent Semantic Analysis, UAI 1999

Probabilistic Latent Semantic Analysis Unsupervised technique Two-level generative model: a document is a mixture of topics, and each topic has its own characteristic word distribution w d z T. Hofmann, Probabilistic Latent Semantic Analysis, UAI 1999

“face” pLSA for images w d z Document = image, topic = class, word = quantized feature w d z “face” J. Sivic, B. Russell, A. Efros, A. Zisserman, B. Freeman, Discovering Objects and their Location in Images, ICCV 2005

The pLSA model Probability of word i in document j (known) Probability of word i given topic k (unknown) Probability of topic k given document j (unknown) For that we will use a method called probabilistic latent semantic analysis. pLSA can be thought of as a matrix decomposition. Here is our term-document matrix (documents, words) and we want to find topic vectors common to all documents and mixture coefficients P(z|d) specific to each document. Note that these are all probabilites which sum to one. So a column here is here expressed as a convex combination of the topic vectors. What we would like to see is that the topics correspond to objects. So an image will be expressed as a mixture of different objects and backgrounds.

Codeword distributions The pLSA model documents topics documents p(wi|dj) p(wi|zk) p(zk|dj) words words topics = For that we will use a method called probabilistic latent semantic analysis. pLSA can be thought of as a matrix decomposition. Here is our term-document matrix (documents, words) and we want to find topic vectors common to all documents and mixture coefficients P(z|d) specific to each document. Note that these are all probabilites which sum to one. So a column here is here expressed as a convex combination of the topic vectors. What we would like to see is that the topics correspond to objects. So an image will be expressed as a mixture of different objects and backgrounds. Observed codeword distributions (M×N) Codeword distributions per topic (class) (M×K) Class distributions per image (K×N)

Learning pLSA parameters Maximize likelihood of data using EM: Observed counts of word i in document j We use maximum likelihood approach to fit parameters of the model. We write down the likelihood of the whole collection and maximize it using EM. M,N goes over all visual words and all documents. P(w|d) factorizes as on previous slide the entries in those matrices are our parameters. n(w,d) are the observed counts in our data M … number of codewords N … number of images Slide credit: Josef Sivic

Recognition Finding the most likely topic (class) for an image: We use maximum likelihood approach to fit parameters of the model. We write down the likelihood of the whole collection and maximize it using EM. M,N goes over all visual words and all documents. P(w|d) factorizes as on previous slide the entries in those matrices are our parameters. n(w,d) are the observed counts in our data

Recognition Finding the most likely topic (class) for an image: Finding the most likely topic (class) for a visual word in a given image: We use maximum likelihood approach to fit parameters of the model. We write down the likelihood of the whole collection and maximize it using EM. M,N goes over all visual words and all documents. P(w|d) factorizes as on previous slide the entries in those matrices are our parameters. n(w,d) are the observed counts in our data

Topic discovery in images J. Sivic, B. Russell, A. Efros, A. Zisserman, B. Freeman, Discovering Objects and their Location in Images, ICCV 2005

Summary: Generative models Naïve Bayes Unigram models in document analysis Assumes conditional independence of words given class Parameter estimation: frequency counting Probabilistic Latent Semantic Analysis Unsupervised technique Each document is a mixture of topics (image is a mixture of classes) Can be thought of as matrix decomposition Parameter estimation: EM