Again, we will continue with the monkey species dataset and modify the training images to introduce a noise factor. This noise factor essentially changes the pixel values on the original image to remove pieces of information that constitute the original image, making the task a little more challenging than a simple recreation of the original input. Do note that this means that our input variables will be noisy images, and the target variable that's shown to the network during training will be the uncorrupted version of the noisy input image. To generate the noisy version of the training and test images, all we do is apply a Gaussian noise matrix to the image pixels and then clip their values between 0 and 1:
noise_factor = 0.35 # Define noisy versions x_train_noisy = x_train + noise_factor * np.random.normal(loc=0.0, scale=1.0, size=x_train.shape)...