StyleGAN for Evil: Trypophobia and Clockwork Oranging
GANs have become the default image generation technique, and many are familiar with sites like artbreeder, thispersondoesnotexist, and its off-shoots such as thiswaifudoesnotexist. The generated samples are stunning and quite hard to distinguish from real images, and StyleGAN, in particular, has been used and finetuned by many with interesting results.
I’ve experimented with them before - for example, the projection of real images onto the StyleGAN latent space, and then modifying those is something I find quite interesting. In this project, however, I decided to go in a different direction and use them for evil.
All generated horrors in this post are hidden unless you click on them. You can read without looking if you so choose
Now, some of the more traditional ways of using Generative models for evil are for spam, deepfakes, fake news, and scams but we are going in a different direction here.
Trypophobia
Trypophobia is a common condition where people react with discomfort and even strong disgust towards specific irregular patterns of holes or bumps. For some the effect is quite strong, for others, it is just unpleasant, and some like me can see what the issue is but have almost no negative reaction.
It so happens that there is a small, but just big enough dataset on Kaggle to train a StyleGAN on.
Here are a few examples of how the dataset looks:
Example dataset 1 (click to expand)
Example dataset 2 (click to expand)
Example dataset 3 (click to expand)
Training
The training data is very varied - ~6000 images many of completely different objects that only share somewhat similar hole patterns. Inconsistent data works poorly with StyleGAN - what works best is things that are cropped in the same way, from the same angles and generally the same thing but with different features - e.g. faces, even doing full bodies often lead to blobs (less so with stylegan2). This is certainly something that should be a problem with our dataset, but on the bright side we don’t care if the rest of the image is blobby, we just want it to learn the specific patterns that trigger trypophobia, doesn’t matter if the rest of the image is abstract - in fact, it is better in some ways if it is abstract, as that can make the videos and images more appealing.
I took one of the pretrained StyleGANs nearly at random - churches and started finetuning on the dataset. The results even early on looked quite interesting. Here are some from the first hours:
Example training 1 (click to expand)
Example training 2 (click to expand)
Example training 3 (click to expand)
If you find the above fascinating, you can see much more at these links.
Here are some video versions.
Example vid 1 (click to expand)
Example vid 2 (click to expand)
Example vid 3 (click to expand)
Responses of the above vary - some are too disgusted too quickly, while others get just a bit of disgust from the worse of it while being intrigued overall, and some don’t get a negative reaction at all.
I should also note - videos like these might also be useful for good, as a form of Exposure Therapy but let’s not focus on that.
All of the above was trained on Colab using a p100. The final model was trained for roughly 4 days (I saw no improvement near the end), but there were good results within the first day of training.
Clockwork Oranging
After looking at the early examples of my trypophobia finetunning, I saw some churches that still very much look like churches while also having trypo features. For example these:
Church AND Trypo (click to expand)
This gave me the idea that you can fairly easily combine the two (or combine trypophobia and similar images with something else) to create videos which can make someone associate a concept - in this case a church - with negative feelings a la A Clockwork Orange. I chose to add churches to the mix because that’s what my pretrained model was already trained on, and I had the dataset (it was not a religious statement) .
The idea (in this scenario we are very evil) is to strap someone (with trypophobia) to a chair and force them to watch those videos which only require some flowing patterns, at least some churchiness and at least some trypophobia-triggering. Admittedly, those videos didn’t turn out quite so well - I had to experiment with training them with different ratios of trypo to church photos, but they (and the possibly better photos above) demonstrate the idea well enough.
Example vid 1 (click to expand)
Example vid 2 (click to expand)
Conclusion
This was a fun little project, that I spent a few days on. You would need to spend a bit more time to create something actually dangerous (which I doubt this really is) but not that much more. Of course, what I describe as clockwork oranging doesn’t look so useful in the real world but what if you could (and you can) use it to make some images just a bit more repulsive to the general population and others just a bit more appealing with little effort? That seems bad but then again a lot of advertising fits that mold despite it requiring more time per image/video. And at any rate - neither this nor ‘evil’ are near my main concerns with respect to machine learning. So even though I was thinking of finishing this with something about the dangers of AI, I’ll just let people make their own conclusions if there are any to make.