This is my personal implementation(with Torch) of HookNet. I also summarize HookNet paper in my blog.
We propose HookNet, a semantic segmentation model for histopathology whole-slide images, which combines context and details via multiple branches of encoder-decoder convolutional neural networks. Concentric patches at multiple resolutions with different fields of view are used to feed different branches of HookNet, and intermediate representations are combined via a hooking mechanism. - Mart van Rijthoven. (2020)
pip install -r requirements.txt
Above, I install python 3.6 with CUDA 11.4
model/hooknet.py
: main HookNet [input_image_shape :: (284x284x3) x 2, input_mask_shape :: (70x70) x 1]model/hooknet_se_resnext101_32x4d.py
: main HookNet_SE-ResNeXt101_32x4d model script [input_image_shape :: (512x512x3) x 2, input_mask_shape :: (512x512) x 2]datagen.py
: the data dataloader and augmentation scriptfunctional.py
: naming a weight of model and converting outputs to images script train.py
: main training scriptHooknet
├ slide_num_1
| ├ input_x100
| ├ input_x50
| ├ input_x25
| ├ input_x12
| └ input_y1
.
.
.
└ slide_num_n
├ input_x100
├ input_x50
├ input_x25
├ input_x12
└ input_y1
if you want to train with hooknet(normal) or quad_scale_hooknet... (This model trains with valid padding.)
if you want to train with hooknet(se_resnext101_32x4d)... (This model trains with same padding.)
You can get this data structure by using util_multi.py
python train.py
You can adjust hyper parameters in config.py