Building a Convolutional Autoencoder with Keras using Conv2DTranspose

Surajit Saikia
Analytics Vidhya
Published in
5 min readSep 9, 2019

--

In this post, we are going to build a Convolutional Autoencoder from scratch. An autoencoder is an unsupervised machine learning algorithm that takes an image as input and tries to reconstruct it back using a fewer number of bits from the latent space representation.

Here, I am going to show you how to build a convolutional autoencoder from scratch, and then we provide one-hot encoded data for training (Also, I will show you the most simpler way by using the MNIST dataset). After training, we save the model, and finally, we will load and test the model.

Sample image of an Autoencoder
Sample image of an Autoencoder

Pre-requisites: Python3 or 2, Keras with Tensorflow Backend. Also, you can use Google Colab, Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud, and all the libraries are preinstalled, and you just need to import them.

The architecture which we are going to build will have 3 convolution layers for the Encoder part and 3 Deconvolutional layers (Conv2DTranspose) for the Decoder part.

I am also going to explain about One-hot-encoded data.

--

--