The primary reason for building Nightmare Machine was to explore the common fear inspired by intelligent computers, said researchers including Pinar Yanardag from Massachusetts Institute of Technology (MIT) Media Lab.
They wanted to confront the anxiety inspired by AI, and simultaneously test if a computer is capable of understanding and visualising what makes people afraid.
The designers used "deep learning" - a system that mimics the neural connections in a human brain - to teach a computer what makes for a frightening visual, according to Manuel Cebrian, a principal research scientist at CSIRO in Australia.
"Even though there is a lot of room for improvement, some of the faces already look remarkably creepy!" he said.
More From This Section
"We wanted to playfully explore whether and how AI can indeed become a demon, that can learn how to scare us, both by extracting features from scary images and subsequent refinement using crowd feedback," Iyad Rahwan, an associate professor at MIT Media Lab, told 'Live Science'.
Once deep-learning algorithms understood the visual elements that were commonly perceived as spooky, they applied those styles to images of buildings and human faces - with chilling results.