ad
ad
Topview AI logo

I Trained an AI with 10,000 Memes

Science & Technology


Introduction

In today's digital culture, memes have evolved significantly from their beginnings as simple, shareable images on the Internet. From the early “dancing baby” and “hamster dance” to the complex irony presented in modern meme culture, they serve as a platform for social, cultural, and political expressions, often wrapped in humor. I decided to explore whether AI could replicate this humor by training a model with over 10,000 memes. Here's an overview of my journey: how I collected data, what I learned during the training process, and the challenges I faced along the way.

Understanding Memes

Before we dive into the technical details, it’s crucial to define what makes a meme funny. Early internet memes showcased the potential of user-generated content. As memes evolved, they incorporated elements of social commentary and humor that often reflects current events, irony, and exaggerated scenarios. A good meme is often a product of cultural relevance wrapped in humor.

Data Collection

The first step in this project involved gathering a substantial amount of meme data. I identified multiple websites that allow users to create and share memes, enabling me to collect both meme templates and users’ generated captions. This was crucial because having the templates in their blank form coupled with actual captions would help train the model to understand why certain memes are considered funny.

However, data collection was not without its challenges. Many websites employ JavaScript to navigate content, which required simulating a web browser to scrape the data. I utilized Bright Data's proxy services, a valuable tool that allowed me to handle all my scraping needs. After writing a script to gather memes successfully, I amassed a significant collection to work with.

Training the AI Model

I decided to use a multimodal large language model, specifically the Sphinx model, which is capable of using images as input. The training data consisted of memes with descriptions and captions, aimed at helping the model generate humorous output based on user input images.

During the training phase, I leveraged other AI models like the popular model from Hugging Face, which could analyze and explain the humor behind existing memes. However, despite significant effort, I started to notice that humor generated from the AI often fell flat. This made me question whether AI could ever truly understand humor, given that the human understanding of humor is complex and often inexplicable.

After extensive research into humor theory, I identified six types of humor: unexpectedness, exaggeration, absurdity, wordplay, juxtaposition, and incongruity. By implementing these elements into my AI's training, I aimed to provide a framework for humor generation. However, the challenges persisted, as much of the humor also relies on context, which the AI seemed unable to fully grasp.

Leveraging Modern Context

To enhance the relevance of my memes, I decided to incorporate current events. Using web scraping again, I pulled real-time news articles to create memes that resonate with modern audiences. By doing this, I was able to generate more relatable content, increasing the likelihood of amusing results.

Next, I wanted to implement a user-friendly interface. For that, I turned to Streamlit, which allowed for easy interaction with the model and streamlined the process of meme generation from user-submitted photos.

Conclusion

Through extensive effort, I produced an application that could generate memes based on user input, facilitated by the AI's understanding of humor derived from the training dataset. Though the results were sometimes lackluster, the project revealed the intricacies of humor and AI's limitations when trying to replicate it. Working on this project has not only been a significant learning experience but also an insightful endeavor into the nature of humor itself.

Keywords

meme, humor, AI, data collection, training model, juxtaposition, current events, Streamlit, web scraping

FAQ

Q: What was the purpose of training the AI with memes?
A: The purpose was to explore whether AI could replicate humor found in memes by training a model with over 10,000 meme examples.

Q: What challenges did you face during data collection?
A: Many websites used JavaScript for navigating and displaying content, requiring the simulation of a web browser for data scraping.

Q: How does the AI model determine what is funny?
A: The AI model is trained using both meme templates and their associated captions, which allows it to learn what elements contribute to humor.

Q: Can AI truly understand humor?
A: The project raised questions about whether AI can effectively understand humor, as human humor often lacks a clear explanation.

Q: How did you incorporate modern context into the memes?
A: By scraping current news articles, I aimed to provide my AI model with contemporary references that could resonate with users.

ad

Share

linkedin icon
twitter icon
facebook icon
email icon
ad