Recognition by finding patterns

Slides:



Advertisements
Similar presentations
Applications of one-class classification
Advertisements

Detecting Faces in Images: A Survey
Computer vision: models, learning and inference Chapter 8 Regression.
CSCI 347 / CS 4206: Data Mining Module 07: Implementations Topic 03: Linear Models.
Computer Vision - A Modern Approach Set: Probability in segmentation Slides by D.A. Forsyth Missing variable problems In many vision problems, if some.
Computer Vision for Human-Computer InteractionResearch Group, Universität Karlsruhe (TH) cv:hci Dr. Edgar Seemann 1 Computer Vision: Histograms of Oriented.
Chapter 4: Linear Models for Classification
The Viola/Jones Face Detector (2001)
Robust Moving Object Detection & Categorization using self- improving classifiers Omar Javed, Saad Ali & Mubarak Shah.
Lecture 5 Template matching
Bayesian Decision Theory Chapter 2 (Duda et al.) – Sections
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
0 Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John.
Computer Vision - A Modern Approach
Project 4 out today –help session today –photo session today Project 2 winners Announcements.
Classifiers for Recognition Reading: Chapter 22 (skip 22.3) Slide credits for this chapter: Frank Dellaert, Forsyth & Ponce, Paul Viola, Christopher Rasmussen.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
Template matching and object recognition
Texture Reading: Chapter 9 (skip 9.4) Key issue: How do we represent texture? Topics: –Texture segmentation –Texture-based matching –Texture synthesis.
Computer Vision Template matching and object recognition Marc Pollefeys COMP 256 Some slides and illustrations from D. Forsyth, …
1 CS6825: Recognition – a sample of Applications.
Computer Vision I Instructor: Prof. Ko Nishino. Today How do we recognize objects in images?
Smart Traveller with Visual Translator for OCR and Face Recognition LYU0203 FYP.
Linear Discriminant Functions Chapter 5 (Duda et al.)
Face Recognition: An Introduction
Computer Vision P. Schrater Spring 2003
Computer Vision - A Modern Approach Set: Segmentation Slides by D.A. Forsyth Segmentation and Grouping Motivation: not information is evidence Obtain a.
CS 485/685 Computer Vision Face Recognition Using Principal Components Analysis (PCA) M. Turk, A. Pentland, "Eigenfaces for Recognition", Journal of Cognitive.
Face Recognition Using Neural Networks Presented By: Hadis Mohseni Leila Taghavi Atefeh Mirsafian.
Methods in Medical Image Analysis Statistics of Pattern Recognition: Classification and Clustering Some content provided by Milos Hauskrecht, University.
Principles of Pattern Recognition
Introduction to variable selection I Qi Yu. 2 Problems due to poor variable selection: Input dimension is too large; the curse of dimensionality problem.
CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 24 – Classifiers 1.
Template matching and object recognition. CS8690 Computer Vision University of Missouri at Columbia Recognition by finding patterns We have seen very.
CS 782 – Machine Learning Lecture 4 Linear Models for Classification  Probabilistic generative models  Probabilistic discriminative models.
Object Recognition in Images Slides originally created by Bernd Heisele.
Ch 4. Linear Models for Classification (1/2) Pattern Recognition and Machine Learning, C. M. Bishop, Summarized and revised by Hee-Woong Lim.
1 E. Fatemizadeh Statistical Pattern Recognition.
Template matching and object recognition. CS8690 Computer Vision University of Missouri at Columbia Matching by relations Idea: –find bits, then say object.
Face Recognition: An Introduction
MSRI workshop, January 2005 Object Recognition Collected databases of objects on uniform background (no occlusions, no clutter) Mostly focus on viewpoint.
Face Detection Ying Wu Electrical and Computer Engineering Northwestern University, Evanston, IL
Non-Bayes classifiers. Linear discriminants, neural networks.
The Viola/Jones Face Detector A “paradigmatic” method for real-time object detection Training is slow, but detection is very fast Key ideas Integral images.
Edges.
Vision Overview  Like all AI: in its infancy  Many methods which work well in specific applications  No universal solution  Classic problem: Recognition.
Face Detection using the Spectral Histogram representation By: Christopher Waring, Xiuwen Liu Department of Computer Science Florida State University Presented.
Chapter 20 Classification and Estimation Classification – Feature selection Good feature have four characteristics: –Discrimination. Features.
Elements of Pattern Recognition CNS/EE Lecture 5 M. Weber P. Perona.
Classification Course web page: vision.cis.udel.edu/~cv May 14, 2003  Lecture 34.
Machine Learning 5. Parametric Methods.
Face Detection Using Neural Network By Kamaljeet Verma ( ) Akshay Ukey ( )
Lecture 5: Statistical Methods for Classification CAP 5415: Computer Vision Fall 2006.
Computer Vision Lecture 7 Classifiers. Computer Vision, Lecture 6 Oleh Tretiak © 2005Slide 1 This Lecture Bayesian decision theory (22.1, 22.2) –General.
Recall: Gaussian smoothing/sampling G 1/4 G 1/8 Gaussian 1/2 Solution: filter the image, then subsample Filter size should double for each ½ size reduction.
Linear Discriminant Functions Chapter 5 (Duda et al.) CS479/679 Pattern Recognition Dr. George Bebis.
1 C.A.L. Bailer-Jones. Machine Learning. Data exploration and dimensionality reduction Machine learning, pattern recognition and statistical data modelling.
Data Transformation: Normalization
LECTURE 09: BAYESIAN ESTIMATION (Cont.)
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Recognition using Nearest Neighbor (or kNN)
Object detection as supervised classification
Neural Networks and Backpropagation
Segmentation and Grouping
Lecture 26: Faces and probabilities
Outline Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no.
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
Announcements Project 4 out today Project 2 winners help session today
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
The “Margaret Thatcher Illusion”, by Peter Thompson
Presentation transcript:

