# Transposed Convolution ###### tags: `Semantic Segmentation` Transposed Convolutions are used to upsample the input feature map to a desired output feature map using some learnable parameters. 1. Consider a 2x2 encoded feature map which needs to be upsampled to 3x3 feature map. 2. We take a kernel of size 2x2 with unit stride and zero padding. ![Input](https://i.imgur.com/Gr1QoAs.png) ![Kernal](https://i.imgur.com/X3ZsuyS.png) 3. Now we take the upper left element of the input feature map and multiply it with every element of the kernel as shown in figure. 4. Similarly, we do it for all the remaining elements of the input feature map as depicted in figure 2. 5. As you can see, some of the elements of the resulting upsampled feature maps are over-lapping. To solve this issue, we simply add the elements of the over-lapping positions. ![](https://i.imgur.com/bzJV3TJ.png) 6. The resulting output will be the final upsampled feature map having the required spatial dimensions of 3x3. On a smaller scale it would look something like this ![](https://i.imgur.com/EF2nWS1.png) #### Notes * The name transposed convolution comes from ![](https://i.imgur.com/kakD5ot.png) * Transposed convolution is also known as deconvolution, though it isn't correct to say so as this doesn't nulify the effect of convolution. * It is also referred to as fractionally strided convolution due since stride over the output is equivalent to fractional stride over the input. For instance, a stride of 2 over the output is 1/2 stride over the input. * It is also known as upsampled convolution which is intuitive to the task it is used to perform, i.e upsample the input feature map. * It is also referred to as Backward strided convolution because forward pass in a Transposed Convolution is equivalent to backward pass of a normal convolution. #### Problems with transposed convolution Transposed convolutions suffer from chequered board effects. 3x3 stride 2 convolutions specifically produce this kind of problems. ![](https://i.imgur.com/WeVUYe3.png) The main cause of this is uneven overlap at some parts of the image causing artifacts. This can be fixed or reduced by using kernel-size divisible by the stride, for e.g taking a kernel-size of 2x2 or 4x4 when having a stride of 2. #### Applications 1. It is used for symentic segmentation 2. It is used in computer vision for super resolution