4
$\begingroup$

Recently, I've been seeing more and more code/paper using even size kernels in ConvNets, which is quite counter-intuitive to me. I wish someone could shed some light on the reasoning behind it:

  1. When is an even-size kernel preferred, and why?
  2. How does an even-size kernel is placed on an image since it doesn't have a specific center point as an odd-size kernel?

An example of even-size kernels applied to ConvNet:

https://github.com/rtqichen/beta-tcvae

Thanks in advance.

$\endgroup$
2
  • $\begingroup$ Could you explain why you feel its counter-intuitive to you? I dont see why even or odd matters much. $\endgroup$ – Anonymous Emu May 6 '19 at 21:45
  • $\begingroup$ For an odd-size kernel, I know that its center is aligned with pixels in the image. For an even-size kernel, there is no such a center point, and I'm confused about how the kernel is combined with the image. $\endgroup$ – Maybe May 7 '19 at 0:39
2
$\begingroup$

To the best of my knowledge, there is no consistent answer to the first question. It's like asking "is it better to use (3,3) kernel size or (5,5) kernel size?". As far as I know, the reason behind choosing either an even or odd kernel comes from trial and error in practical implementations and can vary from one case to the other.

For the second question, it is not counter-intuitive, the following picture shows it in a nice way: enter image description here

  • Begin with aligning the even kernel (here (4,4)) to the upper left part of the input feature map
  • do element-wise multiplication between kernel and input feature and then take the sum, sum leads to the upper left position of the output feature map
  • slide the kernel to the right (by arbitrary stride)
  • do element-wise multiplication between kernel and input feature and then take the sum, sum leads to the value of the second position in output feature map
  • repeat this scenario
$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.