1
$\begingroup$

Recently I have come up with a VGG16 model for my binary classification task. I have relatively simple signal images

this

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 3x3and 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

$\endgroup$
2
  • $\begingroup$ 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? $\endgroup$ – Neil Slater Sep 23 '20 at 16:21
  • $\begingroup$ yes I can only use images like shown above. I wish I had a raw signal data. $\endgroup$ – bit_scientist Sep 23 '20 at 23:59
0
$\begingroup$

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 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.

$\endgroup$
2
  • $\begingroup$ the linked document doesn't provide any info that separable filters increase the performance, although it does say that it increases efficiency. $\endgroup$ – bit_scientist Oct 26 '20 at 3:54
  • $\begingroup$ @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) $\endgroup$ – pasaba por aqui Oct 26 '20 at 9:41
-1
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ " 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. $\endgroup$ – pasaba por aqui Oct 24 '20 at 10:20

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.