Image for post
Image for post


Averaged faces from classical paintings

Aleksey Tikhonov
Jan 24, 2020 · 2 min read

TLDR: I took a subset of 18.5K portraits from a dataset of the Kaggle competition, Painter by Numbers, and arranged them by style and gender. Then I used the Facer library from John W. Miller to build average faces based on these portrait groups, as well as a time-lapse of average faces from the portraits dating from the Middle Ages to the 20th century. Check out my society6 page for prints of these portraits.


I used metadata from the Painter by Numbers dataset, where the subset of portraits was less than 20%. The metadata is quite detailed and convenient, including authors, styles, titles, and years of creation. After filtering, I had about 18.5K paintings declared as portraits. However, my attempts to build average faces by artistic style without additional data cleaning produced strange sexless faces.

Therefore, I had to break these portraits down into categories: group, male, female, child, and other portraits. The “other” portraits were those where I wasn’t able to determine the character’s gender, e.g. some of the Cubist paintings. Note: This creates a bias towards more human-like faces, which is more significant for abstract types of art.

I used only male and female portraits, as there were too few of those of children. From my experience, I knew that Facer needed at least a dozen faces to produce stable results of acceptable quality, so I subdivided the portraits by style, then picked 24 styles that contained enough pictures of both genders to use for averaging. The results are available on a github project (as well as a table with gender labels).

Finally, I averaged portraits for every 50 years from 1500 AD to 2000 AD in 10 year increments, and compiled a time-lapse video. Due to the overlap of 40 years between every two adjacent frames, the video turned out to be quite smooth and nice:

Also, as an experiment, I uploaded some of these pictures to a society6 page, where prints, mugs, and clocks featuring these images are available.

Altsoph’s blog

Random notes on people and machines

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store