Fashion-MNIST Fashion Image Dataset:
Image Classification Modern Benchmark
A fashion product image dataset released by Zalando Research. 70,000 28×28 grayscale images, 10 categories—serving as a direct alternative to the classic MNIST, providing a more challenging benchmark for image classification research.
Dataset Highlights
Fashion-MNIST is becoming the new standard benchmark dataset in the field of image classification
MNIST Alternative
Directly replaces the classic MNIST, compatible with the same file format, data structure, and toolchain, allowing for a switch without modifying any code.
Fashion Items
Real clothing images (T-shirts, pants, dresses, coats, etc.), offering more visual diversity and classification challenges than handwritten digits.
MIT Open Source
Utilizes a permissive MIT license, freely usable for commercial projects and academic research, with no additional restrictions.
Standard Format
IDX binary format, fully compatible with MNIST. 4 gzip compressed files containing images and labels for the training and test sets.
Moderate Difficulty
Harder than MNIST but easier than CIFAR-10, making it ideal for transitioning from beginner to advanced learning and model tuning experiments.
Framework Support
Built-in support for PyTorch, TensorFlow, and Keras, allowing the dataset to be loaded with a single line of code, ready to use out of the box.
Applicable Scenarios
From academic research to industrial applications—common uses of Fashion-MNIST
Image Classification
CNN, ResNet, Vision Transformer—preferred benchmark dataset for validating various image classification models
Model Benchmarking
Comparing accuracy, parameter count, and inference speed of different network architectures on standard data
AutoML Evaluation
Used to evaluate the performance of automated machine learning frameworks, validating the optimal model architectures found through automated search
Clothing Recognition
Prototype validation for product classification in fashion e-commerce scenarios, quickly building a clothing image recognition MVP
Data Preview
Fashion-MNIST contains grayscale images of fashion items in 10 categories
Label Category Name Description ─────────────────────────────────────── 0 T-shirt/top T-shirt/top 1 Trouser Trousers 2 Pullover Pullover 3 Dress Dress 4 Coat Coat 5 Sandal Sandals 6 Shirt Shirt 7 Sneaker Sneakers 8 Bag Bag 9 Ankle boot Ankle boots
3 Steps to Get Started Quickly
From browsing to usage, just a few minutes
Browse the Dataset
View detailed descriptions, category definitions, and data previews of the Fashion-MNIST dataset on the Ace Data Cloud platform.
Download the Data Files
One-click download of 4 gzip compressed files to your local machine, no registration, no payment, get it immediately.
Load and Train
Load the data with one line of code using PyTorch, TensorFlow, or Keras, and start training your image classification model.
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
# Data preprocessing
transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,))
])
# Load Fashion-MNIST dataset
train_data = datasets.FashionMNIST(
root="./data", train=True, download=True, transform=transform
)
test_data = datasets.FashionMNIST(
root="./data", train=False, download=True, transform=transform
)
train_loader = DataLoader(train_data, batch_size=64, shuffle=True)
test_loader = DataLoader(test_data, batch_size=64, shuffle=False)
# Define a simple neural network
class FashionNet(nn.Module):
def __init__(self):
super().__init__()
self.flatten = nn.Flatten()
self.fc1 = nn.Linear(28 * 28, 256)
self.fc2 = nn.Linear(256, 128)
self.fc3 = nn.Linear(128, 10)
self.relu = nn.ReLU()
def forward(self, x):
x = self.flatten(x)
x = self.relu(self.fc1(x))
x = self.relu(self.fc2(x))
return self.fc3(x)
model = FashionNet()
criterion = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(), lr=0.001)
# Train the model
for epoch in range(5):
model.train()
for images, labels in train_loader:
optimizer.zero_grad()
outputs = model(images)
loss = criterion(outputs, labels)
loss.backward()
optimizer.step()
# Evaluate accuracy
model.eval()
correct, total = 0, 0
with torch.no_grad():
for images, labels in test_loader:
outputs = model(images)
_, predicted = torch.max(outputs, 1)
total += labels.size(0)
correct += (predicted == labels).sum().item()
print(f"Test accuracy: {100 * correct / total:.2f}%") # About 88%
Start Your Image Recognition Journey
Fashion-MNIST is the ideal bridge from handwritten digits to real image classification. Download for free and start exploring fashion AI now.