Can Artificial Intelligence Guess Our Sex?

Severin Ibarluzea
Universal Data Tool
2 min readMar 5, 2020

I trained a machine learning model to predict the sex of a face. The model was trained on AI-generated faces from generated.photos which were labeled on wao.ai. Some sample faces from the training set (total size about 2,000 images) are shown below.

Some example faces from generated.photos

The model scored about 95% accuracy. That means this AI can guess a person’s sex 19 out of 20 times. Don’t believe me? Try it here! (P.S. None of your image data is sent to the server, it’s all done in your browser!)

How did we make this?

You can see every step of the process in Creating a Sex Classification Model in Google AutoML. The model uses Tensorflow.js to run in the browser. The dataset was uploaded to wao.ai for ground-truth labeling.

Where does the model fail?

Children and gender-neutral haircuts seem to be the biggest sources of confusion.

Where the AI was successful (top rows), and where it made mistakes (bottom two rows)

Confusion matrix shown below. There doesn’t seem to be a bias towards male or female despite the data set being uneven with around 66% of the faces being female.

Confusion Matrix

Will AI be able to instantly and precisely identify our sex in the future?

Definitely. This model is trained on a really small dataset of about 2,000 images, with more data and some additional image preprocessing it would be possible to get much higher accuracies.

--

--