EasyDeepLearn

How does a depthwise separable convolution reduce compute?

medium

Answer

  • Factor a standard conv into (1) depthwise: one k×k filter per input channel independently; (2) pointwise: a 1×1 conv mixing the depthwise outputs across channels.
  • Compute goes from CinCoutkkC_{\mathrm{in}} \cdot C_{\mathrm{out}} \cdot k \cdot k to Cinkk  +  CinCoutC_{\mathrm{in}} \cdot k \cdot k\; + \;C_{\mathrm{in}} \cdot C_{\mathrm{out}} — for k=3, Cin=Cout=512C_{\mathrm{in}} = C_{\mathrm{out}} = 512, that's 8-9x cheaper.
  • Foundation of MobileNet, Xception, EfficientNet.
  • Small accuracy loss vs standard convs but huge speedups on mobile / embedded.
Check yourself — multiple choice
  • Same compute as standard conv
  • Depthwise per-channel + 1x1 pointwise mixing → ~8-9x cheaper, foundation of MobileNet/Xception
  • More expensive than standard
  • Only for 1D signals

Depthwise + pointwise = huge compute reduction with tiny accuracy cost.

#cnn#architectures

Practise Deep Learning

214 interview questions in this topic.

Related questions