Presentation is loading. Please wait.

Presentation is loading. Please wait.

AdaBoost 1. Classifier Simplest classifier 2 3 Adaboost: Agenda (Adaptive Boosting, R. Scharpire, Y. Freund, ICML, 1996): Supervised classifier Assembling.

Similar presentations


Presentation on theme: "AdaBoost 1. Classifier Simplest classifier 2 3 Adaboost: Agenda (Adaptive Boosting, R. Scharpire, Y. Freund, ICML, 1996): Supervised classifier Assembling."— Presentation transcript:

1 AdaBoost 1

2 Classifier Simplest classifier 2

3 3

4 Adaboost: Agenda (Adaptive Boosting, R. Scharpire, Y. Freund, ICML, 1996): Supervised classifier Assembling classifiers – Combine many low-accuracy classifiers (weak learners) to create a high-accuracy classifier (strong learners) 4

5 5 Example 1

6 Adaboost: Example (1/10) 6

7 Adaboost: Example (2/10) 7

8 Adaboost: Example (3/10) 8

9 Adaboost: Example (4/10) 9

10 Adaboost: Example (5/10) 10

11 Adaboost: Example (6/10) 11

12 Adaboost: Example (7/10) 12

13 Adaboost: Example (8/10) 13

14 Adaboost: Example (9/10) 14

15 Adaboost: Example (10/10) 15

16 16

17 Adaboost Strong classifier = linear combination of T weak classifiers (1) Design of weak classifier (2) Weight for each classifier (Hypothesis weight) (3) Update weight for each data (example distribution) Weak Classifier: < 50% error over any distribution 17

18 Adaboost: Terminology (1/2) 18

19 19 Adaboost: Terminology (2/2)

20 Adaboost: Framework 20

21 Adaboost: Framework 21

22 22

23 23

24 Adaboost Strong classifier = linear combination of T weak classifiers (1) Design of weak classifier (2) Weight for each classifier (Hypothesis weight) (3) Update weight for each data (example distribution) Weak Classifier: < 50% error over any distribution 24

25 Adaboost: Design of weak classifier (1/2) 25

26 Adaboost: Design of weak classifier (2/2) Select a weak classifier with the smallest weighted error Prerequisite: 26

27 Adaboost Strong classifier = linear combination of T weak classifiers (1) Design of weak classifier (2) Weight for each classifier (Hypothesis weight) (3) Update weight for each data (example distribution) Weak Classifier: < 50% error over any distribution 27

28 Adaboost: Hypothesis weight (1/2) How to set ? 28

29 Adaboost: Hypothesis weight (2/2) 29

30 Adaboost Strong classifier = linear combination of T weak classifiers (1) Design of weak classifier (2) Weight for each classifier (Hypothesis weight) (3) Update weight for each data (example distribution) Weak Classifier: < 50% error over any distribution 30

31 Adaboost: Update example distribution (Reweighting) 31 y * h(x) = 1 y * h(x) = -1

32 32 Reweighting In this way, AdaBoost “focused on” the informative or “difficult” examples.

33 33 Reweighting In this way, AdaBoost “focused on” the informative or “difficult” examples.

34 34

35 Summary 35 t = 1

36 36 Example 2

37 Example (1/5) Original Training set : Equal Weights to all training samples Taken from “A Tutorial on Boosting” by Yoav Freund and Rob Schapire

38 Example (2/5) ROUND 1

39 Example (3/5) ROUND 2

40 Example (4/5) ROUND 3

41 Example (5/5)

42 42 Example 3

43 43

44 44

45 45

46 46

47 47

48 48

49 49

50 50 Example 4

51 Adaboost: 51

52 52

53 53

54 54

55 Application 55

56 Discussion 56

57 57 Discrete Adaboost (DiscreteAB) (Friedman’s wording)

58 58 Discrete Adaboost (DiscreteAB) (Freund and Schapire’s wording)

59 59 Adaboost with Confidence Weighted Predictions (RealAB)

