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

A question about the split of dataset #77

Open
wuxchcandoit opened this issue Jun 10, 2023 · 2 comments
Open

A question about the split of dataset #77

wuxchcandoit opened this issue Jun 10, 2023 · 2 comments

Comments

@wuxchcandoit
Copy link

wuxchcandoit commented Jun 10, 2023

Hi!
In the paper, dataset is split into two parts, training slides and testing slides. In the code, testing dataset is evaluated after every epoch of training. It seems that testing dataset is used as validation dataset. Do the classification results come from results of the last evaluation? Which do the classification results come from, results of the last evaluation or the best evaluation?

@wuxchcandoit wuxchcandoit changed the title A question about the number of patches (per bag) used to train the model A question about the split of dataset Jun 14, 2023
@binli123
Copy link
Owner

Hi, the test set should be reserved before the training, and the training process further splits the training data into a training set and a validation set. After the training is done you can then evaluate with the best model on the test data.

@binli123
Copy link
Owner

I incorporated the training/testing into the same pipeline in the latest commit. You can set --eval_scheme=5-fold-cv-standalone-test which will perform a train/valid/test like this:

A standalone test set consisting of 20% samples is reserved, remaining 80% of samples are used to construct a 5-fold cross-validation.
For each fold, the best model and corresponding threshold are saved.
After the 5-fold cross-validation, 5 best models along with the corresponding optimal thresholds are obtained which are used to perform inference on the reserved test set. A final prediction for a test sample is the majority vote of the 5 models.
For a binary classification, accuracy and balanced accuracy scores are computed. For a multi-label classification, hamming loss (smaller the better) and subset accuracy are computed.

You can also simply run a 5-fold cv --eval_scheme=5-fold-cv

There were some issues with the testing script when loading pretrained weights (i.e., sometimes the weights are not fully loaded or there are missing weights, setting strict=False can reveal the problems.). The purpose of the testing script is to generate the heatmap, you should now read the performance directly from the training script. I will fix the issues in a couple of days.

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