Deep LearningAdvanced CNN Operations

What is a depthwise convolution?

A depthwise convolution applies a separate spatial filter to each input channel, instead of combining all channels in one convolution. It is a special case of grouped convolution that reduces the number of weights and arithmetic operations.

How does it work?

  • Suppose a feature map has 16 input channels.
  • A depthwise 3×3 convolution with one filter per channel applies 16 independent `3×3` filters.
  • It produces 16 output channels, one from each input channel. The channels are not mixed together by this operation.

Compare the number of filter weights (excluding biases) for 16 input and 16 output channels:

  • Standard `3×3` convolution: 16 × 16 × 3 × 3 = 2,304 weights.
  • Depthwise `3×3` convolution: 16 × 3 × 3 = 144 weights.

That is 93.75% fewer weights for this layer configuration. Depthwise convolution can also use more than one filter per input channel (*depth multiplier*).

How is it implemented?

In PyTorch, a typical depthwise layer is:

nn.Conv2d(16, 16, kernel_size=3, padding=1, groups=16)

Setting groups equal to the number of input channels makes each channel use its own filters.

When is it useful?

  • Lightweight CNNs: Efficient architectures such as MobileNet use depthwise operations to reduce computation.
  • Mobile and edge devices: Fewer arithmetic operations and weights can help under tight resource budgets.

Limitation: Depthwise convolution learns spatial patterns within individual channels but does not combine information across channels. A subsequent 1×1 pointwise convolution is commonly used for channel mixing; together, the operations form a *depthwise separable convolution*. Actual runtime speed also depends on the hardware and implementation.

Key distinction: In a general grouped convolution, each group can contain several input channels; in a depthwise convolution, each group contains exactly one input channel.

Related: “What is a grouped convolution in a CNN?” Next: “What is a pointwise convolution?”

Research: MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications.

Sources & Research References

#depthwise convolution explained#what is depthwise convolution#depthwise convolution vs standard convolution#depthwise convolution PyTorch groups#depthwise convolution MobileNet#depthwise vs grouped convolution#deep-learning#cnn#depthwise-convolution#grouped-convolution

Learning Sequence

Deep Learning Curriculum

72% Completed
Up NextDeep Learning

What is a pointwise convolution?

Explore Related Questions

Deepen your understanding across related Deep Learning topics.

Machinoai Logo
Machinoai

Your edge in the AI era. Deep dives into machine learning concepts, paper explainers, verified industry jobs, and developer tools.

© 2026 Machinoai. All rights reserved.