52
Introduction to Adaptive Boosting Introduction to Adaptive Boosting Hsuan-Tien Lin National Taiwan University Machine Learning, Fall 2008 Hsuan-Tien Lin AdaBoost

Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

  • Upload
    dangdan

  • View
    219

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive Boosting

Introduction to Adaptive Boosting

Hsuan-Tien Lin

National Taiwan University

Machine Learning, Fall 2008

Hsuan-Tien Lin AdaBoost

Page 2: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 3: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 4: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 5: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 6: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 7: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 8: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 9: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 10: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 11: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 12: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 13: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 14: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 15: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 16: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 17: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 18: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 19: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 20: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 21: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 22: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Apple Recognition Problem

Is this a picture of an apple?We want to teach a class of 6 year olds.Gather photos from NY Apple Asso. and Google Image.

Hsuan-Tien Lin AdaBoost

Page 23: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Begins

Teacher: How would you describe an apple? Michael?Michael: I think apples are circular.(Class): Apples are circular.

Hsuan-Tien Lin AdaBoost

Page 24: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Begins

Teacher: How would you describe an apple? Michael?Michael: I think apples are circular.(Class): Apples are circular.

Hsuan-Tien Lin AdaBoost

Page 25: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Begins

Teacher: How would you describe an apple? Michael?Michael: I think apples are circular.(Class): Apples are circular.

Hsuan-Tien Lin AdaBoost

Page 26: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Being circular is a good feature for the apples. However, ifyou only say circular, you could make several mistakes.What else can we say for an apple? Tina?

Tina: It looks like apples are red.(Class): Apples are somewhat circular and somewhat red.

Hsuan-Tien Lin AdaBoost

Page 27: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Being circular is a good feature for the apples. However, ifyou only say circular, you could make several mistakes.What else can we say for an apple? Tina?

Tina: It looks like apples are red.(Class): Apples are somewhat circular and somewhat red.

Hsuan-Tien Lin AdaBoost

Page 28: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Being circular is a good feature for the apples. However, ifyou only say circular, you could make several mistakes.What else can we say for an apple? Tina?

Tina: It looks like apples are red.(Class): Apples are somewhat circular and somewhat red.

Hsuan-Tien Lin AdaBoost

Page 29: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Yes. Many apples are red. However, you could still makemistakes based on circular and red. Do you have any othersuggestions, Joey?

Joey: Apples could also be green.(Class): Apples are somewhat circular and somewhat red and

possibly green.

Hsuan-Tien Lin AdaBoost

Page 30: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Yes. Many apples are red. However, you could still makemistakes based on circular and red. Do you have any othersuggestions, Joey?

Joey: Apples could also be green.(Class): Apples are somewhat circular and somewhat red and

possibly green.

Hsuan-Tien Lin AdaBoost

Page 31: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Yes. Many apples are red. However, you could still makemistakes based on circular and red. Do you have any othersuggestions, Joey?

Joey: Apples could also be green.(Class): Apples are somewhat circular and somewhat red and

possibly green.

Hsuan-Tien Lin AdaBoost

Page 32: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Yes. It seems that apples might be circular, red, green. Butyou may confuse them with tomatoes or peaches, right?Any more suggestions, Jessica?

Jessica: Apples have stems at the top.(Class): Apples are somewhat circular, somewhat red, possibly

green, and may have stems at the top.

Hsuan-Tien Lin AdaBoost

Page 33: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Yes. It seems that apples might be circular, red, green. Butyou may confuse them with tomatoes or peaches, right?Any more suggestions, Jessica?

Jessica: Apples have stems at the top.(Class): Apples are somewhat circular, somewhat red, possibly

green, and may have stems at the top.

Hsuan-Tien Lin AdaBoost

Page 34: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Our Fruit Class Continues

Teacher: Yes. It seems that apples might be circular, red, green. Butyou may confuse them with tomatoes or peaches, right?Any more suggestions, Jessica?

Jessica: Apples have stems at the top.(Class): Apples are somewhat circular, somewhat red, possibly

green, and may have stems at the top.

Hsuan-Tien Lin AdaBoost

Page 35: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Put Intuition to Practice

IntuitionCombine simple rules to approximate complex function.Emphasize incorrect data to focus on valuable information.

AdaBoost Algorithm (Freund and Schapire 1997)Input: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.Get the confidence αt of such ruleEmphasize the training examples that do not agree with ht .

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 36: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Put Intuition to Practice

