A simple face detector (MD) trained from convolutional neural network (CNN). Accuracy is as high as 98%, the trained model can distinguish human faces from animal faces without having any animal faces in the training set.
- Python3 (tested on Python 3.7.4)
- TensorFlow 2.0 (tested on 2.0.0)
- NumPy (tested on 1.17.3)
- SciPy (tested on 1.3.1)
- Matplotlib (tested on 3.1.1)
- Datasets (see DATA.SOURCE.md)
Run ./run.sh
to learn a face detector
Run python3 cnn_gender.py
to train a gender model
- UTKFace Dataset was used to train face images
- Random scenery pictures were used to train non-face images
- An independent LHI-Animal-Faces dataset was used as part of the test set
- Animal faces are added to the validation set to see if the trained model misclassify them as human faces
- In the test set, non-face images are more than images with faces to simulate a actual picture where most of the windows do no contain a face
Note that the sample/test division is random, so the accuracy could fluctuate