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

时间:2021-05-29 10:40:59

标签: deep-learning conv-neural-network convolution medical-imaging 2d-3d-conversion

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

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

有没有办法做到这一点?感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

您可以排列图像。 (某些框架如 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)