Catalog / Vision
MNIST (1998)
70,000 handwritten digits, 28×28 grayscale, 10 classes.
Why it matters
The "hello world" of machine learning. A remix of NIST handwriting data, small enough to train on a laptop in seconds, it was the standard yardstick for neural networks from LeNet-5 to the first deep learning papers. Geoffrey Hinton called it "the drosophila of machine learning".
Get the data
# pip install -U huggingface_hub
hf download ylecun/mnist --repo-type dataset \
--local-dir mnistfrom datasets import load_dataset # pip install datasets
ds = load_dataset("ylecun/mnist", "mnist")
print(ds)import polars as pl
df = pl.read_parquet("hf://datasets/ylecun/mnist@~parquet/mnist/test/*.parquet")
print(df.shape)- Year
- 1998
- Creators
- Yann LeCun, Corinna Cortes, Christopher J.C. Burges
- Task
- Image classification (handwritten digits)
- Size
- 70,000 images
- Splits
- train 60,000 · test 10,000
- Input
- 28×28 grayscale image
- Labels
- Digit 0–9
- License
- CC BY-SA 3.0
- Paper
- Gradient-Based Learning Applied to Document Recognition
Samples

28×28 px

this is all the model sees




























































What one record actually looks like (raw JSON, row 2561)
{
"image": {
"height": 28,
"src": "samples/mnist/2561-image.jpg",
"width": 28
},
"label": 8
}Media fields point at a local copy; on Hugging Face they are bytes in a Parquet file.
Sampled 2026-11-07 from ylecun/mnist at revision 77f3279
Worth knowing
- Digits were size-normalized to fit a 20×20 box, then centered by center of mass in a 28×28 frame. That is why every digit sits in the middle.
- The writers were US Census Bureau employees and high-school students; train and test use disjoint sets of writers.
- LeNet-5 got about 0.95% test error in 1998. Modern models reach about 0.2%, and most remaining errors are arguably mislabeled or ambiguous digits.
Related datasets
- NIST Special Database 1 & 3: source data
- Fashion-MNIST: 2017, drop-in replacement with clothing imagesHugging Face ↗Fashion-MNIST on this site →
- EMNIST: 2017, adds lettersnist.gov ↗
- KMNIST: 2018, cursive Japanese charactersgithub.com ↗
- SVHN: 2011, digits from Street View photosHugging Face ↗SVHN on this site →
Landmark papers
- Adaptive Subgradient Methods for Online Learning and Stochastic Optimization (AdaGrad) (2010)AdaGrad on this site →
- Understanding the difficulty of training deep feedforward neural networks (2010)Xavier initialization on this site →
- On the importance of initialization and momentum in deep learning (2013)SGD with momentum on this site →
- Auto-Encoding Variational Bayes (VAE) (2013)VAE on this site →
- Dropout: A Simple Way to Prevent Neural Networks from Overfitting (2014)Dropout on this site →
- Adam: A Method for Stochastic Optimization (Adam) (2014)Adam on this site →
- Generative Adversarial Nets (GAN) (2014)GAN on this site →
- Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift (2015)Batch normalization on this site →
- Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks (DCGAN) (2015)DCGAN on this site →