Skip to content

Keras implementation of a CNN network for estimating age and gender

License

Notifications You must be signed in to change notification settings

kingofoz/age-gender-estimation

Repository files navigation

Age and Gender Estimation

This is a Keras implementation of a CNN network for estimating age and gender from a face image. In training, the IMDB-WIKI dataset is used.

Dependencies

Tested on Ubuntu 16.04, Python 3.5.2, CUDA 8.0, cuDNN 5.0.

  • Python3.5+
  • Keras
  • scipy, numpy, Pandas, tqdm
  • OpenCV3

Usage

Download the dataset

The dataset is downloaded and extracted to the data directory.

./download.sh

Create data

Filter out noise data and serialize images and labels for training into .mat file. Please check check_dataset.ipynb for the details of the dataset.

python3 create_db.py --output data/imdb_db.mat --db imdb --img_size 64

Train network

Train the network using the training data created above.

python3 train.py --input data/imdb_db.mat

Plot training curves from history file.

python3 plot_history.py -input models/history_16_8.h5 

Network architecture

In the original paper, the pretrained VGG network is adopted. Here the Wide Residual Network (WideResNet) is trained from scratch. I modified the @asmith26's implementation of the WideResNet; two classification layers (for age and gender estimation) are added on the top of the WideResNet. Note that age and gender are estimated independently using different two CNNs.

Results

Trained on imdb, tested on wiki.

About

Keras implementation of a CNN network for estimating age and gender

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 96.0%
  • Python 3.9%
  • Shell 0.1%