We have updated the pretrained weights of ResNet50 to 'https://download.pytorch.org/models/resnet50-11ad3fa6.pth', and it achieved an AUC of 93, which is very close to the result using the official repo of DTFD-MIL with its provided pickle dataset.
After consulting the authors, patch feature extration method in this repo has now been modified.
This repo is built to help readers better understand CVPR2022 paper DTFD-MIL: Double-tier feature distillation multiple Instance learning for histopathology whole slide image classification.
This is NOT an official implementation of the paper. The official one is here
Dataset
Model
Code-style
Download CAMELYON16 dataset here
Clone this repo. Cd into this repo.
Run 'Patch-Generation/gen_patch_noLabel_stride_MultiProcessing_multiScales.py' to convert each WSI into a folder of patches. This file is from the official DTFD-MIL repo.
Run 'patches2feature.py' to convert each patch into a 1024-dimension vector. This file will run through all the patches in a folder and eventually generate a feats1024.npy for each WSI. In other words, by running this file, we can convert a gigapixel WSI into a Nx1024 matrix (N is the number of patches in a WSI).
Run 'train_DTFD-MIL.py' to train and validate the framework.
loss1.backward() raises an Exception that gradient has changed.
Prerequests: