-
Introduction I Didn’t Discover AI Through ChatGPT A robotics engineer, I spent twelve years alongside artificial intelligence in places where it cannot be separated from… -
01 February 2012: A Car That Learned Nothing In February 2012, a car drove itself down a Californian highway without having learned anything: every rule had… -
02 From One Neuron to a Network: What Is Learned and What Flows A neuron on its own decides very little. This chapter stacks neurons into layers, shows that only numbers… -
03 Rows of Numbers: What We Gain and What We Lose How a network stores and multiplies its numbers, why that makes it a pattern-spotting machine, what it gains… -
04 Rosenblatt, and the Book That Buried His Perceptron In 1957, in an aeronautical laboratory in New York State, a machine learns instead of being programmed. This… -
05 Backpropagation, or the Art of Sharing the Blame A deep network gets it wrong: how do you know which setting to correct, and by how much?… -
06 LeCun, ZIP Codes, and the Idea of Looking in Pieces Connecting every point of an image to every neuron gives a count that the machines of the time… -
07 Why It Wasn’t Enough: The Cost of a Single Experiment The idea worked, and it convinced nobody. Three reasons explain why: three days of computation per experiment, no… -
08 The Second Burial: Two Famines, Fifteen Years For fifteen years, neural networks lost to other methods. This chapter shows that theory was not to blame:…
A deep network gets it wrong: how do you know which setting to correct, and by how much? The answer has a name, backpropagation. This chapter explains it without a single equation, and tells why the paternity of this idea is more…
Read this episode again
The goal fits in one sentence: teach a machine to read the digits of a handwritten ZIP code, so that the mail sorts itself towards its destination. On an envelope, everyone draws their 4s and 7s in their own way, more or less slanted, more or less large, never quite in the same place. No hand-written rule covers all these variants: you need a network that learns to recognise a digit from examples, like the one in episode 5, but fed with images.
The quiet triumph promised by episode 5 took place on envelopes. Here it is. To get there, a practical problem had to be solved first: the size of the network. An image of 100 pixels by 100 makes 10,000 inputs. A first layer just as wide, ten thousand neurons each connected to the ten thousand inputs, would need 10,000 times 10,000, that is a hundred million weights, the numbers that learning adjusts one by one for each connection. That was beyond the reach of the data and the machines of the time.
A stencil moved across the image
The answer came first from Japan, with Kunihiko Fukushima’s Neocognitron, published in Biological Cybernetics in 1980, then took its modern form at Bell Labs in the hands of Yann LeCun. In 1989, he applied backpropagation to reading handwritten ZIP codes: the method that sends the error back from the network’s output to each of its weights, to tell each one by how much it should move.
The principle is called convolution: instead of connecting everything to everything, you slide a stencil a few pixels wide across the image, a small square of weights that specialists call a filter, reusing the same weights at every position. A network does not have just one, but several, often dozens, and each looks for its own shape: a vertical edge, a slanting stroke, a corner, a curve. Wherever that shape sits in the image does not matter: a slanting stroke is still a slanting stroke at the top left as at the bottom right, and the same stencil finds it everywhere.
How does a stencil fit into a neural network? It is nothing other than a neuron, the one from episode 3, plugged into just a few neighbouring pixels: nine for a stencil of three cells by three. Its weights are the cells of the stencil, and its weighted sum is the stencil’s response at that spot. Convolution copies this same neuron to every position in the image, with exactly the same weights. The responses of all these copies, each placed where its piece of image sits, form what we will call further on the response map: a whole row of neurons that costs only the weights of a single stencil. A network has as many of these rows as it has stencils.
The full map is not an addition of all these responses. Each copy of the neuron makes its own sum, over its own nine pixels, and writes the result into a single cell, the one that matches its position. Nothing passes from one cell to another. On an image of eight pixels by eight, the three-by-three stencil fits in six positions per row and six per column: thirty-six copies of the same neuron, thirty-six numbers, a map of six cells by six. Read at a glance, it redraws the stroke: 3 where the stencil sits squarely on it, 2 at the two ends, where it covers only part of it, 0 everywhere else. It is this drawing, and not a single number, that the layer passes on to the rest of the network.
Four clarifications avoid misreading this mechanism. First, the size of a stencil is fixed: all those in the same layer have the same, three cells by three here, five by five in LeCun’s 1989 network. It does not adapt to the handwriting: a 4 drawn small or large passes under the same stencil, which finds the same fragment in it, a piece of slanting stroke.
Next, the areas looked at by two neighbouring cells of the map overlap. The stencil moves in small steps, always shorter than its own width: one pixel at a time in our examples, two pixels in LeCun’s 1989 network, with its five-cell stencil. Two neighbouring positions therefore share some of their pixels, six out of nine here. That is what stops a stroke from falling between two areas: if the stencil jumped three pixels at a time, a stroke straddling two areas would be seen only in part by each, and no response would reach 3.
Third, a layer does not have a single stencil, but several, each tuned to a different shape: one to slanting strokes, another to horizontal bars, another to vertical strokes. Each slides over the whole image and produces its own map, which answers a single question: where is my shape? A layer of ten stencils thus produces ten maps, one per shape sought. They are not added together, because the sum would erase the answer: on a handwritten 4, with these three stencils, a point on the slant, a point on the bar and a point on the foot all give a total of 5, and the machine could no longer tell which is which. The maps therefore stay separate, and it is by reading them together, spot by spot, that you know which shapes are where.
Finally, the next layer no longer looks at pixels, but at these maps: its own stencils, still three cells by three, read at each spot the responses of all the maps at once, and so combine the fragments found by the first layer, a slanting stroke that meets a bar, a bar that crosses a foot. Each level sees a wider area of the original image, five pixels across at the second, seven at the third, and much more when the pooling described further on shrinks the maps between two levels, until it covers the whole digit. That is how a small stencil of fixed size is enough to read very different handwriting: the fragments look alike from one hand to another, and it is their assembly, level after level, that makes the digit. As for the size of the digits themselves, LeCun had help upstream: as we will see, each digit reached him already cut out and brought to the same format.
Who decides the shape of each stencil? Nobody. Its weights are parameters like any others, the values that training adjusts: drawn at random at the start, then corrected by the learning loop of episode 5, example after example, until each stencil specialises in the shape that most helps the network recognise digits. In the examples that follow, we choose the stencils by hand, to see the calculation; a real network finds its own.
Do it once, by hand. Start by looking at the image the way the machine receives it: not a drawing, but a table of numbers. Take an image of seven pixels by seven: each lit pixel is worth 1, each unlit pixel is worth 0. The slanting stroke is nothing more than a diagonal of 1s among the 0s.
Then take a stencil of three cells by three. It too is just a small table of numbers, its weights: the three cells on its diagonal are worth 1, the other six 0. Lay it on the image, straddling the stroke: it covers nine pixels. Multiply each pixel by the stencil cell lying just above it: a lit pixel under a 1 gives 1; an unlit pixel gives 0, whatever cell covers it. Add up the nine products: 1 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 = 3. This is the calculation of the neuron from episode 3, a weighted sum, here over nine inputs. This 3 is the stencil’s response at that spot: the three pixels of the stroke fall exactly under its three 1s.
Now lay it on a shape that only partly resembles it: a stroke that sets off at a slant, then bends to run straight down. The first two lit pixels fall under 1s in the stencil: 1 × 1 = 1, they count. The third falls under a 0: 1 × 0 = 0, it does not count. The sum is 2, less than the 3 of the perfectly aligned stroke: the more the shape resembles the stencil, the stronger its response. Finally, shift the stencil one cell to the side of the slanting stroke: its two lit pixels both fall under 0s, and the sum drops to 0, as on an empty corner of the image.
All that remains is to repeat the move everywhere. Shift the stencil one cell to the right, redo the nine multiplications and the addition, note the result; when you reach the edge, go down a row and start again from the left, the way you read a page. Each sum is written into a new grid, in the place the stencil occupied: this grid is called the response map. On our image, it fills with 0s, except for its diagonal, which reads 2, 3, 3, 3, 2: the map lights up exactly where the slanting stroke passes.
On a real image, the point of the method becomes clear at once. Take a 4 written by hand, as it might appear in a ZIP code: a rising slanting stroke, a horizontal bar, a vertical foot. Slide four stencils over it, each with its three 1s arranged differently: on a rising diagonal, horizontally, vertically, on a falling diagonal. Each produces its own response map, and each map only really lights up, with 3s, where the stroke with its shape passes: the rising diagonal finds the 4’s slanting stroke, the horizontal its bar, the vertical its foot. The falling diagonal finds three pixels aligned in its direction nowhere: its map never goes above 2. The digit ends up broken down into strokes, and each stroke located at the exact spot where it lies. A layer of stencils therefore does not recognise the 4 in one go: it draws up an inventory of its strokes and their position, and it is the following layers that make use of it. Had the 4 been written higher up or further to the right, the same stencils would have found the same strokes; the maps would simply have lit up elsewhere.
The stencils of real networks do not carry only 0s and 1s. Their weights can be negative: a negative weight subtracts the pixel it covers instead of adding it. The most common of all, the vertical edge stencil, carries −1, −2, −1 in its left column, nothing in the middle, +1, +2, +1 in its right column. On a uniform area, all white or all black, the pluses and minuses cancel out, and the response is zero. At the left edge of a vertical stroke, the right column covers ink and the left column paper: the response is strong. At the right edge, it is the other way round: the response is just as strong, but negative, and its sign says on which side the ink lies.
Turned a quarter turn, the same stencil finds horizontal edges; turned an eighth, slanting edges. These edge detectors bear the name of Irwin Sobel, who presented them with Gary Feldman in 1968 at the Stanford Artificial Intelligence Laboratory; image processing used them long before neural networks.
The most striking thing lies elsewhere: when a network is left to learn its own stencils, those of its first layer usually end up looking like them. In 2012, Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton observed that the first layer of their network had learnt, on its own, stencils sensitive to orientation, detectors of edges and strokes in every direction, alongside blobs of colour.
This weight sharing, the reuse of the same weights at every position, is already there in Fukushima, where each plane of cells repeats the same distribution of synapses from one end of the image to the other; what LeCun brings to it is backpropagation.
Sliding one stencil over the whole image brings two things. First, there are far fewer weights to adjust: on an image of a hundred pixels by a hundred, the nine weights of a stencil replace a hundred million connections, and that gain is certain. Second, a stroke is spotted wherever it lies, since the same stencil passes everywhere; this second gain is less complete than it looks, and the rest of the episode will say why. The result was not long in coming.
Since the same weights are reused everywhere, a shape that moves produces the same response. The response follows the movement; it does not stay put. The network therefore never has to learn separately the slanting stroke in the top corner and the one in the bottom corner.
That is the whole point of these identical neurons, laid like a grid over the entire image: the network does not learn to recognise a stroke at a given spot, it learns a stroke, once, and the grid looks for it everywhere on its behalf.
Orientation, on the other hand, is not part of the package. Rotating an image and then passing it under the stencil does not give the same result as passing the stencil and then rotating. Specialists say that a classic convolutional network is equivariant only to translation: its response moves with the shape when you slide it, not when you rotate it. An object shown at an angle it has never met can escape it completely.
So what do people do? The most down-to-earth thing imaginable, and that admission says a lot about the field: they show the network the same images rotated every which way, until it learns to recognise them. This is data augmentation, a universal and yet approximate practice, which costs training time and guarantees nothing outside the angles shown. It is the first move of what we will later call the data factory, the one where nothing new is collected, where what we already have is transformed.
Architectures have indeed been designed to build rotation into the structure itself, such as the group equivariant networks proposed by Taco Cohen and Max Welling in 2016, but they remain a minority. What the architecture offers is solid and free; what has to be learnt through examples is fragile and expensive. The whole story that follows plays out along this border.
You often hear that a convolutional network does not care where a shape is. That is not what we have just seen: when the 4 moves, its response moves with it on the map. The stencil therefore says where the shape is. Yet the question put to the network is not “where is the 4?”, but “is this a 4?”: a 4 written a little higher or a little further to the right is still a 4, and the verdict must not change for so little. Position still matters inside the digit, though: it is because the slant sits above the bar, and the foot on the right, that a 4 is a 4. So the small movements of the whole digit have to be forgotten, without forgetting how the strokes are arranged relative to one another. That is the job of a second mechanism, distinct from the stencil: pooling. After each stage of stencils, the response map is cut into small squares of two cells by two, laid side by side without overlapping, and the four values in each square are replaced by a single one, most often the strongest. The map thus loses half its rows and half its columns. It keeps the response, but no longer its exact place: the network knows that something lit up in the square, without knowing in which of the four corners. A shift of one cell inside the square therefore no longer changes anything.
Repeat the operation over several stages, and a shift of a few pixels ends up changing nothing at the output: the response no longer follows, it stays put. That is where indifference to position is born, and not in weight sharing. LeCun and his co-authors put it in black and white in 1998: invariance to distortions is obtained through this progressive reduction in resolution, offset by a progressive enrichment of the representation. Two organs, then, and two distinct services: the stencil makes the response follow and brings the bill down, pooling makes the network forget where it lit up. This distinction becomes decisive as soon as a robot arm has to be controlled.
Put end to end, stencils and poolings form a chain, and it is the chain that reads the digit. The first layer finds strokes; the second, junctions between those strokes; pooling tightens the maps; the third layer recognises an assembly of junctions, and a final neuron gives the verdict. At each stage, the area of the image a neuron sees grows, from three pixels across to the whole digit.
Your turn to move a digit around. The third tab below runs a small stencil network, trained only on digits placed in the centre of a blank sheet. Slide the digit: the stencils’ maps follow it, and since the network keeps only the strongest response of each map at the end, its verdict does not budge. Then rotate it a quarter turn: that is where it loses its grip.
Backpropagation, step by step
Three tabs. The first plays backpropagation on a small network, the second shows it at work on a real one, the third moves a digit under a stencil network, the kind this episode is about.
➡️ the numbers move forward, from input to output
🔍 The calculation in detail
Choose an example, then run the forward pass.
Run a forward pass, then a backward pass, and touch a line: its calculation appears here.
average loss per epoch
✏️ Your turn: draw a digit from 0 to 9 in the frame, then lift the pen. Steps 2 to 4 show how the network analyses it.
✏️ your drawing → ✂️ 28 × 28 points → 🧠 32 neurons → 📊 10 outputs
1. ✏️ Your drawing 280 × 280 points, black or white: this is what you see, not yet what the network sees.
The image stays in your browser: it is not sent anywhere.
2. ✂️ Framed as in MNIST The box around the ink is cut out, brought down to 20 points high and centred in a 28 × 28 square. These 784 numbers, from 0 to 1, are all the network sees.
No ink found: draw or import a digit.
3. 🧠 32 hidden neurons Each multiplies the 784 numbers by its weights, adds up and passes its threshold. In yellow, the ones your drawing lights up: they react to certain bits of strokes.
4. 📊 10 outputs, one per digit Each output combines the 32 hidden neurons and gives a score from 0 to 1. The strongest, in green, is the answer.
🤔 Did the network recognise the right digit?
Which digit did you draw?
✋ The network has recognised this digit. Drag it anywhere (finger, mouse or arrow keys) and watch what moves and what does not.
① The stencils: the response follows the digit On the left, a stencil: 5 × 5 learned weights, blue for a positive weight, red for a negative one. The network sets it on every point of the field and computes, like a neuron, the sum of the pixels multiplied by its weights. The map on the right shows where that sum is strong. 👀 Move the digit: the yellow spot goes with it, by the same number of points.
② The network, live Each circle is a stencil, and its brightness is its strongest response, wherever it is in the field. Between rows, pooling keeps the strongest of four neighbouring cells. The ten outputs read only the 32 circles of the third row. 👀 Move the digit: the same circles light up.
⬇️ from the field to the verdict
Model, source and limits
Model: the loss is half the square of the gap; a neuron’s blame is the sum of the blames it feeds, each multiplied by the weight; a weight’s slope is the blame where it arrives multiplied by what it carried; the correction is the learning rate multiplied by the slope. Source: the paper by Rumelhart, Hinton and Williams (Nature, 1986), and the numbers in this episode. Limits: a small dense network; real networks have millions of weights, and the On a real network tab only recognises single digits, drawn as in MNIST.
784 inputs, 32 hidden neurons, 10 outputs: 25,450 parameters set by the same backpropagation, on 60,000 handwritten digits. Data: the MNIST database (Yann LeCun, Corinna Cortes, Christopher Burges).
Tab 3: a stencil network with 6,346 weights. Eight 5 × 5 stencils, 2 × 2 pooling, sixteen 3 × 3 stencils, pooling, thirty-two 3 × 3 stencils, the maximum of each map, ten outputs. It was trained offline by backpropagation, with a cross-entropy loss and the Adam method, which sets the step size weight by weight, on the 60,000 MNIST digits set in the middle of a blank sheet. It reads the field surrounded by the same blank margin. The ten examples are, for each digit, the first test image it recognises in the middle of the field.
Without script: in the example from the text, the dog output is 0.70 when 0 was expected. The weight 0.80 carried 0.60: its slope is 0.70 × 0.60 = 0.42, and at a learning rate of 0.1 it becomes 0.758. The hidden neuron receives a blame of 0.56 from dog and −0.14 from cat, 0.42 in all.
Along the way, the stencil settles the question of size, but only halfway. A stencil travels: give it an image twice as large, and it will travel twice as long and produce a response map twice as large. Convolution layers therefore do not care about dimensions. But the verdict, at the end of the network, is given by fully connected layers, where each input is connected to each output, with no stencil and no sharing, as in the network of episode 2. Those layers demand a number of inputs fixed in advance, and bring the constraint back. Hence the practice of a whole decade: resizing and cropping images to a single format, two hundred and twenty-four pixels across for the most widespread architectures.
Kaiming He and his co-authors proposed doing away with it in 2014, with a sentence from their paper that I like because it says what many thought without writing it: this requirement is artificial. Their solution is to insert, before the fixed part, a pooling operation whose cells are proportional to the image rather than of constant size. Large image, large cells; small image, small cells; and in both cases the same number of values at the output. The network now accepts any size without the photograph being mutilated to make it fit.
A word on colours, since they raised the same question. A colour image is three grids stacked on top of one another, one per primary colour. The stencil does not look at just one: it has three layers of its own and reads all three at once, which lets it detect patterns that exist only in colour, a border between red and green for example, invisible in greyscale. These stacked layers are called channels, and nothing requires them to be colours. A robot fitted with a depth camera, such as the Kinect, adds to the three colours a fourth channel that gives, for each pixel, the distance of the object; an observation satellite such as Sentinel-2 supplies thirteen, one per band of light, several of them invisible to the eye; a thermal camera has only one, temperature. And inside the network, the maps produced by a layer’s stencils become the channels of the next layer: the map of slants, the map of bars, the map of vertical strokes, stacked like the three colours of a photograph. The following layers pile up dozens of them, then hundreds, each devoted to a different pattern.
The first success fitted on envelopes, and it did not read addresses
The US Postal Service had entrusted LeCun with 9,298 handwritten digits, cut out of ZIP codes taken from the mail passing through the Buffalo post office, 7,291 of them for training. His network recognises exactly 95% of the test set, and the method would soon move from envelopes to bank cheques. Only nine thousand seven hundred and sixty parameters, for sixty-four thousand six hundred and sixty connections, so much does weight sharing save. That was what the lock backpropagation had just broken was worth, in practice.
Do the sums. The test set gathers the 9,298 digits minus the 7,291 used for training, that is 2,007 digits the network had never seen; 5% errors means about a hundred digits misread. And 64,660 connections for 9,760 parameters: each parameter is used 6.6 times on average, at different places in the image.
Yet this network did not read an address. It received digits already separated: the 1989 paper specifies that each image given to the network contains only one digit, brought to a standard format. Everything before that had been done before the image reached it: finding the address on the envelope, spotting the ZIP code line in it, then cutting that line into five small images, one per digit. The network came in only at the very last step, the one that consists of saying, in front of an image containing a single digit, which digit it is. It is the most spectacular step, but not the hardest: recognising a single character is much simpler than reading a string of characters that touch, where you first have to know where one ends and the next begins.
This cutting up is called segmentation, and the problem it poses is remarkably perverse, the kind that goes round in circles. To recognise a digit, you first have to isolate it. But to know where to cut, in handwriting where characters touch, tangle and overlap, you would already need to know what they are. Cutting assumes recognising, recognising assumes cutting. Every attempt that treated the two steps separately stumbled on the same thing: one unlucky cut, and the best classifier in the world conscientiously recognises halves of digits.
To break out of this circle, LeCun published a paper in 1998 with Léon Bottou, Yoshua Bengio and Patrick Haffner, Gradient-Based Learning Applied to Document Recognition. Their solution is to refuse to choose. Rather than deciding where to cut, you cut generously, at every vaguely plausible place, which produces a thicket of competing hypotheses. The network gives each one a score. And on top, a language model decides, that is, a program that knows which sequences of symbols are possible: in a US ZIP code, some sequences of five digits exist and others do not; on a cheque, an amount obeys writing rules that rule out many sequences of signs. It is the reading of the whole that decides the cutting, and not the other way round.
The authors go further: they make the entire chain differentiable, from extracting the field to the language model. Differentiable means that you know how to calculate, for each parameter of each module, the slope of the final error, the gradient of episode 5. All the modules are then trained together on a single measure of performance, the accuracy of the final reading.
This move ranks among the most important in machine learning: end-to-end training. You stop optimising each step for its own sake, you optimise the result that matters, and you let the chain share out the work, on one condition: that the error can travel back up every step, from one end to the other, which requires each of them to be differentiable. The system described in that paper read, according to its abstract, several million cheques a day in the United States; the body of the paper, for its part, speaks of several million a month. And you will find this principle everywhere afterwards, right up to language models: do not split the problem into tasks you judge simpler, give the whole task to the machine and let backpropagation decide who does what.
What an arm must remember, and what reading was better off forgetting
This move eventually left paper and entered an arm. In 2015, Sergey Levine, Chelsea Finn, Trevor Darrell and Pieter Abbeel put the question to a robot: is it better to train perception and control together, or each on its own? Their answer fits in a convolutional network of ninety-two thousand parameters and seven layers, which runs from the camera image to the torques sent to the motors of a PR2, that is, the turning forces commanded at each joint, with no intermediate step written by hand. The robot screws a cap onto a bottle, slides the claw of a hammer under a nail, hangs a coat hanger on a rail.
This network works without any pooling, and that is deliberate. LeCun wanted to know which digit was written, no matter where; an arm that has to grasp a cap needs to know where it is, to the pixel. The authors write it: in classification, pooling throws away position information, whereas for controlling a robot that is what counts. Their network therefore makes do with three layers of stencils, which keep their maps at full size, thirty-two maps of 109 cells by 109 at the last layer. It follows them with an operation of a different nature. Each map is reduced not to its strongest response, as pooling would do, but to the place where it lights up: the centre of its response area, a point in the image given by two coordinates. A map that has learnt to respond to the cap becomes “the cap is here”, another “the edge of the bottle is there”. This operation also fills pooling’s other role, which is to tighten: thirty-two maps become sixty-four numbers. These coordinates are joined to the current position of the arm’s joints, and two small layers of forty neurons draw from them the forces to send to the seven motors. What reading characters was better off forgetting, controlling a robot must keep: the network no longer asks what is in the image, but where the things that matter for its movement are.
Object detection went through the same story as reading the mail. Counting the cars in a photograph poses the same problem as reading a ZIP code: to know how many there are, you first have to locate them one by one, and so cut the image into distinct objects, even though they partly hide behind one another. For a long time, this was done in several separately tuned steps: a first step pointed to the areas of the image where an object might be, then a classifier examined each area to say what it contained. And as with the mail, the solution was to merge these steps into a single network, trained end to end on the result wanted.
In June 2015, Joseph Redmon and his co-authors published a system with a name that says it all, “you only look once”, which they presented the following year at the CVPR conference (Computer Vision and Pattern Recognition), the field’s great annual gathering. It stops recycling a classifier moved across the image and frames detection as a single prediction: one network produces in one go, for the whole image, the rectangles where the objects are and what they are. Forty-five images per second, enough to process a video as it streams. Always the same move: several steps cobbled together by hand become a single network trained on what you really want to obtain.
How does a network, which only knows how to produce numbers, indicate a location? By producing numbers, precisely. The image is cut into a grid of cells, and each cell is asked to answer three questions at once: is there something here, if so of what size and centred exactly where, and what category is it. The coordinates of the rectangle become outputs like any others, on the same footing as the probability of being a dog.
Count them. The 2016 grid is seven cells by seven. Each cell proposes two rectangles, of five numbers each (the centre, as two coordinates, the width, the height and the confidence), then twenty probabilities, one per category: two times five plus twenty, thirty numbers. Seven times seven times thirty: 1,470 numbers for the whole image, in a single pass. Position was never a problem of a different nature: it was a problem of extra outputs. Every time you see a network accomplish a task that seems beyond its reach, look first for how someone managed to restate it as numbers to predict.
The same skill brought down the test that told us apart from machines
Reading distorted characters is also a test we all take, several times a month, without thinking about it. To stop automated programs from creating accounts in bulk or snapping up concert tickets, websites have since the early 2000s asked us to copy out a word that a machine itself made up, then damaged. The site draws a random string of letters and digits, twists the characters and squeezes them until they touch, strikes them through with a line, then drowns them in stray dots. It keeps the right answer to itself and compares: if what you type matches, you pass.
The test is called a CAPTCHA, the English acronym for a “Completely Automated Public Turing test to tell Computers and Humans Apart”, developed in 2000 by a team at Carnegie Mellon University led by Manuel Blum. The Turing test, devised in 1950, puts a human judge in written conversation with interlocutors he cannot see, and asks him to guess which one is a machine; the CAPTCHA reverses it, since it is a machine that asks the question and must recognise the human. The distortions are not chosen at random: they target what the machines of the time did badly. A human reads the word at a glance; recognition software cut in the wrong place and recognised pieces of letters. The entire security of sign-ups, ticket offices and forms thus rested on a conviction: reading distorted characters would stay beyond the reach of machines.
It fell in April 2014. A Google team, led by one Ian Goodfellow, of whom you will hear again, was trying to read house numbers on Street View photographs. The problem is the one we have just described: find the number, cut it up, recognise it. Their answer is that of 1998, taken all the way: a single network that locates, segments and recognises in one move, with no separate steps.
They posted this work in December 2013, and it is only about house numbers. Then, to check that their method works for other texts, they put their network up against reCAPTCHA, Google’s CAPTCHA service. It deciphers the hardest category with 99.8% success. That result is absent from the December posting, which does not contain the word CAPTCHA a single time and did not even carry the title under which the paper is cited today; it appears in the version posted on 14 April 2014. The authors conclude there, soberly, that the usefulness of distorted text as a test of humanity is greatly diminished. Google acknowledged it publicly nearly eight months later, on 3 December 2014, when it announced the tick-box CAPTCHA: distorted text, on its own, is no longer a reliable test. The announcement is a company blog post, signed by the reCAPTCHA product manager, who is also one of the paper’s co-authors.
Take the measure of the shift. One of the most ordinary barriers between the automaton and the human had just given way, not under a hacker’s assault, but as a side effect of a mapping project. That is why, since December 2014, Google’s CAPTCHA no longer really asks you to read: it observes your whole interaction with the test, before, during and after. The question is no longer “can you read this”; it has become “do you behave like a human”. This arrangement is probably not final. The networks of 1989 and 1998 belong to history and will not change; the way a site tells a human from a program today will change again, as programs learn to imitate our gestures the way they learnt to read.
Before closing on that note, the other half of the story deserves its due, or it would be impossible to understand why the world rushed ahead. The CAPTCHA itself is the loveliest proof of it. One of its inventors, Luis von Ahn, published the calculation in Science in 2008: more than a hundred million CAPTCHAs are typed every day worldwide, which adds up to hundreds of thousands of human hours a day. The idea he draws from it, which I still find magnificent: rather than made-up words, show internet users the words that no recognition software managed to read in digitised archives. You proved you were human, and along the way you transcribed a line of an old newspaper.
The method fits in a few words. Each test showed two, in a random order: one whose answer was known, used to check the human, the other taken from an old page that the software had failed to read. On these prints with faded ink and yellowed paper, automatic recognition missed about one word in five. Whoever typed the first word correctly had their reading of the second counted as one vote; a software reading was worth only half a vote, and two and a half matching votes were needed to settle the spelling of the word. Do the sums on the time given: the authors measure thirteen seconds per CAPTCHA on average, and a hundred million CAPTCHAs a day come to more than three hundred thousand hours.
The paper does not just propose the method, it measures it, and that is what makes it convincing: on a sample of New York Times articles drawn from 1860, 1865, 1908, 1935 and 1970, the crowd gets 99.1% of words right, on a par with the guarantee of more than 99% sold by professional transcription services. More than forty thousand sites were already using the system, for more than four hundred and forty million words transcribed. Google bought reCAPTCHA in September 2009 and plugged it into its own digitisation projects, Google Books and newspaper archives. The most hated chore on the web made searchable millions of pages that had been sleeping on yellowed paper.
And the skill that brought down this test is exactly the one that today makes readable parish registers, handwritten censuses and letters that no one would have had the budget to copy out by hand. Automatic postal sorting did not only make money for operators: it made it possible to carry ever more mail without hiring as many people, and to lighten part of the sorting by hand. The same ability opens one door and breaks down another, and you can rarely have only the first.
And one observation that will serve you a few episodes from now. Reading an address is no longer classifying an image, it is producing a sequence: one decision after another, each depending on the previous ones, since the third digit of a ZIP code only makes sense with the first two. The problem has just changed its nature. Computer vision had just met, without knowing it, the difficulty that would occupy the next twenty years, right up to today’s language models: how does a machine handle a sequence?
The first undisputed industrial success of neural networks is there, in plain sight. It will not be enough to convince.
Sources
A stencil moved across the image
- Neocognitron · Fukushima, Biological Cybernetics 36, 1980, received in October 1979 · peer-reviewed · weight sharing from one end of the image to the other
- Backpropagation Applied to Handwritten Zip Code Recognition · LeCun et al., Neural Computation 1(4), 1989, pages 541 to 551 · peer-reviewed · the two-to-one reduction in resolution from one stage to the next, and its reason: detecting the presence of a stroke takes precision, locating it takes less; approximate position information must be kept so that later stages can assemble larger shapes
- Gradient-Based Learning Applied to Document Recognition · LeCun, Bottou, Bengio and Haffner, Proceedings of the IEEE 86(11), November 1998, pages 2278 to 2324 · peer-reviewed · invariance to distortions obtained through the progressive reduction in resolution
- Spatial Pyramid Pooling in Deep Convolutional Networks · He, Zhang, Ren and Sun, posted on 18 June 2014, published in Computer Vision – ECCV 2014 · the end of the imposed input format
- Group Equivariant Convolutional Networks · Cohen and Welling, posted on 24 February 2016, presented at ICML the same year · peer-reviewed for the conference
- Sobel operator · English Wikipedia · collaborative encyclopaedia · the operator presented by Irwin Sobel and Gary Feldman in 1968 at the Stanford Artificial Intelligence Laboratory, under the title “An Isotropic 3 × 3 Image Gradient Operator”; two 3-by-3 stencils, one per direction
- ImageNet Classification with Deep Convolutional Neural Networks · Krizhevsky, Sutskever and Hinton, Advances in Neural Information Processing Systems 25, 2012 · peer-reviewed · the 96 stencils learnt by the first layer: “a variety of frequency- and orientation-selective kernels, as well as various colored blobs”
The first success fitted on envelopes, and it did not read addresses
- Backpropagation Applied to Handwritten Zip Code Recognition · LeCun et al., Neural Computation 1(4), 1989, pages 541 to 551 · peer-reviewed · 9,298 digits cut out in Buffalo, 7,291 of them for training; 5.0% error on the test set; 9,760 free parameters for 64,660 connections; an input made of normalised images of isolated digits
- Gradient-Based Learning Applied to Document Recognition · LeCun, Bottou, Bengio and Haffner, Proceedings of the IEEE 86(11), November 1998, pages 2278 to 2324 · peer-reviewed · LeNet-5, over-segmentation, the language model, training of the whole chain and the cheque-reading system deployed at NCR
What an arm must remember, and what reading was better off forgetting
- End-to-End Training of Deep Visuomotor Policies · Levine, Finn, Darrell and Abbeel, April 2015, published in Journal of Machine Learning Research 17, 2016, pages 1 to 40 · peer-reviewed · from the camera to the motors of a PR2, without pooling, with the coordinates of salient points
- You Only Look Once: Unified, Real-Time Object Detection · Redmon, Divvala, Girshick and Farhadi, posted on 8 June 2015, presented at CVPR 2016 (conference version) · peer-reviewed for the conference · forty-five images per second; a grid of 7 × 7 cells, two rectangles and twenty categories per cell, 7 × 7 × 30 numbers at the output
The same skill brought down the test that told us apart from machines
- Multi-digit Number Recognition from Street View Imagery · Goodfellow, Bulatov, Ibarz, Arnoud and Shet · preprint never published in a journal · the first posting, of 20 December 2013, is titled Street Number Transcription with Deep Convolutional Neural Networks and does not mention CAPTCHA; the second version already carries the title above without mentioning CAPTCHA; the passage on reCAPTCHA and the 99.8% appear in the version posted on 14 April 2014
- CAPTCHA: Using Hard AI Problems For Security · von Ahn, Blum, Hopper and Langford, paper at Eurocrypt 2003 · peer-reviewed for the conference · the authors write that they introduced the notion of CAPTCHA in 2000
- reCAPTCHA: Human-Based Character Recognition via Web Security Measures · von Ahn, Maurer, McMillen, Abraham and Blum, Science 321, 12 September 2008, pages 1465 to 1468 · peer-reviewed · more than a hundred million CAPTCHAs typed a day and thirteen seconds per CAPTCHA on average; a control word and an unknown word, shown in a random order; two and a half votes to settle a word, half a vote for the software’s reading; about one word in five missed by automatic recognition on old prints; 99% of words correct on the New York Times sample, more than forty thousand sites and more than four hundred and forty million words transcribed
- Teaching computers to read: Google acquires reCAPTCHA · official Google blog, 16 September 2009 · company announcement, co-signed by Luis von Ahn, both seller and author of the previous paper · the move to Google Books
- Are you a robot? Introducing “No CAPTCHA reCAPTCHA” · Vinay Shet, Google Online Security Blog, 3 December 2014 · company announcement, signed by a product manager who is also a co-author of Goodfellow’s paper · distorted text, on its own, is no longer a reliable test; the same 99.8%
- CAPTCHA · Encyclopædia Britannica · encyclopaedia · Manuel Blum’s team at Carnegie Mellon, in 2000, and the expansion of the acronym
- ImageNet: A Large-Scale Hierarchical Image Database · Deng, Dong, Socher, Li, Li and Fei-Fei, CVPR 2009 · peer-reviewed for the conference · labelling through votes by internet users on Amazon Mechanical Turk, an image being kept only by a clear majority
- Robot masters new skills through trial and error · University of California, Berkeley press release, May 2015 · institutional press release · BRETT, the team’s PR2, and its tasks
- Sentinel-2 MSI, spectral resolutions · European Space Agency · official documentation · the thirteen spectral bands
- Drilling Down on Depth Sensing and Deep Learning · Berkeley BAIR lab blog, 23 October 2018 · lab blog post · the Kinect, a camera that gives the distance of each pixel