18 votes
Accepted

When should I use 3D convolutions?

3D convolutions are used when you want to extract features in 3 dimensions or establish a relationship between 3 dimensions. Essentially, it's the same as 2D convolutions, but the kernel movement is ...
ashenoy's user avatar
  • 1,409
6 votes

When should I use 3D convolutions?

3D convolutions should be used when you want to extract spatial features from your input on 3 dimensions. For computer vision, they are typically used on volumetric images, which are 3D. Some examples ...
Jerome's user avatar
  • 201
6 votes
Accepted

How to calculate the number of parameters of a convolutional layer?

What are the parameters in a convolutional layer? The (learnable) parameters of a convolutional layer are the elements of the kernels (or filters) and biases (if you decide to have them). There are ...
nbro's user avatar
  • 40.6k
4 votes

Is the stride applied both in the horizontal and vertical directions in convolutional neural networks?

Yes, in Keras you can apply different strides by giving a tuple/list, specifying the value of strides along the height and width. If you just give a single value the API assumes the same value for all ...
Saurav Maheshkar's user avatar
3 votes

What is the use of the regular convolutional layer in expansion path of U-Net?

The point is that in the expansive path you have two forms of information: the information from the contracting path, which includes all high-level features extracted from the original image. the ...
Djib2011's user avatar
  • 3,183
3 votes
Accepted

What gets optimized in convolutional neural network?

Do both the kernel values and weights in FCC get optimized? Yes. Some of the designs for image processing neural networks prior to CNNs had separate filter processing states. For instance, Sobel ...
Neil Slater's user avatar
  • 32.1k
3 votes

Are these visualisations the filters of the convolution layer or the convolved images with the filters?

Only the first convolutional layer, with filters that process the input [colour] channels directly, can be rendered directly as image patches in the same domain as the input. The left-most panel in ...
Neil Slater's user avatar
  • 32.1k
3 votes
Accepted

What is the need for so many filters in a CNN?

Then how do each filter differ by? Is it in hovering over the input matrix? Or is it in the values contained by filter itself? Or differs in both hovering and content? The filters (aka kernels) are ...
nbro's user avatar
  • 40.6k
3 votes

How to calculate the number of parameters of a convolutional layer?

For a standard convolution layer, the weight matrix will have a shape of (out_channels, in_channels, kernel_sizes). In addition, you will need a vector of shape <...
razvanc92's user avatar
  • 1,128
3 votes

Is the stride applied both in the horizontal and vertical directions in convolutional neural networks?

Yes, in Keras this is simply implemented by using a tuple for the stride argument of a convolutional layer, with each element of the tuple corresponding to the stride of each dimension.
Ryan Rudes's user avatar
3 votes
Accepted

How is the depth of the input related to the depth of the output of a convolutional layer?

The reason why you go from 16 to 3 channels is that, in a 2d convolution, filters span the entire depth of the input. Therefore, your filters would actually be $7 \times 7 \times 16$ in order to cover ...
cantordust's user avatar
3 votes

How to compute the derivative of the error with respect to the input of a convolutional layer when the stride is bigger than 1?

Backpropagation with stride > 1 involves dilation of the gradient tensor with stride-1 zeroes. I created a blog post that describes this in greater detail.
Mayank's user avatar
  • 131
2 votes
Accepted

If I wanted to calculate multiple feature maps in a convolutional layer, should the filters be trained individually?

Each feature map (or kernel) is independent of each other. If you had $3$ of these filters, your output shape would be $(28, 28, 3)$ (given the appropriate amount of padding and stride) with a total ...
mshlis's user avatar
  • 2,359
2 votes
Accepted

What is the intuition behind the number of filters/channels for each convolutional layer?

The channel sizes 32, 128, etc. are used because of memory and efficiency. There is nothing holy about these numbers. The intuition behind choosing the number of channels is as follows- The initial ...
cybershiptrooper's user avatar
2 votes
Accepted

Is "kernel" different from "filter" in convolutional neural networks?

The term "filter" is (usually) a synonym for "kernel" in the context of convolutional neural networks and image processing. The reason why the ...
nbro's user avatar
  • 40.6k
2 votes

How can equivariance to translation be a benefit of a CNN?

Equivariance is useful because the neural network can learn to detect common image components - edges, corners, curves in specific orientations - in a general way that is then applied across a whole ...
Neil Slater's user avatar
  • 32.1k
2 votes
Accepted

How is a filter actually applied to all input channels in a ConvLayer2D

If you have a conv layer that has 3 input channels and 32 output channels (i.e. the number of filters), then you essentially have $3 \times 32$ convolution operations connecting every input channel to ...
PeaBrane's user avatar
  • 356
1 vote
Accepted

Why do we add 1 in the formula to calculate the shape of the output of the convolution?

In a few words, we add $1$ to account for the initial position of the kernel. You can easily see this if you let $s = 1$ (unit stride) and $p = 0$ (i.e. no padding), so your formula simplifies to \...
nbro's user avatar
  • 40.6k
1 vote

Confusion about conversion of RGB image to grayscale image using a convolutional layer with 2-dimensional filters

Yes, the kernel is 3D in this case - or 4D as in 3x3x3x1. In the general case you can have multiple output channels, making it 3x3x3x8 for example. The number of channels isn't a convolution dimension ...
user253751's user avatar
1 vote

How do you pass the image from one convolutional layer to another in a CNN?

The application of 1 kernel (aka filter) to an input (with a 2d convolution) is a matrix (a 2d array), which is often known as a feature map (aka activation map). The application of $k$ kernels to the ...
nbro's user avatar
  • 40.6k
1 vote

What is the need for so many filters in a CNN?

All filters move across the same area, but the filter values (also called filter kernels) are different for each filter. This makes it possible to "filter out" different features.
Tom Dörr's user avatar
  • 483
1 vote

DQN not learning and step not stepping towards target

In my experience, neural networks with convolutional layers take much much longer to train, so try increasing the number of iterations (time steps). After running, save the network model (I dont know ...
Lucas Pelizzari's user avatar
1 vote

Do all filters of the same convolutional layer need to have the same dimensions and stride?

It seems that a similar question has been raised here: https://stackoverflow.com/questions/57438922/different-size-filters-in-the-same-layer-with-tensorflow-2-0 Like answered in the link above, you ...
Marco Prata's user avatar
1 vote

Can fully connected layers be used for feature detection?

First of all, (FC) Neural Networks (NN) are universal function approximators. This means, that, in theory, there must exist some NN of appropriate size that is capable of doing what a CNN can do as ...
Daniel B.'s user avatar
  • 815
1 vote

What is the point of using 1D and 2D convolutions with a kernel size of 1 and 1x1 respectively?

Traditional CNNs used for image classification (and related tasks) are composed of 1 or more fully connected layers (FCs), after the convolutional and pooling layers, which take as input the features ...
nbro's user avatar
  • 40.6k
1 vote

How to add a dense layer after a 2d convolutional layer in a convolutional autoencoder?

For me, this worked perfectly. I encoded with conv2d and dense and then I flatten I and reshape in the decoder after the dense layer so the encoder and decoder are symmetrical. The only difference is ...
Maciek Woźniak's user avatar
1 vote
Accepted

How is the depth of the filters of convolutional layers determined?

Does the next convolutional filter have a depth of 40? So, would the filter dimensions be 3x3x40? Yes. The depth of the next layer $l$ (which corresponds to the number of feature maps) will be 40. If ...
nbro's user avatar
  • 40.6k
1 vote
Accepted

How are the dimensions of the feature maps produced by the convolutional layer determined in VGG-16?

Both responses I got are correct but do not answer exactly what I was looking for. The answer to my question is : each filter is a 2D convolution. It is applied to every channel from previous node (...
lrosique's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible