MNIST

MNIST

MNIST is a collection of 70,000 small images of handwritten digits from 0 to 9, each labeled with the correct answer. Since the 1990s it has been considered the standard practice exercise on which learning programs and beginners take their first steps.

MNIST is a publicly available collection of images. Each image shows a handwritten digit between 0 and 9. In total there are 70,000 images, written by students and employees of a US agency. Each image is tiny: 28 by 28 pixels, grayscale only, no color image. For each image it is also noted which digit was actually meant. It is precisely this note that makes the collection valuable: a computer program can guess and then immediately check whether it guessed correctly. The name is an abbreviation and refers back to the agency whose forms the handwriting samples came from.

The training ground of machine learning

In AI research one needs benchmarks. If two groups claim their method recognizes handwriting particularly well, both must be measured on the same task. Otherwise one compares apples to oranges. From 1998 onward, MNIST became this shared benchmark and has remained so to some extent to this day. The collection is small, freely available, and downloaded within seconds.

Historically, MNIST has played an important role. On this task it became clear early on that a particular architecture of artificial neural networks is especially good at handling images. Neural networks are programs that derive rules themselves from many examples rather than being given them explicitly. The error rates of under one percent achieved at the time were a strong argument for this approach.

Today, MNIST is a solved research task. Good programs achieve about 0.2 percent errors, thus performing better than many humans. Anyone presenting a new method therefore proves nothing anymore with MNIST. As a first exercise for learners, however, the collection remains unbeatably practical.

From 784 pixels to a digit

For the computer, an MNIST image is simply a list of 784 numbers. Each number indicates how bright a single pixel is, from 0 for black to 255 for white. The program receives these numbers and is supposed to output one of ten possible answers. At the start it answers randomly and is almost always wrong.

Then training begins. The program sees an image, gives an answer, and learns the correct solution. With every mistake, its internal numerical values are shifted a small step in the direction that reduces the error. After a few tens of thousands of examples, it clicks. What’s remarkable about this: nobody told the program what a seven looks like.

The collection is deliberately split in two. 60,000 images are used for training, 10,000 are held back and used only at the end for testing. This is important because otherwise a program could simply memorize the training images. It would then be perfect on familiar images but useless on new handwriting. This separation into training and test data is a fundamental principle that can be well understood through MNIST.

Where the digit images turn up

In every introductory course on machine learning, MNIST is the first practical exercise. The common programming libraries provide the collection directly, often with a single line of code. A simple model can be trained on it on an ordinary laptop within a few minutes. So one doesn’t have to wait for expensive specialized hardware to see the principle in action for oneself.

The actual application behind MNIST does indeed exist. Postal sorting facilities read handwritten postal codes, and banks used to read amounts on checks. Similar technology is found today in apps that photograph a bill or a form and read out the numbers in it.

In news articles and technical texts, MNIST often serves as a point of comparison. Phrases like “this is nothing more than MNIST” mean that a task is easy and has long been solved. A common misconception here: solving MNIST does not mean one has solved image recognition. Real photos have colors, shadows, and distracting backgrounds. For such cases there are harder collections like CIFAR-10 or ImageNet, which contain millions of real photos.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.