In the summer of 2015, Google unveiled a visualization tool named Deep Dream. It is an artificial neural network — a series of simple algorithms linked together, in an approximation of the neurons in a mammal’s brain. Programmers gave Deep Dream a curious task: not to analyze photos like other recognition software, but to over-interpret the images. Google engineers likened Deep Dream to the children’s game of spotting shapes in the clouds.

Where Google explored artificially intelligent reveries, MIT researchers are now wondering, just in time for Halloween, whether an algorithm could generate night terrors. The artificial intelligence is called the Nightmare Machine. And true to its name, it’s creepy.

Google, like its “don’t be evil” former motto, did not aim for horror show. Under Deep Dream’s influence, photographs of trees were reworked into church steeples. The network reinterpreted leaves as birds. Faces and almost everything else became rainbow dogs, as though Timothy Leary awoke from the dead and shambled into the Westminster show.

Because Google raised the program on a steady diet of animal photographs, the neural network was inclined to see canines, birds and walleyed fish where there were none. The patterns it produced were psychedelic and could be disturbing, though the cute critters curbed the eeriness of the computer’s hallucinations.

There are no multihued puppies to redeem the hellscapes produced by the Nightmare Machine. That’s because the algorithm was trained for one purpose — horror.

The Nightmare Machine goes to work on the Colosseum. (MIT Nightmare Machine. Original image via Flickr. CC 2.0 license.)

This new artificial intelligence infuses images with tendrils, as though inky veins or creeping roots had taken over the world’s landmarks. The Nightmare Machine blackens skies. Human faces warp and turn blood red. A shot of the second presidential debate is remixed into Trump and Clinton standing on a dais of skeletons.

The Nightmare Machine is one of the few, if not the first, “deep-learning” systems designed to evoke fear. The sinister features it produces are the result of what MIT Media Lab researcher Pinar Yanardag Delul called a “nightmarifying” process, she said in an email. Where Google primed Deep Dream to see animals, MIT’s training course for the Nighmare Machine was more ominous.

“We use state-of-the-art deep learning algorithms to learn what haunted houses, ghost towns or toxic cities look like,” Yanardag Delul said. The algorithm extracts elements — such as a bruised-black palette — from these scary templates and implants them in the landmarks.

The MIT scientists argued the Nightmare Machine represented more than an exercise in making bizarre photographs.

“Our research group’s main goal is to understand the barriers between human and machine cooperation,” MIT’s Iyad Rahwan said in an email. “Over the past two years, we’ve seen a rising number of intellectuals and luminaries raising alarms about the potential threat of superintelligent AI on humanity. Pioneer and inventor Elon Musk famously said that as we develop AI, we are ‘summoning the demon.’”

Even in the abstract, in other words, artificial intelligence can be scary. But Yanardag Delul and her colleagues, including Rahwan, wanted to know whether AI could creatively and purposefully unsettle humans.

“Scholars have long commented on the phenomenon of the uncanny valley, which describes how people feel a sense of eeriness and revulsion at robots that appear almost, but not exactly, like real human beings,” Yanardag Delul said. “But can AI elicit more powerful visceral reactions more akin to what we see in a horror movie?”

On the Nightmare Machine website, voters can rate images to teach the artificial intelligence to make faces even scarier. The MIT computer scientists recently analyzed the responses from 100,000 voters to discern which were the scariest.

As far as the Nightmare Machine’s early success, results appear to be mixed. “Initial tallies reveal that humans quickly converge on finding some of them very scary,” MIT research scientist Manuel Cebrian wrote to The Post, “and others not at all.”

You can decide for yourself. The top eight scary faces generated by the Nightmare Machine can be seen below. For those of us who admit that demonic facial expressions are unsettling — scroll down carefully.

Or, as Yanardag Delul said, “Trigger warning goes here.”

(Courtesy of MIT Nightmare Machine)

You can check out more of the AI’s creepy photos on the Nightmare Machine Instagram account.

Ben GuarinoBen Guarino is a reporter for The Washington Post’s Science section. Before joining The Post in 2016, he worked as a freelance science journalist, an associate editor at the Dodo and a medical reporter at the McMahon Group. He also has a background in bioengineering. Follow

Sign up for email updates from the "Confronting the Caliphate" series.

Content from Allstate This content is paid for by an advertiser and published by WP BrandStudio. The Washington Post newsroom was not involved in the creation of this content. Learn more about WP BrandStudio.