04/16/2022
Background
Recently, I have been thinking about typography and machine learning. This semester, I’m designing my own font in a different class, which made me realize how time consuming the entire process is. Many type designers, agencies, and companies spend thousands of hours refining fonts. I can’t help but imagine what it would be like to have a tool that could generate letters based on criteria defined by the user. Because fonts are complicated, I also imagine this would be really difficult to accomplish. But if DALL-E can generate incredibly accurate images with text input only, then surely font generation isn’t out of the picture?
Anyways, type design is a cousin of logo design and wordmarks, an area that I feel is oversaturated with AI driven solutions that are all quite similar to each other. I know you’ve seen AI logo generators on the Internet before. I have come across so many logo generators. I don’t know the tech stack behind these generators, but I came across a paper in which Agustsson et al. (2017) constructed a dataset containing over 600,000 logos from the Internet and proposed methods of training GANs for logo synthesis. Vukobrat (2019) then used this same dataset to generate logo images with varying levels of success.
I thought these projects were pretty cool. I don’t have a lot of experience in machine learning so most of the stuff about discriminators, loss functions, and failure modes went over my head. However, a lot of the logos in the dataset looked visually and stylistically outdated, which affected the outputs.
Project I wanted to generate more modern looking logos. Because of my lack of skills and time, I decided to use Runway’s ML Lab. Inside Runway, the default generative image model is StyleGAN2, which is the second version of StyleGAN, a GAN introduced by NVIDIA researchers in December 2018. I collected a dataset containing 699 black and white logos and used StyleGAN2 to train a model based on this dataset. I ran two cases and ended up with different results.
Data collection I compiled 699 black and white logos. I found them on Are.na, it’s a platform that is kind of like Pinterest without ads. There are a lot of designers on it, so I was easily able to find logos in places that other people had curated already. I decided to only collect black and white logos because good logos are recognizable regardless of colour and I didn’t want colours to distract from the basic forms of the logos. Runway recommended a range of 500 to 5,000 images, so I thought that 699 would be sufficient for this project.
One roadblock that I did not expect to encounter was downloading the images. Are.na has an export function that allows users to download the contents of a collection, however, I found that I was only able to download 126 out of 699 using this method. So, I saved the remaining 573 images manually, which was slightly more time consuming. Next time, for larger amounts of data, I might need to write a script to parse webpages and download files.
Case 1
The first time I tried generating images in Runway, I was asked to start with a pre-trained model. There were four categories: faces, objects, scenes, and illustrations. I selected illustrations because I thought that was closest. The model was trained with 3,000 steps and no image cropping.
There were two qualities of the results that stood out to me the most. First, I noticed that many of the forms looked very organically shaped, compared to images from the original dataset, which typically had sharper and more defined lines. My guess is that this was carried over from the pre-trained model, which was mostly bird illustrations. The generated images look somewhat bird-like, right? It would be interesting to select a different category such as objects, or try something different from StyleGAN2 altogether.
Second, I saw that some of the generated images were completely black. I thought this might be because some of the images in my dataset were PNGs with transparent backgrounds. Before training, I wondered if this would affect the results, but proceeded anyways.
Case 2
In my second attempt, I continued with the previous model that was already trained with my logo dataset. However, I uploaded a new dataset where I converted all the PNGs to JPGs, which gave them a white background. There was no image cropping, and the experiment ran for 500 steps since I was running out of credits.
With these results, I solved the problem of the all black images, but a lot of the new images appeared very similar to each other. Maybe this is mode collapse?
Future
I actually prefer the output from Case 1. Although there were some unusable images, I found the results overall more unique and felt that some of the images had potential to become interesting logos. For this project, I used Runway’s ML Lab, but in the future, I would like to play with Google Colab. It seems like it would be more powerful and customizable. I should probably also look into other networks that are not StyleGAN2.
I’m considering working on a similar topic for my upcoming thesis project, but maybe with letters instead of logos. I like typography and machine learning, but I’m also interested in blockchain technologies. I was talking to Alexis about this and he suggested being able to mint fonts on a blockchain. This made me think about the potential of using blockchain to prevent font piracy. We will see what happens.
References AI logo makers (Are.na) BW logo dataset (Are.na) Case 1 results (Are.na) Case 2 results (Are.na) Agustsson, E. et al. (2017). Logo Synthesis and Manipulation with Clustered Generative Adversarial Networks. (arXiv) Vukobrat, N. (2019). GANs Logo Generator. (Github) StyleGAN2 (Github)