/Child-Face-Generation

Pix2Pix implementation for child-face generation from BEGAN interpolated output.

Primary LanguagePythonMIT LicenseMIT

Child Face Generation

This is the second and final architecture in the workflow of the dual-architecture system designed for predicting child facial features from parental facial features.

The two stage system is:

  • (1) Extract an encoding of the parental features and find a mid-point encoding
  • (2) Find a probabilistic mapping from this encoding to child features

For this project, we use BEGAN coupled with spherical interpolation for Stage I and Pix2Pix cGAN for Stage II.

See the full report here.

Requirements


To install the requirements, an Anaconda environment is highly recommended:

conda create --name <env> --file requirements_conda.txt

Additionally, a requirements.txt file for pip installation is created. This method is not tested or recommended:

pip install -r requirements.txt

Dataset


The dataset in the format required can be downloaded here.

Before training the model, move this file to the data/processed folder.

See the Parent Child in the Wild (PCW) section below for more information on the dataset.

Running 🏃


Activate the environment:

source activate <env>

Then navigate to src/models and run:

python main.py --backend tensorflow --dset cupidV --nb_epoch 400 --generator deconv --img_dim 128 32 32

This is to train the model for 400 epochs with the deconvolutional method for a 128x128 and a 32x32 patch size.

Trained Model


The full trained model can be downloaded here.

Experiments & Representative Output


In the following images, the rows from top to bottom are: input interpolated parent facial features, predicted child facial features, ground truth. Below is a representative output from the deconvolutional method:

The upsampling method was also tested, but returned subjectively worse results. Below is a representative output:

Parent-Child in The Wild (PCW)


No suitable datasets containing a mother-father-child relationship for facial images was found. As such, via scraping and validation methods described in the report, this dataset was created.

Example family photo for creating the dataset:

Families are grouped and all facial images are cropped, aligned, and annotated with predicted gender and age. 766 families are available.

Download the raw data here.