When** dealing with image’s and image data, CNN are the go-to architectures. Convolutional neural networks have proved to provide many state-of-the-art solutions in deep learning and computer vision. Image recognition, object detection, self-driving cars would not be possible without CNN.

But when it comes down to how CNN see’s and recognize the image the way they do, things can be trickier.

  • How a CNN decides whether a image is a cat or dog ?
  • What makes a CNN more powerful than other models when it comes to image classification problems ?
  • How and what do they see in an image ?

These were some of the questions i had back back when i first learned about CNN. The questions will grow as you deep dive into it.

Back then i heard about these terms filters and featuremaps, but dont know what they are and what they do. Later i know what they are but dont know what they look like but now, i know. When dealing with **Deep Convolutional Networks **filters and featuremaps are important. Filters are what makes the Featuremaps and that’s what the model see’s.

What are Filters and FeatureMaps in CNN?

Filters** are set of weights which are learned using the backpropagation algorithm. If you do alot of practical deep learning coding, you may know them as kernels. Filter size can be of 3×3 or maybe 5×5 or maybe even 7×7.

Filters in a CNN layer learn to detect abstract concepts like boundary of a face, edges of a buildings etc. By stacking more and more CNN layers on top of each other, we can get more abstract and in-depth information from a CNN.

Image for post

Image for post

7×7 and 3×3 filters

F

**eature Maps **are the results we get after applying the filter through the pixel value of the image.This is what the model see’s in a image and the process is called convolution operation. The reason for visualising the feature maps is to gain deeper understandings about CNN.

Image for post

Feature map

Selecting the model

We will use the ResNet-50 neural network model for visualizing filters and feature maps. Using a ResNet-50 model for visualizing filters and feature maps is not ideal. The reason is that the resnet models in general, are a bit complex. Traversing through the inner convolutional layers can become quite difficult. You will learn how to access the inner convolutional layers of a difficult architecture. In the future, you will feel much more comfortable working with similar or more complex architectures.

The image i used is a photo from pexels. Its a image i collected to train my face-detection classifier.

#deep-learning #convolutional-network #python3 #pytorch #visualization #deep learning

Visualizing Filters and Feature Maps in Convolutional Neural Networks
21.90 GEEK