1
$\begingroup$

So I was studying MobileNetV2 architecture and came across this table from the original paper that represents its architecture:

Table 2: MobileNetV2 : Each line describes a sequence of 1 or more identical (modulo stride) layers, repeated n times. All layers in the same sequence have the same number c of output channels. The first layer of each sequence has a stride s and all others use stride 1. All spatial convolutions use 3 × 3 kernels. The expansion factor t is always applied to the input size as described in Table 1. Table Description: "Table 2: MobileNetV2 : Each line describes a sequence of 1 or more identical (modulo stride) layers, repeated n times. All layers in the same sequence have the same number c of output channels. The first layer of each sequence has a stride s and all others use stride 1. All spatial convolutions use 3 × 3 kernels. The expansion factor t is always applied to the input size as described in Table 1."

However I don't really understand why the last pointwise convolution (conv2d 1x1) is applied after the average pooling. Shouldn't the output from the avgpool go to a dense layer so that it can then perform its predictions?

What is the point of performing convolution, more precisely pointwise conv. after pooling? Also, why is k not a fixed number of kernels/filters, like the other layers?

Thanks in advance!

$\endgroup$
0

1 Answer 1

1
$\begingroup$

This is largely a matter of semantics I think. After the avg pool layer, the feature map becomes $1\times 1\times 1280$ as indicated on the table, so when you apply a pointwise convolution (a $1 \times 1$ conv), it essentially serves as a fully-connected layer operating on the channel dimension since there are no spaital dimensions to work with anymore.

If you want, you can think of the last layer as a dense layer with weights shaped $1280 \times k$, where the $1280$ input channels are interpreted as input features to the dense layer, and where $k$ is the number of classes.

$\endgroup$
2
  • $\begingroup$ I was having a hard time understanding the purpose of that final '1x1 conv layer' but your answer really made it clear for me! Thanks for that! I guess I didn't understand the semantics behind the usage of '1x1 conv layer' instead of a simple 'dense layer'. Is this a common practice when writting papers? Thank you again! $\endgroup$
    – Blue Ross
    Commented Oct 16, 2022 at 22:47
  • 1
    $\begingroup$ @BlueRoss I don't know if this convention is common, but I've seen multiple conventions (e.g. 1x1 conv, dense, fc, etc.) being used to describe the classification layer of a convnet. You may want to look at other major convnet papers (e.g. ResNet, other mobilenet versions) to see what they use $\endgroup$
    – PeaBrane
    Commented Oct 17, 2022 at 5:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .