Kernel Size and Why Everyone Loves 3x3 - Neural Network Convolution

21,859
0
Published 2022-07-14
Patreon: www.patreon.com/Animated_AI

Find out what the Kernel Size option controls and which values you should use in your neural network.

All Comments (21)
  • The basic reason we don't use (even number) x (even number) layers, is because those layers don't have a "center". Having a "center" pixel (as in a 3 x 3 configuration) is very useful for max and average pooling - it's much more convenient for us.
  • @pritomroy2465
    In the Unet, GAN architecture when it is required to generate a feature map half of its actual size a 4x4 kernel size is used.
  • @maxlawwk
    Perhaps 2x2 kernel is a common trick for learnable stride-2 downsample kernel and upsample deconvolution kernel. It is a more likely about computation efficiency instead of network performance, because such kernels are almost equivalent to downsample/upsample followed by a 3x3 kernel. In this regard, 2x2 combo with stride-2 down/upsample operations do not shrink the resultant feature map size by 2 as 3x3 kernel does, possibly beneficial to image generation tasks. In GAN, 2x2 or 4x4 kernels are commonly found in discriminators which emphasize non-overlapping kernels to avoid grid artifacts.
  • @Firestorm-tq7fy
    I don’t see a reason for 1x1. All you achieve is loosing information, while also creating N-features, each scaled by a certain factor. This can also be achieved within a normal layer (the scaling i mean). There is rly no point. Obviously outside of Depthwise-Pointwise combo. Pls correct me if I’m missing smt.
  • I think odd sized filters are mainly used since we often use a stride of 1. Each pixel (except for the edges) will then be filtered based on the surrounding pixels (defined by the kernel size). If the kernel size is even the pixel that the kernel represents would be the average pixel of the 4 middle pixels. It introduces a sort of shift of 0.5 pixel. I think it might be fine mathematically speaking, but it feels odd or wrong. Also if you worked with Gaussian filters (which I assume many CNN researchers has) you are literaly forced to use odd sized filters there.
  • This is honestly the best video related to machine learning in general I have seen, amazing work. Most people just pull architectures out of thin air or make a clumsy disclaimer to experiment with numbers. This video shows 3d visual representations of popular CNN architectures, and really helps you build all cnns in general.
  • @schorsch7400
    Thanks for the effort of maxing this excellent visualization! This creates a very good intuition for how convolutions work and why 3x3 is dominant.
  • @kznsq77
    The even size of the kernel does not allow symmetrical coverage of the area around the pixel
  • @naevan1
    Wow really beatiful animations , great job! However I got kinda confused since I always saw convolution in 2d haha
  • @bangsa_puja
    How about of kernel 1x7, 7x1 in inception modul C. Please help me
  • @josephpark2093
    There was no reason that I should have this very question and there had to be a great video telling me the exact reason why on the internet. Bless!
  • @alansart5147
    friking love your videos! Keep up with your awesome work! :D
  • @Antagon666
    Wait so why do we need larger filters in first layer ? To extract more features from only the 3 channels ? And what is better, more chained filters with lower channel count, or lesser amount of chained filters with more channels ?