
Visualization of the MNIST Test Dataset in the Deep Lake UI
The MNIST (Modified National Institute of Standards and Technology database) dataset contains a training set of 60,000 images and a test set of 10,000 images of handwritten digits. The handwritten digit images have been size-normalized and centered in a fixed size of 28×28 pixels. The MNIST digits dataset is often used by data scientists who want to try machine learning techniques and pattern recognition methods on real-world data while spending minimal effort on preprocessing and formatting.
Instead of downloading the MNIST dataset in Python, you can effortlessly load it in Python via our Deep Lake open-source with just one line of code.
import deeplake
ds = deeplake.load("hub://activeloop/mnist-train")
import deeplake
ds = deeplake.load("hub://activeloop/mnist-test")
MNIST Data Fields
- image: tensor containing the 28×28 image.
- label: an integer between 0 and 9 representing the digit.
MNIST Data Splits
- The MNIST dataset training set is composed of 30,000 patterns from SD-3 and 30,000 patterns from SD-1.
- The MNIST dataset test set was composed of 5,000 patterns from SD-3 and 5,000 patterns from SD-1.
Train a model on MNIST dataset with PyTorch in Python
Let’s use Deep Lake built-in PyTorch one-line dataloader to connect the data to the compute:
dataloader = ds.pytorch(num_workers=0, batch_size=4, shuffle=False)
Train a model on MNIST dataset with TensorFlow in Python
dataloader = ds.tensorflow()
Data Collection and Normalization Information
The original images from MNIST were size-normalized to fit a 20×20 pixel box, while the aspect ratio was preserved. As a result, the images contain grey levels (i.e., pixels don’t simply have a value of black and white, but a level of greyness from 0 to 255) due to the anti-aliasing technique used by the normalization algorithm.
Next, the images were centered in a 28×28 pixel image by computing the center of mass of the pixels and translating the image to position this point at the center of the 28×28 field.
- Homepage: http://yann.lecun.com/exdb/mnist/
- Repository: N/A
- Paper: Y. LeCun, L. Bottou, Y. Bengio and P. Haffner: Gradient-Based Learning Applied to Document Recognition, Proceedings of the IEEE, 86(11):2278-2324, November 1998
- Point of Contact: http://yann.lecun.com/
MNIST Dataset Curators
Chris Burges, Corinna Cortes and Yann LeCun
MNIST Dataset Licensing Information
MNIST Dataset Citation Information
@article{lecun2010mnist,
title={MNIST handwritten digit database},
author={LeCun, Yann and Cortes, Corinna and Burges, CJ},
journal={ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist},
volume={2},
year={2010}
}
What is the MNIST dataset for Python?
The MNIST dataset (Modified National Institute of Standards and Technology database) is one of the most popular datasets in machine learning. MNIST is a dataset of 60,000 square 28×28 pixel images of handwritten single digits between 0 and 9. The images are in grayscale format.
What is the MNIST dataset used for?
MNIST is used as a “hello world” example by data scientists worldwide. Typically, the MNIST dataset is used as a benchmark dataset, or as a proof-of-concept for training and testing purposes in the field of machine learning.
How to download the MNIST dataset in Python?
You can load the MNIST dataset fast with one line of code using the open-source package Deep Lake in Python. See detailed instructions on how to load the MNIST dataset training subset or MNIST dataset testing subset in Python.
How can I use MNIST dataset in PyTorch or TensorFlow?
You can stream the MNIST dataset while training a model in PyTorch or TensorFlow with one line of code using the open-source package Deep Lake in Python. See detailed instructions on how to train a model on the MNIST dataset with PyTorch in Python or train a model on the MNIST dataset with TensorFlow in Python.
Should I work with MNIST dataset in CSV?
No. CSV is not optimized for working with image data, especially for machine learning workflows. Instead of downloading MNIST dataset CSV, you easily load, version-control, query, and manipulate MNIST for machine learning purposes using Deep Lake.
How to create an Image Dataset like MNIST dataset?
With Deep Lake, creating image datasets like the MNIST digits dataset is simple. Simple datasets like MNIST can be created automatically by allowing Deep Lake to parse the legacy files into Deep Lake dataset format. More complex datasets can be created manually.
MNIST vs Fashion-MNIST. What is the difference between MNIST and Fashion-MNIST?
MNIST and Fashion-MNIST dataset are two separate datasets. However, the Fashion-MNIST dataset is meant to be an MNIST dataset alternative. Fashion-MNIST comprises pictures of clothing items and was published in 2017 by Zalando, a German online retailer. Both datasets are of the same size: 60 000 photos in the training set, as well as 10 000 pictures of clothing in the validation set of the dataset.
What is the size of each image in the MNIST dataset?
MNIST dataset image size is constant across all images of the dataset. Each MNIST dataset image is a fixed-size 28×28 pixel square image.
Why is MNIST so popular?
Created in 1998, the MNIST dataset containing handwritten digits from 0-9 is small in size, simple in structure, and easy to use. This makes it a good first dataset to try various pattern recognition methods in, with minimal effort required in data preprocessing.
What does MNIST stand for?
MNIST is an acronym for the Modified National Institute of Standards and Technology dataset.
Is MNIST suitable for Deep Learning?
What are MNIST dataset alternatives?
The MNIST dataset is a popular benchmark dataset for image classification tasks. However, these six alternatives can be used for similar tasks. Here are a few:
Fashion MNIST: This is a dataset of clothing images published by Zalando, with 10 classes of clothing items such as t-shirts, trousers, as well as shoes.
CIFAR 10 and CIFAR 100: These are datasets of color images with 10 and 100 classes, respectively. The images are 32×32 pixels in size and contain objects such as airplanes, automobiles, or animals.
SVHN: The Street View House Numbers dataset is a dataset of house numbers generated from Google Street View images. It comprises over 600,000 images of house numbers, and helps train models recognizing the digits in the numbers.
EMNIST: EMNIST serves as an extension of the MNIST dataset, including handwritten characters from uppercase and lowercase letters, as well as digits.
Kuzushiji-MNIST (KMNIST) and KKanji (Kuzushiji-Kanji): Both are datasets of handwritten Japanese characters.
Caltech-256: Caltech dataset has 256 classes. The images are larger than those in MNIST or and CIFAR, with the size going up to 300×200 pixels.