Recognition by finding patterns We have seen very simple template matching (under filters) Some objects behave like quite simple templates Frontal faces Strategy: Find image windows Correct lighting Pass them to a statistical test (a classifier) that accepts faces and rejects non-faces Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Basic ideas in classifiers Loss some errors may be more expensive than others e.g. a fatal disease that is easily cured by a cheap medicine with no side-effects -> false positives in diagnosis are better than false negatives We discuss two class classification: L(1->2) is the loss caused by calling 1 a 2 Total risk of using classifier s Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Basic ideas in classifiers Generally, we should classify as 1 if the expected loss of classifying as 1 is better than for 2 gives Crucial notion: Decision boundary points where the loss is the same for either case 1 if 2 if Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Some loss may be inevitable: the minimum risk (shaded area) is called the Bayes risk Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Finding a decision boundary is not the same as modelling a conditional density. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Example: known distributions Assume normal class densities, p-dimensional measurements with common (known) covariance and different (known) means Class priors are Can ignore a common factor in posteriors - important; posteriors are then: Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Classifier boils down to: choose class that minimizes: Mahalanobis distance because covariance is common, this simplifies to sign of a linear expression: Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Plug-in classifiers Assume that distributions have some parametric form - now estimate the parameters from the data. Common: assume a normal distribution with shared covariance, different means; us usual estimates ditto, but different covariances; ditto Issue: parameter estimates that are “good” may not give optimal classifiers. picture from Ripley Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Histogram based classifiers Use a histogram to represent the class-conditional densities (i.e. p(x|1), p(x|2), etc) Advantage: estimates become quite good with enough data! Disadvantage: Histogram becomes big with high dimension but maybe we can assume feature independence? Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

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. get class conditional densities (histograms), priors from data (counting) Classifier is Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Figure from “Statistical color models with application to skin detection,” M.J. Jones and J. Rehg, Proc. Computer Vision and Pattern Recognition, 1999 copyright 1999, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Figure 22.4. It’s quite hard to see much difference between 1, 2, and 3 Figure from “Statistical color models with application to skin detection,” M.J. Jones and J. Rehg, Proc. Computer Vision and Pattern Recognition, 1999 copyright 1999, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Finding faces Faces “look like” templates (at least when they’re frontal). General strategy: search image windows at a range of scales Correct for illumination Present corrected window to classifier Issues How corrected? What features? What classifier? what about lateral views? Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Naive Bayes (Important: naive not necessarily perjorative) Find faces by vector quantizing image patches, then computing a histogram of patch types within a face Histogram doesn’t work when there are too many features features are the patch types assume they’re independent and cross fingers reduction in degrees of freedom very effective for face finders why? probably because the examples that would present real problems aren’t frequent. Many face finders on the face detection home page http://home.t-online.de/home/Robert.Frischholz/face.htm Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Figure from A Statistical Method for 3D Object Detection Applied to Faces and Cars, H. Schneiderman and T. Kanade, Proc. Computer Vision and Pattern Recognition, 2000, copyright 2000, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Face Recognition Whose face is this? (perhaps in a mugshot) Issue: What differences are important and what not? Reduce the dimension of the images, while maintaining the “important” differences. One strategy: Principal components analysis Many face recognition strategies at http://www.cs.rug.nl/users/peterkr/FACE/face.html Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

prove this on the whiteboard Main point is that the first principal component is the direction of largest variance. I usually prove this on the whiteboard Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Figure 22.6 - story in the caption Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Difficulties with PCA Projection may suppress important detail smallest variance directions may not be unimportant Method does not take discriminative task into account typically, we wish to compute features that allow good discrimination not the same as largest variance Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Computer Vision - A Modern Approach Fig 22.7 Principal components will give a very poor repn of this data set Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Computer Vision - A Modern Approach 22.10 - Two classes indicated by * and o; the first principal component captures all the variance, but completely destroys any ability to discriminate. The second is close to what’s required. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Linear Discriminant Analysis We wish to choose linear functions of the features that allow good discrimination. Assume class-conditional covariances are the same Want linear feature that maximises the spread of class means for a fixed within-class variance I do the two lines of math on the whiteboard - it’s easier to explain notation, etc. that way. Section 22.3.3 Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

The first linear discriminant gets excellent separation Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Computer Vision - A Modern Approach Figure 22.12 - read the caption. This yields quite a good illustration of the power of the method. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Neural networks Linear decision boundaries are useful but often not very powerful we seek an easy way to get more complex boundaries Compose linear decision boundaries i.e. have several linear classifiers, and apply a classifier to their output a nuisance, because sign(ax+by+cz) etc. isn’t differentiable. use a smooth “squashing function” in place of sign. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Computer Vision - A Modern Approach Here phi is a squashing function; this is figure 22.13. We seek to adjust the w’s to get the best classifier. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

22.14 - a bunch of different squashing functions Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Training Choose parameters to minimize error on training set Stochastic gradient descent, computing gradient using trick (backpropagation, aka the chain rule) Stop when error is low, and hasn’t changed much Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

The vertical face-finding part of Rowley, Baluja and Kanade’s system Figure from “Rotation invariant neural-network based face detection,” H.A. Rowley, S. Baluja and T. Kanade, Proc. Computer Vision and Pattern Recognition, 1998, copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Histogram equalisation gives an approximate fix for illumination induced variability Histogram equalisation (fig 22.15) Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Architecture of the complete system: they use another neural net to estimate orientation of the face, then rectify it. They search over scales to find bigger/smaller faces. Always worth asking: “why is it better to search over scales than to use bigger templates?” Figure from “Rotation invariant neural-network based face detection,” H.A. Rowley, S. Baluja and T. Kanade, Proc. Computer Vision and Pattern Recognition, 1998, copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Figure from “Rotation invariant neural-network based face detection,” H.A. Rowley, S. Baluja and T. Kanade, Proc. Computer Vision and Pattern Recognition, 1998, copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Convolutional neural networks Template matching using NN classifiers seems to work Natural features are filter outputs probably, spots and bars, as in texture but why not learn the filter kernels, too? Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

subsample, and finally classify based on outputs of this process. A convolutional neural network, LeNet; the layers filter, subsample, filter, subsample, and finally classify based on outputs of this process. Figure from “Gradient-Based Learning Applied to Document Recognition”, Y. Lecun et al Proc. IEEE, 1998 copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

LeNet is used to classify handwritten digits. Notice that the test error rate is not the same as the training error rate, because the test set consists of items not in the training set. Not all classification schemes necessarily have small test error when they have small training error. 22.19 Figure from “Gradient-Based Learning Applied to Document Recognition”, Y. Lecun et al Proc. IEEE, 1998 copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Support Vector Machines Neural nets try to build a model of the posterior, p(k|x) Instead, try to obtain the decision boundary directly potentially easier, because we need to encode only the geometry of the boundary, not any irrelevant wiggles in the posterior. Not all points affect the decision boundary Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Computer Vision - A Modern Approach 22.20 - Two point sets that are in fact separable by a linear classifier boundary. Notice that relatively few points determine the boundary (a subset of each side’s hull). Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Support Vector Machines Linearly separable data means Choice of hyperplane means Hence distance I do only linearly separable cases in class, and don’t derive the dual problem. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Support Vector Machines Actually, we construct a dual optimization problem. By being clever about what x means, I can have much more interesting boundaries. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Space in which decision boundary is linear - a conic in the original space has the form An SVM in a non-linear space. I don’t do the Mercer representation of this process; this figure, etc. usually gives enough illumination to the process. Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Vision applications Reliable, simple classifier, use it wherever you need a classifier Commonly used for face finding Pedestrian finding many pedestrians look like lollipops (hands at sides, torso wider than legs) most of the time classify image regions, searching over scales But what are the features? Compute wavelet coefficients for pedestrian windows, average over pedestrians. If the average is different from zero, probably strongly associated with pedestrian Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Fig 22.21 - caption tells the story Figure from, “A general framework for object detection,” by C. Papageorgiou, M. Oren and T. Poggio, Proc. Int. Conf. Computer Vision, 1998, copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Figure 22.22 - caption tells the story Figure from, “A general framework for object detection,” by C. Papageorgiou, M. Oren and T. Poggio, Proc. Int. Conf. Computer Vision, 1998, copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth

Figure 22.23 - caption tells the story Figure from, “A general framework for object detection,” by C. Papageorgiou, M. Oren and T. Poggio, Proc. Int. Conf. Computer Vision, 1998, copyright 1998, IEEE Computer Vision - A Modern Approach Set: Recognition as Template Matching Slides by D.A. Forsyth