AdaBoost explained

AdaBoost, short for Adaptive Boosting, is a statistical classification meta-algorithm formulated by Yoav Freund and Robert Schapire in 1995, who won the 2003 Gödel Prize for their work. It can be used in conjunction with many other types of learning algorithms to improve performance. The output of the other learning algorithms ('weak learners') is combined into a weighted sum that represents the final output of the boosted classifier. Usually, AdaBoost is presented for binary classification, although it can be generalized to multiple classes or bounded intervals on the real line.[1]

AdaBoost is adaptive in the sense that subsequent weak learners are tweaked in favor of those instances misclassified by previous classifiers. In some problems it can be less susceptible to the overfitting problem than other learning algorithms. The individual learners can be weak, but as long as the performance of each one is slightly better than random guessing, the final model can be proven to converge to a strong learner.

Although AdaBoost is typically used to combine weak base learners (such as decision stumps), it has been shown that it can also effectively combine strong base learners (such as deep decision trees), producing an even more accurate model.[2]

Every learning algorithm tends to suit some problem types better than others, and typically has many different parameters and configurations to adjust before it achieves optimal performance on a dataset. AdaBoost (with decision trees as the weak learners) is often referred to as the best out-of-the-box classifier.[3] [4] When used with decision tree learning, information gathered at each stage of the AdaBoost algorithm about the relative 'hardness' of each training sample is fed into the tree growing algorithm such that later trees tend to focus on harder-to-classify examples.

Training

AdaBoost refers to a particular method of training a boosted classifier. A boosted classifier is a classifier of the formF_T(x) = \sum_^T f_t(x)where each

ft

is a weak learner that takes an object

x

as input and returns a value indicating the class of the object. For example, in the two-class problem, the sign of the weak learner's output identifies the predicted object class and the absolute value gives the confidence in that classification. Similarly, the

t

-th classifier is positive if the sample is in a positive class and negative otherwise.

Each weak learner produces an output hypothesis

h

which fixes a prediction

h(xi)

for each sample in the training set. At each iteration

t

, a weak learner is selected and assigned a coefficient

\alphat

such that the total training error

Et

of the resulting

t

-stage boosted classifier is minimized.

E_t = \sum_i E[F_{t-1}(x_i) + \alpha_t h(x_i)]

Here

Ft-1(x)

is the boosted classifier that has been built up to the previous stage of training and

ft(x)=\alphath(x)

is the weak learner that is being considered for addition to the final classifier.

Weighting

At each iteration of the training process, a weight

wi,t

is assigned to each sample in the training set equal to the current error

E(Ft-1(xi))

on that sample. These weights can be used in the training of the weak learner. For instance, decision trees can be grown which favor the splitting of sets of samples with large weights.

Derivation

This derivation follows Rojas (2009):[5]

Suppose we have a data set

\{(x1,y1),\ldots,(xN,yN)\}

where each item

xi

has an associated class

yi\in\{-1,1\}

, and a set of weak classifiers

\{k1,\ldots,kL\}

each of which outputs a classification

kj(xi)\in\{-1,1\}

for each item. After the

(m-1)

-th iteration our boosted classifier is a linear combination of the weak classifiers of the form:C_(x_i) = \alpha_1k_1(x_i) + \cdots + \alpha_k_(x_i),where the class will be the sign of

C(m-1)(xi)

. At the

m

-th iteration we want to extend this to a better boosted classifier by adding another weak classifier

km

, with another weight

\alpham

:C_(x_i) = C_(x_i) + \alpha_m k_m(x_i)

So it remains to determine which weak classifier is the best choice for

km

, and what its weight

\alpham

should be. We define the total error

E

of

Cm

as the sum of its exponential loss on each data point, given as follows:E = \sum_^N e^ = \sum_^N e^e^

Letting

(1)
w
i

=1

and
(m)
w
i

=

-yiCm-1(xi)
e
for

m>1

, we have:E = \sum_^N w_i^e^

We can split this summation between those data points that are correctly classified by

km

(so

yikm(xi)=1

) and those that are misclassified (so

yikm(xi)=-1

):\beginE &= \sum_ w_i^e^ + \sum_ w_i^e^ \\&= \sum_^N w_i^e^ + \sum_ w_i^\left(e^ - e^\right)\end

