Search⌘ K
AI Features

Exercise: Build Your Own CNN

Explore how to build a custom convolutional neural network by implementing the VGG-8 architecture with batch normalization. Learn to preprocess an input image and pass it through the model while extracting and visualizing feature maps at each ReLU activation. Understand how different layers detect features, from simple edges to complex objects.

Objective

  • Implement a simplified VGG-8 architecture with batch normalization.

  • Load and preprocess an input image.

  • Pass the input image through the CNN and collect intermediate feature maps.

  • Visualize the feature maps of each ReLU layer in the model.

Steps

  • After each Conv2d layer, add the following:

    • A batch normalization layer

    • A ReLU layer

    • A MaxPool2D layer with kernel size and stride = 2 ... ...