/  Deep Learning Interview questions and answers   /  What do you mean by filtering, stride and padding in Convolutional Neural Network?
Neural network 40 (i2tutorials)

What do you mean by filtering, stride and padding in Convolutional Neural Network?

Ans: Filter

A filter is represented by a vector of weights which we convolve the input. Every network layer act like a filter for the presence of specific features or patterns which are present in the original image. For detection of a filter it is inappropriate where exactly this specific feature or pattern is present in the original image. These filters are especially designed to detect whether the image contains or does not contain any such characteristics. This filter is shifted multiple times and applied at different image positions until the entire image has been covered in detail.

Neural network 39 (i2tutorials)

Strides

Stride is the number of pixels shifts over the entire input matrix. When the stride is 1 then we move the filters to 1 pixel at a time. When the stride is 2 then we move the filters to 2 pixels at a time and so on.

Neural network 40 (i2tutorials)

Padding

It’s an additional layer that we can add to the border of an image to get more accurate image information. Sometimes filter does not fit perfectly to the input image. Then we have two options:

Pad the picture with zeros which is also called as zero padding so that it fits to the image.

Neural network 41 (i2tutorials)

Drop the part of the image where the filter did not fit the image or picture. This is called as valid padding which keeps only valid part of the image and removes the other.

Leave a comment