Answers.Body: <p>Both responses I got are correct but do not answer exactly what I was looking for.</p>
  
  <p>The answer to my question is : each filter is a 2D convolution. It is applied to every channel from previous node (so we get N 2D matrices). Then all of these matrices are added up to make a final matrix (1 matrix for 1 filter). Finally, the output is all filters' matrices in parallel (like channels).</p>
  
  <p>The hard part was to find the "sum up", since many websites speak of it as a 3D convolution (which is not !).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-08T12:15:37.960Z
Answers.LastActivityDate: 2019-01-08T12:15:37.960Z
Answers.UserDisplayName: lrosique
Answers.Body: <p>The 64 here is the number of filters that are used.
  The picture is kind of misleading in that it leaves out the transition of the maxpool.
  <a href="https://i.sstatic.net/jFKgV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jFKgV.png" alt="enter image description here"></a></p>
  
  <p>Below is a text description of the size of the features as they go through the network with the number of filters in bold.</p>
  
  <ol>
  <li>The first 2 layers in the diagram you posted contain <strong>64</strong> 3x3 convs
  resulting in a 224x224x64 matrix of features. </li>
  <li>This is then fed into a maxpool which reduces the size to a 112x112x64 matrix. </li>
  <li>This is then fed to 3 layers of <strong>128</strong> 3x3 convs resulting in a 112x112x128
  matrix. </li>
  <li>Then another maxpool giving a 56x56x128 matrix.</li>
  <li>Feeding that to 3 layers of <strong>256</strong> 3x3 convs results in a 56x56x256 matrix.</li>
  <li>This is then fed into another maxpool giving a 28x28x256 matrix,</li>
  <li>Which is then fed into 3 layers of <strong>512</strong> 3x3 convs resulting in a
  28x28x512 matrix.</li>
  <li>Another maxpool gives a 14x14x512 matrix which is fed to 3 layers of <strong>512</strong> 3x3 convs giving a matrix of 14x14x512 features.</li>
  <li>Another maxpool reduces this to a 7x7x512 which is then
  given to 3 fully connected layers of <strong>4096</strong> units each before being
  sent to a softmax.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-07T16:34:52.463Z
Answers.LastActivityDate: 2019-01-07T16:34:52.463Z
Answers.UserDisplayName: Jaden Travnik
Answers.Body: <p>For learning image features with CNNs, we use 2D Convolutions. Here 2D does not refer to the input of the operation, but the output.</p>
  
  <p>Consider you have an input tensor of size 224 x 224 x 3. Say for example you have 64 different convolution kernels. Theses <strong>kernels are also 3 dimensional</strong>. Each kernel will produce a 2D matrix as output. Since you have 64 different kernels/filters, you will have 64 different 2D matrices. In other words, you got a tensor with depth 64 as output.</p>
  
  <p><a href="https://i.sstatic.net/FjvuN.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FjvuN.gif" alt="enter image description here"></a></p>
  
  <p>I would suggest you to go through this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/42883547/intuitive-understanding-of-1d-2d-and-3d-convolutions-in-convolutional-neural-n">Understanding 1D, 2D and 3D convolutions</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-07T16:45:31.357Z
Answers.LastActivityDate: 2019-01-07T16:45:31.357Z
Answers.UserDisplayName: Sooryakiran Pallikulathil
Body: <p>I'm trying to understand how the dimensions of the feature maps produced by the convolution are determined in a ConvNet.</p>
  <p>Let's take, for instance, the VGG-16 architecture. How do I get from 224x224x3 to 112x112x64? (The 112 is understandable, it's the last part I don't get)</p>
  <p>I thought the CNN was to apply filters/convolutions to layers (for instance, 10 different filters to channel red, 10 to green: are they the same filters between channels ?), but, obviously, 64 is not divisible by 3.</p>
  <p>And then, how do we get from 64 to 128? Do we apply new filters to the outputs of the previous filters? (in this case, we only have 2 filters applied to previous outputs) Or is it something different?</p>
  <p><a href="https://i.sstatic.net/AJo0w.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AJo0w.png" alt="vgg 16 archictecutre" /></a></p>
  
