IAmSuyogJadhav / 3d-mri-brain-tumor-segmentation-using-autoencoder-regularization

Keras implementation of the paper "3D MRI brain tumor segmentation using autoencoder regularization" by Myronenko A. (https://arxiv.org/abs/1810.11654).
MIT License
369 stars 114 forks source link

How to make this code suitable for single modal input data(e.g. t1ce)? #13

Closed joe1chief closed 4 years ago

joe1chief commented 4 years ago

I made the following changes for your example. input_shape = (1, 80, 96, 64) data[i] = np.array([preprocess(read_img(imgs['t1ce']), input_shape[1:])], dtype=np.float32) and commented

assert (c % 4) == 0, "The no. of channels must be divisible by 4

in model.py.

But I got the following error.

Epoch 1/1 [1] 9624 floating point exception (core dumped) python test.py

Can you give me some hints to modify your code and give me an explanation for why assert (c % 4) == 0?

IAmSuyogJadhav commented 4 years ago

The way I have implemented this model makes it not flexible to modifications. Since the original implementation used 4 modalities, the model has layers with the number of kernels set according to that value, finally making the correct expected shapes at the output of each of the layers. If that value is changed, the pooling operations will return unexpected shapes and giving possibly 0 at one of the steps, making the layer shapes invalid (thus the error). Making this model flexible is one of the things I have had on my mind for a long time. I will get on it once I have some free time on my hands. Till then, if you want to, you can make it flexible all by yourself as well. ellisdg/3DUnetCNN has done a really nice job at creating a flexible 3D U-Net. A similar approach would be needed to rework this code into a flexible one.