Q1. What’s the difference between ANN, CNN, and RNN?
ANN stands for Artificial Neural Networks which is the basis of deep learning, in ANN we have layers, neurons, activation functions, weights, and backpropagation. You should be familiar with all these terms, if not then read Neurons, Activation Functions, Back-Propagation, Epoch, Gradient Descent: What are these?
I usually find good candidates drawing during interviews to illustrate their ideas and confirm their knowledge. Drawing the below diagram will help you further explain ANN and how it learns.
CNN is a Convolution Neural Network its main application is computer vision and video analytics in general. CNN deals with the issue of how to enter an image in an ANN, how to capture the important features of an image and convert it into a format that can be fed in the neural network.
CNN takes an image and passes it through the below steps
1- Convolution
The image is converted into 0’s and 1’s then multiplied by a feature detector to produce a feature map. The main reason for this step is to reduce the size of the input image, some information might get lost but the main features of the image will get captured. Usually, the image is multiplied by multiple feature detectors to produce multiple feature maps. These feature maps go through a function, usually, ReLU, to ensure non-linearity in the image.
2- Pooling
There are several pooling operations but the most common is max pooling. It teaches the network spatial variance, in simple words the ability to recognize the image features even if the image is upside down, tilted, the image is taken from far or close, etc. The output of this operation is a pooled feature map.
3- Flattening
The purpose of this operation is to be able to input the pooled feature map into the neural network.
The below image shows the entire CNN operation.
As you can see the flattened output of the CNN has the image features and is in a format that can be input to the ANN.
RNN is Recurrent Neural Networks and it’s mainly used for time series problems like stock market forecasting. They are famous for LSTM (Long Short-Term Memory). Similar to ANN there are input and output layers along with multiple layers of neurons in between but the main difference is that RNN neurons have a sort of short-term memory. This short-term memory provides the neurons with the possibility to remember what was in this neuron previously. This is the reason RNN is good for time series problems and translation since the network will need to know the previous translated word in order to create a coherent sentence rather than just translate each word on its own.
This question is one of my all-time favorites because it shows a general overview understanding of the main concept of neural networks.