yang-jin-hai / SAIN

[AAAI-2023] Self-Asymmetric Invertible Network for Compression-Aware Image Rescaling
Apache License 2.0
33 stars 2 forks source link

train method #1

Closed brighteast closed 1 year ago

brighteast commented 1 year ago

First, really thank you for your work. The paper was really interesting to me. Now, I tried to train SAINetwork and made a own training code. Scheduler, learning rate, patchsize, augmentation,,, I set those of them with the paper and your code in the same way. But it only reached about 30 psnr (RGB Channel, Set5 dataset). If using your pretrained model(SAINx2_JPEG.pth), It reached about 32 psnr. I was not able to find any difference with your training method. So I'll really appreciate if you let me know training method in detail.

yang-jin-hai commented 1 year ago

Hi, thank you for your appreciation. To the best of my recollection, the training details are all included in the paper. And the training pipeline and loss functions have been implemented in the model.py, so I think the training script would not be a big problem. I'm wondering how these values are tested? What is the JPEG QF for testing? Is the model trained on the DIV2K set? If it's convenient, could you please post your configure yml here so that I can check the differences?

brighteast commented 1 year ago

Thank you for your reply! Yes, I wrote training code based on your 'model.py'. And also I tested and trained Quality Factor 75, and trained on the DIV2K dataset. Then I think there are something wrong in my code. I'll try more. Actually, I made a code using pytorch lightning. It is quite different... So I wrote configures here directly.

scale: 2 comp_quality: 75

network: subnet: DBNet in_nc: 3 out_nc: 3 e_blocks: 5 v_blocks: 3 scale: 2 gmm_components: 5 init: xavier down_num: 1

optimizer: Adam Initial Learning Rate: 2e-4 scheduler: StepLR(step_size = 2000 epoch, gamma = 0.5) random horizontal, vertical flip patch_size: 128,128 batch_size: 16

Thank you!

yang-jin-hai commented 1 year ago

There might be some minor differences. We also use random rotation (simply transpose the width/height) for augmentation, which we forgot to mention in the paper, but it may only make a minor difference. For the losses, we use lambda_fit_forw: 4 and lambda_rec_back: 1 for x2 experiments. You can use IRN training script, but note that the distributed training of our model is not tested.

brighteast commented 1 year ago

Oh, I didn't check the lambda values. And I'll try to train using IRN training script. If it works well, I'll comment here. Really thanks!!

yang-jin-hai commented 1 year ago

Hi, we have just released the training codes and configs. Hope it helps.

brighteast commented 1 year ago

Sorry for late reply. I succeded the training and the results is the same as the paper. I really feel grateful!!

Have a good day :)