Path: blob/master/examples/vision/ipynb/autoencoder.ipynb
3236 views
Convolutional autoencoder for image denoising
Author: Santiago L. Valdarrama
Date created: 2021/03/01
Last modified: 2021/03/01
Description: How to train a deep convolutional autoencoder for image denoising.
Introduction
This example demonstrates how to implement a deep convolutional autoencoder for image denoising, mapping noisy digits images from the MNIST dataset to clean digits images. This implementation is based on an original blog post titled Building Autoencoders in Keras by François Chollet.
Setup
Prepare the data
Build the autoencoder
We are going to use the Functional API to build our convolutional autoencoder.
Now we can train our autoencoder using train_data
as both our input data and target. Notice we are setting up the validation data using the same format.
Let's predict on our test dataset and display the original image together with the prediction from our autoencoder.
Notice how the predictions are pretty close to the original images, although not quite the same.
Now that we know that our autoencoder works, let's retrain it using the noisy data as our input and the clean data as our target. We want our autoencoder to learn how to denoise the images.
Let's now predict on the noisy data and display the results of our autoencoder.
Notice how the autoencoder does an amazing job at removing the noise from the input images.