Tags: <deep-learning><convolutional-neural-networks><convolutional-layers><vgg>
Title: How are the dimensions of the feature maps produced by the convolutional layer determined in VGG-16?
UserDisplayName: lrosique
ThreadText: # How are the dimensions of the feature maps produced by the convolutional layer determined in VGG-16?
  
  (Asked by: username_0 on 2019-01-07)
  
  I'm trying to understand how the dimensions of the feature maps produced by the convolution are determined in a ConvNet.
  
  Let's take, for instance, the VGG-16 architecture. How do I get from 224x224x3 to 112x112x64? (The 112 is understandable, it's the last part I don't get)
  
  I thought the CNN was to apply filters/convolutions to layers (for instance, 10 different filters to channel red, 10 to green: are they the same filters between channels ?), but, obviously, 64 is not divisible by 3.
  
  And then, how do we get from 64 to 128? Do we apply new filters to the outputs of the previous filters? (in this case, we only have 2 filters applied to previous outputs) Or is it something different?
  
  [![vgg 16 archictecutre](https://i.sstatic.net/AJo0w.png)](https://i.sstatic.net/AJo0w.png)
  
  **Tags:** deep-learning, convolutional-neural-networks, convolutional-layers, vgg
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2019-01-08. Score: 1 | Accepted answer
  
  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 (so we get N 2D matrices). Then all of these matrices are added up to make a final matrix (1 matrix for 1 filter). Finally, the output is all filters' matrices in parallel (like channels).
  
  The hard part was to find the "sum up", since many websites speak of it as a 3D convolution (which is not !).
  
  
  ---
  
  ### Answer by username_1 on 2019-01-07. Score: 1
  
  The 64 here is the number of filters that are used.
  The picture is kind of misleading in that it leaves out the transition of the maxpool.
  [![enter image description here](https://i.sstatic.net/jFKgV.png)](https://i.sstatic.net/jFKgV.png)
  
  Below is a text description of the size of the features as they go through the network with the number of filters in bold.
  
  1. The first 2 layers in the diagram you posted contain **64** 3x3 convs
     resulting in a 224x224x64 matrix of features.
  2. This is then fed into a maxpool which reduces the size to a 112x112x64 matrix.
  3. This is then fed to 3 layers of **128** 3x3 convs resulting in a 112x112x128
     matrix.
  4. Then another maxpool giving a 56x56x128 matrix.
  5. Feeding that to 3 layers of **256** 3x3 convs results in a 56x56x256 matrix.
  6. This is then fed into another maxpool giving a 28x28x256 matrix,
  7. Which is then fed into 3 layers of **512** 3x3 convs resulting in a
     28x28x512 matrix.
  8. Another maxpool gives a 14x14x512 matrix which is fed to 3 layers of **512** 3x3 convs giving a matrix of 14x14x512 features.
  9. Another maxpool reduces this to a 7x7x512 which is then
     given to 3 fully connected layers of **4096** units each before being
     sent to a softmax.
  
  
  ---
  
  ### Answer by username_2 on 2019-01-07. Score: 1
  
  For learning image features with CNNs, we use 2D Convolutions. Here 2D does not refer to the input of the operation, but the output.
  
  Consider you have an input tensor of size 224 x 224 x 3. Say for example you have 64 different convolution kernels. Theses **kernels are also 3 dimensional**. Each kernel will produce a 2D matrix as output. Since you have 64 different kernels/filters, you will have 64 different 2D matrices. In other words, you got a tensor with depth 64 as output.
  
  [![enter image description here](https://i.sstatic.net/FjvuN.gif)](https://i.sstatic.net/FjvuN.gif)
  
  I would suggest you to go through this question:
  
  [Understanding 1D, 2D and 3D convolutions](https://stackoverflow.com/questions/42883547/intuitive-understanding-of-1d-2d-and-3d-convolutions-in-convolutional-neural-n)
  
  
  ---
  
  