Sharp | Defocused-blurred | Motion-blurred |
---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Libraries Required :-
Numpy
🐼Pandas
Matplotlib
OpenCV
tqdm
TensorFlow
Keras
Standard size: (128,128,3)
Split choosen: 80:20
Loss function -> Mean Squared Error
Optimizer -> Adam
Evaluation metric -> Accuracy
Also define the learning rate reducer to reduce the learning rate if there’s no improvement in the Accuracy
Encoder - Build a stack of Conv2D(64) - Conv2D(128) - Conv2D(256). The model is going to be having input shape (128, 128, 3) and kernel size equal to 3 and the Encoder will compress this shape to (16, 16, 256) and will further flatten this into a one dimensional array which will be the input for our Decoder.
Decoder - Manually convert the one dimensional array from the encoder model to the shape (16, 16, 256) and then send it to the decoder to decode it back to (128, 128, 3) shape. So the stack here will be Conv2DTranspose(256) - Conv2DTranspose(128) - Conv2DTranspose(64).
AUTOENCODER = Encoder + Decoder
Accuracy - 68 %
We cannot compare blurred and sharp images on the basis of PSNR or SSIM but sharp images can be used for visual comparison.