Simple Explanation for Calculating the Number of Parameters in Convolutional Neural Network

Total number of parameters, output shape in the Convolution layer

Indhumathy Chelliah
5 min readAug 17, 2021

--

Photo by Yan Krukov from Pexels

In this article, we will go through two important concepts in the convolution layer.

  1. How to calculate the number of parameters?
  2. How the shape of output is calculated?

First, let’s understand the important terms used in the convolution layer.

Important terms

1. input_shape

input_shape = (batch_size, height, width, depth)
batch_size= number of training examples in one forward/backward pass

2. output_shape

output_shape = (batch_size, height, width, depth)

3. filter

In a convolution neural network, input data is convolved over with a filter which is used to extract features. Filter/kernel is a matrix that will move over the image pixel data (input) and will perform a dot product with that particular region of that input data and the output will be the matrix of the dot product.

--

--