Reputation: 53
I have a question regarding interconnection between two convolutional layers in CNN. for example suppose I have architecture like this:
input: 28 x 28
conv1: 3 x 3 filter, no. of filters : 16
conv2: 3 x 3 filter, no. of filters : 32
after conv1 we get output as 16 x 28 x 28 assuming dimension of image is not reduced. So we have 16 feature maps. In the next layer each feature map is connected to next layer means if we consider each feature map(28 x 28) as a neuron then each neuron will be connected to all 32 filters means total (3 x 3 x 16) x 32 parameters. How these two layers are stacked or interconnected? In the case of Artificial Neural Network we have weights between two layers. Is there something like this in CNN also? How the output of one convolutional layer is fed to the next convolutional layer?
Upvotes: 2
Views: 1998
Reputation: 136379
The number of parameters of a convolutional layer with n
filters of size k×k
which comes after f
feature maps is
n ⋅ (f ⋅ k ⋅ k + 1)
where the +1
comes from the bias.
Hence each of the f
filters is not of shape k×k×1
but of shape k×k×f
.
How the output of one convolutional layer is fed to the next convolutional layer?
Just like the input is fed to the first convolutional layer. There is no difference (except the number of feature maps).
Image source: https://github.com/vdumoulin/conv_arithmetic
See also: another animation
It works the same:
Upvotes: 0