Answers.Body: <p>If the filter is separable, that is, the NxM kernel can be mathematically equal to the convolution of a Nx1 filter and a 1xM filter, there are a very important increase in performance.</p>
  <p>Using separable convolution, the network can made an optimal usage of the shared memory and of the parallelism in memory access. See <a href="https://www.google.es/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;ved=2ahUKEwitnfqX98zsAhULkhQKHREPDtwQFjAAegQIBhAC&amp;url=http%3A%2F%2Fdeveloper.download.nvidia.com%2Fassets%2Fcuda%2Ffiles%2FconvolutionSeparable.pdf&amp;usg=AOvVaw1eIqyLuJT6nJDVK7jmyMmX" rel="nofollow noreferrer">this</a> excellent article for details. These improvements are bigger for bigger kernels.</p>
  <p>Also the training is improved, starting by the simple fact that a NxM filter has a number of parameters proportional to N*M but the related separable one has N+M.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-26T03:54:47.247Z
Answers.Text: the linked document doesn't provide any info that separable filters increase the performance, although it does say that it increases efficiency.
Answers.UserDisplayName: bit_scientist
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-26T09:41:35.187Z
Answers.Text: @bit_scientist: see chapters "Separable Filters Can Increase Efficiency" and "Performance" (this one with a comparative graphic againts one of the other usual methods, convolution texture)
Answers.UserDisplayName: pasaba por aqui
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-24T09:46:53.173Z
Answers.LastActivityDate: 2020-10-24T11:45:03.217Z
Answers.LastEditDate: 2020-10-24T11:45:03.217Z
Answers.UserDisplayName: pasaba por aqui
Answers.Body: <p>First of all, Keep in mind that maths operations aren’t the only thing that contribute to performance. Memory bandwidth can also be a factor.</p>
  <p>And most importantly, we want to capture as much area as we can in lowest possible number of operations. So in 3x3 kernel case, we can capture 9 cells in one shot, but with 3x1 followed by 1x3, we have to compute 6 times to capture 9 cells. Which clearly states that 3x3 kernel is far more efficient than these two sequential kernels.</p>
  <p>So, answer to your question will be no, it will not improve performance, instead it will increase computation overhead for your system.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-24T10:20:40.877Z
Answers.Text: " but with 3x1 followed by 1x3, we have to compute 6 times": no. "3x3 kernel is far more efficient than these two ": no. I think you must review what is a separable convolution.
Answers.UserDisplayName: pasaba por aqui
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-24T04:16:05.273Z
Answers.LastActivityDate: 2020-09-24T04:16:05.273Z
Answers.UserDisplayName: Leo
Body: <p>Recently I have come up with a VGG16 model for my binary classification task. I have relatively simple signal images</p>
  <p><a href="https://i.sstatic.net/w6K40.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/w6K40.png" alt="this" /></a></p>
  <p>Therefore (maybe?) other deeper models like <code>resnet18</code> and <code>Inceptionv3</code> were not as good. As known, VGG uses <code>3x3</code> filters for convolving the images to make feature maps. I have tried several hyper-parameters to get a desired performance. However, there are still some things I need to do. I was thinking of replacing the <code>3x3</code> <code>conv</code> filters with <code>3x1</code> followed by <code>1x3</code> filters to reduce the compute. I think it will definitely do so considering the multiplications (9 operations for <code>3x3</code>and 6 for <code>3x1</code> followed by <code>1x3</code>).</p>
  <p>Then I came to think: <em><strong>If I replace all the <code>3x3</code> filters with separable filters, will I get any performance improvement?</strong></em></p>
  <p>What are the benefits of replacing <code>3x3</code> filters with separable ones?</p>
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-23T16:21:21.180Z
Comments.Text: Do you have to use an image of the signal *plot* like your example here? Do you have access to the raw signal data instead?
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-23T23:59:32.103Z
Comments.Text: yes I can only use images like shown above. I wish I had a raw signal data.
Comments.UserDisplayName: bit_scientist
Tags: <deep-learning><filters><vgg>
Title: Does replacing 3x3 filters with 3x1 and 1x3 filters improve the performance?
UserDisplayName: bit_scientist
ThreadText: # Does replacing 3x3 filters with 3x1 and 1x3 filters improve the performance?
  
  (Asked by: username_0 on 2020-09-23)
  
  Recently I have come up with a VGG16 model for my binary classification task. I have relatively simple signal images
  
  [![this](https://i.sstatic.net/w6K40.png)](https://i.sstatic.net/w6K40.png)
  
  Therefore (maybe?) other deeper models like `resnet18` and `Inceptionv3` were not as good. As known, VGG uses `3x3` filters for convolving the images to make feature maps. I have tried several hyper-parameters to get a desired performance. However, there are still some things I need to do. I was thinking of replacing the `3x3` `conv` filters with `3x1` followed by `1x3` filters to reduce the compute. I think it will definitely do so considering the multiplications (9 operations for `3x3`and 6 for `3x1` followed by `1x3`).
  
  Then I came to think: ***If I replace all the `3x3` filters with separable filters, will I get any performance improvement?***
  
  What are the benefits of replacing `3x3` filters with separable ones?
  
  Thanks
  
  **Tags:** deep-learning, filters, vgg
  > **Comments:**
  > **username_1**: Do you have to use an image of the signal *plot* like your example here? Do you have access to the raw signal data instead?  
  > **username_0**: yes I can only use images like shown above. I wish I had a raw signal data.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2020-10-24. Score: 1
  
  If the filter is separable, that is, the NxM kernel can be mathematically equal to the convolution of a Nx1 filter and a 1xM filter, there are a very important increase in performance.
  
  Using separable convolution, the network can made an optimal usage of the shared memory and of the parallelism in memory access. See [this](https://www.google.es/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwitnfqX98zsAhULkhQKHREPDtwQFjAAegQIBhAC&url=http%3A%2F%2Fdeveloper.download.nvidia.com%2Fassets%2Fcuda%2Ffiles%2FconvolutionSeparable.pdf&usg=AOvVaw1eIqyLuJT6nJDVK7jmyMmX) excellent article for details. These improvements are bigger for bigger kernels.
  
  Also the training is improved, starting by the simple fact that a NxM filter has a number of parameters proportional to N\*M but the related separable one has N+M.
  
  > **Comments:**
  > **username_0**: the linked document doesn't provide any info that separable filters increase the performance, although it does say that it increases efficiency.  
  > **username_2**: @bit_scientist: see chapters "Separable Filters Can Increase Efficiency" and "Performance" (this one with a comparative graphic againts one of the other usual methods, convolution texture)  
  
  ---
  
  ### Answer by username_3 on 2020-09-24. Score: -2
  
  First of all, Keep in mind that maths operations aren’t the only thing that contribute to performance. Memory bandwidth can also be a factor.
  
  And most importantly, we want to capture as much area as we can in lowest possible number of operations. So in 3x3 kernel case, we can capture 9 cells in one shot, but with 3x1 followed by 1x3, we have to compute 6 times to capture 9 cells. Which clearly states that 3x3 kernel is far more efficient than these two sequential kernels.
  
  So, answer to your question will be no, it will not improve performance, instead it will increase computation overhead for your system.
  
  > **Comments:**
  > **username_2**: " but with 3x1 followed by 1x3, we have to compute 6 times": no. "3x3 kernel is far more efficient than these two ": no. I think you must review what is a separable convolution.  
  
  ---
  
  