Multi-Class Deep Learning Model for Fashion-MNIST Using Keras Take 3

Template Credit: Adapted from a template made available by Dr. Jason Brownlee of Machine Learning Mastery.

SUMMARY: The purpose of this project is to construct a predictive model using various machine learning algorithms and to document the end-to-end steps using a template. The Fashion MNIST dataset is a multi-class classification situation where we are trying to predict one of several (more than two) possible outcomes.

INTRODUCTION: Fashion-MNIST is an MNIST-like fashion product dataset from Zalando Research. It consists of a training set of 60,000 clothing article examples and a test set of 10,000 examples. Each example is a 28×28 grayscale image, associated with a label from 10 classes. Zalando intends Fashion-MNIST to serve as a direct drop-in replacement for the original MNIST dataset for benchmarking machine learning algorithms. It shares the same image size and structure of training and testing splits.

For the Take1 iteration, we constructed a simple dense-layer model to classify the images. This model serves as the baseline for future iterations.

For the Take2 iteration, we tuned the simple dense-layer model further to examine whether we can improve its prediction performance.

For this iteration, we will convert the dense-layer model into a convolutional model to examine whether we can improve its performance.

ANALYSIS: For the Take1 iteration, the baseline performance of the model achieved an accuracy score of 88.58% after training for three epochs. The same baseline model processed the test dataset with an accuracy of 87.72%. If we were to train the model much further than three epochs, we could run into the over-fitting issue.

For the Take2 iteration, the performance of the Take2 model with the default parameters achieved an accuracy score of 91.68% after training for ten epochs. After tuning the hyperparameters, the Take2 model with the best hyperparameters processed the training dataset with an accuracy of 91.82%. The same Take2 model processed the test dataset with an accuracy of 89.20%.

For the Take2 iteration, tuning the hyperparameters does not appear to have a noticeable effect on the model accuracy. The reason could be that, for image recognition, a simple dense-layer model can only do so much.

For this iteration, the performance of the Take3 model with the default parameters achieved an accuracy score of 95.67% after training for ten epochs. After tuning the hyperparameters, the Take3 model with the best hyperparameters processed the training dataset with an accuracy of 94.51%. The same Take2 model processed the test dataset with an accuracy of 91.68%.

For the Take3 iteration, adding the convolutional layers improved the model’s prediction performance. The increasing difference between training and validation accuracy after each epoch indicated that we potentially have a high variance problem. We will need more data to train the model before we can bring up the prediction accuracy of the validation dataset.

CONCLUSION: For this dataset, the model built using Keras and TensorFlow achieved a satisfactory result and should be considered for future modeling activities.

Dataset Used: Fashion-MNIST Dataset

Dataset ML Model: Multi-class classification with numerical attributes

Dataset Reference: https://github.com/zalandoresearch/fashion-mnist

One potential source of performance benchmarks: https://www.kaggle.com/zalando-research/fashionmnist

The HTML formatted report can be found here on GitHub.