What is a grouped convolution in a CNN?
A grouped convolution splits a CNN layer's input and output channels into separate groups, then performs convolution independently within each group. Unlike a standard convolution, each output channel uses only the input channels assigned to its group.
How does it work?
- Standard convolution (`groups = 1`): Every output channel can combine information from every input channel.
- Grouped convolution (`groups = g`): Divide the input and output channels into
gequal groups. Each group processes only its own input channels, and the resulting output channels are combined into one output tensor.
Example: Suppose a 3×3 layer has 16 input channels and 32 output channels with groups = 4:
- Each group receives 4 input channels and produces 8 output channels.
- Each group learns its own filters; there are no direct filter connections between different groups in that layer.
- The result still contains 32 output channels.
Why use grouped convolution?
Grouped convolution reduces computation and learned parameters when the input/output channel counts and kernel size are held fixed.
Ignoring biases, the parameter count is:
parameters = out_channels × (in_channels / groups) × kernel_height × kernel_width
For this example:
- Ordinary `3×3` convolution:
32 × 16 × 3 × 3 = 4,608weights. - Four-group `3×3` convolution:
32 × 4 × 3 × 3 = 1,152weights — 75% fewer.
Grouped convolutions are used in architectures such as ResNeXt to learn multiple channel-group transformations efficiently.
What is the trade-off?
Channels in different groups do not interact within the grouped layer. A later 1×1 convolution or channel-shuffling operation can help mix information across groups.
Important: The groups setting controls channel connectivity; dilation controls spacing between spatial kernel samples. They are different operations.
Special case: When groups = in_channels (and output channels are a suitable multiple), grouped convolution becomes depthwise convolution—the next concept in this series.
References: PyTorch Conv2d documentation and Aggregated Residual Transformations for Deep Neural Networks (ResNeXt).
Sources & Research References
Learning Sequence
Deep Learning Curriculum
Explore Related Questions
Deepen your understanding across related Deep Learning topics.