- AI, But Simple
- Posts
- Convolutional Neural Networks, Simplified
Convolutional Neural Networks, Simplified
AI, But Simple Issue #4
Quick note: For this week’s issue, it would be helpful to have some knowledge about neural networks.
So If you don’t understand the general idea of how neural networks work, feel free to check out a previous issue, where we discussed the inner workings of a neural network:
You can find it here
Convolutional Neural Networks, Simplified
AI, But Simple Issue #4
A Convolutional Neural Network (CNN) is a type of neural network that specializes in processing data that has a grid-like shape, such as an image.
CNNs are one of the main types of neural networks that are commonly studied in the world today.
Other types include RNN, LSTM, GAN, Transformers, etc.
CNN’s are widely used (sort of an industry standard): anything from facial recognition to medical imaging can be tackled using this network.
CNN to classify cats and dogs
They are based on convolutions, a mathematical concept that "blends" one function with another.
If you have the time, feel free to check out this great resource on convolutions
The role of CNNs is to reduce the images into a form that is easier to process, without losing features that are needed for a good prediction.
This is what convolutions are used for: to reduce the size of input by “blending” the image pixels
This is important when we are designing an architecture that is not only good at learning features but also scalable to large datasets.
The unique thing about CNN’s are that they have specialized layers that help it adaptively learn features effectively from input images.
These layers include convolutional layers, pooling layers, and fully connected layers.
The layers are arranged in such a way such that they detect simpler patterns first (like lines, curves, etc.) and more complex patterns (like faces, objects, etc.) further along.
It’s interesting because CNNs are modeled after the visual cortex of the brain, as they process visual information in a hierarchical manner (similar to the brain)
In the visual cortex, neurons have receptive fields that respond to specific parts of the visual field. Similarly, in CNNs, filters (or kernels) scan through the image and respond to specific patterns or features.
Let’s talk about the specialized layers in a CNN:
Convolutional Layer
Convolutional layers are usually paired with ReLU
The convolutional layer is the core of the CNN. It carries the main portion of the network’s computational load.
The main role of this layer is to reduce the input size of the image and learn the most important features of the image.
This layer uses a special type of matrix, called a kernel, to help with this task.
A kernel is a small matrix of learnable parameters (weights). During training, the values in the kernel are adjusted to help the network learn the most useful features for the given task.