Skip to content

Fashion-MNIST

A dataset of 70,000 small grayscale clothing images, designed as a drop-in replacement for MNIST.

Stars
12.9k
Forks
3.1k
Licence
MIT
Language
Python
Last update
4.4 years ago
Type
Learning resource

No commits in over a year — check for forks or alternatives before adopting.

What it is

Fashion-MNIST is a collection of 70,000 28x28 grayscale images of clothing and accessories from Zalando, split into 60,000 training and 10,000 test examples across 10 labeled classes. It uses the same file format and image size as the classic handwritten-digit MNIST dataset, so people can test machine learning models on a harder problem with the same code. The repository also includes a scikit-learn based benchmark and a loader script.

  • Train a small convolutional network to classify clothing types
  • Load the data with the included mnist_reader Python script and compare classifiers
  • Load the dataset directly through Keras, PyTorch, or TensorFlow Datasets
  • Explore the label set (T-shirt, trouser, sneaker, bag, and so on) with the provided visualization images

Great for

  • Machine learning students comparing classifiers on a familiar format
  • Researchers who want a slightly harder benchmark than MNIST
  • Developers prototyping image classification code before using larger data
  • People who want a dataset already bundled in many ML libraries

Not ideal for

  • Projects needing real-world photos or high-resolution images, since the images are small 28x28 grayscale product shots
  • Anyone expecting deep learning benchmark results, because the README says the built-in benchmark covers classical classifiers but no deep learning
Step-by-step guide: how to use Fashion-MNISTInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Clone and build from source

    You'll need: Python 3 with NumPy (for the included loader)

    Clone the repository (includes data under data/fashion)

    git clone git@github.com:zalandoresearch/fashion-mnist.git
  2. 2

    Run it

    • Clone the repository or download the four .gz files from the links in the README
    • Place the data in data/fashion, or use a library's built-in loader
    • Run the Python loader: import mnist_reader, then call load_mnist('data/fashion', kind='train')
    • Train any classifier on X_train and y_train and evaluate on the test split
  3. 3

    Get the most out of it

    • Use the built-in loaders in Keras, PyTorch, or TensorFlow Datasets to skip manual downloads
    • Follow the official TensorFlow tf.keras tutorial linked in the README for a worked example
    • Compare your model against the benchmark results the README describes for scikit-learn classifiers
    • Check the README's per-language loader list if you need to read the data outside Python

Downloads

Strengths

  • Drop-in replacement for MNIST with the same file format and split sizes
  • Built into many popular machine learning libraries, so no manual download is needed
  • Includes a published benchmark system and labeled reference results

Trade-offs

  • Small 28x28 grayscale images limit how closely it reflects real-world vision tasks
  • The README says loaders for other languages have not all been tested with this dataset
  • The last push was in June 2022 and there are no releases, so updates are infrequent

How it compares

ProjectStarsTypeLevelUpdatedBest for
fashion-mnist (this)12.9kLearning resourcebeginner4.4 years agoMachine learning students comparing classifiers on a familiar format
AI-For-Beginners70.5kLearning resourcebeginner13 days agoBeginners who want a structured, self-paced introduction to AI
ai-engineering-from-scratch76.3kLearning resourceintermediate4 days agoStudents who want to understand how LLMs, retrieval, and agents work internally
annotated_deep_learning_paper_implementations67.6kLearning resourceintermediate4 days agoStudents learning how transformers, GANs, or optimizers work internally
LaTeX-OCR16.6kAI model / agentintermediate1.8 years agoStudents who want to turn a handwritten or printed formula photo into editable LaTeX
machine-learning-for-trading21.7kLearning resourceintermediate8 days agoReaders of the Machine Learning for Trading book who want to run its code

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.