# Does not using more filters in deeper CNN creates more images?

For example, we have applied 32 filters to a single image. Then it created 32 different images (stack of convolutional values).

And in the second layer, if we apply 64 filters, are all these filters going to be applied on all those 32 images? If so, then it will create 64*32 numbers of output or I am understanding wrong?

I have become confused because when I studied keras documentation, it says that using 64 filters it will create 64 outputs. If anybody enlights me on how the second or deeper layer works in CNN briefly it will be helpful for me.

No, your understanding is not correct.

Each of the 64 filters of the second layer will be applied to each of the 32 channels from the output of the first layer, resulting in 64 channels in the output of the second layer.

When the input of a convolutional layer has multiple channels, the convolution filter itself has the same number of channels. In your example, if we are using $$3\times3$$ filters, each filter in the second layer will be a tensor of dimensions $$3\times3\times32$$. Therefore, the filter "covers" the full depth of the input. Then, you simply perform the element-wise multiplication of the filter with the overlapping region in the input and add all the resulting elements together. Applying just 1 filter, we obtain a result with 1 channel.

This way, the number of channels of the output of a convolutional layer is the same as the number of filters in the convolution.