Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question regarding net_d #78

Closed
seanko29 opened this issue Jun 18, 2024 · 4 comments
Closed

Question regarding net_d #78

seanko29 opened this issue Jun 18, 2024 · 4 comments
Labels
question Further information is requested solved issue has been solved

Comments

@seanko29
Copy link

Hi muslll,

Thank you for your great work. It works perfectly fine in python 3.10 and fixed the yaml configuration.
I had another question and I guess it was better if I open a new issue thread.

For networks such as SAFMN and SPAN, there are no net_d (no discriminator) from what I read in the paper.
However, when. I run train_span.yml or train_safmn.yml in their basic setting equivalent with the repo, it seems to work with the discriminator turned on and training goes smoothly.

So the question is,
are there explicit different results when we use a UNet discriminator + gan_loss on net_d on networks that does not essentially require a net_d? (like span or safmn) or does it improve the performance when we add the net_d during training for any models?

Thank you in advanced :).

@muslll muslll added the question Further information is requested label Jun 18, 2024
@muslll
Copy link
Owner

muslll commented Jun 18, 2024

Hi, glad you got it working.
About GAN and discriminator: it works regardless of the network. GAN is usually applied to real-world SISR to push the network to generate more perceptually pleasant images. The default configurations on neosr of all networks targets the best real-world SISR practices, so in all of them GAN is enabled. Neosr also supports different kinds of discriminators that you can try out. Unet-SN is standard, but a2fpn also works pretty well (sometimes even better, depending on your dataset and LQ degradations).

@seanko29
Copy link
Author

So, if I understood your reply correctly,
Q1. discriminators in neosr boost real world SISR and does it work independently from the generator network?
Q2. If I am looking at more research-focused SR, is it perfectly fine to turn-off the discriminator setting first during my experiments?

Thank you.

@muslll
Copy link
Owner

muslll commented Jun 19, 2024

Yes to both Q1 and Q2. About Q2: usually when training from scratch (no pretrained network), you should disable GAN and train with only pixel_opt or mssim_opt first. GAN is only used after you have a stable model.

@Phhofm
Copy link
Contributor

Phhofm commented Jun 19, 2024

Just to add to the understanding (its whats already written here, just re-stated): net_d has nothing to do with the network.

Since you listed SPAN and SAFMN, it doesnt matter, you could list all of them here (ATD, SRFormer, HAT, SwinIR, ESRGAN, etc) or not a single one. It is more coupled to a loss, gan loss, not a network.
So none of those require a net_d. All of them can use it. Its not the network. (im just stating my points in the extreme to make it more clear)

An official pretrain almost never has a net_d because in most cases they are trained with pixel loss only on bicubic downsampled dataset like div2k or df2k. Thats what you will most likely find in papers or in official github repositories. Unless they release a real world model where they use the Real-ESRGAN degradation pipeline or something similiar, where they add noise, blur, compression to the dataset so the model can deal with those.

If you want to see a manual example of this you can have a look at my 4xNomosWebPhoto Dataset PDF where I showed how I created it, it is also attached in the release of my 4xNomosWebPhoto_realplksr model.

Hm maybe not the best example but you could have a look at what I used for my SPAN pretrains since I included the config files in the attachements where I basically deactivated any loss except pixel (or mssim) and ran on a downsampled-only lr.

Maybe this helps a bit, simply wanted to add to the already answers here.

@muslll muslll closed this as completed Jun 21, 2024
@muslll muslll added the solved issue has been solved label Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested solved issue has been solved
Projects
None yet
Development

No branches or pull requests

3 participants