0
$\begingroup$

I'm reading this about Self-Attention GANs : https://sthalles.github.io/advanced_gans/

I'm trying to better frame what is intended about 1x1convolution for input images. Does this simply mean that we produce feature maps by multiplying a scalar filter to each single pixel of the image? It's not clear since in the reported picture the 1x1conv part resembles a vector.

enter image description here

$\endgroup$
2
  • $\begingroup$ I had not read this work, but I am quite curious since it seems to me that this would just create three sets of layers that are just scaled representations of each other. Though, that could be the purpose given the different intentions of $f(x), g(x), and h(x)$ in self attention models. $\endgroup$ Commented Mar 21, 2022 at 11:58
  • $\begingroup$ Anyway I think that my question is kinda trivial: saying we have feature maps of dimension $(N, K,K)$ where $N$ is the batch size, then convolving them with $1 \times 1$ filters (single-channel) will return transformed tensors with the same dimensions $(N,K,K)$ and the image is a bit misleading from my perspective. Is this correct? Also, convolving with $1 \times 1$ filters is what it's usually named 'Point convolution' ? $\endgroup$ Commented Mar 21, 2022 at 12:13

1 Answer 1

1
$\begingroup$

1x1 convolutions is a very simple trick generalized by the Inception module published by Google in 2014 in the famous paper Going Deeper with Convolutions.

The most common use case is to modify the output channels of the input feature maps. This is mostly used when you have a net architecture with multiple branches that needs to be aggregated into one result (such as in your image or such as in the Inception module).

Here is an example:

  • Input Feature map: $F_{in}: B \times H \times W \times C_{in}$
  • Convolution: $W: 1 \times 1 \times C_{out}$
  • Output Feature map: $F_{out}: B \times H \times W \times C_{out}$

In plain english: 1x1 convolutions modify the output feature maps channels $C$ without altering the resolution $H \times W$.

When is this useful? For when you need to expand or shrink the feature maps channels. Examples: Inception, SE Blocks, Bottlenecks Blocks, Detectors Head (RetinaHead)...

Here is a more in depth article

$\endgroup$
2
  • $\begingroup$ many thanks! So is this the same as 'point convolution' ? $\endgroup$ Commented Mar 21, 2022 at 12:29
  • 1
    $\begingroup$ Yes, exactly. In some papers they say point convolution or fully connected layers, but in the code they are implemented with 1x1 conv $\endgroup$
    – JVGD
    Commented Mar 21, 2022 at 12:47

You must log in to answer this question.

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