memeBot: Towards Automatic Image Meme Generation

Aadhavan Sadasivam, Kausic Gunasekar, Hasan Davulcu, Yezhou YangarXiv 2020

Introduction

Internet memes have become a primary mode of communication in the digital age, blending visual templates with culturally specific text to convey complex emotions and ideas. While AI has excelled at descriptive image captioning, generating contextually relevant memes remains a significant challenge. memeBot is an end-to-end neural framework designed to bridge this gap by treating meme generation as a translation task—converting a user's natural language input into a culturally resonant image meme.

High-level pipeline of memeBot, showing the transition from input sentence to a final captioned meme.

The Challenge of Automated Meme Generation

A meme is more than just a picture with text; it is a triad consisting of the Ideal (the underlying concept), the Behavior (the choice of template and linguistic style), and the Manifestation (the final visual output). Previous research has largely focused on caption selection or simple descriptions. memeBot addresses the "Ideal-to-Manifestation" problem: how to take a spontaneous user thought (e.g., a tweet) and automatically produce a meme that captures the intended sentiment using established visual shorthand.

Methodology: A Two-Stage Pipeline

The authors propose a modular architecture that separates template selection from caption generation.

1. Meme Template Selection Module

The first stage involves identifying the most appropriate visual format for the input text. The researchers fine-tuned several pre-trained language models—BERT, XLNet, and RoBERTa—to classify input sentences into one of 24 popular meme templates, such as "Success Kid" or "Distracted Boyfriend."

2. Meme Caption Generator

Once a template is selected, a specialized Transformer-based encoder-decoder generates the final text.

  • The Translation Approach: The system treats the user's input as the "source language" and the meme's caption as the "target language."
  • Information Abstraction via POS Tagging: To improve generalization, the model uses a Parts-of-Speech (POS) tagger to mask the input. By focusing on noun phrases and verbs, the model learns to extract core entities and actions rather than being limited by specific sentence structures.
  • Conditioned Decoding: The decoder is conditioned on both the input sentence and the specific meme template. This ensures the generated text adheres to the linguistic conventions of the chosen format (e.g., the "One Does Not Simply" template requires a specific setup).
Detailed architecture of memeBot, highlighting the POS masking process and the Transformer-based encoder-decoder conditioned on template embeddings.

Data Collection and Processing

The study introduced two significant datasets:

  • Meme Caption Dataset: A large-scale collection of 177,942 meme captions across 24 templates, scraped from imgflip.com. This is the first dataset of its size specifically for training meme-generation models.
  • Twitter Dataset: To evaluate real-world performance, 1,000 non-negative tweets related to the "Corona virus" were used as prompts for the bot.

Experimental Results

The system was evaluated using both automated metrics and human judgment.

  • Template Selection: RoBERTa-base achieved the highest accuracy at 69.31% in matching captions to their original templates.
  • Caption Quality: Using BLEU scores, the researchers found that including both noun phrases and verbs (SMT2MC-NP+V) yielded the best results, as verbs provide the necessary "action" context to match a meme's energy.
  • Human Evaluation: In a study using Amazon Mechanical Turk, over 60% of generated memes were rated as coherent and relevant. Furthermore, 65% of human raters reported "liking" the memes, indicating that the AI successfully captured the intended humor or sentiment.

Conclusion and Future Directions

memeBot demonstrates that memes can be modeled as a distinct dialect of natural language. While currently limited to 24 classic templates, the framework provides a foundation for more complex generation. Future work aims to incorporate Reinforcement Learning to optimize for "virality" or social engagement and to expand the system's vocabulary to include the rapidly evolving "dank meme" culture.

Summary updated

BibTeX
@misc{sadasivam2020memebot,
  author = {Aadhavan Sadasivam and Kausic Gunasekar and Hasan Davulcu and Yezhou Yang},
  title = {{memeBot: Towards Automatic Image Meme Generation}},
  year = {2020},
  eprint = {2004.14571},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.14571},
}
Figure