Introducing CNNs
In recent years, Deep Neural Networks (DNNs) have contributed a new impetus to research as well as industry and are therefore been used increasingly. A special type of a DNN is a Convolutional Neural Network (CNN), which has been used with great success in image classification problems.
Before diving into the implementation of an image classifier based on CNN, we'll introduce some basic concepts in image recognition, such as feature detection and convolution.
It's well known that a real image is associated with a grid composed of a high number of small squares, called pixels. The following figure represents a black and white image related to a 5x5 grid of pixels:

Black and white image
Each element of the grid corresponds to a pixel and, in the case of a black and white image, it assumes either a value of 1, which is associated with black color or the value 0, which is associated with white image. In a grayscale image, the values for each grid element are in the range [0-255...