Adway,
Everything works out of the box!
Good to know, thanks for the feedback
I was just curious about experimenting with larger patch sizes to see what the results of the pre-trained model would be for larger patches. Do you think I will need to re-train the model for a larger/smaller patch size?
Short answer
Yes!
Long answer
Given a fixed image resolution (e.g., 1x1x1mm, as in this case), the feature extractors/kernels of the convolutional layers are in principle independent on the dimension on the input (they will simply “slide more” and produce a bigger activation map).
However, if you look at the model architecture, you will see that some of the layers depend on the dimension of the input data - crucially one, i.e., the 7M units dense_1
fully connected layer after the last 3D Max Pooling maxpooling3d_2
. If the input dimension changes, since the pooling kernel has a fixed dimension, the number of deep features after the flatten_1
changes, and therefore the forward pass cannot be completed (you will have less or more features than 13824).
This could have been taken are of, e.g., by using a 3D adaptive average pooling layer instead of the max pooling (in that case, the kernel size gets computed on the fly based on the number of features going in and the required number of features going out). The choice of keeping the input fixed-size is arbitrary - and to be fair, you will see this in most of the cases/published models anyway. In this case, the input size choice, as described in the paper, depended on the size of the bounding boxes drawn around the tumours of the NSCLC patients in the three datasets.
What Hosny et Al. did though, was testing, for instance, how robust the model was to perturbations in the segmentation masks (and therefore perturbation of the center of mass around which the 50x50x50 patch is cropped).
Do you think I will need to re-train the model for a larger/smaller patch size?
Although I wouldn’t advise this, If one really wanted to do it I would strongly suggest to keep the first part of the model (the one extracting the deep features) intact (with some fiddling it’s definitely possible), and re-train only the fully connected layers. Keep in mind this is a hard task to do (not from the learning perspective, but simply because you will need a training, a validation and a testing dataset to validate your results and make sure the prognostic power of the model is not lost after the operation)!
Let me know if I can help with something else!