CNN Encoder-decoder

for CNN encoder-decoder my MSE loss is very low (Loss: tensor(0.0067, grad_fn=))
but still output images are not clear .
my network architecture is
Layer (type) Output Shape Param #

        Conv2d-1            [-1, 6, 98, 98]              60
        Conv2d-2           [-1, 10, 96, 96]             550
        Conv2d-3           [-1, 20, 94, 94]           1,820
        Conv2d-4            [-1, 9, 92, 92]           1,629
     MaxPool2d-5  [[-1, 9, 46, 46], [-1, 9, 46, 46]]               0
     MaxPool2d-6  [[-1, 9, 23, 23], [-1, 9, 23, 23]]               0
        Conv2d-7            [-1, 9, 23, 23]             738
     MaxPool2d-8  [[-1, 9, 11, 11], [-1, 9, 11, 11]]               0
   MaxUnpool2d-9            [-1, 9, 23, 23]               0
       Conv2d-10            [-1, 9, 23, 23]             738
  MaxUnpool2d-11            [-1, 9, 46, 46]               0
  MaxUnpool2d-12            [-1, 9, 92, 92]               0
       Conv2d-13            [-1, 9, 92, 92]             738
       Conv2d-14           [-1, 20, 94, 94]           1,640
       Conv2d-15           [-1, 10, 96, 96]           1,810
       Conv2d-16            [-1, 6, 98, 98]             546
       Conv2d-17          [-1, 1, 100, 100]              55

================================================================
Total params: 10,324
Trainable params: 10,324
Non-trainable params: 0

images: image

Please let me know what other parameters I can tweak so that image will be clear
lr = 0.01 , epochs = 10

Hi, Arpit.

Generated image is good.
Try to increase the learning rate is 0.01, and increase the epocs to 50.

also you need to check other hyperparameters like batch size etc.
Kindly check this for more info
https://cs231n.github.io/neural-networks-3/

All the best!

HI Satyajit ,
I already tried increasing learning rate as well as number of epochs . but still it is same only,
minimum error is 0.0067 only , batch size is 100, if i am increasing the batch size ite not learning much ,
and if i decrease also its the same thing error is high

So, now you can increase the number of hidden layers or hidden units and check if it learns better or also curious to know which optimiser you are using
if you are using SGD you can try with Adam.
SGD
Adagrad
RMSprop
Adam
You have to understand the output of every iterations and accordingly set the hyperparameters.

I am using Adam optimizer , Which layer do you want me to increase (pooling layer or conv layer )?

  1. Kindly try to increase the Conv2d layer of 1-2 max.

  2. Changing activation function, RELU or leaky RELU if you are using sigmoid.

  3. Since you are using multilayer so sometimes our NN will converge to local minima, Xavier weight initialization can help.

  4. You can also use concepts of “Dropouts” where we deactivate the insignificant neurons from participating in training. ( For complex architecture ).

  5. Also Normalizing and scaling the data can help in better performance. You need to data augmentations for it, for that you have to look into the data.

In your case you can tweak the lr b/t (0.01 to 0.9) and epochs of 50 max.
If you are getting the overall idea then it is fine.

All the best!

I am agreeing on all the things that you have mentioned but my doubt is, error is so less still output is not clear

All the things that you mentioned is to get rid of local minima, to reduce error, for fast processing .
but my network is already fast and giving less error ,

Hi, Arpit.

Yes, I can see that the loss is less but still the resolution is not perfect but identifiable.
In this case you need to try to change the architecture of your model to get better results as I mentioned.
or you can consider this a new “Resolution enhancement” problem where you need to use variational autoencoder instead of just using a encoder and decoder.
or a Denoising autoencoder.

Kindly refer below papers and code

  1. https://arxiv.org/pdf/2006.05218v1.pdf
    code https://github.com/ioangatop/srVAE

  2. https://csce.ucmss.com/cr/books/2019/LFS/CSREA2019/ICD8034.pdf

All the best!