html5-img
1 / 49

Recognition using Boosting

Recognition using Boosting. Modified from various sources including http:// people.csail.mit.edu/torralba/courses/6.869/6.869.computervision.htm. Background. Computer screen. Bag of image patches. In some feature space. Object Recognition.

marlon
Download Presentation

Recognition using Boosting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Recognition using Boosting Modified from various sources including http://people.csail.mit.edu/torralba/courses/6.869/6.869.computervision.htm

  2. Background Computer screen Bag of image patches In some feature space Object Recognition Object detection and recognition is formulated as a classification problem. The image is partitioned into a set of overlapping windows … and a decision is taken at each window about if it contains a target object or not. Decision boundary Where are the screens?

  3. Recognition Techniques…a few Neural networks Nearest neighbor 106 examples LeCun, Bottou, Bengio, Haffner 1998 Rowley, Baluja, Kanade 1998 … Shakhnarovich, Viola, Darrell 2003 Berg, Berg, Malik 2005 … Conditional Random Fields Support Vector Machines and Kernels Guyon, Vapnik Heisele, Serre, Poggio, 2001 … McCallum, Freitag, Pereira 2000 Kumar, Hebert 2003 …

  4. Classification function Where belongs to some family of functions Formulation • Formulation: binary classification … x1 x2 x3 … xN xN+1 xN+2 xN+M … Features x = -1 +1 -1 -1 ? ? ? y = Labels Training data: each image patch is labeled as containing the object or background Test data • Minimize misclassification error • (Not that simple: we need some guarantees that there will be generalization)

  5. Lets look at one technique called Boosting • Boosting • Gentle boosting • Weak detectors • Object model • Object detection

  6. A simple object detector with Boosting • Download • Toolbox for manipulating dataset • Code and dataset • Matlab code (an API that has many useful functions) • Gentle boosting • Object detector using a part based model • Dataset with cars and computer monitors http://people.csail.mit.edu/torralba/iccv2005/

  7. Why boosting? • A simple algorithm for learning robust classifiers • Freund & Shapire, 1995 • Friedman, Hastie, Tibshhirani, 1998 • Provides efficient algorithm for sparse visual feature selection • Tieu & Viola, 2000 • Viola & Jones, 2003 • Easy to implement, not requires external optimization tools.

  8. Boosting • Defines a classifier using an additive model: Strong classifier Weak classifier Weight Features vector Boosting classifier = sum of weighted “weaker” classifier IDEA = stronger classifier is sum of weaker classifiers Example of ONE Weaker classifier = say you might be trying to find computer screens and your examples all have black screens –so you might use color and if there is black in the content then there might be a computer screen there.

  9. Boosting • Defines a classifier using an additive model: • We need to define a family of weak classifiers Strong classifier Weak classifier Weight Features vector from a family of weak classifiers

  10. +1 ( ) yt = -1 ( ) Boosting • It is a sequential procedure: xt=1 Each data point has a class label: xt xt=2 and a weight: wt =1 Our example blue =computer screen Red = not a computer screen How do we find week classifiers ----first we need some sample data in our feature space X where we have a class label for each sample. In this simple example we have 2 classes +1(red) and -1(blue) ---representing abstractly 2 classes

  11. +1 ( ) yt = -1 ( ) Toy example Weak learners from the family of lines Each data point has a class label: and a weight: wt =1 IDEA = find a single linethat will separate best the 2 classes from each other h => p(error) = 0.5 it is at chance

  12. +1 ( ) yt = -1 ( ) Toy example Each data point has a class label: and a weight: wt =1 This one seems to be the best This is a ‘weak classifier’: It performs slightly better than chance.

  13. +1 ( ) yt = -1 ( ) Toy example Each data point has a class label: We update the weights: wt wt exp{-yt Ht} We set a new problem for which the previous weak classifier performs at chance again

  14. +1 ( ) yt = -1 ( ) Toy example Each data point has a class label: We update the weights: wt wt exp{-yt Ht} We set a new problem for which the previous weak classifier performs at chance again

  15. +1 ( ) yt = -1 ( ) Toy example Each data point has a class label: We update the weights: wt wt exp{-yt Ht} We set a new problem for which the previous weak classifier performs at chance again

  16. +1 ( ) yt = -1 ( ) Toy example Each data point has a class label: We update the weights: wt wt exp{-yt Ht} We set a new problem for which the previous weak classifier performs at chance again

  17. Toy example f1 f2 f4 f3 F= f1 + f2 + f3 +f4 The strong (non- linear) classifier is built as the combination of all the weak (linear) classifiers.

  18. Boosting • Different cost functions and minimization algorithms result is various flavors of Boosting • In this demo, I will use gentleBoosting: it is simple to implement and numerically stable.

  19. Overview of section • Boosting • Gentle boosting • Weak detectors • Object model • Object detection

  20. Boosting Boosting fits the additive model by minimizing the exponential loss Training samples The exponential loss is a differentiable upper bound to the misclassification error.

  21. Exponential loss Squared error Loss 4 Misclassification error 3.5 Squared error 3 Exponential loss 2.5 2 Exponential loss 1.5 1 0.5 0 -1.5 -1 -0.5 0 0.5 1 1.5 2 yF(x) = margin

  22. Boosting Sequential procedure. At each step we add to minimize the residual loss input Desired output Parameters weak classifier For more details: Friedman, Hastie, Tibshirani. “Additive Logistic Regression: a Statistical View of Boosting” (1998)

  23. gentleBoosting • At each iteration: We chose that minimizes the cost: Instead of doing exact optimization, gentle Boosting minimizes a Taylor approximation of the error: At each iterations we just need to solve a weighted least squares problem Weights at this iteration For more details: Friedman, Hastie, Tibshirani. “Additive Logistic Regression: a Statistical View of Boosting” (1998)

  24. Weak classifiers • The input is a set of weighted training samples (x,y,w) • Regression stumps: simple but commonly used in object detection. fm(x) b=Ew(y [x> q]) a=Ew(y [x< q]) Four parameters: x q fitRegressionStump.m

  25. gentleBoosting.m function classifier = gentleBoost(x, y, Nrounds) … for m = 1:Nrounds fm = selectBestWeakClassifier(x, y, w); w = w .* exp(- y .* fm); % store parameters of fm in classifier … end Initialize weights w = 1 Solve weighted least-squares Re-weight training samples

  26. Demo gentleBoosting Demo using Gentle boost and stumps with hand selected 2D data: > demoGentleBoost.m

  27. Flavors of boosting • AdaBoost (Freund and Shapire, 1995) • Real AdaBoost (Friedman et al, 1998) • LogitBoost (Friedman et al, 1998) • Gentle AdaBoost (Friedman et al, 1998) • BrownBoosting (Freund, 2000) • FloatBoost (Li et al, 2002) • …

  28. Overview of section • Boosting • Gentle boosting • Weak detectors • Object model • Object detection

  29. From images to features:Weak detectors We will now define a family of visual features that can be used as weak classifiers (“weak detectors”) Takes image as input and the output is binary response. The output is a weak detector.

  30. Weak detectors Textures of textures Tieu and Viola, CVPR 2000 Every combination of three filters generates a different feature This gives thousands of features. Boosting selects a sparse subset, so computations on test time are very efficient. Boosting also avoids overfitting to some extend.

  31. Weak detectors Haar filters and integral image Viola and Jones, ICCV 2001 The average intensity in the block is computed with four sums independently of the block size.

  32. Edge fragments Opelt, Pinz, Zisserman, ECCV 2006 Weak detector = k edge fragments and threshold. Chamfer distance uses 8 orientation planes

  33. Weak detectors Other weak detectors: • Carmichael, Hebert 2004 • Yuille, Snow, Nitzbert, 1998 • Amit, Geman 1998 • Papageorgiou, Poggio, 2000 • Heisele, Serre, Poggio, 2001 • Agarwal, Awan, Roth, 2004 • Schneiderman, Kanade 2004 • …

  34. Weak detectors Part based: similar to part-based generative models. We create weak detectors by using parts and voting for the object center location Screen model Car model These features are used for the detector on the course web site.

  35. Weak detectors First we collect a set of part templates from a set of training objects. Vidal-Naquet, Ullman (2003) …

  36. Weak detectors We now define a family of “weak detectors” as: * = = Better than chance

  37. Weak detectors We can do a better job using filtered images = * = * = Still a weak detector but better than before

  38. Training First we evaluate all the N features on all the training images. Then, we sample the feature outputs on the object center and at random locations in the background:

  39. … 1 2 3 4 10 100 Representation and object model Selected features for the screen detector Lousy painter

  40. Representation and object model Selected features for the car detector … … 100 3 2 4 1 10

  41. Overview of section • Boosting • Gentle boosting • Weak detectors • Object model • Object detection

  42. Example: screen detection Feature output

  43. Example: screen detection Thresholded output Feature output Weak ‘detector’ Produces many false alarms.

  44. Example: screen detection Thresholded output Feature output Strong classifier at iteration 1

  45. Example: screen detection Thresholded output Feature output Strong classifier Second weak ‘detector’ Produces a different set of false alarms.

  46. Example: screen detection Thresholded output Feature output Strong classifier + Strong classifier at iteration 2

  47. Example: screen detection Thresholded output Feature output Strong classifier + … Strong classifier at iteration 10

  48. Example: screen detection Thresholded output Feature output Strong classifier + … Adding features Final classification Strong classifier at iteration 200

  49. Demo Demo of screen and car detectors using parts, Gentle boost, and stumps: > runDetector.m

More Related