Gender prediction has been in increasing demand in the Computer Vision sphere. The need for the ability to predict the gender of a person has many uses. As the world gets more digital by the day, it is absolutely viable to make use of technology like AI to tackle such problems. Further, it can be used by the biometric system at airports/railways/government buildings to verify people. The uses are limited by creativity and imagination.
In the AI community there are no certain guidelines regarding how hyperparameters affect a model’s performance. We have tried our best to shed some light on this issue. Also our motivation was to analyze why some state of the art architectures perform the way they do.
We aim to implement VGG-16, InceptionV3 CNN models on the “UTKFace” dataset, draw results and analyze them to conclude possible reasons for the results obtained.
UTKFace dataset is a large-scale face dataset with a long age span (range from 0 to 116 years old). The dataset consists of over 20,000 face images with annotations of age, gender, and ethnicity.
We used the standard VGG-16 architecture pre-trained on the ImageNet dataset for our gender classification task. Original images which were 200x200 pixels were pre-processed into size 224x224 to be fed into the model.
All the fully connected layers and the convolutional layers were freezed, i.e- their ‘weights’ and ‘bias’ were not updated by the optimizer ‘adam’.
We used the standard InceptionV3 architecture pre-trained on the ImageNet dataset for our gender classification task. Original images which were 200x200 pixels were pre-processed into size 299x299 to be fed into the model.
All the fully connected layers and the convolutional layers were freezed, i.e- their ‘weights’ and ‘bias’ were not updated by the optimizer ‘RMS-prop’.
Train | Vaidation | Test | ||||
---|---|---|---|---|---|---|
Accuracy | Loss | Accuracy | Loss | Accuracy | Loss | |
VGG-16 | 88.9 | 27.13 | 83.86 | 40.11 | 80.38 | 48.19 |
InceptionV3 | 89.24 | 26.35 | 85.40 | 33.27 | 82.93 | 40.51 |
For our gender classification task on the UTKFace dataset of 20,000 images, we prepared the dataset according to ‘male’ and ‘female’ classes. The entire implementation was done on google collaboratory which provided the high-end hardware specification of the google servers. Tensorflow and keras were primary libraries used in the code.
We then used two CNN architectures pre-trained on the ImageNet Dataset namely, VGG-16 and InceptionV3. Both the models with 10 epochs but both got preempted as their accuracy didn’t improve further. The results were drawn and it was found that InceptionV3 performs better. We analyzed the various factors due to which this could be so.