This is a personal project that aims to devepol a image classification model using machine learning. The project uses idea from the paper "FaceNet: A Unified Embedding for Face Recognition and Clustering".
In this project, I created a dataset consisting of two categories "tired" and "not_tired". Data collection was done under different lighting conditions both indoors and outdoors. We can use algorithms like Facenet to extract a vector of embeddings for these features. A classification model then can be trained using this data.
In this project I aim to develop a efficient way to image classification using machine learning. We use embedding extracted using Facenet or some other algorithm to train a classification model.
A custom dataset is used for training the model. Data consist of 317 images for both the classes which was collected from few volunteers, few images from a couple of online resources are also used in this data. After filtering the dataset some performance improvements were seen.
If you wish to use the data used in this project then please read agreement in the google form below and give your approval.
Some other detectors like Dlib seems to be less costly in detecting faces but misses some of the hard examples. Also it was observed that number of false positives were also high.
Although more costly MTCNN seemed to work very well in different settings.
I used the keras implementation of Facenet to extract a vector of embeddings from the cropped images. You can follow up this implementation on this repo.
Extracted features can be normalized before training. But in this case it doesn't seemed to matter much. A kernel-SVM is trained using processed data.
The accuracy on test set is 83%. The classification report is:
precision | recall | f1-score | support | |
---|---|---|---|---|
0 | 0.91 | 0.88 | 0.90 | 34 |
1 | 0.78 | 0.82 | 0.80 | 17 |
The model performs well concerning the testing dataset for which the identities were same as the train set. I further did some more testing with some new identities that were not part of the training set, in this case the model seemed to perform poorly espicially for "not_tired" category. Training model for embeddings extracted from entire face of a person leads to overfitting due to which it performs so poorly for new identities.