# You Only Look Once (YOLO): Convolutional Neural Network

This question refers to the YOLO architecture (figure 3).

In their architecture they define a convolutional layer 7x7x64-s-2 followed by a maxpool layer 2x2-s-2. These transform an input of 448x448x3 into a tensor of 112x112x192, using a kernel of 7x7 in the convolutional layer.

Can someone please clarify this notation 7x7x64-s-2?

I'm assuming s-2 refers to stride of 2. Then is 64 the padding?

The first two numbers are the size of the filter/kernel, that much is certain. I think the third number is either the depth of the filter or the number of filters. For the first layer, it could be the depth of the filter, giving us 64 for each of the three --192, which is the depth of the output. However this same line of reasoning appears not to hold for the next layer.

The kernel has a size of 7x7. There are 64 convolution filters in the first layer. The stride is 2. In the image below you can see the input and output of each layer. When you run YOLO you will see this in the command prompt. The other answers up now look good, but I thought it might help with clarity if I went through each shape transformation.

Input: image with height 448, width 448, and 3 color channels (e.g. RGB, BGR, HSV)

448 x 448 x 3


Apply convolution kernel 7x7x64-s-2.

224 x 224 x 192


The first two dimensions are halved, due to the stride of 2. The final dimension is 192 because, presumably, the kernel is applied to each 448 x 448 x 1 layer of the image individually, then the outputs of all 3 are stacked (note: 192 = 3 * 64).

Apply maxpool 2x2-s-2

112 x 112 x 192


Pooling a 2 x 2 area with stride 2 essentially means that you pool over separate blocks of the input tensor. The stride 2 is why the first two dimensions are halved. This is applied separately to each of 192 layers, so the final dimension remains the same.

• thanks, make sense. But what happen in the next layer, why input 112*112*192, a conv layer 3*3*192, a maxpooling layer 2*2-s-2, output 56*56*256? how did this 256 comes? – flankechen Sep 18 '17 at 10:49
• My guess is that there are 256 individual 3 x 3 x 192 filters used. If you convolve one 3 x 3 x 192 filter over the first two axis of a 112 x 112 x 192 input, you get 112 x 112 x 1 output. So, you'd learn 256 unique conv filters (each of shape 3 x 3 x 192, outputting 112 x 112 x 1), and stack their outputs (112 x 112 x 256). – Eric Bigelow Sep 19 '17 at 18:55
• I run the code to check what happen, in face, the Figure 3 in the paper kind of misleading. first 7*7*64-s-2 conv and the next 2*2-s-2 max pooling layer would output a 112*112*64. and the next 3*3*192 conv would output 112*112*192. the operation on channel is stacking. Thanks anyway. – flankechen Sep 20 '17 at 4:59