Number of Filters in Convolution 2D

Hi,
I am a bit confuse regarding the number of filters that we use in convolution layer. why we need multiple filter? in one of the examples, it used 64 filters in conv2D layer, and the output was 26x26x64 ( input was 28x28).
what are the added dimensions? I understand what a filter does, but why we need to do it 64 times ? how do we pick the number of filters? is it random ?would you please explain the process a little bit

Images input to the model has shape (batch_size, height, width, num_channels). For grayscale image, the last dimension is 1 since there is only 1 color channel. Each filter has shape (filter_heigth, filter_width, num_channels).

When you apply 64 filters, each of 64 filters is applied to an image separately to learn the more details about the image.

You get to code both forward and backward passes of a convolution layer as part of Deep learning specialization if you are interested in exploring further.

As far as the number filters go, increase the number of filters as you go deeper in the network. Usually, number of filters are powers of 2 starting with 8, unless you want to adjust only the number of channels in which case the filter has dimension 1x1.

1 Like