Answers.Body: <p>In any case anyone is struggling with the same problem. It seems that they were simply typos in the original paper. I have downloaded the author's framework <a href="https://pjreddie.com/darknet/" rel="nofollow noreferrer">Darknet</a>, as well as the configuration and <a href="http://pjreddie.com/media/files/yolov1/yolov1.weights" rel="nofollow noreferrer">weight</a> files for YOLOv1.</p>
  <p>Then, the architecture can be tested with one sample image using this command:</p>
  <pre><code>./darknet yolo test cfg/yolov1/yolo.cfg yolov1.weights data/person.jpg
  </code></pre>
  <p>The output of this command also prints the full architecure of the net. There, I see the expected depth values after the first (depth of 64) and second max layers (depth of 192):</p>
  <pre><code>   layer   filters  size/strd(dil)      input                output
         0 Create CUDA-stream - 0 
       Create cudnn-handle 0 
      conv     64       7 x 7/ 2    448 x 448 x   3 -&gt;  224 x 224 x  64 0.944 BF
         1 max                2x 2/ 2    224 x 224 x  64 -&gt;  112 x 112 x  64 0.003 BF
         2 conv    192       3 x 3/ 1    112 x 112 x  64 -&gt;  112 x 112 x 192 2.775 BF
         3 max                2x 2/ 2    112 x 112 x 192 -&gt;   56 x  56 x 192 0.002 BF
  </code></pre>
  <p>So it seems clear to me that the 192 and 256 depth values after the first and second max layer on the figure in the question are just typos.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-28T20:01:59.000Z
Answers.LastActivityDate: 2021-12-28T20:01:59.000Z
Answers.UserDisplayName: ldemaeztu
Body: <p>I was reading the last version of <a href="https://arxiv.org/abs/1506.02640" rel="nofollow noreferrer">the YOLO paper</a> available in Arxiv, and I don't fully understand the output dimensions (I understand width and height, but not depth) of the first and second convolutional layers.</p>
  <p><a href="https://i.sstatic.net/nOBHW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nOBHW.png" alt="enter image description here" /></a></p>
  <p>Shouldn't the output of the first layer be 112x112x64? Shouldn't the output of the second layer be 56x56x192? I thought (and this is the case after the 3rd layer) that the depth of the ouput of a conv layer is equal to the number of filters of this layer. This is why after the first conv layer (that contains 64 filters) I would expect an output depth of 64. And the same for the second conv layer that contains 192 filters, I would expect the output to have a depth of 192.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-15T10:33:25.777Z
Comments.Text: In the diagram, they write 7x7x64-s-2. What is the meaning of the notation "64-s-2"? That's probably going to answer your question. Feel free to answer your own question below, if you find an answer to it.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-15T16:23:21.910Z
Comments.Text: I don't think that's the solution. s-2 means stride of 2, and this stide results in the input dimensions being divided by 2 in the output. This is why after the first two s-2 layers (one conv and one maxpool), the 448x448 input is transformed into a 112x112 output. The second s-2 maxpool layer, transforms its 112x112 input into a 56x56 output. An so on. However, this is not related in principle to the third dimension (depth). Thanks in any case!
Comments.UserDisplayName: ldemaeztu
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-15T16:29:28.597Z
Comments.Text: Yes, I was thinking that s was related to stride. The other idea is that 64*3 = 192. Are they using a 3d convolution?
Comments.UserDisplayName: nbro
Tags: <convolutional-neural-networks><architecture><yolo><convolution-arithmetic>
Title: Are the output dimensions of the first and second convolutional layer in YOLO paper correct?
UserDisplayName: ldemaeztu
ThreadText: # Are the output dimensions of the first and second convolutional layer in YOLO paper correct?
  
  (Asked by: username_0 on 2021-12-12)
  
  I was reading the last version of [the YOLO paper](https://arxiv.org/abs/1506.02640) available in Arxiv, and I don't fully understand the output dimensions (I understand width and height, but not depth) of the first and second convolutional layers.
  
  [![enter image description here](https://i.sstatic.net/nOBHW.png)](https://i.sstatic.net/nOBHW.png)
  
  Shouldn't the output of the first layer be 112x112x64? Shouldn't the output of the second layer be 56x56x192? I thought (and this is the case after the 3rd layer) that the depth of the ouput of a conv layer is equal to the number of filters of this layer. This is why after the first conv layer (that contains 64 filters) I would expect an output depth of 64. And the same for the second conv layer that contains 192 filters, I would expect the output to have a depth of 192.
  
  **Tags:** convolutional-neural-networks, architecture, yolo, convolution-arithmetic
  > **Comments:**
  > **username_1**: In the diagram, they write 7x7x64-s-2. What is the meaning of the notation "64-s-2"? That's probably going to answer your question. Feel free to answer your own question below, if you find an answer to it.  
  > **username_0**: I don't think that's the solution. s-2 means stride of 2, and this stide results in the input dimensions being divided by 2 in the output. This is why after the first two s-2 layers (one conv and one maxpool), the 448x448 input is transformed into a 112x112 output. The second s-2 maxpool layer, transforms its 112x112 input into a 56x56 output. An so on. However, this is not related in principle to the third dimension (depth). Thanks in any case!  
  > **username_1**: Yes, I was thinking that s was related to stride. The other idea is that 64*3 = 192. Are they using a 3d convolution?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-12-28. Score: 2 | Accepted answer
  
  In any case anyone is struggling with the same problem. It seems that they were simply typos in the original paper. I have downloaded the author's framework Darknet, as well as the configuration and weight files for YOLOv1.
  Then, the architecture can be tested with one sample image using this command:
  ./darknet yolo test cfg/yolov1/yolo.cfg yolov1.weights data/person.jpg
  
  The output of this command also prints the full architecure of the net. There, I see the expected depth values after the first (depth of 64) and second max layers (depth of 192):
     layer   filters  size/strd(dil)      input                output
         0 Create CUDA-stream - 0 
       Create cudnn-handle 0 
      conv     64       7 x 7/ 2    448 x 448 x   3 ->  224 x 224 x  64 0.944 BF
         1 max                2x 2/ 2    224 x 224 x  64 ->  112 x 112 x  64 0.003 BF
         2 conv    192       3 x 3/ 1    112 x 112 x  64 ->  112 x 112 x 192 2.775 BF
         3 max                2x 2/ 2    112 x 112 x 192 ->   56 x  56 x 192 0.002 BF
  
  So it seems clear to me that the 192 and 256 depth values after the first and second max layer on the figure in the question are just typos.
  
  
  ---
  
  