CHAPTER 09/1763–2012

Learning from Data on Its Own

Two centuries of tools, and three lamps that lit at once in 2006–2012

Show a machine many examples and let it find the rules. Many of the tools behind this came out of statistics, bee classification, parole decisions in prisons, research on sending signals, and psychological tests. In the seven years from 2006, deep neural networks (deep learning) suddenly grew powerful because GPUs and huge amounts of data joined that toolbox.

012006 · The start of deep learning

Three conditions came together

What was new in 2006: an idea, or the conditions?

Neural networks with many stacked layers could not learn well with backpropagation (Chapter 8) alone. In 2006 Geoffrey Hinton and his colleagues showed a way to : first, with no correct answers, the network learns the features of the data (pre-training), and then the whole thing is finished off with backpropagation. The error rate on the handwritten-digit set MNIST was 1.25%.

A Science paper from the same year said it had been . It named speed of computation, amount of data, and a good starting point for the weights, and went on:

In the figure on the right, switch the lamps for the three conditions on and off to compare reconstructions of images of vertical and horizontal bars. When the starting weights are set by pre-training, the network learns one layer at a time with no correct answers, and then the whole thing is finished off with backpropagation (the effects of the lamps are an example made for this site).

Δwij =η(⟨vihj⟩data − ⟨vihj⟩reconstruction)
v, h
neurons of the visible layer (pixels) and the hidden layer
w
weight
⟨ ⟩
average (the weights are corrected by the gap between data and reconstruction; the method of the restricted Boltzmann machine)
What you think you knowThe popular story:In 2006, Hinton invented a brand-new idea called deep learning
The original source says:The paper itself said it had been obvious since the 1980s, and what was new was mainly . In the same year, Yoshua Bengio and colleagues published a similar method.

What the figure shows:What was new in 2006 was not the idea of deep networks, but 3 conditions coming together: fast computation, plentiful data, and good starting weights.

Reconstruction error (it shrinks as learning proceeds)
021763, 1961 · Bayes

From the result back to the cause

Can you classify the field of a document from clue words alone?

Bayes' theorem is the idea of recalculating how likely a cause or hypothesis is after you obtain evidence. The paper was read at the Royal Society in England on December 23, 1763. Its author, Thomas Bayes, had already died; it was his friend Price who found it among his papers and sent it in.

In 1961, M. E. Maron of the RAND Corporation used this idea in an experiment that sorted paper abstracts into 32 fields. He assumed that, once the field is fixed, words occur independently of one another, and simply multiplied the probabilities of the individual words (today called simple Bayes, or naive Bayes). On 85 new abstracts that contained two or more clue words, the top-ranked field was correct for 44 (51.8%), and for 68 (80%) if the top three fields were allowed.

In the figure on the right, pressing the clue words changes the probabilities of the fields by multiplication (the words and probabilities are an example made for this site).

P(field | words) ∝ P(field) × Π P(word | field)
P(A | B)
probability that A happens given condition B
Π
multiply together across the words
∝
proportional to (at the end, divide so that the total is 1)
What you think you knowThe popular story:Naive (simple) Bayes is a method that naively believes words are independent of each other
The original source says:Maron himself wrote that the independence assumption is clearly not correct, and that he adopted it to make the calculation simple. The paper contains neither the word "naive" nor the name "Bayes".

What the figure shows:Multiplying word probabilities for each subject area can identify a document's subject from clue words. It works reasonably well even with the false assumption that the words are unrelated to one another.

031805 · Least squares

Square the errors, add them, minimize

When measured points scatter, which line “fits” best?

In 1805, Adrien-Marie Legendre in Paris published the method of least squares in an appendix to a book on calculating the orbits of comets. When there are more equations than unknowns, you cannot make every error zero. So he wrote that the most general, accurate and easy approach is to square each error, add them up, and choose the values that make that total smallest. He also explained that this balances the errors against each other and keeps extreme errors from dragging the result around.

In the figure on the right, the errors are drawn as real squares. Move the points or change the slope of the line (the intercept adjusts automatically) and try to make the total area smaller. Press "Least squares (to the valley bottom)" and the line found from the formula in one step is drawn. You fit the numbers in the formula to the data. Many of the methods in this chapter start from this form.

S=Σ(yi − (a xi +b))² made as small as possible
a=Σ(xi − x̄)(yi − ȳ) ÷ Σ(xi − x̄)²、b= ȳ − a x̄
(xi, yi)
the observed data points
a, b
slope and intercept of the line
x̄, ȳ
means of x and y
What you think you knowThe popular story:Least squares was devised by Gauss
The original source says:Legendre was the first to print and publish it (1805). In his 1809 book Gauss wrote that he had used it since 1795, and Stephen Stigler (1981) concluded that Gauss was probably first but that it is not conclusive. Robert Adrain in America also published it in 1808–1809.

What the figure shows:The straight line that fits scattered points is chosen to minimize the sum of the squared differences.

Sum of squared errors as the slope a changes (the bottom of the valley is the least squares)
041838, 1958 · The S-shaped curve

From population formula to probability

How do you build a prediction that always stays between 0 and 1?

In 1838, Pierre François Verhulst in Belgium wrote down how a population grows as a formula. It takes the doubling push mp and subtracts a brake np² that gets stronger as the population grows. The solution curve is S-shaped, and the population approaches an upper limit m/n. In 1845 he named this curve logistique (he did not give a reason).

The same S-shaped curve later came to be used to predict probabilities. For data whose answer is “yes (1)” or “no (0)”, the method that predicts the probability of a 1 from explanatory variables is logistic regression. A straight line can predict below 0 or above 1, but an S-shaped curve always stays between 0 and 1. In 1958, David Cox of the University of London published a paper on regression for 0-and-1 data.

In the figure on the right, in "Population (1838)" move m and n, and in "Yes/No (1958)" press "Learn one step", and watch the S-curve fit itself to the points.

dp/dt=mp − np²
P(y=1)=1 ÷(1+e−(ax+b))
p, m, n
the population, the growth push, the strength of the brake
a, b
numbers set by learning
e
about 2.718 (the base of natural logarithms)
What you think you knowThe popular story:Logistic regression was devised by Cox in 1958
The original source says:In a 1994 interview Cox himself said he did not know who was first and that Cornfield might have done it. In 1944, Berkson had used the logistic function and coined the word .

