Skip to content
Home » The CNN Workflow

The CNN Workflow

“What’s CNN workflow?” Alex asked. Peter replied, “If we have an input image represented as a tensor, like a 32×32 pixel image with 3 color channels (Red, Green, Blue) would have a shape of 32x32x3.”

Then, a convolutional layer applies a set of learnable filters (kernels) to the input image. Each filter slides over the image, performing a dot product with the underlying pixels to detect specific features, such as edges, curves, or textures.

“Yes, the result of this operation is a set of feature maps, and then?” asked Alex.

A spirit replied, “After the convolution, an activation function, commonly ReLU, is applied to the feature maps. ReLU converts all negative values to zero and keeps all positive values as they are.”

A pooling layer reduces the spatial dimensions of the feature maps, which helps to reduce the number of parameters and computational cost.

The CNN typically repeats the convolution, activation, and pooling process multiple times. Each subsequent layer learns more complex and abstract features by combining the features learned in the previous layers.

After the final pooling layer, the resulting multi-dimensional feature maps are converted into a single, long 1D vector. This step is called flattening and prepares the data for the fully connected layers that follow.

The flattened vector is fed into one or more fully connected layers. These layers learn to combine the high-level features learned by the convolutional part of the network to make a final prediction.

The final fully connected layer uses a softmax activation function to convert the raw output scores (logits) into a probability distribution. The class with the highest probability is the network’s final prediction.

🧬 CNN Workflow

  1. Input Image (e.g., 32×32×3 RGB)
  2. Convolution → Feature maps
  3. ReLU Activation
  4. Pooling → Smaller feature maps
  5. Repeat steps 2–4
  6. Flatten → 1D vector
  7. Fully Connected Layers
  8. Softmax Output → Class prediction

The most common type is max pooling, which selects the maximum value from a small region of the feature map. This process helps the model become more robust to variations in the position of features.

error: Content is protected !!