Depthwise separable convolution replaces a regular Conv2D with two cheaper steps: a spatial convolution applied independently to each input channel, followed by a 1 × 1 pointwise convolution that mixes channels. It separates spatial-feature learning from channel-feature learning, using the prior that intermediate spatial patterns are correlated while channels are relatively independent. section 9.4
A smaller Xception-like ConvNet
In Keras, replace convolution layers inside repeated ConvNet blocks with SeparableConv2D, commonly alongside batch normalization, ReLU activation, max pooling, and residual connections. A dogs-versus-cats model built this way used 721,857 trainable parameters instead of 1,569,089 and reached 90.8% test accuracy instead of 83.9%. section 9.5
Use the layer when practical efficiency matters:
- Expect substantially fewer parameters and floating-point operations than regular convolution, with comparable representational power. section 9.4
- Prefer it especially for small models trained from scratch on limited data, where smaller models can converge faster and reduce overfitting. section 9.4
- Treat it as one architecture choice among repeated blocks, increasing filter counts, residual connections, batch normalization, and pooling; tune hyperparameters systematically afterward. section 9.5
Figure 9.4 Depthwise separable convolution: a depthwise convolution followed by a pointwise convolution
Use the diagram to trace the two-stage operation from depthwise spatial filtering to pointwise channel mixing. section 9.4

