0% found this document useful (0 votes)
51 views4 pages

CNN Numerical

The document outlines the architecture of a CNN network, detailing the output sizes and parameters for each layer, including two convolution layers, two pooling layers, a flatten layer, and two fully connected layers. It provides calculations for output sizes and the number of parameters at each step, resulting in a total of 183715 parameters for the first fully connected layer and 24 for the second. The final output sizes are 222x222x20, 111x111x20, 109x109x90, 54x54x90, 26244, and outputs of 7 and 3 for the fully connected layers.

Uploaded by

Kavya Jagtap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

CNN Numerical

The document outlines the architecture of a CNN network, detailing the output sizes and parameters for each layer, including two convolution layers, two pooling layers, a flatten layer, and two fully connected layers. It provides calculations for output sizes and the number of parameters at each step, resulting in a total of 183715 parameters for the first fully connected layer and 24 for the second. The final output sizes are 222x222x20, 111x111x20, 109x109x90, 54x54x90, 26244, and outputs of 7 and 3 for the fully connected layers.

Uploaded by

Kavya Jagtap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

For the given CNN network, the size of the output image and the number of parameters at

each step can be calculated as follows:

Convolution Layer 1:

• Input Size: 224x224x3

• Kernel Size (F): 3x3

• Number of Kernels (K): 20

• Stride (S): 1

• Padding (P): 0

Output Size Calculation:

Output Size = ((Input Size - Kernel Size + 2 * Padding) / Stride) + 1

• Height: ((224 - 3 + 2 * 0) / 1) + 1 = 222

• Width: ((224 - 3 + 2 * 0) / 1) + 1 = 222

• Depth: 20 (number of filters)

• Output Size: 222x222x20

Parameter Calculation:

Number of parameters = (Kernel Size * Number of input channels + 1) * Number of Kernels

• (3 * 3 * 3 + 1) * 20 = (27 + 1) * 20 = 560

• Number of parameters: 560


Pooling Layer 1:
• Input Size: 222x222x20

• Pool Size: 2x2

• Stride (S): 2

Output Size Calculation:

• Height: 222 / 2 = 111

• Width: 222 / 2 = 111

• Depth: 20

• Output Size: 111x111x20

Parameter Calculation: Pooling layers do not have learnable parameters, so the number of
parameters is 0.

Convolution Layer 2:

• Input Size: 111x111x20

• Kernel Size (F): 3x3

• Number of Kernels (K): 90

• Stride (S): 1

• Padding (P): 0

Output Size Calculation:

• Height: ((111 - 3 + 2 * 0) / 1) + 1 = 109

• Width: ((111 - 3 + 2 * 0) / 1) + 1 = 109

• Depth: 90

• Output Size: 109x109x90

Parameter Calculation:

• (3 * 3 * 20 + 1) * 90 = (180 + 1) * 90 = 16290

• Number of parameters: 16290


Pooling Layer 2:

• Input Size: 109x109x90

• Pool Size: 2x2

• Stride (S): 2

Output Size Calculation:

• Height: 109 / 2 = 54.5 which is 54 after floor function

• Width: 109 / 2 = 54.5 which is 54 after floor function

• Depth: 90

• Output Size: 54x54x90

Parameter Calculation: Pooling layers do not have learnable parameters, so the number of
parameters is 0.

Flatten Layer:
• Input Size: 54x54x90

• Output Size: 54 * 54 * 90 = 26244

• Output Size: 26244

Fully Connected Layer 1 (FC1):


• Input Size: 26244

• Output Size: 7

Parameter Calculation:

Number of parameters = (Input Size + 1) * Output Size

• (26244 + 1) * 7 = 183715

• Number of parameters: 183715

Fully Connected Layer 2 (FC2):


• Input Size: 7

• Output Size: 3

Parameter Calculation:
• (7 + 1) * 3 = 24

• Number of parameters: 24

You might also like