jomariya23156 / fashion-shop-images-classification

Multi-class and multi-label images classification for fashion shops
5 stars 1 forks source link
convolutional-neural-networks deep-learning fashion-classifier multiclass-classification multilabel-classification tensorboard-visualizations tensorflow2

Fashion Shop Images Classification

Important notes before getting started

Project Overview

    We are trying to automate the labeling process of an online fashion shop which sells 3 main product categories which are Trousers&Jeans, Shoes, and Glasses&Sunglasses. This is the best fit to do images classification with CNN. Trousers&Jeans and Shoes both have sublabels for 'male' and 'female'. Moreover, Shoes is the most complex one, it can be subcategorized into 'Boots', 'Trainers/Sneakers', 'Sandals/Flip flops/Slippers', 'Formal shoes','Others' under 'male' category, and 'Boots', 'Ballerina', 'Trainers/Sneakers','High heels', 'Sandals/Flip flops/Slippers', 'Others' under 'female' category.
    So overall, this is a multi-classes muti-labels problem. In this project, We have tried 2 different approaches, which are Combined and Hierarchical, for those categories having subcategories. Combined approach is to combine all possible combination labels into a single classes example 'Boots' under 'male' will be combined in to 'Boots male' as 1 label, and so on. Hierarchical approach is to train the separated model to perform different tasks, for example, first we classify whether its 'male' or 'female', if it's male, which of 5 labels in male shoes it is belong to.

Results

Accuracy

Plan to attack

  1. Create Primary Classification model which aims to classify whether images are 'Trousers&Jeans' or 'Shoes' or 'Glasses&Sunglasses'.
  2. Create all of model to classify further down in each class both combined and hierarchical approach.
  3. If it is Glasses&Sunglasses, we will use Glasses&Sunglasses classification model which aim to classify 'Glasses' or 'Sunglasses'. (There is no gender specific for glasses)
  4. If it is Shoes, we will use Shoes_Gender model to classify whether it's male or female. Then, we will use Shoes_Male and Shoes_Female model to classify which type of shoes.
  5. If it is Trousers&Jeans, we will use Trousers&Jeans_Gender model to classify whether it's male or female. Then, we will use Trousers&Jeans_Male and Trousers&Jeans_Female model to classify which type of shoes.
  6. Step 3 to 5 are hierarchical approach. Now, we will use combined approach. After the primary classification, we will apply those label to its combined classification model (name in *_All.ipynb) to classify its labels.
  7. Compare combined and hierarchical approach, which one will perform better.
  8. Try different model Architecture.
  9. Do hyperparameter tuning.

Libraries

numpy, tensorflow, sklearn, PIL, matplotlib

Files explanation

    All the files are named with descriptive naming convention. However, to be clear, we have included this part here. (We recommend to ingore the number after the Model_. It might be a bit confusing. It's there for training and testing many different models for each specific task.)

All model architecture we tried

We used 'relu' for all layers except the output layers which 'softmax' is used.

  1. Conv -> MaxPool -> Conv -> MaxPool -> Flatten -> Dense
  2. Conv -> MaxPool -> Conv -> MaxPool -> Flatten -> Dense -> Dense
  3. Conv -> MaxPool -> Conv -> MaxPool -> Flatten -> Dense -> Dropout -> Dense
    We also apply L2 to some models. Please check .ipynb files for each model if you wish

Problems we found in this project

    There is only one main big problem occurred when we test our model with test set. It appeared to predict everything wrong with .evaluate() function. However, when we tried using .predict() function it appears to be fine. So, we went for .predict() and write a code to calculate it manually.

Thank you for reaching out and read til the end. You are AMAZING. :D