SBU-BMI / wsinfer

🔥 🚀 Blazingly fast pipeline for patch-based classification in whole slide images
https://wsinfer.readthedocs.io
Apache License 2.0
56 stars 10 forks source link

[ADD] vgg16 tils model #112

Closed kaczmarj closed 1 year ago

kaczmarj commented 1 year ago

this pr adds the vgg16 tils model from https://github.com/ShahiraAbousamra/til_classification

the original model was implemented in tensorflow slim and the weights were converted to a pytorch state dict using the script https://github.com/SBU-BMI/wsinfer/blob/main/scripts/convert_tf_to_pytorch_til_vgg16.py

the tensorflow model file was downloaded from Box (https://stonybrookmedicine.app.box.com/file/905508899913?s=r0p2h2oh53zw52o6fm6qrqjtcwd3p0ga). the weights files were those with the prefix tcga_vgg16_mix_new3.ckpt.

i am not 100% sure that the image normalization is correct. at the moment, images are normalized to range [-1, 1]. this appears to give correct output. normalizing each image to mean 0 and variance 1 gave poor results so it is probably not correct. using original image values [0, 255] also gave poor results. the original code does reference normalizing to [-1, 1] but it is not fully clear that this was used for this model.

fixes #110