An AI That Makes RAGE COMICS
Introduction
Like many of my projects, I actually have no idea how this project came into my mind. It was more of an intrusive thought if anything. Anyways, for this project, I attempted to create an AI that would be able to create comic strips using sentiment analysis! This was the first time I really tried using sentiment analysis and I was pretty satisfied with the way this project turned out! I also want to state that I made a video on YouTube in which I showcase this project! Feel free to check out the video if that's more your type of medium!
What is a "Rage Comic"
A "Rage Comic" is essentially a web comic that gets its appeal from being crudely created and having a sort of low quality feel to them. With this description, it's hard to understand why these would get popular in the first place. To be honest, the poorly drawn images were part of the charm. It was really easy for people to create their own comics and tell their own stories without having to worry about learning how to draw or properly create comic strips. One could literally open any image editor, copy and paste some images haphazardly, and people would like them! For a brief moment, there was an even an app that one could download to make these rage comics. From there, people could directly upload their new comics to Reddit, iFunny, or just share them with friends. It was a time where we weren't taking the internet too seriously and were just trying to have fun!
Creating The Layout
This was a project that I had in the back of the mind for a while but I never really knew how to go about it. Rage Comics come in all sorts of shapes but I felt like the easiest way to go about it was by following a 2x2 comic format. I felt like this was pretty straightforward and would allow us to create content in an organized fashion. So for our first step, we can create a blank canvas and split it up into four quadrants.
Creating the Text
This part is actually a bit anticlimactic. I essentially used ChatGPT to provide the text for me. I simply asked if to give me text that it might find in a rage comic from 2007. I did a little bit of engineering so that it could present the text in a way that would make it easy to copy and paste into Python. I know there are ways to connect ChatGPT directly to Python using their API and tokens but at this point of this project, I wasn't sure if this was something worth finishing or not. So I decided to keep it simple for now.
I say this but I have to admit that this isn't the first time I attempted this project. The last time I tried doing this project was before ChatGPT was a thing. At the time, trying to automatically generate text was a huge hurdle that I never got through. The way I was originally going about it was by visiting the subreddit dedicated to Rage Comics and downloading the top 200 images or so. From there, I wrote some code to try to scrape the text that was on the images and then try to store it in a local database. This worked very poorly for multiple reasons. First of all, as I mentioned before, Rage Comics can come in all shapes and sizes. For this projcet we're following a 2x2 format but there are people that have created comics in wildly different formats such as 3x2, 2x3, 2x6, 6x2, etc. This meant that I would first have to try to see how many panels were in the comic and then try to categorize it that way.
The next issue came from the fact that because these comics are poorly drawn by design, there were many instances in which the text that my code picked up did not match what the text in the comic said. It was a mess. It was at this point that I knew that I didn't have the capacity to attempt this project. I tried a Hail Mary approach and tried creating text based on the little text that I was able to scrape but it was completely incoherent. I gave up in the moment but I knew that I would be back in the future.
Anyways, back to the present day. We have technology and I asked ChatGPT to give me four lines of text that would be found in a rage comic. I then placed the text that it gave me into its respective quadrant. I tried to pick a font and size that looked most fitting.
Getting the Faces
This part of the project was the main reason for why I wanted to attempt it in the first place. Something that I didn't mention before was the fact that one of the ongoing bits with Rage Comics is the reusual of certain "faces". These faces have become a part of meme culture and can be found in almost every rage comic that has been created. These faces include the classic Troll Face that used to be prevelant back in the day! It would not be a complete comic without these faces and I knew that this was something that I had to include in my project somehow. With that being said, I decided to use sentiment analysis.
Sentiment Analysis and Rage Faces
There are a ton of rage faces that reappear across Rage Comics. For this portion, I decided it would be most convenient if I picked a few and associated those with common emotions. The way I went about this was by first going to Kaggle and finding a dataset that was made for sentiment analysis and had multiple emotions labeled. I ended up using a dataset by Praveen which can be accessed by clicking the following link:
This dataset comes with six different emotions. I went online and found six common rage faces that I felt fit the emotions in an appropriate way.
Anger Face | Fear Face
Joy Face | Love Face
Sad Face | Surprise Face
With the faces in place, we could now train our model on the dataset that we downloaded from Kaggle. Once the model was trained, I was finally able to put the text that was given to us by ChatGPT through the model and try to see what emotions we get back. For the first trial, I simply ran the text from the first panel, "Le Me Browsing the Internet"
This image gives us a results. The numbers represent different probabilities. These probabilities let us know how confident that AI is that the text falls within a certain category. We simply look at which category has the highest value and that is the classification we are going to go with. As we can see, the text we submitted seems to resonate the most with "Joy" at about 0.4816... or 48.16%. Since this appears to be a joyous comment, what we can do is place the "Joy Face" that we linked earlier on the quadrant in which the text appears.
We can then run the remaining three lines of text through the model and repeat the process.
Adding Poorly Drawn Objects
One of the more charming and unique characteristics of Rage Comics are the crudely made drawings that people make. They aren't meant to be realistic or stylized... or good, and that's why we love them. However, this is one of those taks that is easier for a human to do than a computer. For example, if I wanted a picture of a cat, it would be much easier for me to doodle a quick sketch as opposed to trying to create some sort of AI that can do it for me. It took me a while to figure out how I wanted to about it, but then I was able to Google the answer.
Google Quick, Draw!
Google has a game entitled Quick, Draw! The way this game works is simple. You have are given a word that you are going to draw on your device. The catch is, you only have 20 seconds to draw. The objective of this game is to see if the Google AI can accurately guess what it is your drawing, based on your sketches.
This is amazing for us because this whole application was built with the specific purpose of trying to train an AI to be able to classify poorly drawn images. The best part about this? The API is public, and I was able to access it! It even lets you look at a video of the drawing being made! This means that I now had literally millions of poorly drawn images that were already labeled! What I could now do was write some code to analyze the text that ChatGPT created and if the Quick, Draw (QD) API detected any of the subjects, we could pull a random drawing and place it on the comic.
Raccoon Drawing and Mona Lisa Drawing
Unforuntately, there are only a certain amount of items that the AI was trained on. This means that the probability that the ChatGPT text has a subject that can be found within the QD dataset was really small. The way I fixed this was by simply going to the prompt that I had created to get the text and fed it the list of possible drawing categories. I told ChatGPT to try to include as many objects from the list as possible when creating text.
With the newly curated text, we could go back to the plan I had previoously mentioned. What I could now do was analyze the text and if we see a match with one of the words from the text and one of the categories from the QD API, we could then place a drawing onto the panel in which the object was referenced. I went ahead and placed them in a random location so that it didn't look super formulaic.
Finishing Up
To finally finish this project, I went ahead and added some bodies to the faces so that they weren't floating. I tried to add a bit of randomness to the lines so that it looked like they were hand drawn. Overall, this project was pretty fun and a great way to spend a day. I feel like there are a ton of improvements that could definitely be made but honestly, this project felt like one big ongoing joke and I wasn't sure I was actually going to finish it. I'm glad I did and I feel Like I learned a lot! I learned more about accessing and navigating API's as well as more about Natural Language Processing -- specifically Sentiment Analysis.
If you haven't already, I would appreciate it if you watched the video associated with this project! I linked it at the top of this post! With that being said, I leave you with some of my favorite memes that were created!