##########################################################
##########################################################
This is my final course project for CSCI 8360 Data Science Practicum course. This project focuses on gender and age classification based on images. My work builds on the previous work of:
Gil Levi & Tal Hassner Alexander, Age and Gender Classification using Convolutional Neural Networks. 2015
Ari Ekmekji. Convolutional Neural Networks for Age and Gender Classification, Stanford University. 2016
Both of these papers have established efficient architectures for solving gender and age classification problem. I've tried to extend their approach in order to improve the results. The primary area of experimentation is to tweak previously published architecture in terms of depth of the network, number of parameters in the network, modifications to parameters of the network or the layout of these networks. I've tried to chain the architectures for age and gender classification to take advantage of gender-specific age characteristics inherent to images.
The dataset used for training and testing for this project is the Adience Benchmark - collection of unfiltered face images. It contains total 26,580 images of 2,284 unique subjects that are collected from Flickr [10]. There are 2 possible gender labels: M, F and 8 possible age ranges: 0-2, 4-6, 8-13, 15-20, 25-32, 38-43, 48-53, 60+. Each image is labelled with the person’s gender and age-range (out of 8 possible ranges mentioned above). From the original dataset I've used mostly frontal face images reducing the dataset size to 17,523 images. The images are subject to occlusion, blur, reflecting real-world circumstances.
##########################################################
The following preprocessing was applied to each image:
##########################################################
For Gender Classification, following are the details of the model:
Since, gender and age classification has been chained i.e. based on gender, classify age, 2 separate age classifiers: Male-Age and Female-Age classifiers have been built. Based on the results of gender classification, the images are fed to the respective gender-based age classifiers.
For gender-based Age Classification, same model(Gender Classification model) has been used with the following modifications:
For both Age and Gender classification, training is performed using Stochastic Gradient Descent having a batch size of 50. The initial learning rate is 1e−3, reduced to 5e-4 after every 10,000 iterations. The models have been trained using 4-fold cross validation.
##########################################################
Ensure the following Python packages are installed on your machine:
Once your environment has been setup, download the project files and run the following:
For gender classification execute: python gender/train_n_test_gender.py
The script expects: Path to training and testing data. Cross validation accuracy is recorded every 1000 iterations. Predictions are saved every 1000 iterations to predicted_genders.txt
Based on the gender classification results, to separate out the data of predicted males and females, execute the script: gender/create_gender_test_based_on_predictions.py
Once we have separated out the predicted males and females, we can then feed them gender-based age classifiers to get the age. Inorder to do so, execute the script:
##########################################################
All the results have been logged here: https://github.com/eds-uga/gender-age-classification/issues/3