This is an image classification project to identify 5 female face shapes using Convolutional Neural Networks (CNN). I completed this as my Capstone Project for Data Science Immersive course with General Assembly (October 2020).
This project is also deployed as a web app using Stremlit on Heroku. If you're interested, check your face shape at myfaceshape.herokuapp.com
Based on The Deloitte Consumer Review, consumers are demanding more personalised experience, however trial remains low. In beauty and fashion industry, over 40% of adults aged 16-39 are interested in personalised offer, while trial is only 10%-14%. Among those who are interested, ~80% are willing to pay at least 10% higher price.
By being able to classify face shapes will enable brands to offer more personalised solutions to increase customer satisfaction, while increasing margin from premium positioning. Example of use cases are:
For this project, I will be using Deep Learning approach with Convolutional Neural Networks (CNN) to classify 5 different female face shapes (Heart, Oblong, Oval, Round, Square). The model that was highest accuracy score will be chosen.
I have explored 2 approaches of CNN by building from scratch vs. trasfer learning with VGG-16 architecture and pre-trained weights from VGGFace. Transfer learning approach helped increased accuracy, while the most mis-classified face shape is 'Oval'.
Image pre-processing also played an important role in reducing overfitting and increasing validation accuracy. Key drivers are:
The Face Shape Dataset is a dataset from Kaggle by Niten Lama.
This dataset comprises a total of 5000 images of the female celebrities from all around the globe which are categorized according to their face-shape namely:
Each category consists of 1000 images (800 for training : 200 for testing)
Pre-processing of the images is a critical factor in reducing model overfitting to the training dataset, and increasing the validation accuracy. The following steps have been explored:
CNN Model built from scratch With limited training data of 4000 images (800 images x 5 classes), I build the model with 4 Convolutional + Max-Pooling Layers, and 2 Dense layers (details below).
CNN Model with transfer learning enables me to use a more complex VGG-16 architecture, by using pre-trained weights from VGGFace that has been trained on over 2.6 Million images.
Transfer Learning helped improved accuracy significantly, from 76.9% to 92.7%, with the help of pre-trained weights on larger dataset.
From the models built from scratch, all models performed better than baseline of 20% (5 classes are balanced with 20% each).
Summary of all models below.
Both models have highest misclassification on Oval face shape. Although the transfer learning model improved the accuracy of the model built from scratch, yet Oval is still the most misclassified, with the majority being Oval misclassified as Round. Interestingly, Round face is also mostly misclassified as Oval, although overall misclassification for Round face shape is low. The confusion between Oval and Round are mostly Asian faces, and more so with transfer learning. This is likely because the pretrained weights have less Asian images.