Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between different kernel sizes(1x1, 3x3, 5x5) in a convolution neural network? [closed]

I am working on cnn for image classification, i want to understand the difference between 1x1, 3x3, 5x5 size kernel in conv layer of cnn. Effect of each kernel, usages, advantage and disadvantage. When to use which kernel size. Does the size of kernel depends on the type of data, or size of data.

like image 774
Rahul Verma Avatar asked May 27 '19 06:05

Rahul Verma


1 Answers

Lets divide the kernel sizes into 2 parts small and large, small being 1x1, 3x3 and large being 5x5.

Now the various comparisons between the 2 types of kernels could be as follows:

  • Receptive Field : The small kernel will have a smaller receptive field which means it will look at very few pixels at once whereas a large kernel will look at a larger field view. This in turn would mean the the features extracted by a small kernel would be highly local whereas the features extracted from the large kernel would be generic and spread across the image.
  • Amount of Information extracted : Small kernels would extract small complex features whereas the large kernel would extract simpler features . The amount of features extracted by large kernels would be considerably lesser than the small kernels.
  • With respect to Network :
    • Small kernels would lead to slow reduction of image dimensions making the network deep whereas large kernels would decrease the size of the image really fast. Weight sharing is better in small kernels than large kernel. For example : Number of weights in two 3x3 kernels = 3x3 + 3x3 = 18 whereas the number of weights in 5x5 would be 25.
  • Memory : Since smaller kernels tend to make the network deeper it will require more memory whereas larger network tends to make the network smaller so requires less memory.

So 3x3 kernel is a popular choice among 1x1, 3x3 and 5x5 kernel for both reducing the dimensions of the images and capturing neighborhood information. But this might not be applicable to all the datasets, for different datasets you will have to experiment with different kernel sizes and see which one performs the best for you. But yea to get an idea you consider the fact about complexity of features you want to capture in your image.

Notes that might be helpful :
- 1x1 convolutions have their importance in dimensionality reduction for images. You can read about it here : https://iamaaditya.github.io/2016/03/one-by-one-convolution/
- If you use an image sized kernel(large kernel) it will work just as a dense/fully connected layer.

like image 51
Akash Basudevan Avatar answered Sep 28 '22 04:09

Akash Basudevan