Suppose we draw one of the digits . How does a human recognize which digit it is? That neuroscience question is not answered here. How can a computer recognize which digit it is? This is a machine learning question. Both answers probably begin with the same idea: learn from examples.
So we start with different images (the training set). An image is a set of small pixels — or a vector . The component tells us the “grayscale” of the th pixel in the image: how dark or light it is. We now have images, each with features: vectors in -dimensional space. For every in that training set, we know the digit it represents.
In a way, we know a function. We have inputs in , each with an output from to . But we don’t have a “rule.” We are helpless with a new input. Machine learning proposes to create a rule that succeeds on (most of) the training images. But “succeed” means much more than that: the rule should give the correct digit for a much wider set of test images taken from the same population. This essential requirement is called generalization.
What form shall the rule take? Here we meet the fundamental question. Our first answer might be: could be a linear function from to (a by matrix). The outputs would be probabilities of the numbers to . We would have entries and training samples to get mostly right.
The difficulty is that linearity is far too limited. Artistically, two s could make an . and could combine into a handwritten or possibly a . Images don’t add. Recognizing faces instead of numbers requires a great many pixels — and the input-output rule is nowhere near linear.
Artificial intelligence languished for a generation, waiting for new ideas. There is no claim that the absolute best class of functions has now been found. That class needs to allow a great many parameters (called weights). And it must remain feasible to compute all those weights (in a reasonable time) from knowledge of the training set.
The choice that has succeeded beyond expectation—and transformed shallow learning into deep learning—is continuous piecewise linear (CPL) functions. Linear for simplicity, continuous to model an unknown but reasonable rule, and piecewise to achieve the nonlinearity that is an absolute requirement for real images and data.
This leaves the crucial question of computability. What parameters will quickly describe a large family of CPL functions? Linear finite elements start with a triangular mesh. But specifying many individual nodes in is expensive. It would be better if those nodes are the intersections of a smaller number of lines (or hyperplanes). Please note that a regular grid is too simple.
Figure 1 is a first construction of a piecewise linear function of the data vector . Choose a matrix and vector . Then set to (this is the nonlinear step) all negative components of . Then multiply by a matrix to produce the output . That vector forms a "hidden layer" between the input and the output .
Figure 1. Neural net construction of a piecewise linear function of the data vector v.
The nonlinear function called was originally smoothed into a logistic curve like . It was reasonable to think that continuous derivatives would help in optimizing the weights , , . That proved to be wrong.
The graph of each component of has two half-planes (one is flat, from the s where s negative). If is by , the input space is sliced by hyperplanes into pieces. We can count those pieces! This measures the “expressivity” of the overall function . The formula from combinatorics is
This number gives an impression of the graph of . But our function is not yet sufficiently expressive, and one more idea is needed.
Here is the indispensable ingredient in the learning function . The best way to create complex functions from simple functions is by composition. Each is linear (or affine), followed by the nonlinear . Their composition is . We now have hidden layers before the final output layer. The network becomes deeper as increases. That depth can grow quickly for convolutional nets (with banded Toeplitz matrices ).
The great optimization problem of deep learning is to compute weights and that will make the outputs nearly correct — close to the digit that the image represents. This problem of minimizing some measure of is solved by following a gradient downhill. The gradient of this complicated function is computed by backpropagation: the workhorse of deep learning that executes the chain rule.
A historic competition in 2012 was to identify the 1.2 million images collected in ImageNet. The breakthrough neural network in AlexNet had 60 million weights in eight layers. Its accuracy (after five days of stochastic gradient descent) cut in half the next best error rate. Deep learning had arrived.
Our goal here was to identify continuous piecewise linear functions as powerful approximators. That family is also convenient — closed under addition and maximization and composition. The magic is that the learning function gives accurate results on images that has never seen.