Answers.Body: <p>Take a look at <a href="https://cs.nyu.edu/~fergus/papers/zeilerECCV2014.pdf" rel="nofollow noreferrer">this article</a>. It give tools to actually understand what your filters have learn and show what you can do next to optimize your hyper-parameters. Also check more recent articles that seek to provide interpretations of what NN learn. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-16T12:49:43.390Z
Answers.LastActivityDate: 2018-03-16T12:49:43.390Z
Answers.UserDisplayName: Robin
Answers.Body: <p>One key to the answer is in the question, "Even for one specific conv layer."  It is not a good idea to build deep convolution networks on the assumption that a single kernel size most aptly applies to all layers.  When perusing the configurations that proved successful in publications, it becomes apparent that configurations that varying through their layers are more commonly found to be optimal.</p>
  
  <p>The other key is to understand that two layers of 11x11 kernels have a 21x21 reach, and ten layers of 5x5 kernels have a 41x41 reach.  A mapping from one level of abstraction to the next need not be completed in one layer.</p>
  
  <p>Generalities regarding kernel sizes exist, but they are functions of the typical input characteristics, the desired output of the network, the computing resources available, resolution, size of the data set, and whether they are still images or movies.</p>
  
  <p>Regarding input characteristics, consider this case: The images are shot with a large depth of field under poor lighting conditions, such as in security scenarios, so the aperture of the lens is wide open, causing objects at some ranges of distance to be out of focus, or there can be motion blur.</p>
  
  <p>Under such conditions a single 3x3 kernel will not detect many edges.  If the edge may span five pixels, the choice exists as to how many layers are dedicated to its detection.  What factors affect that choice is based on what other characteristics exist in the input data.</p>
  
  <p>Expect that as acceleration hardware develops (in VLSI chips dedicated to this purpose) that the computing resource constraints will decrease in priority as a factor in kernel size selection.  Currently, the computation time is significant and forces the decision about how to balance layer count and layer size to be mostly a matter of cost.</p>
  
  <p>This question begs another question.  Can an oversight machine learner learn how to automatically balance the configuration of deep convolution networks?  It could then be re-executed whenever additional computing resources are provisioned.  It would be surprising if there weren't at least a dozen labs working on exactly this capability.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-13T09:53:58.070Z
Answers.LastActivityDate: 2018-10-13T10:02:14.467Z
Answers.LastEditDate: 2018-10-13T10:02:14.467Z
Answers.UserDisplayName: Douglas Daseeco
Body: <p>Obviously, finding suitable hyper-parameters for a neural network is a complex task and problem or domain-specific. However, there should be at least some "rules" that hold most times for the size of the filter (or kernel)!</p>
  
  <p>In most cases, intuition should be to go for small filters for detecting high-frequency features and large kernels for low-frequency features, right? For example, <span class="math-container">$3 \times 3$</span> kernel filters for edge detection, color contrast, etc., and maybe <span class="math-container">$11 \times 11$</span> for detecting full objects, when the objects occupy an area of roughly <span class="math-container">$11 \times 11$</span> pixels.</p>
  
  <p>Is this "intuition" more or less generally true? How can we decide which kernel's sizes should be chosen for a specific problem - or even for one specific convolutional layer?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-29T23:03:50.080Z
Comments.Text: You may be interested in the papers [Selective Kernel Networks](https://openaccess.thecvf.com/content_CVPR_2019/papers/Li_Selective_Kernel_Networks_CVPR_2019_paper.pdf) (2019, CVPR) by Xiang Li et al and [Optimizing Filter Size in Convolutional Neural Networks for Facial Action Unit Recognition](https://openaccess.thecvf.com/content_cvpr_2018/papers/Han_Optimizing_Filter_Size_CVPR_2018_paper.pdf) (2018, CVPR) by Shizhong Han et al.
Comments.UserDisplayName: nbro
Tags: <convolutional-neural-networks><image-recognition><hyperparameter-optimization><hyper-parameters><filters>
Title: How do we choose the kernel size depending on the problem?
UserDisplayName: daniel451
ThreadText: # How do we choose the kernel size depending on the problem?
  
  (Asked by: username_0 on 2017-05-16)
  
  Obviously, finding suitable hyper-parameters for a neural network is a complex task and problem or domain-specific. However, there should be at least some "rules" that hold most times for the size of the filter (or kernel)!
  
  In most cases, intuition should be to go for small filters for detecting high-frequency features and large kernels for low-frequency features, right? For example, $3 \times 3$ kernel filters for edge detection, color contrast, etc., and maybe $11 \times 11$ for detecting full objects, when the objects occupy an area of roughly $11 \times 11$ pixels.
  
  Is this "intuition" more or less generally true? How can we decide which kernel's sizes should be chosen for a specific problem - or even for one specific convolutional layer?
  
  **Tags:** convolutional-neural-networks, image-recognition, hyperparameter-optimization, hyper-parameters, filters
  
  > **Comments:**
  > **username_1**: You may be interested in the papers [Selective Kernel Networks](https://openaccess.thecvf.com/content_CVPR_2019/papers/Li_Selective_Kernel_Networks_CVPR_2019_paper.pdf) (2019, CVPR) by Xiang Li et al and [Optimizing Filter Size in Convolutional Neural Networks for Facial Action Unit Recognition](https://openaccess.thecvf.com/content_cvpr_2018/papers/Han_Optimizing_Filter_Size_CVPR_2018_paper.pdf) (2018, CVPR) by Shizhong Han et al.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-03-16. Score: 2
  
  Take a look at [this article](https://cs.nyu.edu/~fergus/papers/zeilerECCV2014.pdf). It give tools to actually understand what your filters have learn and show what you can do next to optimize your hyper-parameters. Also check more recent articles that seek to provide interpretations of what NN learn.
  
  
  ---
  
  ### Answer by username_3 on 2018-10-13. Score: 1
  
  One key to the answer is in the question, "Even for one specific conv layer." It is not a good idea to build deep convolution networks on the assumption that a single kernel size most aptly applies to all layers. When perusing the configurations that proved successful in publications, it becomes apparent that configurations that varying through their layers are more commonly found to be optimal.
  
  The other key is to understand that two layers of 11x11 kernels have a 21x21 reach, and ten layers of 5x5 kernels have a 41x41 reach. A mapping from one level of abstraction to the next need not be completed in one layer.
  
  Generalities regarding kernel sizes exist, but they are functions of the typical input characteristics, the desired output of the network, the computing resources available, resolution, size of the data set, and whether they are still images or movies.
  
  Regarding input characteristics, consider this case: The images are shot with a large depth of field under poor lighting conditions, such as in security scenarios, so the aperture of the lens is wide open, causing objects at some ranges of distance to be out of focus, or there can be motion blur.
  
  Under such conditions a single 3x3 kernel will not detect many edges. If the edge may span five pixels, the choice exists as to how many layers are dedicated to its detection. What factors affect that choice is based on what other characteristics exist in the input data.
  
  Expect that as acceleration hardware develops (in VLSI chips dedicated to this purpose) that the computing resource constraints will decrease in priority as a factor in kernel size selection. Currently, the computation time is significant and forces the decision about how to balance layer count and layer size to be mostly a matter of cost.
  
  This question begs another question. Can an oversight machine learner learn how to automatically balance the configuration of deep convolution networks? It could then be re-executed whenever additional computing resources are provisioned. It would be surprising if there weren't at least a dozen labs working on exactly this capability.
  
  
  ---
  
  