In situations where input images contain unwanted noise, autoencoder networks can be trained to remove such noise. This is achieved by providing images with noise as input and providing a clean version of the same image as output. The autoencoder network is trained so that the output of the autoencoder is as close to the output image as possible.
Denoising autoencoders
MNIST data
We will make use of MNIST data that's available in the Keras package to illustrate the steps that are involved in creating a denoising autoencoder network. MNIST data can be read using the following code:
# MNIST data
mnist <- dataset_mnist() str(mnist)
List of 2 $ train:List of 2 ..$ x: int [1:60000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ... ...