DUTyimmy / MFNet

source code for ICCV2021 paper "MFNet: Multi-filter Directive Network for Weakly Supervised Salient Object Detection"
11 stars 8 forks source link

Hello, how do I use three pseudo labels to train? #1

Closed ma3252788 closed 2 years ago

ma3252788 commented 3 years ago

I want to train simultaneously with three pseudo-labels or more fake labels. How should I modify the code?

Thank you!

DUTyimmy commented 3 years ago

Thanks for your attention! You can copy and add the code of directive filter in model_densenet.py for corresponding your specified number of pseudo labels. And don't forget to make the appropriate changes in the loss term in trainsal.py.

ma3252788 commented 3 years ago

Thank you, may I only need to modify these two files?

Thanks for your attention! You can copy and add the code of directive filter in model_densenet.py for corresponding your specified number of pseudo labels. And don't forget to make the appropriate changes in the loss term in trainsal.py.

Thank you, may I only need to modify these two files?

In addition, if there are more than one, how to calculate the loss is better? For example, there are three data sets, which are A, B, and C. and loss= A-B-C ?

DUTyimmy commented 3 years ago
  1. You need to modify dataloader.py for loading other pseudo labels, and there also may be some minor problems with other files, you can make changes accordingly according to the debugging situation.
  2. If you need three pseudo labels, just take those labels equally. Such as the the final multi-guidance loss term: BCEloss(saliency prediction, (the average outputs of three DFs after refinement)). You could also try to find out the effect of different weights of DFs to the final performance, i think it will be a interesting issue.