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

Reproducing Cross-domain Experiments #22

Closed
X-Lai opened this issue Oct 23, 2020 · 6 comments
Closed

Reproducing Cross-domain Experiments #22

X-Lai opened this issue Oct 23, 2020 · 6 comments

Comments

@X-Lai
Copy link

X-Lai commented Oct 23, 2020

@yassouali @SuzannaLin Firstly, thanks a lot for your great work! But I still have problems in reproducing the cross-domain experiments.

I have seen the implementation from https://github.com/tarun005/USSS_ICCV19, however, I notice that there are still many alternatives for the training schemes.

During training, in each iteration (i.e. each execution of 'optimizer.step()'), do you train the network by forwarding inputs from both two datasets? Or by forwarding inputs from only one dataset in the current iteration, and then executing "optimizer.step()", and then forwarding inputs from the other dataset in the next iteration, and so on?

Also, are there any tricks to deal with the data imbalance situation, e.g. the CamVid dataset only contains 367 images while the Cityscapes dataset has 2975 training images? (Just like constructing a training batch with different ratios for two datasets or other sorts of things)

Besides, can you give some hints on hyperparameters, e.g. the number of training iterations, batch size, learning rate, weight decay?

Looking forward to your reply! Thanks a lot!

@SuzannaLin
Copy link
Contributor

For class imbalance, I recommend using Focal Loss. You do need to count the object pixels per class and put that in a list in the code as "pixelcount". (I haven't written an automatic label counter yet and recycled this from my Matlab script).

FL works really well in my experience. I used a learning rate of 1e-3, weight decay of 1e-4, and momentum of 0.9. The batch size should be as large as possible, try and test how much your memory can handle. I had to keep it to 3 for the supervised and unsupervised branch. I achieved a maximum mIoU at 40 - 70 epochs depending on the dataset and settings. Also, you can adjust the crop size to fit your data, but the larger it is, the longer training will take.
I hope this helps you a bit. The other questions, I can't answer them.

@X-Lai
Copy link
Author

X-Lai commented Oct 24, 2020

For class imbalance, I recommend using Focal Loss. You do need to count the object pixels per class and put that in a list in the code as "pixelcount". (I haven't written an automatic label counter yet and recycled this from my Matlab script).

FL works really well in my experience. I used a learning rate of 1e-3, weight decay of 1e-4, and momentum of 0.9. The batch size should be as large as possible, try and test how much your memory can handle. I had to keep it to 3 for the supervised and unsupervised branch. I achieved a maximum mIoU at 40 - 70 epochs depending on the dataset and settings. Also, you can adjust the crop size to fit your data, but the larger it is, the longer training will take.
I hope this helps you a bit. The other questions, I can't answer them.

Anyway, thanks for your reply. But what I am asking is all about the cross-domain experiments rather than the normal semi-supervised setting on only a single dataset.

@yassouali May I know more details about the cross-domain experiments?

@yassouali
Copy link
Owner

Hi @X-Lai, Thank you for your interest.

During training, both of your suggestion would work relatively well. In our case, we alternate between the two datasets from one iteration to the other and call step seperately.

In terms of hyperarameters & class imbalance, we did not use any specific thing, the parameters used are the same as the semi-supervised case. Altough I think better performances can be obtained if we seach of better parameters.

@X-Lai
Copy link
Author

X-Lai commented Oct 24, 2020

@yassouali Thank you very much for your reply.

So are these cross-domain experiments conducted based on PSPNet with ResNet50, rather than the DRN used in https://github.com/tarun005/USSS_ICCV19?

Looking forward to your reply! Thank you very much!

@yassouali
Copy link
Owner

@X-Lai yes you are correct, the same model as the semi-supervised case.

@X-Lai
Copy link
Author

X-Lai commented Oct 24, 2020

Big thanks!

@X-Lai X-Lai closed this as completed Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants