docs/en/datasets/classify/fashion-mnist.md
The Fashion-MNIST dataset is an image classification benchmark of 70,000 28x28 grayscale images of Zalando's clothing articles, evenly split across 10 classes — T-shirt/top, trouser, pullover, dress, coat, sandal, shirt, sneaker, bag, and ankle boot. It ships with a predefined split of 60,000 training and 10,000 test images (7,000 per class) and serves as a drop-in replacement for the original MNIST dataset for benchmarking machine learning algorithms. For the color-image equivalent, see the related CIFAR-10 dataset.
<p align="center"> <iframe loading="lazy" width="720" height="405" src="https://www.youtube.com/embed/eX5ad6udQ9Q" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen> </iframe><strong>Watch:</strong> How to do <a href="https://www.ultralytics.com/glossary/image-classification">Image Classification</a> on Fashion-MNIST using Ultralytics YOLO
</p>Fashion-MNIST ships with an official, predefined split, so no automatic or manual partitioning is needed:
!!! note "Validation split"
Fashion-MNIST has no separate validation folder, so Ultralytics uses the 10,000-image test set as the validation split during training by default.
Fashion-MNIST is widely used to train and evaluate image classification models, from classic Convolutional Neural Networks (CNNs) and Support Vector Machines (SVMs) to modern deep architectures. Its small grayscale images and 10 clothing categories make it a fast, reproducible benchmark for algorithm comparison and computer vision experimentation, while being more challenging than the handwritten digits of MNIST.
Train a YOLO model on Fashion-MNIST for 100 epochs at an image size of 28. For the full list of available arguments, see the Training page and the image classification task guide.
!!! example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-cls.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="fashion-mnist", epochs=100, imgsz=28)
```
=== "CLI"
```bash
# Start training from a pretrained *.pt model
yolo classify train data=fashion-mnist model=yolo26n-cls.pt epochs=100 imgsz=28
```
Sample images from the Fashion-MNIST dataset:
The samples show the variety of clothing categories in the Fashion-MNIST dataset, underlining the value of a varied dataset for training robust image classification models.
If you use the Fashion-MNIST dataset in your research or development work, please cite the following paper:
!!! quote ""
=== "BibTeX"
```bibtex
@article{xiao2017fashion,
title={Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms},
author={Han Xiao and Kashif Rasul and Roland Vollgraf},
year={2017},
eprint={1708.07747},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
```
We would like to acknowledge Zalando Research for creating and maintaining the Fashion-MNIST dataset as a valuable resource for the machine learning and computer vision research community. For more information about the Fashion-MNIST dataset and its creators, visit the Fashion-MNIST GitHub repository.
The Fashion-MNIST dataset is a benchmark of 70,000 28x28 grayscale images of Zalando's clothing articles across 10 classes, created as a drop-in replacement for the original MNIST dataset. It shares MNIST's exact image size, format, and 60,000/10,000 train/test split, but replaces handwritten digits with harder fashion categories — such as T-shirt/top, trouser, and ankle boot — making it a more demanding benchmark for image classification models.
To train an Ultralytics YOLO model on Fashion-MNIST, use the code snippets below. The dataset downloads automatically on first use. For a full list of arguments, see the model Training page.
!!! example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-cls.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="fashion-mnist", epochs=100, imgsz=28)
```
=== "CLI"
```bash
# Start training from a pretrained *.pt model
yolo classify train data=fashion-mnist model=yolo26n-cls.pt epochs=100 imgsz=28
```
Fashion-MNIST has 10 classes — T-shirt/top, trouser, pullover, dress, coat, sandal, shirt, sneaker, bag, and ankle boot — with exactly 7,000 images each, for 70,000 images in total. Every image is a 28x28 grayscale picture of a single Zalando clothing article, and the classes are perfectly balanced.
Fashion-MNIST ships with a predefined split of 60,000 training images and 10,000 test images, with exactly 6,000 training and 1,000 test images per class. Unlike folder-based classification datasets that Ultralytics splits automatically, Fashion-MNIST's official partition is used as-is, and the test set serves as the validation split during training by default.
Yes. Ultralytics Platform lets you manage datasets, train image classification models, and deploy them without extensive coding. It is a convenient way to run Fashion-MNIST experiments in the cloud, and you can explore more options in our classification datasets overview.