Skip to main content

Separable Convolutions

 https://towardsdatascience.com/a-basic-introduction-to-separable-convolutions-b99ec3102728


Idea of separating one convolution into two.

Types:

Spatial Separable Convolution

Depthwise Separable Convolution


Spatial Separable Convolution:

Example:

Dividing 3x3 kernel into 3x1 and 1x3 kernel.



Advantage: Instead of doing one convolution with 9 multiplications, we do 2 convolutions with 3 multiplications each, so 6 in total, to achieve same effect.

Limitations: All convolution kernels are not separable - so only limited number of kernels are allowed

Not used much


Depthwise Separable Convolution:

We do depthwise convolution first and do pointwise colvolutions x num of times we want output


It’s worth noting that in both Keras and Tensorflow, there is a argument called the “depth multiplier”. It is set to 1 at default. By changing this argument, we can change the number of output channels in the depthwise convolution. For example, if we set the depth multiplier to 2, each 5x5x1 kernel will give out an output image of 8x8x2, making the total (stacked) output of the depthwise convolution 8x8x6 instead of 8x8x3.