Machine Learning is Fun Part 7: Abusing Generative Adversarial Networks to Make 8-bit Pixel Art

Adam Geitgey
Feb 12, 2017 · 12 min read
Picture from Alec Radford’s original DCGAN paper
All the art in this game level is machine-generated.

The goal of Generative Models

A dog. More specifically, my dog.
Yes, the robots are coming for everyone’s jobs. Eventually.
I mean.. sure, that’s a terrible idea for an AI start-up. But I’ve definitely heard worse start-up ideas, so…. maybe?

How DCGANs work

The Discriminator Network
The Generator Network
The Generator makes the first (terrible) fake dollar
The Discriminator thinks the dollar is real!
The Discriminator levels up! It now can spot very bad fake dollars.
The Generator makes a very slightly better counterfeit dollar

Applying this to Video Games

Sometimes they swap the colors around to make the different areas look different, but that’s it.

Getting Data

Just a few of the 10,000 screenshots that make up the data set

Setting up the DCGAN

The original Nintendo could only display these 64 colors. Technically there’s only 54 unique colors because some of them are duplicates.
The tiles I grabbed out of the generated screenshots
So spooooky
The Cheetahmen is not a good game.

Is that it?

A nightmare animal! Photo from Ian Goodfellow’s GAN Tutorial paper
It’s a bicycle! I swear!
Image from “Face Aging With Conditional Generative Adversarial Networks

Keep Learning


Adam Geitgey

Written by

Interested in computers and machine learning. Likes to write about it.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade