A GAN toy example on Fashion-MNIST
The MNIST handwritten digit recognition dataset has long been one of the touchstones for testing various machine learning algorithms. Recently a new dataset has emerged to challenge its status, called Fashion-MNIST, which consists of images of clothes, shoes, hats, and the like. To make it easy for users to migrate to Fashion-MNIST, the authors made the dataset almost identical to MNIST — the same number and size of images, the same 10 classes, even the same packaging format and naming conventions as MNIST. It really seems like Fashion-MNIST went all out trying to replace MNIST, making everything as similar as possible so as to minimize the cost of switching over. That's some serious determination to challenge the incumbent.
The reason behind this challenge is simple — many people complain that if an algorithm doesn't work on MNIST, then it's certainly useless, but if an algorithm does work on MNIST, that doesn't necessarily mean it will work on real-world problems either. In other words, this dataset is too simple to be representative.
Fashion-MNIST's GitHub page: https://github.com/zalandoresearch/fashion-mnist/more
An introduction from the public account: "Replacing MNIST? German Fashion-Circle Scientists Release a Benchmark Dataset, All Clothes, Pants, Shoes, and Bags"
Fashion-MNIST has 10 classes in total: T-shirt/top, Trouser, Pullover, Dress, Coat, Sandal, Shirt, Sneaker, Bag, and Ankle boot. Quite a few people have been running experiments to see how models that previously worked well on MNIST perform when directly ported to this new dataset. Here you can already find some benchmarks for reference.
I decided to join in the fun too, and ran my previously effective WGAN-GP code for MNIST (see "The Art of Mutual Sparring: Getting to WGAN-GP from Scratch") on this dataset, and found that it still works. The usage is very simple — you just need to change the path.
Code: https://github.com/bojone/gan/blob/master/fashion_mnist_gangp.py
Usage
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 has changed. In the out directory under the current working directory, you can see the generated samples gradually becoming clearer and more diverse over time. Of course, there's still a gap compared to the real images, which is probably a matter of insufficient model capacity — readers are welcome to experiment further; I'm just throwing out a brick to attract jade here.
Some generated samples (order: left to right, top to bottom. You'll notice that partway through, the images become blurrier than before, but after that they become more diverse):
fashion_mnist_gan_1
fashion_mnist_gan_2
fashion_mnist_gan_3
fashion_mnist_gan_4
fashion_mnist_gan_5
fashion_mnist_gan_6
Translated automatically with claude-sonnet-5; all equations are reproduced verbatim from the source. Copyright remains with the original author.
