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

I have a problem with increasing the accuracy or decreasing the loss when using the ml decoder. #45

Open
penguin1109 opened this issue May 10, 2022 · 5 comments

Comments

@penguin1109
Copy link

Thanks for the implementation and great project!

I actually saw a similar issue to mine, which was solved by decreasing the learning rate.
I tried the same, but there seems to be no difference.

I am currently using the ml decoder on a TResNet-M for a single label classification problem.

I used the ml decoder code you implemented and after replacing the backbone model's global_pooling and head to nn.Identity(),
I attached the ml decoder for classification.
Does there seem to be a problem with my usage?

I also want to ask you if there is another way to actually install the ml decoder instead of using the entire code for usage.

Thank you.

@giladsharir
Copy link
Collaborator

Can you provide more information: what dataset are you training? what accuracy did you reach? what training hyper-parameters? etc.
We currently don't have an install package option

@penguin1109
Copy link
Author

Thanks for the response.
I am currently handling image data for the Herbarium 2022 Competition that is hosted by Kaggle.

I am using the TResNet for the backbone CNN layer, and was trying to compare the GAP and ml decoder for our classification head.

I have tried both the Adam and AdamW optimizer with the starting learning rate ranging from 1e-4 to 3e-4, and using the Cross Entropy Loss for the single label classification problem.

As you wrote on the readMe file, the ml decoder gets the input from the output before the TResNet's global_pool layer.

Is this implementation correct?

@penguin1109
Copy link
Author

The accuracy jittered from 0.13 to 0.14 for 20epochs, and I used the macro f1 score for the metric function. When I used GAP, the best accuracy was 0.97.

What could be the problem??

@giladsharir
Copy link
Collaborator

giladsharir commented May 12, 2022

If the dataset contains many classes (>10K ) you can try increasing the num-of-groups argument to 200 or 300, (current default value is 100).
Otherwise you can look at the details on Single-Label in the readme. We mainly followed the training procedure described in "Resnet strikes back" paper - training with sigmoid, instead of softmax. (read the details in our paper)
The implementation you described seems to be correct.

@penguin1109
Copy link
Author

I actually seemed to have been setting the group_num parameter to -1. I'll change and try again-thanks a lot!

But to be honest, I am actually not that sure why this parameter is critical for the accuracy.

And yes, the target class for my dataset is quite large, but not more than 10K.

And do you think is would be helpful for me to use the pretrained weights of your COCO-448 TResNet-L model??

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

2 participants