--- # For reference on dataset card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/datasetcard.md?plain=1 # Doc / guide: https://huggingface.co/docs/hub/datasets-cards {} --- # Dataset Card for MNIST ## Dataset Details ### Dataset Description The MNIST database is a large collection of handwritten digits. It has a training set of 60,000 examples, and a test set of 10,000 examples. ### Dataset Sources - **Homepage:** https://paperswithcode.com/dataset/mnist#:~:text=The%20MNIST%20database%20(Modified%20National,test%20set%20of%2010%2C000%20examples. ## Dataset Structure Total images: 70,000 Splits: - **Train**: 60,000 images - **Test**: 10,000 images Classes (labels): 10 categories Image specs: 28x28 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/mnist", split="train", trust_remote_code=True) # dataset = load_dataset("randall-lab/mnist", split="test", trust_remote_code=True) # Access a sample from the training set example = dataset[0] image = example["image"] label = example["label"] image.show() # Display the image print(f"Label: {label}") ``` ## Citation **BibTeX:** @misc{lecun1998mnist, author={Yann LeCun and Corinna Cortes and Christopher J.C. Burges}, title={The MNIST database of handwritten digits}, year={1998}, url={http://yann.lecun.com/exdb/mnist/} }