Convolutional Neural Networks (CNN) - Translational-Equivariant CNN

CNN - Intuition

CNN - Steps

  1. Input Image Preprocessing (optional)
  2. multiple rounds of:
    1. Convolutional Layer (kernel/filter) - which outputs Feature Maps
    2. Non-Linear Activation Function (e.g. ReLU)
    3. Subsampling Layer (e.g. MaxPooling Layer)
  3. Fully Connected Layer
  4. Softmax Layer (for classification)
Applying Non-Linear Activation after Convolution

Typical CNN architecture

NOT SHOWN but non-linear activation functions applied between convolutions and subsampling

𝑑 is the number of convolutions/filters/kernels, which will produce 𝑑 separate feature maps

After Training - Representation Learning of Convolutional Layers

CNN - Tensorflow Code Example

import tensorflow as tf
 
def generate_model():
   model = tf.keras.Sequential([
      # first convolutional layer
      tf.keras.layers.Conv2D(32, filter_size=3, activation='relu'), # 32 different feature maps
      tf.keras.layers.MaxPool2D(pool_size=2, strides=2),
 
      # second convolutional layer
      tf.keras.layers.Conv2D(64, filter_size=3, activation='relu'), # 64 different feature maps
      tf.keras.layers.MaxPool2D(pool_size=2, strides=2),
 
      # fully connect classifier
      tf.keras.layers.Flatten(),
      tf.keras.layers.Dense(1024, activation='relu'), # 1024 nuerons
      tf.keras.layers.Dense(10, activation='softmax') # 10 outputs
   ])
   return model

Subpages

Resources