jiwoon-ahn / psa

Learning Pixel-level Semantic Affinity with Image-level Supervision for Weakly Supervised Semantic Segmentation, CVPR 2018
MIT License
380 stars 62 forks source link

CAMs on custom dataset #14

Open sinAshish opened 5 years ago

sinAshish commented 5 years ago

Hi Jiwoon

I trained the classification model on my own dataset which has binary labels(present or not present). I made the necessary changes to your code. But while generating CAMs using infer_cls.py. All I get is completely black or white images. Are there any other modifications that I need to make to generate cams except for the softmax with BCELoss. and changing labels from 20 to 2?

jiwoon-ahn commented 5 years ago

Hi @sinAshish, Here are my tips for your case: 1) We hypothesize the background confidence scores by setting alphas because there's no such label in PASCAL VOC. If your dataset has background labels, I don't recommend you to do this. Instead, you can threshold CAMs by some value or just take argmax of classes per pixel. 2) Check the classification accuracy of your validation set. (probably you should get over 95% acc)

sinAshish commented 5 years ago

Thanks for the suggestion. I'll try it out and see if it works.

XZNWU commented 5 years ago

I have trained the classification model on my own data set, which is similar to your result. How do you solve this problem? @sinAshish

sinAshish commented 5 years ago

I take argmax of classes per pixel as suggested by @jiwoon-ahn . But I haven't yet run the code so can't say for sure if it would work.

sinAshish commented 5 years ago

My loss decreases to a very less extent, like from .68 to around .43 or .48. I use log_softmax with NLLLoss. What about you @xiangzhang06 ?

dalonzom commented 4 years ago

Hello! Has anyone found any success with this? When I try to run infer_cls, every value in the CAM comes up as 0. The only change in train_cls I made was changing the number of labels, and loss only decreases from 0.6929 to 0.606.

zijinY commented 3 years ago

Hello! Has someone solved such a problem? I also got all-zero CAMs.