What the figure shows:An S-shaped curve describing population growth later became a formula for predicting yes-or-no probabilities between 0 and 1.

051901, 1933 · Principal component analysis

Which line is closest to the points?

When both x and y have measurement error, how do you decide on a “fitting line”?

The least squares line assumes that only y has error and minimizes the vertical gaps. So you get a different line depending on whether you take x or y as the base. In 1901, Karl Pearson in London reasoned that it is enough to minimize the sum of the squares of the perpendicular lengths dropped from each point to the line. That line passes through the center of the points, and points along the longest axis of the ellipse that describes how the points scatter.

In the figure on the right, choose "Pearson's 10 points" to see the 10 points exactly as in the numerical example from Pearson's paper. Choose "Perpendiculars", rotate the line and look for the direction in which the average of the squared perpendiculars is smallest. The paper's answer is a slope of −0.546. Regression that predicts y from x gives −0.5396, and predicting x from y gives −0.5659, so the three lines are all different.

In 1933, Harold Hotelling of Columbia University named the method of taking out, one after another, the components that explain the most variation from the scores of many related tests .

The direction that minimizes Σ di² =the direction in which the points scatter most (the first principal component)
di
length of the perpendicular from the i-th point to the line
scatter ellipse
an ellipse that shows how the data scatter
What you think you knowThe popular story:Principal component analysis was devised by Hotelling in 1933
The original source says:That the line closest to the points is the longest axis of the scatter had already been shown by Pearson in 1901.

What the figure shows:The line closest to the points, minimizing the sum of squared perpendicular distances, follows the longest direction of their spread. It differs from a regression line that measures only differences in y.

The direction of the line and the average squared perpendicular
061950 · Japan · Quantification

Deciding the scores from the data

What score should we give to answers like “fits in well, ordinary, rebellious”?

Around the end of Japan's 1948 survey of literacy, Chikio Hayashi of the Institute of Statistical Mathematics was approached by a scholar of criminal law who wanted statistics to make the decision of whether to grant parole more reliable. Until then, people had decided scores for each answer, such as −2 to 2, and added them up.

Hayashi went to Yokohama Prison and read a trend: both model prisoners who fit in well and people who were openly rebellious were likely to reoffend, and people in the middle were least likely to reoffend. So he arrived at a method in which the numbers given to the answers themselves are decided from the data, so that the group that did not reoffend and the group that did are separated as clearly as possible (an English-language paper in 1950).

In the figure on the right, compare scores decided by a person with scores decided from the data (the headcounts are an example made for this site).

