Standard fully connected networks fail when processing high-dimensional data like images because they ignore spatial relationships. Convolutional Neural Networks (CNNs) solve this by looking at local pixel blocks.
The core of a CNN is the Convolutional Layer. Instead of connecting every pixel to every neuron, a sliding matrix called a Kernel (or filter) traverses the image. As it slides, it performs dot products on local region matrices, highlighting spatial features like edges, textures, or shapes.
Pooling layers reduce the spatial size of representation matrices to cut down parameters and computational load. The most popular method is Max Pooling, which slides a filter across the output and selects the maximum value from each block, keeping only the most dominant features.
A 2×2 pooling window with stride 2 slides across the 4×4 input, selecting the maximum value in each region.
Calculate the output spatial size (O) for a convolution operation with the following settings:
Next, we will apply convolutional concepts in a project where we train a model on real images!