Samim Winiger

A person sees this soon-to-be pornographic gif as an attractive blonde addressing the camera as she’s about to pull a man’s shorts down. A computer sees it as a portrait of a late-20s female inclining her head, sitting indoors in a room with clothing and a painting. (Yes, there’s a painting in the background.)

Advertisement

Thanks to Google, we now know more about how machines pick out images of animals and buildings in photos. But we have a German coder to thank for showing us how machines interpret pornographic images:

Advertisement

Samim Winiger, who's also the CEO of gaming company 2Beats, sent a web crawler out on the Internet that collected over 1,000 or so porn images in order to feed them into image-classifying "neural networks." His goal was to show the public how machine vision interpreted them in hopes of getting people to better understand how artificial intelligence works.

"It's extremely important to have an informed public because if you have a black box magic mentality, you can compare it to the Middle Ages, where only a few were literate," he said. If only "an elite has knowledge and access to machine learning–that's a recipe for disaster."

In recent years, neural networks have helped AI researchers make huge improvements in tasks like computer vision, machine translation and speech recognition. Every time you verbally ask Google to help you find information on your Android phone, for instance, or do an image search, you're tapping into the search giant's powerful neural networks, a breed of software that's exceptional at learning patterns from huge amounts of data.

Advertisement

But for all the advances neural nets have enabled, scientists don't really understand how they work or why they're so good at categorizing images. For example, researchers have known for a while that if they wanted a neural net to learn to pick out, say, butts, they'd have to code up a low-level layer to detect the most basic parts of a human behind, the edges. The next layer up would start piecing those edges together into shapes and then, finally, into the object you want the software to detect. By doing that, machines can build up an understanding of how objects look. Think of it a bit like each layer is a turn on a camera's focus wheel. As you go from the lowest "setting," AKA layer, to the highest, what's in the image should become clear.

Now, scientists are beginning to develop tools that more fully highlight how these programs decipher images. And because these can show us what each layer "sees," we can "view" images through the eyes of machines and get a better sense of how the software works, or how it fails.

Let's take a look at how Winiger's neural nets experience porn, through a sampling of the different layers in the network. The multi-colored row is the lowest layer, which recognizes edges. The images going down correspond to layers higher up. The second row of images is the layer that starts to piece those edges into shapes and parts of objects. From there, those are "stitched" together into complete objects. You can see boobs and butts and all sorts of other NSFW body parts.

Advertisement

The next two rows correspond to the algorithm's attempt to classify, or label, the porn images, Winiger says. They're how the network is "visualizing" the images it's been shown. These correspond to the final, or answer-generating, layer of the network.

Advertisement

As you might have already gathered, these don't look much like anything. And that's because the algorithm doesn't know what the hell it's looking at. It hasn't seen a lot of porn during its lifetime. It's basically a porn virgin. But that too is useful information: that gives us a glimpse into its limitations.

In contrast, check out how much more clearly, a different network, from researchers at Caltech, Cornell and the University of Wyoming, can visualize things like flamingos, vehicles, and billiard tables:

From Yosinski et al. 2015

Advertisement

Neural networks can only identify things correctly if they've seen them many times before and they've been told what they are. If not, they can be pretty useless. I should note here that Winiger's porn dataset is quite small, much smaller than what Google or other AI companies would have at their disposal, meaning if you fed an algorithm more porn, it would learn the curves and contours of the naked male and female forms. Still, he makes a good general point.

"Novelty is still very much an issue," Winiger says.

As other researchers have noted, even though porn abounds on the web, good clit and dick detection is still really, um, hard–in part because no one's gone through and labeled dick and clit picks like they have cute pictures of cats or their latest pimped out car.

Advertisement

Some might say who cares?? After all, it's just porn. But "imagine the biggest model, which presumably is run by the NSA. If mislabeling happens on a human target, it's the same as these models making exactly this mistake. You  never read about it, but novelty in these systems can be challenging and tricky. I can just pray to all the machine-learning overlords that they don't auto fire but have human intervention planned."

Winiger's experiment is the DIY version of research that has been playing out at big tech companies, like Facebook and Google, in recent weeks, in attempts to better understand neural networks.

In case you missed it, this past month, artificial intelligence went hallucinogenic. First, Google published a blog post describing how one of their huge computer vision algorithms could create images, like pigs and birds suspended in the sky and multicolored cathedrals that looked like Gaudi-Chagal-Dali mashups. Those were the images that went viral. (Some called these things the AI versions of pareidolia, basically a phenomenon through which your brain tricks you into seeing things that aren't all there – like seeing the face of Jesus in a tortilla, for instance.) But the networks also "created" images of more normal things like dumbbells, ants and starfish. A few days later, Facebook turned around and published its own post about software that could also dream up images of its own.

Advertisement

The point wasn't just to unleash surrealist images on the world, but to use these as tools to uncover the hidden inner workings of these technologies, and how they make mistakes. By getting neural networks to generate images, the researchers could learn if their algorithms were learning the features that make a dumbbell a dumbbell and an ant an ant. If not, they could tweak their software accordingly.

For instance, Google's neural network "thinks" a dumbbell is part human arm. Wrong! Now, that Googlers know this is how the system "sees" a dumbbell, they can fix that misunderstanding:

Google's neural network

Advertisement

Winiger imagines a future in which AI won't just be able to tell us what's in human-generated images or text. AIs will be able to generate their own creative content, at the request of a user. Think of it as the AI-powered second coming of the on-demand economy. And it's already starting to happen, albeit slowly. Winiger has created bots that auto-generate Obama-like speeches and TED talks. Others have created Bible-verse Twitter bots and smart card games. Some companies even promise to write you whole narratives from scratch, using data as inspiration.

For now, most of these are toy experiments, but what happens in the future when a full-fledged, competent bot homebrews its own sex tape starring two virtual porn stars that look like celebrities or your next door neighbors? Or worse yet, child pornography? Who is liable? Is it the person who programmed the bot, the lewd person watching, or both? We've already started to grapple with these questions, thanks to drug-purchasing bots.

"These systems can learn new kinds of behaviors or new ways of doing things. They might learn something that the designer of the system could not predict. That opens up this question, 'Are we training machines that we might not understand?" Bart Selman, an AI expert at Cornell University, recently told me. "You train it for a certain goal, but the system might achieve that goal by doing things you might not want it to do. How can we prevent that?"

Advertisement

Researchers are still working on that. Understanding how machines see porn or fish in the sky is just a first step.

Daniela Hernandez is a senior writer at Fusion. She likes science, robots, pugs, and coffee.