DL0057 2D VS 3D Convolutions

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.

Side-by-side 2D image kernel and 3D spatiotemporal kernel receptive fields.

Figure 1: Kernel geometry and output formation for 2D spatial convolution and 3D spatiotemporal convolution.

(1) Kernel Geometry: A 2D kernel has spatial extent k_h\times k_w; a 3D kernel adds k_d 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 k_d times more than a comparable 2D layer and stores larger activation volumes.

Mathematical Formulation:
Y_{o,d,h,w}=\sum_{c=1}^{C_{in}}\sum_{\delta_d,\delta_h,\delta_w}K_{o,c,\delta_d,\delta_h,\delta_w}X_{c,d+\delta_d,h+\delta_h,w+\delta_w}

Where:

  • X and Y are the input and output tensors, while K is the learned 3D convolution kernel.
  • o indexes output channels and c\in\{1,\ldots,C_{in}\} indexes input channels.
  • d,h,w index output depth/time, height, and width; \delta_d,\delta_h,\delta_w range over the kernel support along those axes.
  • For a 2D convolution, d and \delta_d are removed, leaving only spatial indices h,w; stride, padding, and dilation modify each active index mapping.
Decision flowchart for selecting 2D, 3D, or factorized convolution.

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


Login to view more content

Did you solve the problem?

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *