EMNIST Dataset

Visualization of the EMNIST Dataset training subset for category letters in the Deep Lake UI
The Extended-MNIST (EMNIST) dataset consists of 28×28 pixel images of handwritten character digits derived from the NIST Special Database 19. The dataset has a structure that directly matches the MNIST dataset and provides more challenging classification tasks involving letters and digits.
Instead of downloading the EMNIST 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/emnist-byclass-train")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-byclass-test")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-bymerge-train")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-bymerge-test")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-balanced-train")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-balanced-test")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-letters-train")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-letters-test")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-digits-train")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-digits-test")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-mnist-train")
import deeplake
ds = deeplake.load("hub://activeloop/emnist-mnist-test")
EMNIST Data Fields
- images: tensor containing 28×28 images.
- labels: tensor representing the class label.
EMNIST Data Splits
- The EMNIST data training subset for class ByClass is composed of 697,932 images.
- The EMNIST data testing subset for class ByClass is composed of 116,323 images.
- The EMNIST data training subset for class Merge is composed of 697,932 images.
- The EMNIST data testing subset for class Merge is composed of 116,323 images.
- The EMNIST data training subset for class Balanced is composed of 112,800 images.
- The EMNIST data testing subset for class Balanced is composed of 112,800 images.
- The EMNIST data training subset for class Digits is composed of 240,000 images.
- The EMNIST data testing subset for class Digits is composed of 40,000 images.
- The EMNIST data training subset for class Letters is composed of 88,800 images.
- The EMNIST data testing subset for class Letters is composed of 56,800 images.
- The EMNIST data training subset for class MNIST is composed of 60,000 images.
- The EMNIST data testing subset for class MNIST is composed of 10,000 images.
Train a model on EMNIST 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 EMNIST dataset with TensorFlow in Python
dataloader = ds.tensorflow()
Data Collection
The EMNIST Dataset consists of 28×28 pixel images of handwritten character digits collected from the NIST Special Database 19.
- Homepage: https://www.nist.gov/itl/products-and-services/emnist-dataset
- Paper: Cohen, G., Afshar, S., Tapson, J., & van Schaik, A. (2017). EMNIST: an extension of MNIST to handwritten letters. Retrieved from http://arxiv.org/abs/1702.05373
- Point of Contact: emnist@nist.gov
EMNIST Dataset Curators
Cohen, G., Afshar, S., Tapson, J., & van Schaik, A.
EMNIST Dataset Citation Information
Cohen, G., Afshar, S., Tapson, J., & van Schaik, A. (2017). EMNIST: an extension of MNIST to handwritten letters. Retrieved from http://arxiv.org/abs/1702.05373
What is the MNIST dataset for Python?
The Extended-MNIST (EMNIST) dataset has the same structure as the MNIST dataset and it consists of 28×28 pixel images of handwritten characters which were derived from the NIST Special Database 19. This dataset was created to provide more challenging classification tasks involving letters and digits in comparison to the MNIST dataset.
How to download the EMNIST dataset in Python?
You can load the EMNIST dataset fast with one line of Python code using the open-source package Activeloop Deep Lake. See detailed instructions on how to load the EMNIST dataset training subset or how to load the EMNIST dataset testing subset.
How can I use EMNIST dataset in PyTorch or TensorFlow?
You can stream the EMNIST dataset while training a model in PyTorch or TensorFlow with one line of code using the open-source package Activeloop Deep Lake in Python. See detailed instructions on how to train a model on the EMNIST dataset with PyTorch or train a model on the EMNIST dataset with TensorFlow.
Should I work with EMNIST dataset in CSV?
No. CSV is not optimized for working with image data, especially for machine learning workflows. Instead of downloading the EMNIST dataset in CSV format, you can easily load, version-control, query, and manipulate EMNIST for machine learning purposes using Activeloop Deep Lake.
How to create an Image Dataset like EMNIST dataset?
With Activeloop Deep Lake, creating image datasets like the EMNIST dataset is easy. Simple datasets like EMNIST 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.
EMNIST vs Fashion-MNIST. What is the difference between EMNIST and Fashion-MNIST?
EMNIST and Fashion-MNIST datasets are two separate datasets. Both datasets are inspired by, and meant to be alternatives to the original MNIST dataset, and thus contain 28×28 pixel images.
Fashion-MNIST comprises pictures of clothing items and was published in 2017 by Zalando, a German online retailer. EMNIST comprises of handwritten digits and letters from the NIST-Special Database 19.
EMNIST vs MNIST . What is the difference between EMNIST and MNIST ?
EMNIST and MNIST datasets are two separate datasets. Both the datasets contain 28×28 pixel handwritten images. The MNIST dataset comprises of only handwritten digits and it is quite easy to achieve high accuracies on it. The EMNIST dataset was created to provide more challenging classification tasks which involves both letters and digits in the dataset.
What is the size of each image in the EMNIST dataset?
Each image in the EMNIST dataset is a 28×28 grayscale image.

Deep Lake community member Manas Gupta has contributed to this dataset documentation. You're awesome, Manas!