Choose the scores s so that the correlation ratio η² is as large as possible
s
the number given to an answer (category)
η²
the share of the overall variation that is explained by differences between groups (the form of today's Quantification Type II)
What you think you knowThe popular story:Quantification Types I to IV were created and named by Hayashi in that order
The original source says:The first to be completed was the parole prediction method (today's Type II). The numbers I to IV were names given in 1964 by the social psychologist Hiroshi Akuto, and have nothing to do with the order in which they were made.

What the figure shows:Letting data determine the scores assigned to answers, instead of choosing them by hand, captures relationships that do not follow a straight line, such as people in the middle range being least likely to reoffend.

071951, 1967 · k-nearest neighbors

Just copy the closest example

If you only copy the closest example you remember, how far can you get?

The k-nearest-neighbor method finds the k closest data points to a new point you want to classify, and assigns it to the class most of them belong to. It assumes nothing in advance about the shape of the distribution of the data. In February 1951, Fix and Hodges considered this kind of rule in a report from the U.S. Air Force School of Aviation Medicine. They showed that if k grows as the number of data points n grows (while k/n goes to 0), the rule approaches the best possible classification.

In 1967, Cover and Peter Hart of Stanford proved that even the nearest-neighbor rule (k=1), which copies just the single closest point, has with unlimited data an error rate that does not exceed twice the theoretical minimum (the Bayes error rate). In this sense, the paper says, half of the classification information in infinite data is contained in the one nearest point.

Place points in the figure on the right and change k. With k=1 every training point is classified correctly, but small islands form around the noisy points.

R* ≤ R ≤ R*(2 − M R* ÷(M − 1))≤ 2R*
R
error rate of the nearest-neighbor rule (with unlimited data)
R*
Bayes error rate (the error that remains even if the distribution is known perfectly)
M
number of classes
What you think you knowThe popular story:The k-nearest-neighbor method was devised by Cover and Hart in 1967
The original source says:The two themselves wrote that Fix and Hodges seem to have been the first to formulate the neighbor rule and study its properties. The 1951 report was never turned into a journal paper.

What the figure shows:Simply copying the nearest example can give the right answer. Setting k to 1 gets every training point right, but creates small islands around noisy points.

R* and the upper bound on R (for two classes)
081957, 1967 · k-means

Split, then move to the average

Without giving the right answers, can we split data into k groups?

k-means is a procedure that alternates two steps: (1) assign each point to the nearest representative, and (2) move each representative to the average of its group. It keeps shrinking the spread within the groups. With each repetition, the total spread either decreases or stays the same and stops.

Many people arrived at the same kind of procedure independently. In 1957, Lloyd of Bell Labs, working on sending a signal's voltage by replacing it with a fixed number of representative values (PCM), wrote up a procedure for finding the boundaries and representatives that give the smallest error, in a manuscript circulated inside the lab (it appeared in a journal about 25 years later). In 1967, James MacQueen of the University of California, Los Angeles gave the name k-means to a procedure that puts points one at a time into the nearest group and immediately updates the averages.

In the figure on the right, press "Assign" and "Move" in turn. If you change where the first representatives are placed, it may stop at a different answer.

W=Σgroup Σpoint x in the group ‖x − μgroup‖²
x, μ
a point, and the representative (average) of its group
‖ ‖²
squared distance
W
total spread within the groups
What you think you knowThe popular story:k-means was invented by MacQueen in 1967
The original source says:In the same paper he himself lists earlier examples: Sebestyen (1962), Forgy and Jennrich, and Wallace and Ball. Steinhaus in 1956 and Lloyd in 1957 had also put forward the same idea.

What the figure shows:Alternating between assigning points to their nearest representative and moving each representative to the average divides data into groups without being taught answers. Different starting points can lead to different final results.

091958, 1963 · Hierarchical clustering

Link the most similar into a tree

How can you find clusters in data without deciding the number of groups?

In 1958, the entomologists Sokal and Michener of the University of Kansas compared 97 species of bees using 122 characters per species. They first grouped the species that resemble each other, then kept linking the groups they had made, and summarized the whole as a tree-shaped diagram (a dendrogram).

In 1963, Ward of an Air Force base laboratory turned this way of summarizing into a general procedure. Check every way of choosing two of the existing groups, and merge the two that make a number measuring how good the grouping is (the objective function) best. Repeat until everything is one group.

The figure on the right is exactly the example in Ward's paper. If the scores of 10 people, 2, 6, 5, 6, 2, 2, 2, 0, 0, 0, are put in one group, the sum of squared deviations from the average is 50.5. Split into four groups, {0,0,0} {2,2,2,2} {5} {6,6}, it is 0. Press "Merge two" and watch the tree grow.

The two groups to merge=the two groups whose merger increases ESS the least (the objective function in this figure)
ESS
the sum, over the groups, of the sum of squared deviations from each group's average
What you think you knowThe popular story:Ward's method merges the pair of groups with the smallest increase in the total squared deviation
The original source says:The 1963 paper wrote it as a general procedure in which the objective function can be any function the researcher chooses to fit the purpose. The sum of squared deviations was just one of the examples.

What the figure shows:Joining the most similar items first brings everything into 1 branching tree, or dendrogram, without choosing the number of groups in advance.

101966, 1975 · Hidden Markov models

Guessing hidden states from symbols

How do you recognize a signal like a voice, which wobbles every time even for the same word?

In 1966, Baum and Petrie of the Institute for Defense Analyses in the United States built a mathematical model in which states that cannot be seen from outside change with certain probabilities, and each state outputs a symbol with certain probabilities. From the sequence of output symbols alone, you can estimate the probabilities of the state changes and of the symbols being produced. This is today's hidden Markov model (HMM).

In 1975, James Baker used this mechanism in the speech understanding system DRAGON, and in 1976 Frederick Jelinek of IBM brought it into continuous speech recognition. It became widely known in 1989 through a tutorial by Rabiner of AT&T Bell Laboratories.

In the figure on the right, hidden states (voice, silence) change from one to another, and all we can observe is the loudness of the sound. From this we estimate the most probable sequence of states (the Viterbi algorithm).

Look for the sequence of states that maximizes P(states | symbols)
states and symbols
the states cannot be seen directly (voice, silence), only the symbols can be observed (loudness)
Viterbi
a dynamic programming method that keeps only the most probable route so far as it moves forward (the same idea as DP matching in Chapter 5)
What you think you knowThe popular story:With the arrival of hidden Markov models, the performance of speech recognition jumped
The original source says:In Rabiner's (1989) experiments on words spoken one digit at a time, the error rates of the HMM and of the earlier pattern matching (DTW) were about the same (1.3% versus 2.0%, and 1.8% versus 1.1%). The strengths lay in its power to represent how sounds are produced, and in its ability to extend to recognition with large vocabularies.

What the figure shows:Hidden states, such as speaking or silence, change according to probabilities, while only sound volume is visible. Using connections over time identifies the sequence of states more accurately than guessing each time step separately.

111971–2010 · Japan · Choosing a model

How do you spot overfitting?

The more numbers you adjust, the better the fit to the data. Where should you stop?

The more numbers you can adjust (parameters), the more closely a formula fits the data in hand. But it tends to miss on new data (overfitting). In 1971, Hirotugu Akaike of the Institute of Statistical Mathematics published AIC, a criterion that adds a penalty for the number of parameters to the fit to the data. Smaller is better.

In 1974, Stone in London wrote up cross-validation, which splits the data into one part for learning and one part for checking, and chooses a model by the average score as the split is varied. In 1977 he showed that leave-one-out cross-validation and AIC behave the same way when there is a lot of data. In 2010, Sumio Watanabe of the Tokyo Institute of Technology created WAIC, which can be used even for neural networks and other models where AIC's assumptions do not hold, and proved that it approaches the same value as leave-one-out cross-validation.

Raise the degree of the polynomial in the figure on the right. The training error keeps falling, but the cross-validation error and AIC start to rise partway.

AIC= −2 log L̂ +2k
L̂
maximum likelihood (how likely the data are at the values that make them most likely)
k
number of parameters
What you think you knowThe popular story:The A in AIC is the A of Akaike
The original source says:In his 1974 paper he wrote that he chose A so that similar criteria such as BIC and DIC could follow, and in a 1981 recollection he wrote that it stands for "an information criterion". The W in WAIC also stands for widely applicable in Watanabe's paper.

What the figure shows:Adding more terms to a formula fits the available data better, but makes errors on new data more likely. AIC and cross-validation help find the right balance.

Training error, cross-validation error and AIC by degree
121977 · The EM algorithm

Fill in the unseen part and recalculate

When part of the data is hidden, how do you find the most plausible values?

In 1977, Arthur Dempster, Nan Laird and Donald Rubin of Harvard University and elsewhere presented a general method for finding plausible parameters when part of the data cannot be seen. It alternates an E step (expectation), which computes the expected value of the unseen part using the current values, with an M step (maximization), which recomputes the values from the filled-in data. With each repetition, the likelihood of the data does not go down.

The first example is data in which 197 animals split into 4 types by a genetic mechanism, as 125, 18, 20 and 34. In the figure on the right, choose "197-animal example" and press "E: Fill in" and "M: Recalculate" in turn. π settles from 0.5 to 0.6268214… in 8 steps, the same numbers as in Table 1 of the paper. In "Two peaks", mixed points are separated into their peaks.

E:x₂ =125 ×(π/4)÷(1/2+π/4)
M:π=(x₂ +34)÷(x₂ +18+20+34)
π
the value we want (a probability inside the genetic model)
x₂
the expected number, among the 125 animals, that belong to the unseen second group
What you think you knowThe popular story:The EM algorithm was invented by Dempster and colleagues in 1977
The original source says:The three themselves wrote that it had been proposed many times before for special cases (Hartley 1958, Baum and colleagues, and others). Their contribution was to put it into a general form, give it a name, and prove that the likelihood does not go down.

What the figure shows:Alternating between filling in hidden parts using the current values (E) and recalculating values from the filled-in data (M) moves toward the most likely values.

π at each repetition
131979 · Japan · Otsu's binarization

Setting the white–black border by itself

When you split a grayscale image into white and black, how do you decide the brightness of the border?

To separate characters or objects from the background, you classify pixels into two groups at a certain brightness (the threshold). In 1979, Nobuyuki Otsu of the Electrotechnical Laboratory published, in an English-language paper, a method for deciding this threshold automatically. When the frequency distribution of brightness (the histogram) is split in two at a threshold k, choose the k that maximizes the variation between the groups (between-class variance). This is the same as minimizing the variation inside each group.

The calculation uses only the share of pixels up to that brightness and the sum of their brightness, so it is very simple. It is an unsupervised method that decides without using examples of correct answers. The paper gave as examples the letter A typed with a new ribbon and an old ribbon, a cloth pattern, and an image of cells.

In the figure on the right, move the threshold and look for the top of the peak in the graph (the image is an example made for this site).

σB²(k)=ω₀ ω₁(μ₀ − μ₁)² → choose the k with the largest σB²
ω₀, ω₁
share of pixels in the dark group and in the bright group
μ₀, μ₁
average brightness of each group
What you think you knowThe popular story:Otsu's binarization is a small trick for turning images into black and white
The original source says:Otsu derived it from discriminant analysis and treated it as one of the basic problems of pattern recognition. The paper's conclusion also says that, as long as you have a histogram, it can be used for other unsupervised classification too.

What the figure shows:The brightness threshold for separating black and white can be chosen automatically, without labeled examples, by finding where the 2 groups are most separated, measured by between-class variance.

Threshold k and the between-class variance σB²
141985 · Bayesian networks

Evidence spreads through the net

Can you reason from many clues without bending the rules of probability?

Many expert systems of the early 1980s (Chapter 6) used ad hoc calculation rules for uncertain reasoning. In 1982, Judea Pearl of the University of California wrote that many AI researchers had accepted the myth that the rules of probability must be bent, at least in part. He devised a graph in which matters are points, direct dependencies are arrows, and their strength is expressed by conditional probabilities. He showed that with this, points that exchange short messages only with their neighbors can update the probabilities of the whole correctly. In 1985 he called this form a Bayesian network.

The figure on the right is a small network in which "Rain" and "Sprinkler" are causes of "Grass is wet" (the probabilities are an example made for this site). Enter "The grass was wet" and both rain and the sprinkler become suspect, but if you then also enter "It rained", the probability of the sprinkler goes down. That is because one cause already explains it.

P(rain | wet)=P(wet | rain) × P(rain) ÷ P(wet)
P(A | B)
probability of A when B is known
arrow
direction from a direct cause to its effect
What you think you knowThe popular story:Bayesian networks were born as a statistical tool for learning from data
The original source says:The title of Pearl's 1985 report was about a model of a self-activated memory that reasons from evidence, and it was presented at a cognitive science conference. The 1982 paper was written as an answer to the ad hoc calculations of expert systems.

What the figure shows:Connecting causes and effects with arrows lets changes in likelihood spread through the network when evidence arrives. Once one cause explains the evidence, the other becomes less suspect.

151986 · Decision trees

Which question do you ask first?

How do you build a "tree" that gives an answer by lining up questions?

A decision tree lines up questions such as "What is the weather?" and "Is the humidity high?" in a branching shape, follows the branches according to the answers, and gives its answer at the leaf it reaches. In 1986, Quinlan of Australia wrote up a way of building one called ID3. It picks first the question with the largest amount of information (information gain, measured in bits) obtained by splitting the data, and repeats the same thing after each split.

The 14 cards in the figure on the right each represent a row of Table 1 of the paper. They show the row number and the answer P or N. Open "Details: 14 source rows, full tree, amount of information" to also read the weather, temperature, humidity and wind on a Saturday morning. Splitting by weather gives 0.246 bits of information, the largest, so the root of the tree is the weather. Press the questions and grow the tree yourself.

Information gain=I(whole) − Σ(share of each split group × I(that group))  I= −p log₂ p − n log₂ n
p, n
shares of P and N in the group
I
the amount of information needed to learn the answer (in bits)
What you think you knowThe popular story:Decision trees were born from AI (machine learning) research
The original source says:The statistics side has its own separate lines: AID by Morgan and Sonquist in 1963 and CART by Breiman and colleagues in 1984. CART does not appear in the references of the 1986 paper, and the two lines grew separately. The paper has an example of the same form as the textbook "weather and tennis" example, but the word tennis does not appear in it.

What the figure shows:A decision tree is built by first asking the question that gives the most information about the answer, then repeating the same process at each branch.

161988, 1989, 1994 · Reinforcement learning

Learning from rewards

Can a machine learn when it is never told the right answer and only now and then gets a "reward"?

Reinforcement learning is machine learning that picks up how to act by trial and error, using rewards as its clue. In 1988, Richard Sutton of GTE Laboratories put into a theory the TD method, which corrects today's prediction by its gap from tomorrow's prediction, without waiting for the final result. In 1989, Christopher Watkins presented in his doctoral thesis Q-learning, which corrects the value Q(x, a) of taking action a in state x a little at a time with each trial. He also proved that if every action is tried many times, the values approach the best ones.

In 1994, Kazuteru Miyazaki, Masayuki Yamamura and Shigenobu Kobayashi of the Tokyo Institute of Technology studied the profit sharing method, which, when a reward comes, strengthens the whole chain of actions that came before it. They proved the conditions under which it does not learn actions that only make a detour, and won a paper award from the Japanese Society for Artificial Intelligence.

In the maze in the figure on the right, train the route to the treasure (the reward) with Q-learning and with profit sharing.

Q(x, a) ← Q(x, a)+α(r+γ maxb Q(x′, b) − Q(x, a))
r, x′
the reward received and the next state
α, γ
the learning rate and the discount rate for future rewards (0–1)
What you think you knowThe popular story:TD learning was invented by Sutton in 1988
The original source says:Sutton himself wrote that the TD method had already been used, for example in Samuel's checkers program (1959, Chapter 3), but was not well understood. Q-learning, too, was born in the 1989 doctoral thesis, not in the 1992 paper.

What the figure shows:Even without correct answers and with a reward only on reaching the treasure, repeated trials let the system learn a path to it.

Number of tries and steps taken to reach the treasure
171990, 1995, 1999 · Boosting

Stacking weak learners on mistakes

Can you gather methods only slightly better than guessing and make a strong one?

It started as a theoretical question. Is weak learning, only slightly better than guessing, as powerful as strong learning, which can be made as accurate as you like? In 1990, Robert Schapire of MIT proved the two are equivalent and gave an algorithm that turns a weak method into a strong one. In 1995, Yoav Freund and Schapire published AdaBoost. It gives more weight to the data that was wrong in the previous round, has the next classifier learn from it, and finally combines the verdicts with a weighted majority vote.

In 1999, Friedman of Stanford generalized gradient boosting, in which the next small decision tree predicts the error (residual) between the current prediction and the right answer and the results are added up bit by bit, as an optimization that goes downhill.

In the figure on the right, press "Add one round" and the wrongly classified data grow larger, and the next boundary comes to classify them.

αt = ½ log((1 − εt) ÷ εt)  weight of a misclassified example ← weight × eαt
εt
the weighted error rate of the t-th classifier
αt
that classifier's weight in the majority vote
What you think you knowThe popular story:Boosting does not overfit
The original source says:In a 2013 commentary, Schapire himself showed an example where the test error keeps falling after the training error reaches 0 (8.4% at round 5 → 3.1% at round 1000), and yet wrote that boosting can overfit too.

What the figure shows:Even classifiers only slightly better than guessing become strong when each new one learns with extra weight on previous mistakes and their answers are combined by voting.

Number of training errors by round
181992 · Support vector machines

Maximizing the margin from the border

You can draw many lines that split two groups. Which one is best?

In July 1992, Bernhard Boser, Isabelle Guyon and Vladimir Vapnik (working at AT&T Bell Laboratories) presented a new learning method at the conference COLT '92. It draws the boundary between two groups so that the distance to the nearest points (the margin) is as large as possible. The boundary is decided only by the few points closest to it, and does not change if other points are moved.

Rewrite it to use only a function that measures how similar points are to each other (a kernel), and the same calculation can maximize the margin even for a curved boundary. On handwritten digits from mail (7300 training images and 2000 test images), a fourth-degree polynomial kernel gave an error rate of 4.9%. That was slightly lower than the 5-layer neural network on the same data (5.1%).

Drag points in the figure on the right. Moving any point other than the ringed ones (the points that support the boundary) does not move the line unless it enters the margin band.

Maximize the margin ⇔ minimize ‖w‖
K(x, x′)=exp(−γ‖x − x′‖²)
w, b
direction and position of the boundary (every point satisfies yi(w·xi+b) ≥ 1, where y marks the group with+1 or −1)
K, γ
the kernel (similarity between points) and how narrow the range of influence is
What you think you knowThe popular story:The support vector machine was invented by Corinna Cortes and Vapnik in 1995
The original source says:The learning method that maximizes the margin and, with kernels, handles curved boundaries too had been presented by the three in 1992. The paper does not contain the term support vector; it calls the points that support the boundary supporting patterns. It also cites the potential function method of Aizerman and colleagues from 1964 as an example of the kernel idea.

What the figure shows:Chapter 8's widest road allowed only a straight line, but replacing the calculation with similarities between points, called a kernel, keeps the idea of maximizing the margin from the nearest points while allowing curved boundaries for groups a straight line cannot separate. Once again, only a few points nearest the boundary determine it.

191995, 2001 · Random forests

A majority vote of randomly grown trees

One tree fits the training data too closely. What happens when you gather many?

If you grow a decision tree deep, it fits all the training data but memorizes even the noise. In 1995, Tin Kam Ho of AT&T Bell Laboratories showed that bundling many trees that each use a randomly chosen part of the features raises accuracy on handwritten digit recognition (random decision forests).

In 2001, Leo Breiman of the University of California, Berkeley, pulled random forests together. Trees are grown on randomly redrawn data, and at each split the best split is chosen from randomly selected features. As trees are added, the error rate settles at a certain value. With the roughly one-third of the data that was not chosen (out-of-bag), you can estimate the error rate without a separate test set.

In the figure on the right, as you increase the number of trees, the jagged border becomes smooth.

Answer of the forest=majority vote (answer of tree₁, answer of tree₂, …, answer of treeB)
B
number of trees
error of the forest
decided by the strength (accuracy) of each tree and the correlation (similarity) between trees
What you think you knowThe popular story:Random forests were thought up by Breiman alone
The original source says:Random decision forests, with a very similar name, had been published by Ho in 1995. Breiman himself lists bagging (1996), Ho's method, and Amit and Geman (1997) as earlier work, and calls the combination random forests.

What the figure shows:A single deep tree memorizes noise too, but voting across many randomly grown trees smooths the boundary and makes the error rate more stable.

Number of trees and the error rate estimated out-of-bag
201873, 1936 · Singular value decomposition

Any table can be broken into three

How can you represent a table of numbers (a matrix) well with few numbers?

Singular value decomposition (SVD) says that any matrix can be broken into three multiplications: rotate, stretch along each axis, and rotate once more. The stretch factors are called singular values. Eugenio Beltrami published it first in 1873, in a mathematics journal for university students in Italy. In 1874 Camille Jordan showed it independently.

If you keep only the large singular values, you can approximate the original table accurately with few numbers. In 1936, Carl Eckart and Gale Young of the University of Chicago, in connection with analyzing scores on psychological tests, solved the problem of finding the matrix that approximates best at a low rank. The answer is the one with the small singular values set to 0.

In "Circle (2×2)" in the figure on the right, a circle becomes an ellipse through "rotate, stretch, rotate". In "Picture (24×24)", a picture drawn from a 24×24 table of numbers is rebuilt keeping only k singular values (the picture is an example made for this site).

A=U Σ VT  Ak =σ₁u₁v₁T + … +σkukvkT
U, V
rotations (they change direction)
Σ
stretching along each axis (a table with the singular values σ₁ ≥ σ₂ ≥ … along the diagonal)
Ak
the approximation that keeps only the largest k
What you think you knowThe popular story:The approximation theorem was found by Eckart and Young (1936)
The original source says:According to Stewart (1992), Erhard Schmidt had proved it in 1907, and the two rediscovered it.

What the figure shows:Any table can be split into 3 operations, rotate, stretch, and rotate; keeping only the largest stretches, called singular values, approximates the original table well using fewer numbers.

Size of the singular values (largest first)
212006–2009 · The Netflix Prize

Learning a table full of blanks

Can you predict what score a person would give to a movie they have not seen?

In October 2006, Netflix started a contest. If you could predict the scores people give to movies 10% more accurately than the company's own recommendations, you won a $1 million prize. The data handed out were more than 100 million ratings, given by about 480,000 people to about 18,000 movies.

On December 11, 2006, a participant, Simon Funk, published his whole method on his blog. He represented people's tastes and movies' features with 40 numbers each, and predicted a rating from the sum of their products. Of the table's roughly 8.5 billion cells, 8.4 billion are blank, so a true singular value decomposition cannot be used. So he computed the error using only the ratings that are known, and corrected the values a little at a time. He himself called this a tweaked SVD.

In the figure on the right, press "Keep learning" and the blanks fill in (the table is an example made for this site).

prediction r̂ =pu · qm
pu ← pu +η e qm (qm is updated the same way. e=r − r̂)
pu, qm
the tastes of person u and the features of movie m (sets of numbers)
r, η
the known rating and the learning rate
What you think you knowThe popular story:Netflix improved its recommendations with what was found in the contest
The original source says:In the company's blog (2012), the winning method was not adopted because it was not worth the effort.

What the figure shows:Representing people's preferences and films' features with a few numbers, then gradually adjusting them using only known ratings, makes it possible to predict blanks in a mostly empty table.

Number of repetitions and the error on the validation data
221770, 2005, 2009 · A person inside

Who put the correct labels on?

When "AI looked at photos and learned by itself", where did the right answers come from?

In November 2005, Amazon started Mechanical Turk, a service in which a program asks people to do small tasks and receives the results. The announcement called having computers get large numbers of people to do tasks and then using the results .

In 2009, Li and colleagues at Princeton University presented ImageNet (3.2 million images at that point), photos gathered for each cluster of nouns in WordNet, which organizes word meanings in a hierarchy. The photos were gathered with search engines, and whether the object was really in each photo was checked, one photo at a time, by people around the world who were paid for the work on Mechanical Turk, and decided by the votes of several people (page 4 of the paper). "A person inside" is not a story only about the 1770 chess machine (called the Turk).

The figure on the right shows how the voting works (the accuracy of each person is a provisional number made for this site).

Correctness of the majority vote=Σk>n/2 C(n, k) pk(1 − p)n−k
n
number of people who check one image (odd)
p
accuracy per person
C(n, k)
the number of ways to choose k people out of n
What you think you knowThe popular story:Amazon explains that it took the name from the 1770 chess machine (the Turk)
The original source says:Amazon's 2005 announcement and its current top page, which this site checked, do not say where the name comes from.

What the figure shows:When AI learned from photos, the correct labels came from paid workers around the world checking each image and deciding by a vote among several people.

Number of people and the accuracy of the majority vote
232009 · Follow the data

Check on separate training and test sets

An elaborate mechanism, or a huge amount of data: which wins?

In 2009, Alon Halevy, Peter Norvig and Fernando Pereira of Google wrote the paper . It said that , and urged:

But learned performance cannot be known unless you evaluate it on data not used for learning. Change the amount of training data in the figure on the right. When there is little, it gets 100% right on the training data but the accuracy on the test data is low (overfitting).

Correctness on the test=number of hits among the examples not used for learning ÷ number of those examples
practice (training data)
data used to train the model
test (test data)
data used only to check performance after learning

What the figure shows:A learned system's performance must be checked on data it did not train on. With little data, it may score 100% in practice and still fail on new cases.

Size of the data that appear in this chapter (each tick is 10 times more)
242006, 2009 · GPUs

The same calculation, many at once

Why did a part for drawing game graphics make AI learning faster?

The GPU, a part for drawing game graphics, can run the same calculation at the same time on many small cores (up to 128 in the 2006 GeForce 8800 GTX). In November 2006, NVIDIA announced CUDA, a system that lets this part be used in ordinary C for calculations other than graphics.

Most of neural network learning is the repetition of "multiply and add". Each one is the same kind of calculation, so it can be divided up and done at the same time. In 2009, Rajat Raina, Anand Madhavan and Andrew Ng of Stanford trained a deep network that learns without correct answers on a GeForce GTX 280 and made it up to 70 times faster than a 2-core CPU. Training a 4-layer network with 100 million parameters dropped from to .

The figure on the right is a race to fill in the cells of a multiplication table with a changing number of cores (a schematic made for this site). The more cores, the more cells are filled in the same time.

Time taken ≒ number of calculations ÷ (number of cores × speed of one core)
assumptions of the figure
every cell takes the same amount of work and the effort of dividing it up is taken as 0 (in reality, things like the time to move data are needed)
What you think you knowThe popular story:Deep learning spread thanks to GPUs
The original source says:Google's big 2012 attempt (the cat paper and DistBelief) used thousands of ordinary computers, not GPUs. The paper wrote that GPUs of the time had difficulty speeding up large models that do not fit in memory (under 6 GB). There was more than one road.

What the figure shows:Neural network training contains large amounts of the same kinds of calculations, so sharing them among a GPU's many small cores makes it much faster.

252009–2012 · Voices

Voices came before images

Was the first big success of AI using deep learning in images?

From around 2009, deep learning began to beat the statistical method that had been used for a long time in speech recognition (GMM). In 2012, four groups, the University of Toronto, Microsoft Research, Google and IBM, wrote a paper that , showing results such as cutting the word error rate from 27.4% to 18.5% on a conversation transcription test. By August 2012, Google had adopted it for speech recognition on Android. All of this came before the October 2012 image contest.

Around the same time, apps you could ask by voice appeared one after another (VoiceTra from NICT in August 2010, Siri from Apple in October 2011, and Shabette Concier from NTT Docomo on March 1, 2012; Japanese Siri came a week later).

The figure on the right shows how speech recognition errors are counted (word error rate).

Error rate= (substitutions+deletions+insertions) ÷ number of words in the correct text
how to count
line up two sentences with the fewest corrections and count them (dynamic programming, the same idea as DP matching in Chapter 5)
What you think you knowThe popular story:The first big success of deep learning was the image contest in the fall of 2012
The original source says:In speech recognition, results began to appear from 2009, and in August 2012 Google had adopted it on Android. Google's blog names, as the first attempt to use neural networks for speech, a paper from the late 1980s (co-authored by two researchers at ATR in Osaka).

What the figure shows:Deep learning's first major success was in speech, before images. Speech recognition errors are counted by finding the fewest edits needed to make 2 sentences match.

262010–2012 · Deep networks

Keeping the signal alive in deep stacks

What happens when you stack 30 layers?

In deep neural networks, the signal that carries the error backward weakens or grows too large at every layer. In 2010–2012, three tricks to prevent this came together.

One is the activation function ReLU (if the input is positive it passes through unchanged, if negative it becomes 0; on the positive side the slope is always 1). Another is a starting range for the weights that is matched to the number of neurons (Glorot and Bengio, 2010). The third is dropout (2012), which at each training step makes half of the neurons in a hidden layer rest at random.

In the figure on the right, change the activation function and the starting values and look at the size of the signal at each layer.

ReLU(x)=max(0, x)
weight range ±√6 ÷ √(nin +nout), standard deviation √(2 ÷ nin)
nin, nout
number of input and output neurons of the layer (the range is Glorot and Bengio's rule, the standard deviation is He and colleagues' rule)
What you think you knowThe popular story:ReLU was invented by Hinton and colleagues in 2010
The original source says:The 2010 paper itself cites an attempt by Jarrett and colleagues in 2009. An activation function of the same shape is in Kunihiko Fukushima's network of 1968–1969 (Chapter 4), but the three papers of 2010–2012 do not cite Fukushima.

What the figure shows:In a deep stack of layers, the backward signal weakens at each layer until it disappears. ReLU and carefully chosen starting weights allowed signals to travel through even 30 layers.

Size of the backpropagated signal at each layer (each tick is 10 times more)
272012 · Three in one year

Traffic signs, and Google's cat

In 2012, how many results did deep learning produce?

In February, Dan Cireşan, Ueli Meier and Jürgen Schmidhuber of the Swiss lab IDSIA trained, on GPUs, a method that lines up several deep convolutional networks and averages their results. On German traffic sign recognition (12,569 test images) it reached an error rate of 0.54%. According to the paper, the human error rate was twice that. But there were only 43 answers, so it is a different level of difficulty from photos with 1000 categories.

In June, Quoc Le, Andrew Ng and colleagues of Google and Stanford University took images, one frame at a time from 10 million YouTube videos, and had a 9-layer network with 1 billion connections learn from them with no correct labels (3 days on 1000 computers and 16,000 cores). Even though nobody taught it, neurons that respond to human faces appeared, and so did ones that respond to cat faces and human bodies. Google's blog stressed that .

Then in October came the image recognition contest (the next spread). In the figure on the right, compare the cat neuron's score with "answering at random".

Table 1 of the paper: human face neuron 81.7%, cat face neuron 74.8%, answering at random 64.8% (the cat test). Read a score by comparing it with the points you would get without doing anything.

What you think you knowThe popular story:Google's AI learned to recognize cats on its own
The original source says:The paper's main result is the human face neuron (81.7%), and the cat face neuron is 74.8%. It was a test in which random answers would score 64.8% (Table 1 of the paper).

What the figure shows:Deep learning successes followed one another in 2012, and Google's cat neuron scored 74.8% on a test where random answers would score 64.8%. Results should be read against the score possible without doing anything useful.

282012 · The image contest

A huge win, with Tokyo in second

What was the “turning point” in the image contest of October 2012?

In ILSVRC, a contest to recognize 1000 kinds of objects from photos, SuperVision, the team of Alex Krizhevsky, Ilya Sutskever and Hinton of the University of Toronto, reached an error rate of 15.3% in the rule that allows 5 guesses (16.4% using only the data the contest provided). The team in second place, from the University of Tokyo (ISI), had 26.2%, a gap of about 11 points. They trained an 8-layer convolutional neural network with 60 million parameters on two gaming GPUs. The contest organizers wrote that for research on recognizing many kinds of objects.

Convolution is a calculation that slides a small window (a filter) over an image and responds strongly at places that have the same shape as the window. The structure continues from Kunihiko Fukushima's Neocognitron of 1979 (Chapter 5) and the network of Yann LeCun and colleagues in 1989. In the figure on the right, choose a window shape and slide it over the image. The graph below shows eight years of the contest's first-place error rate.

output(i, j)=Σa Σb window(a, b) × image(i+a, j+b)
window
a 3×3 table of weights (after learning, it takes shapes that respond to vertical lines, horizontal lines and so on)
What you think you knowThe popular story:Deep learning was suddenly born in 2012
The original source says:The winning mechanism was the network of LeCun and colleagues from 1989 (itself based on Fukushima's Neocognitron of 1979), made bigger and trained on GPUs. The paper itself writes that .

What the figure shows:At the 2012 image competition, a convolutional network beat the runner-up by about 11 percentage points. Inside was the same small-window sliding calculation developed from 1979 and 1989 onward.

First-place error rate of the contest (2010–2017)
292005–2012 · Japan · Shogi and checkers

Learning from records, voting on moves

Is the strength of a shogi program decided by how strong at shogi its maker is?

Most shogi programs until then had their makers decide by hand how to score whether a position was good or bad. Bonanza, made by Kunihito Hoki, a chemistry researcher (released in 2005), had the machine learn how to score so that it would play the same moves as professionals' game records. In May 2006 it won the World Computer Shogi Championship in its first appearance, and in March 2007 it played a public game against Ryuo Akira Watanabe (Watanabe won in 112 moves).

In October 2010, “Akara 2010”, from the Information Processing Society of Japan, beat Ichiyo Shimizu, the women's Osho title holder. It was a system that made the top four Japanese programs think about the same position and played the move chosen most often, by majority vote. At the first Shogi Den'o-sen in January 2012, Bonkras, based on Bonanza, beat Kunio Yonenaga, a retired professional and then president of the Japan Shogi Association, a lifetime title holder of Kisei, in 113 moves.

The figure on the right shows a learning method that updates weights so that the professional's move gets the highest score (a schematic made for this site).

w ← w+η(f(professional's move) − f(m))
m
a move that came to score higher than the professional's move
w, η
the weights for scoring and the learning rate
f
features of the position after making a move (material gain, king safety, how well the pieces work)
What you think you knowThe popular story:To build a strong shogi program, its maker has to be strong at shogi too
The original source says:The author of Bonanza was a chemistry researcher who hardly knew shogi, yet by having the machine learn how to score from game records he won the world championship in his first entry.

What the figure shows:Instead of having developers choose shogi scores, training the machine to give the highest score to the move a professional would choose makes it stronger even if its developers are not shogi experts.

Number of training rounds and the share of professional moves chosen
302001, 2011 · Japan · Predictions

Deadline goals and market forecasts

What "by this year" targets were being put out in Japan in this era?

In November 2011, the National Institute of Informatics began (the Todai Robot Project). Its aims were to bring together AI research that had split into fine pieces since 1980, and to give young people a dream. As concrete markers it set goals with deadlines: (translated) and (translated) (the check against the results is in Chapter 10).

Ten years earlier, in 2001, a report by an industry association of Japan's machinery and robot industry forecast that the robot market would be about 3 trillion yen in 2010 (of which 1.5 trillion yen in the daily-life field) and about 8 trillion yen in 2025. In reality, though, the next-generation robot market outside manufacturing was 1.4–6.8 billion yen a year, not even reaching 10 billion yen, and in fact shrinking (analysis by Hirohiko Arai of the National Institute of Advanced Industrial Science and Technology, 2009). In the government's 2015 strategy, too, the whole robot market was written as (translated).

The figure on the right lines up the forecasts and the actual figures on a scale that goes up by tens.

forecast ÷ actual=how many times off
scale in tens
1, 10, 100 are spaced equally (the length between two points shows how many times off)
What you think you knowThe popular story: (translated) (the accepted view among robot researchers)
The original source says:The industry association's own survey found that the next-generation robot market stayed at 1.4–6.8 billion yen a year and was in fact shrinking (−10.2% a year on average).

What the figure shows:Japan in this period saw predictions and goals with target years. Robot market forecasts differed from reality by factors of several hundred or more.

Closing

Old tools, newly assembled

Most of the tools for learning from data are older than the words "artificial intelligence." Bayes (1763), least squares (1805), the S-shaped curve (1838), singular value decomposition (1873), principal components (1901, 1933). The tools that followed were also born, for the most part, in fields outside AI: bee classification, parole prediction, research on sending signals, psychological tests, questions about animal behavior. And many people arrived at the same methods separately. "Who was first" usually cannot be pinned on one person.

What was new in 2006–2012 was less the ideas than the conditions: fast computation with GPUs, huge amounts of data labeled by large numbers of people, and good starting weights and activation functions. In 2012, when these came together, deep learning produced result after result in speech, traffic signs, cats and the image contest.

There is still a lot we don't know. How many people labeled ImageNet, in which countries, for how much pay? What goes on inside a trained network (attempts to look from outside had only just begun)? Why do HMMs and naive Bayes, which treat things that are not independent as independent, still work well? Why, in boosting, does the test score keep improving after the training error reaches 0? Why is a deeper stack of layers better? None of these has a clear answer in this chapter's sources. In the next chapter, after 2012, AI beats professionals at Go and shogi, the Todai Robot's results are checked, and the forecast that "jobs will disappear" becomes a topic around the world.

Other events in this chapter (1; all with original sources and confidence grades)
2006Verified in the originalSources disagree

The two papers behind , which made Go programs strong

In Go, there are many possible moves in a single position, and evaluating a position is hard. So search methods like those used for chess did not make programs strong. In 2006, a paper by Coulom of France presented a new search method (Monte-Carlo Tree Search, MCTS). It plays out a game at random many times from a position to the end (Monte Carlo), compares moves by their win rates, and examines the more promising branches more deeply. With his 9×9 Go program Crazy Stone, Coulom won a computer Go tournament (KGS). In the same year, Kocsis and Szepesvári of Hungary proposed UCT, a method for deciding which branch to try and how much. Ten years later, the AlphaGo paper (2016) cited these two as the MCTS literature, and combined MCTS with two neural networks (one predicting the next move and one evaluating positions).

3 sources and how they were checked

Where sources disagree:Which edition of the conference the Kocsis and Szepesvári paper was at: the AlphaGo reference list says “15th European Conference on Machine Learning”, while Springer's bibliographic record says ECML 2006 was the 17th (we only confirmed this in search results and did not open the original). We have not settled which is right.

  1. Efficient Selectivity and Backup Operators in Monte-Carlo Tree Search (CG 2006. PDF on the author's site) (Rémi Coulom · 2006 · PDF page 1 Abstract / 5 Game Results (pdf page 8) / 6 Conclusion (pdf … · Original source)
  2. Bandit based Monte-Carlo Planning (ECML 2006. PDF on the author's university page) (Levente Kocsis, Csaba Szepesvári · 2006 · PDF page 1 Abstract / 1 Introduction · Original source)
  3. Mastering the game of Go with deep neural networks and tree search (Nature 529. PDF on DeepMind's server) (David Silver, Aja Huang and others (Google DeepMind, Google) · 2016 · PDF page 1 Abstract and page 1 of the main text, the opponents compare… · Original source)