How do CNNs work?
Before we can go deep into the structure of CNNs, we need to understand a couple of points. I will introduce you to the first point with a question: how many dimensions does a colored RGB image have?
The answer may surprise you: it's 3!
Why? Because every RGB image is, in fact, represented by three 2D images, each one corresponding to a color in RGB architecture. So, there is one image corresponding to red, one corresponding to green, and one to blue. Grayscale images are only 2D, because they are represented by only one scale as there are no colors. The following diagram should make it clearer:
Figure 3: RGB versus black and white images
As you can see, a colored image is represented by a 3D array. Each color has its own layer in the picture, and this layer is called a channel. A grayscale (black and white) image only has one channel and is, therefore, a 2D array.
As you probably know, images are made out of pixels. Each of these...