Convolution Neural Network
CNN is the basis of computer vision and image processing.
There is cross-correlation operation between matrices but not convolution operation. For, convolution operation, the kernal should be 180 degree rotated.
The simple architecture division looks like:
Input Image -> Convolution Layer 1 (Cross-Correlation, Pooling, ReLU) -> Activation Map -> Flattened the Activation Map -> Dense Layer -> Output
Layers:
Convolution Layers
It can thought as “eyes” of a CNN. Input image (244 x 224 x 3), get computed using filters of same channel size (i.e. 3).
Once cross-correlation opetation is done to get single output (one pixel output), then it is send thorugh an activation funciton, and that output from the activation function is save in the activation map (224 x 224 x 1), since single filter was used so only one map.
Note that since 3 channel was there, so for each channel each filter (3 channel filter with different value than each other) does the operation and summed to get a single matrix, and of elements of those get pass to the activation function to get an activation map.
Some Terminalolgy:
1. Padding:
It is inclusion of outer pixels or not.
2. Stride:
It is the step the kernal takes while doing operation.
Convolution Output Spatial Size Calcualtion
Sobel Kernel is one of the kernel example that is used to detect vertical edges.
[1,0,-1 2,0,-2 1,0,-1]
At the last stage of the convolution layer, all the activation maps (channel say) are flattened and then connected to the dense layer.
3. Max Pooling Layers
Extract the max value from the kernal size matrix from the activation maps. Pooling can be max(), avg() etc.
Fully Connected Classifier Layer
Here, dense layer is present.