FACELYZR - A DEEP LEARNING AGE AND GENDER RECOGNITIONBack Case Studies
Client: Internal project
Length: 3 month
Goal: Determine age and gender for a given image of person
Tech: Python, TensorFlow
This project started as a playground for learning neural networks and TensorFlow framework. Its goal was to do image processing. For a given image, our deep learning model would find a face on the image, crop it, and then determine age and gender based on the face. As an addition, we extended our model with a feature that would find attributes on faces. For example, if a person wore eyeglasses, which haircut it had, which hair colour, emotion recognition, etc. After the model is trained, we plan to make a web demo where users can upload their photos.
The approach can be divided into several stages:
- Data set collection - research and find open data set on internet
- Image processing - simple image processing like cropping, scaling, calculate mean, std, and define image read pipeline in TensorFlow
- Define neural network architecture for pretraining
- Train base neural network
- Train each classifier/regressor at top of pretrained neural network
- Add new modules such as face detection, face recognition and verification
- Make demo
We found a public available data set that contains labeled images. The labels include age, gender and other facial attributes. The faces in this dataset have already been cropped and aligned. We decided to use unsupervised learning that could learn on an unlabeled image database. For this, we trained a stacked denoising autoencoder. Now, there is a pre-trained core for other tasks such as prediction of age and gender. After the pre-training, we attached the predictors of age and gender on top of encoder and trained this new network using labeled images. For face detection we used pretrained multitask convolutional neural network. For face verification and recognition we calculate distance between face vectors from neural network embeddings.
Using the technique of semi-supervised learning, we achieved 98% accuracy on test set for the prediction of gender, and a root mean square error of 7 years. Besides improving results, we plan to extend the model with new features like eyeglasses detection, beard detection, haircut, etc. We also plan to make a web demo where users can upload their own photos.