rzaratx
rzaratx

Reputation: 824

Conv2D to Conv3D

I have 3D medical images and wanted to know if I have a CNN that uses Conv2D can I just change the Conv2D to a Conv3D? If not what would I need to change?

Upvotes: 0

Views: 1208

Answers (1)

Nicolas Gervais
Nicolas Gervais

Reputation: 36684

Yes, you can, but there are a few things to change.

Your kernel will now need to be in 3D, so the argument kernel_size must be a 3 integer tuple. Same thing for strides. Note that the CNN you will modify will probably be in 3D already (e.g., 60, 60, 3) if it's designed to train on colored images. The only difference is that you want the neural net to not only detect features in 3 separate 60x60 windows, but through the three windows. In other words, not 3 times 2D, but 3D.

tl;dr yes you can, just change kernel_size and strides. The default values of the keras.layers.Conv3D are adjusted accordingly anyway.

Upvotes: 1

Related Questions