A GAN Toy for Fashion-MNIST

By 苏剑林 | August 26, 2017

fashion_mnist_demo

fashion_mnist_demo

The MNIST handwritten digit recognition dataset has always been one of the touchstones for various machine learning algorithms. Recently, a new dataset has emerged to challenge it, called fashion-mnist, which consists of categories like clothing, shoes, and bags. To make it easier for users to migrate to fashion-mnist, the authors made the dataset almost identical to the MNIST handwritten digit recognition dataset—the same number and size of images, the same 10 categories, and even the same data packaging and naming conventions as MNIST. It seems fashion-mnist is really going all out to replace MNIST, putting in the effort to keep everything exactly the same to minimize usage costs. This determination to challenge the status quo is quite firm.

The reason for this challenge is simple—many people complain that if an algorithm doesn't work on MNIST, it definitely won't work anywhere else; but if an algorithm is effective on MNIST, it might not necessarily be effective on real-world problems. In other words, the original dataset is too simple and lacks representativeness.

fashion-mnist GitHub: https://github.com/zalandoresearch/fashion-mnist/

Introduction on Public Account: "Replacing MNIST? Scientists from the German Fashion Scene Launch a Benchmark Dataset full of Clothes, Pants, Shoes, and Bags"

fashion-mnist has a total of 10 classes: T-shirt/top, Trouser, Pullover, Dress, Coat, Sandal, Shirt, Sneaker, Bag, and Ankle boot. Many people are running experiments to see how models that were originally effective on MNIST perform when directly applied to this new dataset. Some benchmarks can already be found here for reference.

I also joined in the fun and ran the WGAN-GP code that was previously effective on MNIST (see "The Art of Mutual Conflict: Direct Access to WGAN-GP from Scratch") on this dataset and found it still works. Usage is very simple—you only need to change the path.

Code: https://github.com/bojone/gan/blob/master/fashion_mnist_gangp.py

Usage Method

git clone https://github.com/zalandoresearch/fashion-mnist.git
cd fashion-mnist
wget https://raw.githubusercontent.com/bojone/gan/master/fashion_mnist_gangp.py
python fashion_mnist_gangp.py

Compared to the original file, only the path was changed. In the out directory within the current folder, you can see the generated samples gradually becoming clearer and more diverse. Of course, there is still a gap compared to the original images, likely due to a lack of model capacity. You can experiment on your own; I am merely "tossing out a brick to attract jade" (offering this as a starting point).

Some generated samples (Order: Left to Right, Top to Bottom. You may notice that in the middle of the process, images become blurrier than before, but following that, they become much more diverse):

fashion_mnist_gan_1

fashion_mnist_gan_1

fashion_mnist_gan_2

fashion_mnist_gan_2

fashion_mnist_gan_3

fashion_mnist_gan_3

fashion_mnist_gan_4

fashion_mnist_gan_4

fashion_mnist_gan_5

fashion_mnist_gan_5

fashion_mnist_gan_6

fashion_mnist_gan_6


If you would like to cite this article, please refer to:
Su Jianlin. (Aug. 26, 2017). "A GAN Toy for Fashion-MNIST" [Blog post]. Retrieved from https://kexue.fm/archives/4540