3D 体积图像沿三个正交(轴)的 2D 卷积

2D convolution along three orthogonals (axis) for 3D volumetric image

由于3D卷积需要太多的计算成本,所以我更喜欢使用2D conv。我的动机是对体积图像使用 2D conv 来降低成本。

我想沿三个正交应用二维卷积以获得 3 个结果,每个都属于这些正交之一。更清楚地说,假设我有一个 3D 体积图像。我不想应用 3D conv,而是想在 xy、xz、yz 轴上都使用 2D conv。然后,我希望得到 3 种不同的体积结果。每个结果代表三个不同的正交。

有办法吗?感谢您的帮助。

您可以排列图像。 (一些框架如numpy称它为transpose)。

假设我们使用 3 x 3 卷积核。

# A batch of 16 3 channel images (channels first)
a = tensor(shape=[16,3,1920,1080])

# 2D conv will slide over a `1920 x 1080` image, kernel size is `3 x 3 x 3`
a.shape is (16,3,1920,1080)

# 2D conv will slide over a `3 x 1080` image, kernel size is `1920 x 3 x 3`
a.permute(0,2,1,3)
a.shape is (16,1920,3,1080)

# 2D conv will slide over a `1920 x 3` image, kernel size is `1080 x 3 x 3`
a.permute(0,3,2,1)
a.shape is (16,1080,1920,3)