Using Autoencoder to denoise images.
Overview:
In this Article, we will talk about Autoencoder , the type and the applications . I will provide code where I built 22 Machine learning models . We will compare between the models and see who will have the best accuracy .
What is Autoencoder ?
Autoencoder is an artificial neural network where the network tries to learns the reconstruction of the given input . Autoencoder consist of three components, encoder , latent dimension and decoder .
Encoder is a function that tries to reduce the dimensionality of the inputs, the encoded results called latent dimension( we call it latent representation as well ).
Decoder on the other hand is also a function but it tries to decode the latent dimension that is encoded by the encoder.
In other words, the number of neurons goes down as we move to the middle layer, then it grows until the number of neurons is the same as the input .
The figure above shows the architecture of Autoencoder . Credit : Mdpi
Feed-forward neural network
is a type of neural network where the data goes in one direction, it consists of a dense or linear layers and activations functions .
Activation function :
Activation is a function that calculates the output of the node . In terms of autoencoders there are two most used activations functions, ReLu and sigmoid.
ReLu : ReLu define as positive value and it is recommended when you are working with values range between [0,∞]:
ReLU (x) = max (0, x)
Sigmoid : Sigmoid function assumes all values range between]0, 1[, This activation function can be used only if the data is range between 0 and 1, if you are working with normalized values, Sigmoid is a good choice.
Loss Function
Loss function or cost function calculate the distance between the truth value and predicted value. How our model performs in unseened data . There are many loss functions but the two functions are widely used for autoencoder are Mean Square Error and Binary Cross-Entropy.
Mean Square Error : is the most common used in regression problem , since autoencoder is regression problem then MSE is best choice (not always) .
Binary Cross-Entropy :This loss function is recommended if the activation function is sigmoid, the formula is :
Autoencoder applications:
One of the best applications of autoencoder is Dimentionality reducing , Image super resolution and Image Denoising and many more .
For the code check it here in Github .