Handwritten digit recognition on MNIST
Computer vision / OCRThe MNIST benchmark contains 70,000 grayscale images of handwritten digits (60,000 train, 10,000 test), each a image flattened into a 784-dimensional pixel vector. The task is to classify each image as one of the ten digits through .
Treat each image as a point in and classify a test image by the majority label among its nearest training images under Euclidean (L2) distance. No model is trained — the algorithm simply searches the 60,000 stored examples for the closest matches at prediction time.
A plain KNN classifier with and Euclidean distance reaches roughly 97% test accuracy (about a 3% error rate) on MNIST — a strong result for such a simple, training-free method, and competitive with early neural networks. The main cost is at prediction time, since each of the 10,000 test queries is compared against all 60,000 training points.
Source: The MNIST Database of Handwritten Digits (benchmark results table) — LeCun, Y., Cortes, C. and Burges, C.J.C.