60 60 Adaboost Variants Proposed By Friedman LogitBoost

61 61 Adaboost Variants Proposed By Friedman GentleBoost

62 Reference 62

63 63

64 64 Robust Real-time Object Detection Key word : Features extraction, Integral Image, AdaBoost, Cascade

65 65 Outline 1. Introduction 2. Features 2.1 Features Extraction 2.2 Integral Image 3. AdaBoost 3.1 Training Process 3.2 Testing Process 4. The Attentional Cascade 5. Experimental Results 6. Conclusion 7. Reference

66 66 1. Introduction  This paper brings together new algorithms and insights to construct a framework for robust and extremely rapid object detection.  Frontal face detection system achieves : 1.High detection rates 2.Low false positive rates  Three main contributions: 1.Integral image 2.AdaBoost : Selecting a small number of important features. 3.Cascaded structure

67 67 2. Features  Based on the simple features value.  Reason : 1. Knowledge-based system is difficult to learn using a finite quantity of training data. 2. Much faster than Image-based system. ps. Feature-based: Use extraction features like eye, nose pattern. Knowledge-based: Use rules of facial feature. Image-based: Use face segments and predefined face pattern. [3] A.S.S.Mohamed, Ying Weng, S. S Ipson, and Jianmin Jiang, ”Face Detection based on Skin Color in Image by Neural Networks”, ICIAS 2007, pp , 2007.

68 Feature Extraction (1/2)  Filter: Filter type.  Feature: a. pattern 的座標位置. b. pattern 的大小  Feature value: Feature value = Filter Feature EX: eye, nose Ex: haar-like filter EX: convolution

69 69 feature value 2.1 Feature Extraction (2/2) Haar-like filter: The sum of the pixels which lie within the white rectangles are subtracted from the sum of pixels in the grey rectangles. 24 Figure 1 Filter type Feature Filter C + - ++ - +

70 Integral Image (1/6)  Integral image 1.Rectangle features 2.Computed very rapidly  II(x, y) : sum of the pixels above and to the left of (x, y).

71 Integral Image (2/6) Figure 2: Integral image The sum within D can be computed as (2 + 3). A : 3 = A + C Known: A: Sum of the pixels within rectangle A. B: Sum of the pixels within rectangle B. C: Sum of the pixels within rectangle C. D: Sum of the pixels within rectangle D. Location 1 value is A. Location 2 value is A+B. Location 3 value is A+C. Location 4 value is A+B+C+D. Q : The sum of the pixels within rectangle D = ? 1 = A 2 = A + B. 4 = A + B + C + D Equation:

72 Integral Image (3/6) Sum of the pixels

73 Integral Image (4/6)  Using the following pair of recurrences to get integral image : is the integral image. is the original image. is the cumulative row sum. ps.

74 Integral Image (5/6) original image integral image cumulative row sum

75 Integral Image (6/6) original image integral image cumulative row sum … (3*3) … =0+1=1 =0+4=4 =1+2=3 =7+1=8 =0+1=1 =1+1=2 =2+4=6 =0+3=3 =3+3=6 =+ = = = = = = + = = = = = = = =10+8=18

76 76 3. AdaBoost (1/2)  AdaBoost (Adaptive Boosting) is a machine learning algorithm.  AdaBoost works by choosing and combining weak classifiers together to form a more accurate strong classifier ! – Weak classifier: Image set ThresholdFeature value

77 77 3. AdaBoost (2/2)  Subsequent classifiers built are tweaked in favor of those instances misclassified by previous classifiers. [4]  The goal is to minimize the number of features that need to be computed when given a new image, while still achieving high identification rates. [4] AdaBoost - Wikipedia, the free encyclopedia,

