abhimanyudubey / confusion

Code for the ECCV 2018 paper "Pairwise Confusion for Fine-Grained Visual Classification"
https://arxiv.org/abs/1705.08016
200 stars 39 forks source link

How to reproduce the result of densenet161 #10

Open ParsonsZeng opened 5 years ago

ParsonsZeng commented 5 years ago

Hi, I think I have some problem with my code, so I can not reproduce the result of densenet161 with pytorch. I use the pretrained Densenet161 to train on CUB200, with standard SGD, linear-decay of learning rate, initial learning rate 0.1, 40k iterate, 32 batch size. My result is 83.38%, and your paper is 84.21%.

And then, I add the pairwiseconfusion to the loss like : loss = criterion(y, y) + 10* PairwiseConfusion(y). And the result is 83.58%, and your paper is 86.87%.

Can you help me to reproduce the result? Thank you.

abhimanyudubey commented 5 years ago

Hi, how many stages are you doing the training for?

ParsonsZeng commented 5 years ago

Referring to your paper, I think it is just one stage to train the CNN, so it is one stage to train the densenet, without freezing the conv parameters. At this moment, the performances of densenet can be 84.3% without PC, and 85.4% with PC. The input of PC is the output of softmax. But it also cannot achieve the result in your paper. So I think some tricks are missing?

goldentimecoolk commented 5 years ago

Hi, I think I have some problem with my code, so I can not reproduce the result of densenet161 with pytorch. I use the pretrained Densenet161 to train on CUB200, with standard SGD, linear-decay of learning rate, initial learning rate 0.1, 40k iterate, 32 batch size. My result is 83.38%, and your paper is 84.21%.

And then, I add the pairwiseconfusion to the loss like : loss = criterion(y, y) + 10* PairwiseConfusion(y). And the result is 83.58%, and your paper is 86.87%.

Can you help me to reproduce the result? Thank you.

Hello, I fine tune densenet161 on the bird dataset in two stages, i.e., freezing conv layers&fine tune classifier, fine tune all layers. But the highest top1 is just 78%. When I fine tune all layers directly in one stage, it could even be worse, only 50%+ accuracy. My hyper parameters are the same as yours in above. Is there anything need to be take care? Thank you!

ParsonsZeng commented 5 years ago

Hi, I think I have some problem with my code, so I can not reproduce the result of densenet161 with pytorch. I use the pretrained Densenet161 to train on CUB200, with standard SGD, linear-decay of learning rate, initial learning rate 0.1, 40k iterate, 32 batch size. My result is 83.38%, and your paper is 84.21%. And then, I add the pairwiseconfusion to the loss like : loss = criterion(y, y) + 10* PairwiseConfusion(y). And the result is 83.58%, and your paper is 86.87%. Can you help me to reproduce the result? Thank you.

Hello, I fine tune densenet161 on the bird dataset in two stages, i.e., freezing conv layers&fine tune classifier, fine tune all layers. But the highest top1 is just 78%. When I fine tune all layers directly in one stage, it could even be worse, only 50%+ accuracy. My hyper parameters are the same as yours in above. Is there anything need to be take care? Thank you!

I think you should calculate the confusion loss after softmax. And I just train the network in one stage without any tricks. However, I can not get the accuracy of the paper and I think I also lose some tricks>

goldentimecoolk commented 5 years ago

Hi, I think I have some problem with my code, so I can not reproduce the result of densenet161 with pytorch. I use the pretrained Densenet161 to train on CUB200, with standard SGD, linear-decay of learning rate, initial learning rate 0.1, 40k iterate, 32 batch size. My result is 83.38%, and your paper is 84.21%. And then, I add the pairwiseconfusion to the loss like : loss = criterion(y, y) + 10* PairwiseConfusion(y). And the result is 83.58%, and your paper is 86.87%. Can you help me to reproduce the result? Thank you.

Hello, I fine tune densenet161 on the bird dataset in two stages, i.e., freezing conv layers&fine tune classifier, fine tune all layers. But the highest top1 is just 78%. When I fine tune all layers directly in one stage, it could even be worse, only 50%+ accuracy. My hyper parameters are the same as yours in above. Is there anything need to be take care? Thank you!

I think you should calculate the confusion loss after softmax. And I just train the network in one stage without any tricks. However, I can not get the accuracy of the paper and I think I also lose some tricks>

Thanks for your reply. I fine tune the densenet161 in one stage with different lr in backbone and classifier and get your result, 83.38%. However, the new problem is when I add confusion loss which is calculated after softmax, no matter fine tune the network from Imagenet params or 83.38% params, it could not get improved at all. Can you share your pytorch code with me in email or whatever way? My email is jsktt01@gmail.com . Thank you very much!

yomna-safaa commented 5 years ago

@goldentimecoolk did you manage to get the pytorch code working as the paper? Thank you