CNNbasedMedicalSegmentation icon indicating copy to clipboard operation
CNNbasedMedicalSegmentation copied to clipboard

how to caculate the receptive field for the deconvolution layers

Open caney1989 opened this issue 6 years ago • 2 comments

Hi! I have read your paper carefully and your excellent work has gave me a lot of help. However, i have some trouble for how to caculate the receptive field for the deconvolution layers. I caculated the receptive field for the networks by myself , but i can not find the right way to caculate the deconvolution layers. Could you show me some details for this caculation? Thanks very much!!

caney1989 avatar Mar 24 '18 16:03 caney1989

Thank you for the kind words. One can use eq. 7 of our paper to calculate the receptive field of any layer in the network:

rec_field_0 = 1
rec_field_next = rec_field_current + (2 ** (n_downsample - n_upsample)) * (filter_size)

n_downsample and n_upsample are the number of strided convolutions and deconvolutions used in the network up to that point. Essentially, the increase of the receptive field is just the usual increase one gets from using a convolution with a certain filter size, multiplied by a factor that depends on how much the image was up- or downsampled. For example, in Table 7, the receptive field size of layer 6 is 29. This increases to 45 in layer 7. This is because up to that point, we have used three subsampling operations, such that any 3x3x3 convolution increases the receptive field by 2^3 * 2 = 16. Between layer 7 and layer 9, the image gets upsampled using nn-interpolation. This means that the next 3x3x3 convolution will increase the total receptive field by 2^(3-1) * 2 = 8. After the next upsampling operation between layers 10 and 12, the increase will only be 2^(3-2) * 2 = 4, and so on.

bkayalibay avatar Mar 24 '18 18:03 bkayalibay

I have figured out this poing. Thank you for your detailed explanation!! Best wish to you !!!

caney1989 avatar Mar 25 '18 07:03 caney1989