My first unsupervised, supervised deep learning project - Part I
Introduction
The latest project I've been working on has been a very fun and extremely challenging one. It marries two things I love and spend a great deal of time thinking about: machine learning and fashion. The first part of this project, showcased in a Flask application hosted on a local server, was to create models that can identify various attributes of footwear. The most successful ones to date (which is ultimately the criteria for making it on the app) have been: department (boots, sandals, shoes), heel (binary), ankle strap (binary), laces (binary), toe opening (binary), athletics flag (binary), and gender (binary - although the industry is moving towards a more gender fluid categorization).
Methodology - Transfer Learning
To achieve my task, I decided to leverage powerful resources such as pretrained convolutional neural network models (also referred to as CNN or ConvNet). I used CNNs as they perform very well with images. The use of pretrained models is a type of transfer learning, which is basically using knowledge gained from solving one problem and applying it to another. Many models were trained on a massive, 1.2 million image dataset called ImageNet, which consists of 1000 classes (categories of objects). The one I chose for this task is called InceptionV3, which is a complex model that has been trained to detect many patterns and textures (more about the Inception models here). This model is made available through Tensorflow and Keras (thanks Google ^.^).
In order to maximize the accuracy of my models I did two things:
- I removed the fully connected layer at the top of the model, added my own layers, and trained only the new layers (while the weights of the remaining layers were frozen) on my dataset (created by me) of shoes.
- I then unfroze either a few blocks or the whole network and fine tuned the weights using the same dataset of shoes.
I also created a grid search algorithm that looped through many values of hyperparameters, in order for me to choose the values that gave me the highest validation accuracy and to help me build intuition on the nature of my model.
Demo
I built a Flask application to showcase my models (also for fun!).
I hope you enjoyed the demo. I have since added a similarity model, also using transfer learning. More to come on this!
This is a very high level explanation of what I have done. For more information please don't hesitate to contact me - always happy to share the love!