What is the difference between 2D and 3D convolutions, and when would you use each?
Answer
A 2D convolution slides a kernel across height and width, while aggregating all input channels at each spatial location. A 3D convolution slides across depth or time as well as height and width, so it learns joint spatiotemporal or volumetric features. Use 2D convolution for ordinary images, per-frame video processing, or slice-wise analysis when cross-slice context is unnecessary. Use 3D convolution for videos, CT/MRI volumes, or occupancy grids when local relationships along the third axis carry essential information and the additional memory and compute are affordable.

Figure 1: Kernel geometry and output formation for 2D spatial convolution and 3D spatiotemporal convolution.
(1) Kernel Geometry: A 2D kernel has spatial extent ; a 3D kernel adds
and jointly traverses depth or time.
(2) Data Semantics: The third axis should represent an ordered neighborhood such as adjacent frames or slices, not an unordered feature channel.
(3) Trade-off: 3D convolution captures motion or volumetric continuity directly but costs roughly times more than a comparable 2D layer and stores larger activation volumes.
Mathematical Formulation:
Where:
and
are the input and output tensors, while
is the learned 3D convolution kernel.
indexes output channels and
indexes input channels.
index output depth/time, height, and width;
range over the kernel support along those axes.
- For a 2D convolution,
and
are removed, leaving only spatial indices
; stride, padding, and dilation modify each active index mapping.

Figure 2: Selection guide based on third-axis semantics, required context, resource budget, and deployment constraints.



