Since the only part of the right-hand side of this equation that depends on

km

is \sum_ w_i^, we see that the

km

that minimizes

E

is the one in the set

\{k1,\ldots,kL\}

that minimizes \sum_ w_i^ [assuming that <math>\alpha_m > 0</math>], i.e. the weak classifier with the lowest weighted error (with weights
(m)
w
i

=

-yiCm-1(xi)
e
).

To determine the desired weight

\alpham

that minimizes

E

with the

km

that we just determined, we differentiate:\frac = \frac

Luckily the minimum occurs when setting this to zero, then solving for

\alpham

yields:\alpha_m = \frac\ln\left(\frac\right)

We calculate the weighted error rate of the weak classifier to be

\epsilonm=

\sum
(m)
w
i
yikm(xi)
N
\sum
(m)
w
i
i=1
, so it follows that:\alpha_m = \frac\ln\left(\frac\right)which is the negative logit function multiplied by 0.5. Due to the convexity of

E

as a function of

\alpham

, this new expression for

\alpham

gives the global minimum of the loss function.

Note: This derivation only applies when

km(xi)\in\{-1,1\}

, though it can be a good starting guess in other cases, such as when the weak learner is biased (

km(x)\in\{a,b\},a-b

), has multiple leaves (

km(x)\in\{a,b,...,n\}

) or is some other function

km(x)\inR

.

Thus we have derived the AdaBoost algorithm: At each iteration, choose the classifier

km

, which minimizes the total weighted error \sum_ w_i^, use this to calculate the error rate

\epsilonm=

\sum
(m)
w
i
yikm(xi)
N
\sum
(m)
w
i
i=1
, use this to calculate the weight

\alpham=

1
2

ln\left(

1-\epsilonm
\epsilonm

\right)

, and finally use this to improve the boosted classifier

Cm-1

to

Cm=C(m-1)+\alphamkm

.

Statistical understanding of boosting

Boosting is a form of linear regression in which the features of each sample

xi

are the outputs of some weak learner

h

applied to

xi

.

While regression tries to fit

F(x)

to

y(x)

as precisely as possible without loss of generalization, typically using least square error

E(f)=(y(x)-f(x))2

, whereas the AdaBoost error function

E(f)=e-y(x)f(x)

takes into account the fact that only the sign of the final result is used, thus

|F(x)|

can be far larger than 1 without increasing error. However, the exponential increase in the error for sample

xi

as

-y(xi)f(xi)

increases, resulting in excessive weights being assigned to outliers.

One feature of the choice of exponential error function is that the error of the final additive model is the product of the error of each stage, that is,

\sumi-yif(xi)
e

=\prodi

-yif(xi)
e
. Thus it can be seen that the weight update in the AdaBoost algorithm is equivalent to recalculating the error on

Ft(x)

after each stage.

There is a lot of flexibility allowed in the choice of loss function. As long as the loss function is monotonic and continuously differentiable, the classifier is always driven toward purer solutions. Zhang (2004) provides a loss function based on least squares, a modified Huber loss function:\phi(y,f(x)) = \begin-4y f(x) & \texty f(x) < -1, \\(y f(x) - 1)^2 &\text -1 \le y f(x) \le 1. \\0 &\text y f(x) > 1\end

This function is more well-behaved than LogitBoost for

f(x)

close to 1 or -1, does not penalise ‘overconfident’ predictions (

yf(x)>1

), unlike unmodified least squares, and only penalises samples misclassified with confidence greater than 1 linearly, as opposed to quadratically or exponentially, and is thus less susceptible to the effects of outliers.

Boosting as gradient descent

See main article: article and Gradient boosting. Boosting can be seen as minimization of a convex loss function over a convex set of functions.[6] Specifically, the loss being minimized by AdaBoost is the exponential loss\sum_i \phi(i,y,f) = \sum_i e^,whereas LogitBoost performs logistic regression, minimizing\sum_i \phi(i,y,f) = \sum_i \ln\left(1+e^\right).

In the gradient descent analogy, the output of the classifier for each training point is considered a point

\left(Ft(x1),...,Ft(xn)\right)

in n-dimensional space, where each axis corresponds to a training sample, each weak learner

h(x)

