Fashion-MNIST is a dataset of Zalando‘s article images—consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes. We intend Fashion-MNIST to serve as a direct drop-in replacement for the original MNIST dataset for benchmarking machine learning algorithms. It shares the same image size and structure of training and testing splits.
Here’s an example of how the data looks (each class takes three-rows):
Why we made Fashion-MNIST
The original MNIST dataset contains a lot of handwritten digits. Members of the AI/ML/Data Science community love this dataset and use it as a benchmark to validate their algorithms. In fact, MNIST is often the first dataset researchers try. “If it doesn’t work on MNIST, it won’t work at all”, they said. “Well, if it does work on MNIST, it may still fail on others.”
To Serious Machine Learning Researchers
Seriously, we are talking about replacing MNIST. Here are some good reasons:
MNIST is overused. In this April 2017 Twitter thread, Google Brain research scientist and deep learning expert Ian Goodfellow calls for people to move away from MNIST.
MNIST can not represent modern CV tasks, as noted in this April 2017 Twitter thread, deep learning expert/Keras author François Chollet.
Get the Data
Many ML libraries already include Fashion-MNIST data/API, give it a try!
You can use direct links to download the dataset. The data is stored in the same format as the original MNIST data.
Alternatively, you can clone this GitHub repository; the dataset appears under data/fashion. This repo also contains some scripts for benchmark and visualization.
Make sure you have downloaded the data and placed it in data/fashion. Otherwise, Tensorflow will download and use the original MNIST.
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets('data/fashion')
data.train.next_batch(BATCH_SIZE)
Note, Tensorflow supports passing in a source url to the read_data_sets. You may use:
data = input_data.read_data_sets('data/fashion', source_url='http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/')
Also, an official Tensorflow tutorial of using tf.keras, a high-level API to train Fashion-MNIST can be found here.
Loading data with other machine learning libraries
To date, the following libraries have included Fashion-MNIST as a built-in dataset. Therefore, you don’t need to download Fashion-MNIST by yourself. Just follow their API and you are ready to go.
You are welcome to make pull requests to other open-source machine learning packages, improving their support to Fashion-MNIST dataset.
Loading data with other languages
As one of the Machine Learning community’s most popular datasets, MNIST has inspired people to implement loaders in many different languages. You can use these loaders with the Fashion-MNIST dataset as well. (Note: may require decompressing first.) To date, we haven’t yet tested all of these loaders with Fashion-MNIST.
We built an automatic benchmarking system based on scikit-learn that covers 129 classifiers (but no deep learning) with different parameters. Find the results here.
You can reproduce the results by running benchmark/runner.py. We recommend building and deploying this Dockerfile.
You are welcome to submit your benchmark; simply create a new issue and we’ll list your results here. Before doing that, please make sure it does not already appear in this list. Visit our contributor guidelines for additional details.
The table below collects the submitted benchmarks. Note that we haven’t yet tested these results. You are welcome to validate the results using the code provided by the submitter. Test accuracy may differ due to the number of epoch, batch size, etc. To correct this table, please create a new issue.
t-SNE on Fashion-MNIST (left) and original MNIST (right)
PCA on Fashion-MNIST (left) and original MNIST (right)
UMAP on Fashion-MNIST (left) and original MNIST (right)
PyMDE on Fashion-MNIST (left) and original MNIST (right)
Contributing
Thanks for your interest in contributing! There are many ways to get involved; start with our contributor guidelines and then check these open issues for specific tasks.
Contact
To discuss the dataset, please use .
Citing Fashion-MNIST
If you use Fashion-MNIST in a scientific publication, we would appreciate references to the following paper:
Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms. Han Xiao, Kashif Rasul, Roland Vollgraf. arXiv:1708.07747
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Fashion-MNIST
Table of Contents
Fashion-MNISTis a dataset of Zalando‘s article images—consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes. We intendFashion-MNISTto serve as a direct drop-in replacement for the original MNIST dataset for benchmarking machine learning algorithms. It shares the same image size and structure of training and testing splits.Here’s an example of how the data looks (each class takes three-rows):
Why we made Fashion-MNIST
The original MNIST dataset contains a lot of handwritten digits. Members of the AI/ML/Data Science community love this dataset and use it as a benchmark to validate their algorithms. In fact, MNIST is often the first dataset researchers try. “If it doesn’t work on MNIST, it won’t work at all”, they said. “Well, if it does work on MNIST, it may still fail on others.”
To Serious Machine Learning Researchers
Seriously, we are talking about replacing MNIST. Here are some good reasons:
Get the Data
Many ML libraries already include Fashion-MNIST data/API, give it a try!
You can use direct links to download the dataset. The data is stored in the same format as the original MNIST data.
train-images-idx3-ubyte.gz8d4fb7e6c68d591d4c3dfef9ec88bf0dtrain-labels-idx1-ubyte.gz25c81989df183df01b3e8a0aad5dffbet10k-images-idx3-ubyte.gzbef4ecab320f06d8554ea6380940ec79t10k-labels-idx1-ubyte.gzbb300cfdad3c16e7a12a480ee83cd310Alternatively, you can clone this GitHub repository; the dataset appears under
data/fashion. This repo also contains some scripts for benchmark and visualization.Labels
Each training and test example is assigned to one of the following labels:
Usage
Loading data with Python (requires NumPy)
Use
utils/mnist_readerin this repo:Loading data with Tensorflow
Make sure you have downloaded the data and placed it in
data/fashion. Otherwise, Tensorflow will download and use the original MNIST.Note, Tensorflow supports passing in a source url to the
read_data_sets. You may use:Also, an official Tensorflow tutorial of using
tf.keras, a high-level API to train Fashion-MNIST can be found here.Loading data with other machine learning libraries
To date, the following libraries have included
Fashion-MNISTas a built-in dataset. Therefore, you don’t need to downloadFashion-MNISTby yourself. Just follow their API and you are ready to go.You are welcome to make pull requests to other open-source machine learning packages, improving their support to
Fashion-MNISTdataset.Loading data with other languages
As one of the Machine Learning community’s most popular datasets, MNIST has inspired people to implement loaders in many different languages. You can use these loaders with the
Fashion-MNISTdataset as well. (Note: may require decompressing first.) To date, we haven’t yet tested all of these loaders with Fashion-MNIST.Benchmark
We built an automatic benchmarking system based on
scikit-learnthat covers 129 classifiers (but no deep learning) with different parameters. Find the results here.You can reproduce the results by running
benchmark/runner.py. We recommend building and deploying this Dockerfile.You are welcome to submit your benchmark; simply create a new issue and we’ll list your results here. Before doing that, please make sure it does not already appear in this list. Visit our contributor guidelines for additional details.
The table below collects the submitted benchmarks. Note that we haven’t yet tested these results. You are welcome to validate the results using the code provided by the submitter. Test accuracy may differ due to the number of epoch, batch size, etc. To correct this table, please create a new issue.
Other Explorations of Fashion-MNIST
Fashion-MNIST: Year in Review
Fashion-MNIST on Google Scholar
Generative adversarial networks (GANs)
Clustering
Video Tutorial
Machine Learning Meets Fashion by Yufeng G @ Google Cloud
Introduction to Kaggle Kernels by Yufeng G @ Google Cloud
动手学深度学习 by Mu Li @ Amazon AI
Apache MXNet으로 배워보는 딥러닝(Deep Learning) - 김무현 (AWS 솔루션즈아키텍트)
Visualization
t-SNE on Fashion-MNIST (left) and original MNIST (right)
PCA on Fashion-MNIST (left) and original MNIST (right)
UMAP on Fashion-MNIST (left) and original MNIST (right)
PyMDE on Fashion-MNIST (left) and original MNIST (right)
Contributing
Thanks for your interest in contributing! There are many ways to get involved; start with our contributor guidelines and then check these open issues for specific tasks.
Contact
To discuss the dataset, please use
.
Citing Fashion-MNIST
If you use Fashion-MNIST in a scientific publication, we would appreciate references to the following paper:
Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms. Han Xiao, Kashif Rasul, Roland Vollgraf. arXiv:1708.07747
Biblatex entry:
__special_katext_id_1__
Who is citing Fashion-MNIST?
License
The MIT License (MIT) Copyright © [2017] Zalando SE, https://tech.zalando.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.