78 3.4. Image weight adjusting 3.1 Training Process - Flowchart 3.0. Image weight initialization 4. Output: A strong classifier Face (24x24) l 張 Non-Face (24x24) m 張 2. Feature Extraction: Using haar-like filter 設每張 image 可 extract 出 N 個 feature value 共有 N*(l+m) 個 feature value feature 1. Input: Training image set X (24x24) T 個 weak classifiers Candidate threshold θ Weak classifier weight Weak classifier 3. AdaBoost Algorithm: 3.1. Normalize image weight 3.2. Error calculation 3.3. Select a weak classifier h t with the lowest error ε t

79 79 1. Input: Training data set 以 X 表示. 設有 l 張 positive image, m 張 negative image, 共 n (n=l+m) 張 image. { … } 裡的第 j 個 local feature value, 共有 N * n 個 local feature value. 3.2 Training Process - Input 設每張 image 可以 extract 出 N 個 local feature, 表示 image

80 Training Process - Feature Extraction (1/2) Haar-like filter : … Candidate feature value (n*N 個 ) convolution … … … … … … n 張 image Ps. 1 張 image 可 extract 出 N 個 feature value ∴ N = 4 * f f: feature number 2. Feature Extraction: Using haar-like filter

81 Training Process - Feature Extraction (2/2) Define weak classifiers : : 即 image i 的第 j 個 local feature value : 即 image k 的第 j 個 local feature value Non-face Face θ 1,5 θ 2,5 θ 3,5 θ 4,5 Polarity : Ex : 3 face & 1 non-face image extract by 5 th feature h 1,5 h 2,5 h 3,5 h 4,5 ε 1,5 ε 2,5 ε 3,5 ε 4,5

82 Training Process - AdaBoost Algorithm (1/4) 3-0. Image weight initialization : 3. AdaBoost Algorithm: l is the quantity of positive images. m is the quantity of negative images.

83 83 Iterative: t = 1, …,T T : weak classifier number 3-1. Normalize image weight: 3-2. Error calculation : 3-3. Select a weak classifier with the lowest error rate Image weight adjusting : 3.2 Training Process - AdaBoost Algorithm (2/4) Training data set X error rate Candidate weak classifier positive or negative

84 Training Process – Output (1/2) Weak classifier weight threshold

85 3.2 Training Process – Output (2/2) 如 Fig. B ,當 ε (error rate) 在 0 ~ 0.1 區間內與其他如 0.1 ~ 0.5 區間內即使 ε 有相同的變 化量,所對應到的 α (weak classifier weight) 變化量差異也 相當大,如此一來當 ε 越趨近 於 0 時,即使 ε 只有些微改變, 在 strong classifier 中其比重也 會劇烈加大。因此,取 log 是 為了縮小 weight 彼此間差距 , 使 strong classifier 中的各個 weak classifiers 均佔有一定比 重。 Fig. B Fig. C ε ε α α ε

86 AdaBoost Algorithm – Image Weight Adjusting Example If 取最小, 則 初始值 經分類後 OOOOXO Update0.167* *0.2 Normalize Weight 變化 t =1 時 每一輪都將分對的 image 調低其 weight ,經過 Normalize 後,分錯的 image 的 weight 會相對提高, 如此一來,常分錯的 image 就會擁有較高 weight 。 如果一張 image 擁有較高 weight 表示在進行分類 評估時,會著重在此 image 。

87 3.3 Testing Process - Flowchart Test Image 1. Extract Sub-windows 2. Strong Classifier Detection (360*420) … (24*28) (228*336) … 3. Merge Result (24*24) Result Image Downsampling … … h1h1 h2h2 h3h3 hThT Strong Classifier Reject windowsAccept windows … Load T weak classifiers About sub-windows Sub-window For all sub-windows … average coordinate

88 88 4. The Attentional Cascade (1/5)  Advantage: Reducing testing computation time.  Method: Cascade stages.  Idea: Reject as many negatives as possible at the earliest stage. More complex classifiers were then used in later stages.  The detection process is that of a degenerate decision tree, so called “cascade”. Stage True positive False positive True negative False negative Figure 4 : Cascade Structure

89 89 4. The Attentional Cascade (2/4) θ θ θ Stage 1 Stage 2 Stage 3