corresponds to a vector of fixed orientation and length, and the goal is to reach the target point

(y1,...,yn)

(or any region where the value of loss function

ET(x1,...,xn)

is less than the value at that point), in the fewest steps. Thus AdaBoost algorithms perform either Cauchy (find

h(x)

with the steepest gradient, choose

\alpha

to minimize test error) or Newton (choose some target point, find

\alphah(x)

that brings

Ft

closest to that point) optimization of training error.

Example algorithm (Discrete AdaBoost)

With:

x1...xn

y1...yn,y\in\{-1,1\}

w1,1...wn,1

set to
1
n

E(f(x),yi)=

-yif(xi)
e

h\colonx\{-1,1\}

For

t

in

1...T

:

ht(x)

:

ht(x)

that minimizes

\epsilont

, the weighted sum error for misclassified points

\epsilont=

n
\sum
\stackrel{i=1

{ht(xi)yi}}wi,t

\alphat=

1
2

ln\left(

1-\epsilont
\epsilont

\right)

Ft(x)=Ft-1(x)+\alphatht(x)

wi,t+1=wi,t

-yi\alphatht(xi)
e
for

i

in

1...n

wi,t+1

such that

\sumiwi,t+1=1

\sumwi,t+1
ht(xi)=yi
\sumwi,t+1
ht(xi)yi

=

\sumwi,t
ht(xi)=yi
\sumwi,t
ht(xi)yi
at every step, which can simplify the calculation of the new weights.)

Variants

Real AdaBoost

The output of decision trees is a class probability estimate

p(x)=P(y=1|x)

, the probability that

x

is in the positive class.[7] Friedman, Hastie and Tibshirani derive an analytical minimizer for
-y\left(Ft-1(x)+ft(p(x))\right)
e
for some fixed

p(x)

(typically chosen using weighted least squares error):

ft(x)=

1ln\left(
2
x
1-x

\right)

.Thus, rather than multiplying the output of the entire tree by some fixed value, each leaf node is changed to output half the logit transform of its previous value.

LogitBoost

See main article: article and LogitBoost. LogitBoost represents an application of established logistic regression techniques to the AdaBoost method. Rather than minimizing error with respect to y, weak learners are chosen to minimize the (weighted least-squares) error of

ft(x)

with respect toz_t = \frac,wherep_t(x) = \frac,w_t = p_t(x)(1 - p_t(x))y^* = \frac 2.

That is

zt

is the Newton–Raphson approximation of the minimizer of the log-likelihood error at stage

t

, and the weak learner

ft

is chosen as the learner that best approximates

zt

by weighted least squares.

As p approaches either 1 or 0, the value of

pt(xi)(1-pt(xi))

becomes very small and the z term, which is large for misclassified samples, can become numerically unstable, due to machine precision rounding errors. This can be overcome by enforcing some limit on the absolute value of z and the minimum value of w

Gentle AdaBoost

While previous boosting algorithms choose

ft

greedily, minimizing the overall test error as much as possible at each step, GentleBoost features a bounded step size.

ft

is chosen to minimize \sum_i w_ (y_i-f_t(x_i))^2, and no further coefficient is applied. Thus, in the case where a weak learner exhibits perfect classification performance, GentleBoost chooses

ft(x)=\alphatht(x)

exactly equal to

y

, while steepest descent algorithms try to set

\alphat=infty

. Empirical observations about the good performance of GentleBoost appear to back up Schapire and Singer's remark that allowing excessively large values of

\alpha

can lead to poor generalization performance.[8] [9]

Early Termination

A technique for speeding up processing of boosted classifiers, early termination refers to only testing each potential object with as many layers of the final classifier necessary to meet some confidence threshold, speeding up computation for cases where the class of the object can easily be determined. One such scheme is the object detection framework introduced by Viola and Jones:[10] in an application with significantly more negative samples than positive, a cascade of separate boost classifiers is trained, the output of each stage biased such that some acceptably small fraction of positive samples is mislabeled as negative, and all samples marked as negative after each stage are discarded. If 50% of negative samples are filtered out by each stage, only a very small number of objects would pass through the entire classifier, reducing computation effort. This method has since been generalized, with a formula provided for choosing optimal thresholds at each stage to achieve some desired false positive and false negative rate.[11]

