I suppose an image is worth too many words, so here is the image:
As you can see, in the middle where there are voxels to be segmented, no artifacts are present. Whereas on the top and bottom I get a nice checkerboard artifact. This is the prediction. The model was trained on three 3D images, and the validation set consisted of the same three images. This training was an overfitting test. It overfits well, but the artifacts at the top and bottom are present. The slices at the top and bottom with the artifacts have no segmented pixels, which leads me to believe that the neural network comes up with fake data for the slices where there is nothing to come up with. I just don't understand why and how to get rid of it. Any ideas?
Edit: I believe it has less to do with the checkerboard artifact than with the fact that the NN inserts data into slices that have no information, i.e., the voxels in the slices on the top and bottom are all zeros (0). I got rid of the checkerboard pattern using this method: https://arxiv.org/pdf/2002.02117.pdf (TL;DR: add a fixed convolutional layer right after the transposed convolution). The change reduced the checkerboard pattern but I'm still getting the filled in top and bottom parts: