## Conv2D

# Conv2D

### Icon:

### Function:

The 2D convolution node performs convolution operation on 2 dimensional data.

### Parameters:

Filters: The number of output filters in the convolution

Kernels: The height and width of the 2D convolution window.

Activation: The activation function

#### Advance Settings:

##### Strides

The strides of the convolution along the height and width.

- Increase Strides to reduce the size of the output volume.
- The default value is (2,2)
- Strides of (2,2) is sometimes used as a replacement to max pooling

##### Paddings

Padding is used to preserve the size of the input volume.

For example, when you apply three 5 x 5 x 3 filters to a 32 x 32 x 3 input volume, the output volume would be 28 x 28 x 3. Notice that the spatial dimensions decrease. As we keep applying convolution layers, the size of the volume will drop faster than we would like. In the previous layers of our network, we want to preserve as much information about the original input volume so that we can extract those low-level features. Letâ€™s say we want to apply the same convolution layer, but we want the output volume to remain 32 x 32 x 3. To do this, we can use a zero padding of size 2 to that layer. Zero padding pads the input volume with zeros around the border. If we think about a zero padding of two, then this would result in a 36 x 36 x 3 input volume.

- Valid: the input volume is not zero-padded and the spatial dimensions are allowed to reduce via the natural application of convolution.
- Same: preserve the spatial dimensions of the volume such that the output volume size matches the input volume size. In order to achieve this, there is a one-pixel-width padding around the image, and the filter slides outside the image into this padding area.

https://www.pyimagesearch.com/2018/12/31/keras-conv2d-and-convolutional-layers/