1. The convolution

The realization of forward convolution. Assume that the size of the input image is 4×4 and the element matrix is:

The size of the convolution kernel is 3×3, and its element matrix is:

The forward convolution operation: strides = 1, padding = 0, output shape 2X2, as shown below:

In the picture above, the bottom is the input, the top is the output, and the convolution kernel is 3×3. If we describe this process by matrix multiplication, we expand the input matrix into a column vector X

input=[x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15]T

Expand the element matrix of output image output into a column vector Y

input=[y1,y2,y3,y4]T

For input element matrix X and output element matrix Y, the process is described by matrix operations:

Y=CX

Through derivation, we can obtain the sparse matrix C

The shape of the sparse matrix C is 0 4×16, X is 0 16×1, and Y is 0 4×1. The shape of Y is 0 0 Our expected output shape 2X2

2. Deconvolution

So, the deconvolution operation is the transpose of the matrix operation, and the output Y gives the input X:

X=CTY

From the perspective of matrix element shape, it can be understood as: 16×1=16x4x4x1. The following animation vividly describes the deconvolution process:

It is worth noting that the deconvolution operation is not a reversible process of the convolution operation, that is to say, the image cannot be restored to its original appearance after the deconvolution operation. That’s because deconvolution is just transpose, not inverse.

reference

1.yunyang1994.github.io/posts/FCN/