binli123 / dsmil-wsi

DSMIL: Dual-stream multiple instance learning networks for tumor detection in Whole Slide Image
MIT License
358 stars 88 forks source link

How to get ACC of the Slide Class Prediction #84

Closed bryanwong17 closed 9 months ago

bryanwong17 commented 9 months ago

Hi, Thank you for the amazing work! From what I understand, num_classes is equal to the number of positive classes. Let's say I have classes D and M as positive classes and N as the negative class. When converting these to one-hot labels, the ground truth labels would look like this:

Slide label 0 (D: positive class 1) -> One-hot label: [1 0] Slide label 1 (M: positive class 2) -> One-hot label: [0 1] Slide label 2 (N: negative class) -> One-hot label: [0 0]

Now, if the model prediction for the slide is [1 1], indicating that the model predicts both D and M , how can I calculate the accuracy (ACC) of the slide class prediction? Is it appropriate to classify this as a false prediction since it does not fit into any of the three categories (D, M, N)?

Thank you!