Fashion-MNIST Training Images
60,000 28x28 grayscale training images of fashion articles
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.
Fashion-MNIST is becoming the new standard benchmark dataset in the field of image classification
Directly replaces the classic MNIST, compatible with the same file format, data structure, and toolchain, allowing for a switch without modifying any code.
Real clothing images (T-shirts, pants, dresses, coats, etc.), offering more visual diversity and classification challenges than handwritten digits.
Utilizes a permissive MIT license, freely usable for commercial projects and academic research, with no additional restrictions.
IDX binary format, fully compatible with MNIST. 4 gzip compressed files containing images and labels for the training and test sets.
Harder than MNIST but easier than CIFAR-10, making it ideal for transitioning from beginner to advanced learning and model tuning experiments.
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.
From academic research to industrial applications—common uses of Fashion-MNIST
CNN, ResNet, Vision Transformer—preferred benchmark dataset for validating various image classification models
Comparing accuracy, parameter count, and inference speed of different network architectures on standard data
Used to evaluate the performance of automated machine learning frameworks, validating the optimal model architectures found through automated search
Prototype validation for product classification in fashion e-commerce scenarios, quickly building a clothing image recognition MVP
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
From browsing to usage, just a few minutes
View detailed descriptions, category definitions, and data previews of the Fashion-MNIST dataset on the Ace Data Cloud platform.
One-click download of 4 gzip compressed files to your local machine, no registration, no payment, get it immediately.
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%
Fashion-MNIST is the ideal bridge from handwritten digits to real image classification. Download for free and start exploring fashion AI now.