TL;DR
MemeTector introduces an automated framework to accurately distinguish image memes from regular images using a Vision Transformer augmented with a multi-layer trainable attention mechanism (ViTa). To train the model without tedious manual annotation, the authors propose Visual Part Utilization (VPU), a method that automatically crops text-free backgrounds from existing memes to serve as negative training examples. This approach forces the model to focus on subtle visual cues like font morphology and text placement, achieving state-of-the-art performance and robustness.
What Problem Does This Paper Address?
Image memes (specifically image macros) are a dominant form of social media communication, often used to express humor, irony, or even spread hate speech and disinformation. While humans can instantly tell a meme apart from a regular photo, machine learning models struggle. This difficulty arises because the background of a meme is structurally identical to a regular image, causing standard neural networks to generate nearly identical feature maps for both.
Most existing research focuses on downstream tasks, such as classifying whether a meme is offensive, assuming the input is already known to be a meme. The fundamental upstream task—binary meme detection (separating memes from regular images)—remains highly understudied due to a lack of large, publicly available datasets. MemeTector addresses this gap by providing both a robust detection architecture and an automated data-generation strategy.
Methods
The authors introduce two core contributions:
- Visual Part Utilization (VPU): To teach the model what makes a meme unique, the authors create a challenging set of "regular images" by extracting the text-free backgrounds of actual memes. They use a state-of-the-art text detection model (TextFuseNet) to locate text bounding boxes within a meme, and then apply an optimization algorithm to isolate and crop the largest possible text-free rectangular region.
- ViTa (Vision Transformer with Trainable Attention): Standard Vision Transformers (ViTs) rely on a class token that only interacts with patch embeddings within the same layer. ViTa introduces a supplemental attention module that computes compatibility scores between the final class token and the patch embeddings of past odd-numbered layers. This allows the network to leverage multi-granularity semantic information across different processing stages.
The resulting multi-layer context vectors are concatenated and fed into a three-layer dense classification module to output a binary prediction.
Datasets
To evaluate MemeTector, the authors compiled a dataset of 40,000 images (20 times larger than previous unreleased datasets):
- Image Meme Class ($M$): 9,984 memes curated from Facebook’s Hateful Memes Dataset.
- Visual Part Class ($V$): 9,984 text-free background images extracted via the VPU process from the meme class.
- Web-Scraped Regular Images ($R_p$ and $R_a$): 9,984 images with text presence ($R_p$) and 9,984 images with text absence ($R_a$), sampled from Google’s Conceptual Captions dataset.
Key Insights and Ideas
- Exploiting Background Ambiguity: By feeding the model a meme's own cropped background as a negative example, the network is forced to ignore the background context and focus entirely on the addition of text and its specific stylistic features.
- Font Morphology over Text Content: Meme detection is fundamentally a visual task, not a textual one. Attention maps reveal that MemeTector focuses on isolated, seemingly random parts of words rather than reading entire sentences. This indicates the model relies on font size, color, stroke style, and positioning to make its decision, mimicking how humans scan images.
- The Necessity of Text-Heavy Negatives: The authors discovered that the most robust model configuration requires training on a mix of VPU-cropped backgrounds and web-scraped images that already contain text. This prevents the model from taking a shortcut and simply classifying any image with text as a meme.
Key Results
- Baseline Comparison: MemeTector achieved an average binary accuracy of 94.98% across 169 crossed training/testing scenarios, outperforming standard architectures including VGG16 (91.36%), ResNet50 (92.31%), EfficientNetB5 (90.05%), and standard ViT (94.17%).
- Scenario Dominance: The proposed architecture outperformed the standard ViT baseline in 87.57% of all evaluated dataset mix scenarios.
- Real-World Validation: When deployed on an uncontrolled, noisy dataset of 3,199 unique images scraped from Twitter, MemeTector maintained a solid 73% accuracy (TP=877, FP=396, TN=1,454, FN=465), proving its viability for live social media monitoring.
Limitations and Future Work
- Domain Shift in Meme Formats: The model's real-world accuracy drops when encountering meme formats missing from its training set, such as text overlaid directly over complex objects or unconventional, non-standard fonts.
- Sparse Text Vulnerability: Memes containing minimal text (e.g., just a couple of numbers) are frequently misclassified as regular images.
- Color Space Constraints: The current pipeline is strictly optimized for RGB images; grayscale images are automatically discarded during preprocessing.
- Future Work: The authors suggest expanding the framework to capture platform-specific meme vernaculars, multi-modal variations (like tweet screenshots), and developing stronger invariance to diverse font styles.
Summary updated