# ThisEmoteDoesNotExist: Training a GAN for Twitch Emotes

DevFeed: [ThisEmoteDoesNotExist: Training a GAN for Twitch Emotes](<https://devfeed.tech/articles/thisemotedoesnotexist-training-a-gan-for-twitch-emotes-20454.md>)

Original publisher: [Read original article](<https://medium.com/twitch-news/thisemotedoesnotexist-training-a-gan-for-twitch-emotes-a742b6354b73?source=rss----3ae745429979--engineering>)

Author: Avery Gnolek

Published: 2019-07-24T22:05:46Z

Content type: tutorial

Language: en

Sources: [Twitch](<https://devfeed.tech/sources/twitch.md>)

Topics: [Twitch](<https://devfeed.tech/topics/twitch.md>), [Deep learning](<https://devfeed.tech/topics/deep-learning.md>), [Keras](<https://devfeed.tech/topics/keras.md>), [datasets](<https://devfeed.tech/topics/datasets.md>), [Python](<https://devfeed.tech/topics/python.md>), [pixel](<https://devfeed.tech/topics/pixel.md>)

Tags: [dataset](<https://devfeed.tech/tags/dataset.md>), [deep-learning](<https://devfeed.tech/tags/deep-learning.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [keras](<https://devfeed.tech/tags/keras.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [neural-networks](<https://devfeed.tech/tags/neural-networks.md>), [python](<https://devfeed.tech/tags/python.md>), [training](<https://devfeed.tech/tags/training.md>), [twitch](<https://devfeed.tech/tags/twitch.md>)

## AI overview

A developer describes building a progressive-growing GAN for Twitch emotes as a personal machine-learning project. The article covers scraping roughly 2 million Twitch emote assets, implementing a proof-of-concept GAN with Keras, and training it on a random 200,000-image sample.

## Source excerpt

The idea for this project began when a coworker and I were talking about NVIDIA's photo-realistic generated human faces using StyleGAN and they mentioned "I wish someone made one of those for Twitch emotes." I had always wanted to take some time to learn more about convolution neural networks and was in the middle of a machine learning project for work, so it seemed like trying to build this would be a quick and relevant personal project. The original plan (with my time estimates): Scrape all of the Twitch emote image assets (1 day) Write a progressive growing GAN implementation using Keras as a proof of concept (1 week) Adapt the emote dataset for use with a real research-caliber GAN implementation (1-2 days) Train the GAN on the emote dataset (1 day) 1 . Scrape all of the emote image assets This part of the project was actually quite straightforward. Twitch stores all of the emote images on a CDN using a monotonically increasing numeric emote_id. Each emote is available in three different sizes (1.0, 2.0, 3.0) corresponding to the resolutions of 28x28, 56x56, and 112x112. emoticons/778927/1.0emoticons/778927/2.0emoticons/v1/778927/3.0 I wrote a quick python scraper which would go through ~2 million emote_ids of three different sizes and download the images locally. Even at a modest 200 requests per second, this was able to finish overnight. In fact, I think the limiting factor for the speed of this step was actually writing the image files to my HDD, not the network requests themselves. So far, I was right on track with my time estimate. 2. Write a progressive growing GAN implementation using Keras as a proof of concept As I had no experience with CNNs or deep learning before this project, I wanted to at least attempt to write a progressive growing GAN myself as a way to learn before switching to an existing implementation. As Twitch emotes are not even power of two sizes, it was not possible to exactly replicate the 4x4 pixel to 128x128 pixel growing architecture