View on GitHub

Ms.Robot

Machine Learning Fashion Modelling. Training a Variational Autoenconder (VAE) on Keras TensorflowJS framework achieving results on highly challenging dataset of over 60,000 fashion MNIST images.

Ms.Robot Fashion Modelling 👩🏻‍🔬

* ✿ ❀ Training a variational autoencoder on the Fashion MNIST dataset ❀ ✿ *

[![Status](https://img.shields.io/badge/status-active-success.svg)]() [![GitHub Issues](https://img.shields.io/github/issues/lucylow/Ms.Robot.svg)](https://github.com/lucylow/Ms.Robot/issues) [![GitHub Pull Requests](https://img.shields.io/github/issues-pr/lucylow/Ms.Robot.svg)](https://github.com/lucylow/Ms.Robot/pulls) [![License](https://img.shields.io/aur/license/android-studio.svg)]()

Table_of_Contents 💜


Motivation 💜


Autoencoders 💜

Autoencoders yay

Image. How autoencoders work using the MNIST data set with the number “2”


Variational Autoencoders (VAE) 💜


Variational Autoencoder (VAE) Example 💜

Example of encoder network maping inputs to latent vectors:


 x = Input(batch_shape=(batch_size, original_dim))
 
 h = Dense(intermediate_dim, activation='relu')(x)
 
 z_mean = Dense(latent_dim)(h)
 
 z_log_sigma = Dense(latent_dim)(h)

Sample Code for VAE encoder network


Label_descriptions 💜

Ms.Robot has the following fashion pieces in her wardrobe:

  1. T-shirt/top
  2. Trouser
  3. Pullover
  4. Dress
  5. Coat
  6. Sandal
  7. Shirt
  8. Sneaker
  9. Bag
  10. Ankle boot

Plot of subset Images from Fashion MNIST dataset

Image. The 0 to 9 label descriptions for the Fashion MNIST dataset


Prepare_the_node_environment 💜

yarn
# Or
npm install

Download_the_fashion_data 💜


Run_the_training_script 💜

yarn train

Loss_error_function 💜


TensorBoard_monitoring_model_training 💜

Use --logDir flag of yarn train command. Log the batch-by-batch loss values to a log directory

yarn train --logDir /tmp/vae_logs

Start TensorBoard in a separate terminal to print an http:// URL to the console. The training process can then be monitored in the browser by Ms.Robot:

pip install tensorboard 
tensorboard --logdir /tmp/vae_logs

Tensorboard Monitoring

Image. Tensorboard’s monitoring interface.

Tensorboard

Image. Tensorboard’s monitoring interface.


Conclusion_Model_Discussion 💜

Results show a generative model with parameters of a probability distribution variational autoencoder (VAE) is capable of achieving results on a highly challenging dataset of over 60,000 fashion set images using machine learning. The variational autoencoder VAE is a generative model which means it can be used to generate new fashion pieces for Ms.Robot. This is done by scanning the latent plane, sampling the latent points at regular intervals, to generate the corresponding fashion piece for each point. Run to serve the model and the training web page.

yarn watch

screenshot of results on fashion MNIST. A 30x30 grid of small images

*Image of completed training results on fashion MNIST 30x30 grid of small images for Ms.Robot. Visualization of the latent manifold** that was “generated” by the Ms.Robot generative model.


References 💜