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

model weights info #12

Closed sinAshish closed 5 years ago

sinAshish commented 5 years ago

hi @jiwoon-ahn @hardBird123 , I wanted to know if you trained the vgg16 model from scratch or used a imagenet pre-trained model and used only specific layers of it for training on voc12?

jiwoon-ahn commented 5 years ago

Hi @sinAshish, all of the backbones are first pre-trained on ImageNet, and then we finetune the entire network with the VOC2012 image-level labels or our affinity labels. You can try from scratch, but the result of this will be really bad in accuracy.

sinAshish commented 5 years ago

If I may,how have you finetuned the network?

jiwoon-ahn commented 5 years ago

It's simple. For the network computing CAMs, the backbone and the newly added layer (the final fully connected layer for classification) are simultaneously trained, but the latter receives a 10x learning rate of the backbone does. This is a common training scheme of using imagenet pretrained weights. You can check the details in train_cls.py or train_aff.py file in this repository.

sinAshish commented 5 years ago

Got it. Thanks !

sinAshish commented 5 years ago

This may sound very foolish to you, but if you don't mind answering. I run the train_cls.py as mentioned in the readme, but it requires pretrained model weights as arguments, now say that I want to generate CAMs on some other dataset, so I just need to remove weights as a mandatory argument and train the model and save the weights right? I don't have a gpu, so it is taking like forever to test any of my hypothesis, so I thought better to ask you!

jiwoon-ahn commented 5 years ago

In my opinion, it depends on your environment. You can give it a try, but I don't recommend to go without pre-trained weights if the dataset does not have more than 100k images and answers.

sinAshish commented 5 years ago

Was there any specific reason for using pre-trained weights in caffe, you could have used pytorch weights!

jiwoon-ahn commented 5 years ago

Using caffe weights can be hard. But those weights are not mine, and I think it is inappropriate of me to modify it my own purpose. Sorry for the inconvenience.