Image recognition is an interesting topic and I am excited to exercises deep learning techniques to recognize human face image using age, gender and ethnicity attributes. Sequential models with variety of input layers were tested using Keras while compiling the model. Final face recognition shows an excellent accuracy score and acceptable MSE.
Main data set is from UTKFace which has been downloaded and made it available to use. 27304 images with five columns, it was a reasonable size dataset. Features distribution and null/missing values were checked along with features relevancy. Keras / sklearn with Convolutional Neural Network models were used to perform the tasks. Random samples extracted from the data set
Three target variables Age, Gender and Ethnicity are mentioned categorizing the distribution.
Shows the heatmap for feature's relevancy.
As Age is considered to be the contineous variable (Regression Problem) and Gender, Ethnicity are considered (Classification Problem) due to categorical / binary variables.
Different batch sizes were tried as input, including 64,128,256 and 512 number of layers using 'relu' as an activation. Then image was flattened and output in a sigle layer and finally model was compiled using'adam' as an optimizer with measuring 'MSE'.
Similar number of input layers were used with 'simoid' as activation for binary classification. Mode was compiled using 'adam' as optimizer, binary_crossentropy as loss function and accuracy as metrics.
Confusion Metrix show relatively bigger numbers for 'FP' and 'FN', which might be due to some images can't be recognized fully , i.e. kids..
Ethnicity model was tested using 'softma' as activation (for multi classification) , 'adam' as optimizer and accuracy as metrics.
Confusion metrics show the stronger prediction in category 0, 3 and 1.
Finally we took a test of randomly selecting face images and see that 'Gender' and 'Ethnicity' models have higher prediction where as 'Age' model sometimes show an offset of ~6-7 years which was the same as of MSE.