psa
psa copied to clipboard
CAMs on custom dataset
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?
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)
Thanks for the suggestion. I'll try it out and see if it works.
I have trained the classification model on my own data set, which is similar to your result. How do you solve this problem? @sinAshish
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.
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 ?
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.
Hello! Has someone solved such a problem? I also got all-zero CAMs.