Meme Generator (MemeGen) Using Deep Learning

Original article was published on Deep Learning on Medium

Convolutional Neural Networks (CNN):

As the name suggests, CNN works quite similarly to how the neurons of human brain work. Have you ever paid keen attention to how our mind identifies people, objects, and bizarre things? It happens so swiftly that most of us never even give a second thought to it. When we see an image, we scan the image to understand the different features of the image. Our mind then combines the different local features that we scanned to classify the image. This is precisely how CNN also works. It takes an image, breaks it down into several equal parts, and analyses it, followed by overlapping the comprehended results of each such part.

CNN can be understood by clearly associating it with two crucial elements:

1. Convolutional Layer
2. Kernel K

The convolutional layer is the core building block of CNN, and it helps with feature detection. Kernel K is a set of learnable filters and is spatially small compared to the image but extends through the full depth of the input image.

Here is a very satisfying metaphor we found on the Internet about how CNN works:

If you were a detective and you come across a large image or a picture in the dark, how will you identify the image? You will use a flashlight and scan across the entire image. This is exactly what we do in the convolutional layer. Kernel K, which is a feature detector, is equivalent to the flashlight on the image I, and we are trying to detect features and create multiple features maps to help us identify or classify the image. We have multiple feature detectors to help with things like edge detection, identifying different shapes, bends, or different colors, etc.

CNN has several advantages over the conventional image classification methods, one of them being transational invariance which typically means that it identifies an object even if it is translated, rotated or slightly deformed.

This was just a brief on CNN. It seems simple, but in reality, involves a lot of mathematical calculations and understanding of neural networks. If you want to know more about CNN, click here.