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

Question about handling of bag and instance labels #13

Open
butkej opened this issue Jun 24, 2020 · 3 comments
Open

Question about handling of bag and instance labels #13

butkej opened this issue Jun 24, 2020 · 3 comments

Comments

@butkej
Copy link

butkej commented Jun 24, 2020

Hello,

I've got a short question about the network data input shapes during training (and testing).
Regarding the original pytorch implementation of Ilse et al. it seems that there is a bag of instances [n,x,y,z] with a single label attached to it as a single value. Then you have multiple bags m and in total m labels. Makes sense so far when reading the description in the original publication.

However, now in this implementation we have the same bag of instances [n,x,y,z] but instead of a single label there is array of label instances [n,]. This label instance is indeed derived from the binary bag label (0 or 1) but extended to each instance.

Why is that the case? Is it not possible in tensorflow to train the model in a similar way to the original publication? Maybe I am missing something here but I would be happy if anyone could help me out.

Thank you for your work on this implementation!

Kind regards,
Joshua

@utayao
Copy link
Owner

utayao commented Jun 24, 2020

Hi Josuha,

The label instance [n,] is the hidden instance label defined in multiple instance learning, but actually you don't need to know the ground-truth value during your training. In implementation, we set batch size to 1, and each time, Attention MIL pooling will pool those n instance features to one bag feature. After FC layers, the output will be the one predicted bag label for this bag.

@butkej
Copy link
Author

butkej commented Jun 24, 2020

Ok thank you I wondered about this a lot. So it's more like a tensorflow-specific implementation detail because it's not possible otherwise?
Is there any reason this could be hindering to extend this approach to multiclass MIL?
Thank you so much for your fast answer :)

@narminGhaffari
Copy link

Regarding this issue, but the output shape for each training bag is "bagLabel * len(bag)", right?

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

3 participants