I am new to Data Science and CNN.

My understanding of CNN is that:

  • An image's pixel data is convoluted over with filters which extract features like edges and their position.

  • This creates filter maps.

  • Then we apply max pooling which will down sample the data.

  • Then we feed this data to a neural network which learns to classify.

Now I know I can do things with convolution like blurring or get edges from image.

But lets say I am trying to make a "Hotdog or not" app, how do I make my filters? What will the matrix be?


First of all, feature maps are the output of the convolution after an activation function (e.g. ReLU or sigmoid) is applied, not the matrix that the image is convolved with. Usually, this is called a filter.

The magical thing about CNNs is that we don't know what the filters should look like for any given problem. The CNN works out what each filter should look like automatically. This is done through the backpropagation procedure. Without getting heavy into the math of it all, essentially every time a training example (or a batch of examples) goes through the network, the values inside each filter get updated by some small amount. This small amount is determined using the derivatives of a loss function. As each step of the training procedure is completed, the values inside each filter (if all goes well!) slowly converge towards a value that minimises the loss function, thereby producing the best quality predictions.

For more information on the math, I encourage you to read the chapter on backprop in the free online book Neural Networks and Deep Learning, available here.

A more simple explanation is also provided here

  • $\begingroup$ thanks for your answer.. yes u r right those are filters not feature maps.. i have edited my question.. but if i understand correctly, the last stage NN will adjust its weights using backpropagation.. are you saying the backpropagation adjusts the first step's filter as well? $\endgroup$ – Lakshay Oct 8 '18 at 3:53
  • $\begingroup$ Yes, exactly. There are usually several filters and each filter has several values in the matrix. All of these values, as well as the NN weights, are called parameters and are all updated using backpropagation on the loss function. $\endgroup$ – timleathart Oct 8 '18 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.