IntuitionCombine simple rules to approximate complex function.Emphasize incorrect data to focus on valuable information.

AdaBoost Algorithm (Freund and Schapire 1997)Input: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.Get the confidence αt of such ruleEmphasize the training examples that do not agree with ht .

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 37: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Put Intuition to Practice

IntuitionCombine simple rules to approximate complex function.Emphasize incorrect data to focus on valuable information.

AdaBoost Algorithm (Freund and Schapire 1997)Input: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.Get the confidence αt of such ruleEmphasize the training examples that do not agree with ht .

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 38: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Put Intuition to Practice

IntuitionCombine simple rules to approximate complex function.Emphasize incorrect data to focus on valuable information.

AdaBoost Algorithm (Freund and Schapire 1997)Input: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.Get the confidence αt of such ruleEmphasize the training examples that do not agree with ht .

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 39: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Put Intuition to Practice

IntuitionCombine simple rules to approximate complex function.Emphasize incorrect data to focus on valuable information.

AdaBoost Algorithm (Freund and Schapire 1997)Input: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.Get the confidence αt of such ruleEmphasize the training examples that do not agree with ht .

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 40: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Put Intuition to Practice

IntuitionCombine simple rules to approximate complex function.Emphasize incorrect data to focus on valuable information.

AdaBoost Algorithm (Freund and Schapire 1997)Input: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.Get the confidence αt of such ruleEmphasize the training examples that do not agree with ht .

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 41: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 42: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 43: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 44: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 45: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 46: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 47: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 48: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

Some More Details

AdaBoost AlgorithmInput: training examples Z = {(xn, yn)}Nn=1.For t = 1,2, · · · ,T ,

Learn a simple rule ht from emphasized training examples.

How? Choose a ht ∈ H with minimum emphasized error.

Get the confidence αt of such ruleHow? An ht with lower error should get higher αt .

Emphasize the training examples that do not agree with ht .How? Maintain an emphasis value un per example.

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Let’s see some demos.

Hsuan-Tien Lin AdaBoost

Page 49: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

The Final Version

Input: Z = {(xn, yn)}Nn=1. Set un = 1N for all n.

For t = 1,2, · · · ,T ,Learn a simple rule ht such that ht solves

minh

N∑n=1

un · I[yn 6= h(xn)].

Compute the error εt =∑N

n=1unPN

m=1 um· I[yn 6= h(xn)] and the

confidence

αt =12

ln1− εtεt

Emphasize the training examples that do not agree with ht :

un = un · exp(−αtynht(xn)

).

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 50: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

The Final Version

Input: Z = {(xn, yn)}Nn=1. Set un = 1N for all n.

For t = 1,2, · · · ,T ,Learn a simple rule ht such that ht solves

minh

N∑n=1

un · I[yn 6= h(xn)].

Compute the error εt =∑N

n=1unPN

m=1 um· I[yn 6= h(xn)] and the

confidence

αt =12

ln1− εtεt

Emphasize the training examples that do not agree with ht :

un = un · exp(−αtynht(xn)

).

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 51: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

The Final Version

Input: Z = {(xn, yn)}Nn=1. Set un = 1N for all n.

For t = 1,2, · · · ,T ,Learn a simple rule ht such that ht solves

minh

N∑n=1

un · I[yn 6= h(xn)].

Compute the error εt =∑N

n=1unPN

m=1 um· I[yn 6= h(xn)] and the

confidence

αt =12

ln1− εtεt

Emphasize the training examples that do not agree with ht :

un = un · exp(−αtynht(xn)

).

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost

Page 52: Introduction to Adaptive Boosting - 國立臺灣大學htlin/course/ml08fall/doc/adaboost.pdf · Introduction to Adaptive Boosting Intuition Adaptive Boosting (AdaBoost) Apple Recognition

Introduction to Adaptive BoostingIntuitionAdaptive Boosting (AdaBoost)

The Final Version

Input: Z = {(xn, yn)}Nn=1. Set un = 1N for all n.

For t = 1,2, · · · ,T ,Learn a simple rule ht such that ht solves

minh

N∑n=1

un · I[yn 6= h(xn)].

Compute the error εt =∑N

n=1unPN

m=1 um· I[yn 6= h(xn)] and the

confidence

αt =12

ln1− εtεt

Emphasize the training examples that do not agree with ht :

un = un · exp(−αtynht(xn)

).

Output: combined function H(x) = sign(∑T

t=1 αtht(x))

Hsuan-Tien Lin AdaBoost