Understanding convolutional layers
In this chapter, we’ll finally get into the meat of the neural networks behind deepfakes. A big part of how networks such as these work is a technique called convolutional layers. These layers are extremely important in effectively working with image data and form an important cornerstone of most neural networks.
A convolution is an operation that changes the shape of an object. In the case of neural networks, we use convolutional layers, which iterate a convolution over a matrix and create a new (generally smaller) output matrix. Convolutions are a way to reduce an image in size while simultaneously searching for patterns. The more convolutional layers you stack, the more complicated the patterns that can be encoded from the original image.
Figure 6.1 – An example of a convolution downscaling a full image
There are several details that define a convolutional layer. The first is dimensionality. In our...