Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Dank Learning: Generating Memes Using Deep Neural Networks

Alt text Alt text Alt text Alt text


This is the code for the paper Dank Learning: Generating Memes Using Deep Neural Networks ( and for the associated iOS app Dank Learning (


We introduce a novel meme generation system, which given any image can produce a humorous and relevant caption. Furthermore, the system can be conditioned on not only an image but also a user-defined label relating to the meme template, giving a handle to the user on meme content. The system uses a pretrained Inception-v3 network to return an image embedding which is passed to an attention-based deep-layer LSTM model producing the caption - inspired by the widely recognised Show and Tell Model. We implement a modified beam search to encourage diversity in the captions. We evaluate the quality of our model using perplexity and human assessment on both the quality of memes generated and whether they can be differentiated from real ones. Our model produces original memes that cannot on the whole be differentiated from real ones.

Apple App available!

Try the meme generator out for yourself: see

Just here for the data?

The data we scraped using can be found in im2txt/memes (images) and im2txt/captions.txt (associated captions).


Clone the repo

git clone

Now cd in

cd Dank-Learning

Create a virtual environment and activate it

python -m virtualenv venv
source venv/bin/activate

Now install dependencies

pip install tensorflow Pillow jupyter

We've forked our own tf-coreml, which you can install in the virtual environment by doing the following:

cd tf-coreml/
pip install -e .
cd ..

Copy in the big files (word embedding matrix & trained DNN weights) from this Google Drive:

cp -r [path]/trainlogIncNEW im2txt/trainlogIncNew

Now you should be all set up.


Get Jupyter notebooks fired up

jupyter notebook

Navigate in the browser that launched to im2txt/Meme_Maker.ipynb and follow the steps in the notebook to generate your own memes! Also see im2txt/model_conversion_debug.ipynb for how we converted the model to tf-coreml for use on iOS.


Dank Learning codebase, generate a meme from any image using AI. Uses a modified version of the Show and Tell image captioning network







No releases published


No packages published