90 90 4. The Attentional Cascade (3/4)  True positive rates (detection rates): 將 positive 判斷為 positive 機率  False positive rates (FP): 將 negative 判斷為 positive 機率  True negative rates: 將 negative 判斷為 negative 機率  False negative rates (FN): 將 positive 判斷為 negative 機率 FPFN + => Error Rate

91 91 4. The Attentional Cascade (4/4)  Training a cascade of classifiers: Involves two types of tradeoffs : 1.Higher detection rates 2.Lower false positive rates More features will achieve higher detection rates and lower false positive rates. But classifiers require more time to compute. Define an optimization framework: 1.the number of stages 2.the number of features in each stage 3.the strong classifier threshold in each stage

92 4. The Attentional Cascade - Algorithm (1/3)

93 93  f : Maximum acceptable false positive rate. ( 最大 negative 辨識成 positive 錯誤百分比 )  d : Minimum acceptable detection rate. ( 最小辨識出 positive 的百分比 )  : Target overall false positive rate. ( 最後可容許的 false positive rate)  Initial value: P : Total positive images N : Total negative images f = 0.5 d = 初始 False positive rate. 初始 Detection rate. Threshold = 0.5 AdaBoost threshold Threshold_EPS = Threshold adjust weight i = 0 The number of cascade stage 4. The Attentional Cascade - Algorithm (2/3)

94 While( ) { i=i+1 While( ) { ( ) = AdaBoost(P,N, ) While( ) { Threshold = Threshold – Threshold_EPS = Re-computer current strong classifier detection rate with Threshold (this also affects ) } If( ) N = false detections with current cascaded detector on the N } Add Stage Add Feature Threshold, 則 D i,F i Get New D i, F i N = F i *N  Iterative: 4. The Attentional Cascade - Algorithm (3/3) f : Maximum acceptable false positive rate d : Minimum acceptable detection rate : Target overall false positive rate P : Total positive images N : Total negative images i : The number of cascade stage F i : False positive rate at ith stage D i : Detection rate at ith stage n i : The number of features at ith stage

95 95 5. Experimental Results (1/3)  Face training set:  Extracted from the world wide web.  Use face and non-face training images.  Consisted of 4916 hand labeled faces.  Scaled and aligned to base resolution of 24 by 24 pixels.  The non-face sub-windows come from 9544 images which were manually inspected and found to not contain any faces. Fig. 5: Example of frontal upright face images used for training

96 96 5. Experimental Results (2/3)  In the cascade training:  Use 4916 training faces.  Use 10,000 non-face sub-windows.  Use the AdaBoost training procedure.  Evaluated on the MIT+CMU test set:  An average of 10 features out of a stage are evaluated per sub-window.  This is possible because a large majority of sub-windows are rejected by the first or second stage in the cascade.  On a 700 Mhz Pentium III processor, the face detector can process a 384 by 288 pixel image in about.067 seconds.

97 97 5. Experimental Results (3/3) Fig. 6: Create the ROC curve ( receiver operating characteristic ) the threshold of the final stage classifier is adjusted from. θ

98 98 Reference [1] P. Viola and M. Jones, “Rapid Object Detection Using A Boosted Cascade of Simple Features”, Proc. IEEE Conf. Computer Vision and Pattern Recognition, vol.1, pp , 2001 [2] P. Viola and M. Jones, “Robust Real-time Object Detection”, IEEE International Journal of Computer Vision, vol.57, no.2, pp , [3] A.S.S.Mohamed, Ying Weng, S. S Ipson, and Jianmin Jiang, ”Face Detection based on Skin Color in Image by Neural Networks”, ICIAS 2007, pp , [4] AdaBoost - Wikipedia, the free encyclopedia,


Download ppt "AdaBoost 1. Classifier Simplest classifier 2 3 Adaboost: Agenda (Adaptive Boosting, R. Scharpire, Y. Freund, ICML, 1996): Supervised classifier Assembling."

Similar presentations


Ads by Google