emnist / README.md
leonleyang's picture
Update README.md
8c94c2b verified
metadata
{}

Dataset Card for Extended MNIST (EMNIST)

Dataset Details

Dataset Description

The EMNIST (Extended MNIST) dataset is a set of handwritten character and digit samples derived from the NIST Special Database 19. It has been preprocessed to match the structure and format of the original MNIST dataset, with all images resized to 28×28 pixels. EMNIST provides multiple dataset splits designed for different classification tasks, including digits, letters, and a combination of both.

Dataset Sources

Dataset Structure

Total samples: Over 800,000 handwritten characters

Available dataset splits:

  • ByClass: 814,255 characters, 62 unbalanced classes (full NIST dataset).

  • ByMerge: 814,255 characters, 47 unbalanced classes (merged uppercase/lowercase).

  • Balanced: 131,600 characters, 47 balanced classes.

  • Letters: 145,600 characters, 26 balanced classes (merged uppercase/lowercase).

  • Digits: 280,000 characters, 10 balanced classes (0-9).

  • MNIST: 70,000 characters, 10 balanced classes (directly compatible with MNIST).

Image specs: PNG format, 28×28 pixels, Grayscale

Example Usage

Below is a quick example of how to load this dataset via the Hugging Face Datasets library.

from datasets import load_dataset  

# Load the dataset  
dataset = load_dataset("randall-lab/emnist", name="byclass", split="train", trust_remote_code=True)  
# dataset = load_dataset("randall-lab/emnist", name="byclass", split="test", trust_remote_code=True)
# dataset = load_dataset("randall-lab/emnist", name="bymerge", split="train", trust_remote_code=True)  
# dataset = load_dataset("randall-lab/emnist", name="balanced", split="train", trust_remote_code=True)  
# dataset = load_dataset("randall-lab/emnist", name="letters", split="train", trust_remote_code=True)  
# dataset = load_dataset("randall-lab/emnist", name="digits", split="train", trust_remote_code=True)  
# dataset = load_dataset("randall-lab/emnist", name="mnist", split="train", trust_remote_code=True)  

# Access a sample from the dataset  
example = dataset[0]  
image = example["image"]  
label = example["label"]  

image.show()  # Display the image  
print(f"Label: {label}")

Citation

BibTeX:

@inproceedings{cohen2017emnist, title={EMNIST: Extending MNIST to handwritten letters}, author={Cohen, Gregory and Afshar, Saeed and Tapson, Jonathan and Van Schaik, Andre}, booktitle={2017 international joint conference on neural networks (IJCNN)}, pages={2921--2926}, year={2017}, organization={IEEE} }