In the field of statistics, where AdaBoost is more commonly applied to problems of moderate dimensionality, early stopping is used as a strategy to reduce overfitting.[12] A validation set of samples is separated from the training set, performance of the classifier on the samples used for training is compared to performance on the validation samples, and training is terminated if performance on the validation sample is seen to decrease even as performance on the training set continues to improve.

Totally corrective algorithms

For steepest descent versions of AdaBoost, where

\alphat

is chosen at each layer t to minimize test error, the next layer added is said to be maximally independent of layer t:[13] it is unlikely to choose a weak learner t+1 that is similar to learner t. However, there remains the possibility that t+1 produces similar information to some other earlier layer. Totally corrective algorithms, such as LPBoost, optimize the value of every coefficient after each step, such that new layers added are always maximally independent of every previous layer. This can be accomplished by backfitting, linear programming or some other method.

Pruning

Pruning is the process of removing poorly performing weak classifiers to improve memory and execution-time cost of the boosted classifier. The simplest methods, which can be particularly effective in conjunction with totally corrective training, are weight- or margin-trimming: when the coefficient, or the contribution to the total test error, of some weak classifier falls below a certain threshold, that classifier is dropped. Margineantu & Dietterich[14] suggested an alternative criterion for trimming: weak classifiers should be selected such that the diversity of the ensemble is maximized. If two weak learners produce very similar outputs, efficiency can be improved by removing one of them and increasing the coefficient of the remaining weak learner.[15]

See also

Further reading

Notes and References

  1. Hastie . Trevor . Rosset . Saharon . Zhu . Ji . Zou . Hui . 2009 . Multi-class AdaBoost . Statistics and Its Interface . 2 . 3 . 349–360 . 10.4310/sii.2009.v2.n3.a8 . 1938-7989. free .
  2. Wyner . Abraham J. . Olson . Matthew . Bleich . Justin . Mease . David . Explaining the Success of AdaBoost and Random Forests as Interpolating Classifiers . Journal of Machine Learning Research . 2017 . 18 . 48 . 1–33 . 17 March 2022.
  3. Kégl. Balázs. The return of AdaBoost.MH: multi-class Hamming trees . 1312.6086 . 20 December 2013. cs.LG.
  4. Web site: Joglekar. Sachin. adaboost – Sachin Joglekar's blog. codesachin.wordpress.com. 3 August 2016.
  5. Web site: Rojas . Raúl . Raúl Rojas . AdaBoost and the super bowl of classifiers a tutorial introduction to adaptive boosting. . Freie University, Berlin . Tech. Rep. . 2009.
  6. T. . Zhang . Statistical behavior and consistency of classification methods based on convex risk minimization . Annals of Statistics . 32 . 1 . 56–85 . 2004 . 10.1214/aos/1079120130 . 3448494 . free .
  7. 10.1.1.51.9525 . Additive Logistic Regression: A Statistical View of Boosting . Jerome . Friedman . Trevor . Hastie . Robert . Tibshirani . Annals of Statistics . 1998. 28 . 2000 .
  8. Schapire . Robert . Singer . Yoram . 1999 . Improved Boosting Algorithms Using Confidence-rated Predictions . 80–91 . 10.1.1.33.4002.
  9. Web site: A Short Introduction to Boosting . Freund . Schapire . 1999 . .
  10. 10.1.1.10.6807 . Rapid Object Detection Using a Boosted Cascade of Simple Features . Paul . Viola . Robert . Jones . 2001.
  11. Optimizing cascade classifiers. . McCane . Brendan . Kevin . Novins . Michael . Albert . 2005.
  12. Book: Trevor Hastie . Robert Tibshirani . Jerome Friedman . The Elements of Statistical Learning: Data Mining, Inference, and Prediction. 2009. Springer. New York. 978-0-387-84858-7. 2nd.
  13. Book: Adaboost with Totally Corrective Updates for Fast Face Detection . Jan . Šochman . Jiří . Matas . 978-0-7695-2122-0 . 2004.
  14. 10.1.1.38.7017 . Pruning Adaptive Boosting . Dragos . Margineantu . Thomas . Dietterich . 1997.
  15. On the Boosting Pruning Problem . Christino . Tamon . Jie . Xiang . 2000.