180703 一个例子理解转置卷积Deconvolution or Transposed Convolution
来源:Up-sampling with Transposed Convolution
为什么上采样?
- 因为有时候我们需要低分辨率→高分辨率
为什么需要转置卷积?
- 相比于紧邻上采样/双样条采样/三次样条采样等手工选择采样方法,我们需要一种能够自动优化的上采样方法。而转置卷积已经在DCGAN、FCN等中得到了较好的应用效果。
卷积操作(多对一)
- 输入与卷积核进行卷积操作得到卷积输出
反向过程(一对多)
卷积矩阵重构
- 原始卷积矩阵
- 重构卷积矩阵
- 重构输入
重构卷积操作过程
重构卷积输出(结果与之前卷积操作结果相同)
转置卷积逆向操作,得到原始输入(划重点)
- 总结
The transposed convolution operation forms the same connectivity as the normal convolution but in the backward direction.
We can use it to conduct up-sampling. Moreover, the weights in the transposed convolution are learnable. So we do not need a predefined interpolation method.
Even though it is called the transposed convolution, it does not mean that we take some existing convolution matrix and use the transposed version. The main point is that the association between the input and the output is handled in the backward fashion compared with a standard convolution matrix (one-to-many rather than many-to-one association).
As such, the transposed convolution is not a convolution. But we can emulate the transposed convolution using a convolution. We up-sample the input by adding zeros between the values in the input matrix in a way that the direct convolution produces the same effect as the transposed convolution. You may find some article explains the transposed convolution in this way. However, it is less efficient due to the need to add zeros to up-sample the input before the convolution.
One caution: the transposed convolution is the cause of the checkerboard artifacts in generated images. This article Deconvolution and Checkerboard Artifacts recommends an up-sampling operation (i.e., an interpolation method) followed by a convolution operation to reduce such issues. If your main objective is to generate images without such artifacts, it is worth reading the paper to find out more.