IBBM / Cascaded-FCN

Source code for the MICCAI 2016 Paper "Automatic Liver and Lesion Segmentation in CT Using Cascaded Fully Convolutional NeuralNetworks and 3D Conditional Random Fields"
Other
304 stars 127 forks source link

How to run 3D CRF? #8

Closed fabioperez closed 7 years ago

fabioperez commented 7 years ago

Hello,

I'm trying to reproduce your results and I'm having trouble with the CRF step. Following the ipython notebook, I'm using image 17 from 3DIRCAdb1. I've made some modifications in the notebook to run the network for every slice. Without CRF, I got a dice score of 0.8573.

I cloned and installed https://github.com/mbickel/DenseInferenceWrapper/. However, I'm not sure how I can use it. I'm trying the following:

pro = CRFProcessor.CRF3DProcessor()
result = pro.set_data_and_run(img_preprocessed, extended_labels)

Where img_preprocessed is the preprocessed image without the padding reflections (dimensions (W,H,D); and extended_labels is the output of the predictions (direct probabilities, not thresholded bool) with dimensions (W,H,D,L) (where L = 1). I'm getting a (W,H,D) matrix with zeroes.

Can you help me with this?

mohamed-ezz commented 7 years ago

Hi Fabio,

I think what you're missing is the arguments to the CRF3DProcessor. Please take a look at https://github.com/mohamed-ezz/saratan/blob/master/validation/pipeline/miccai_pipeline/predictor.py#L161

There you can find the params passed to CRF3DProcessor object as well as any processing for the inputs of set_data_and_run(...)

fabioperez commented 7 years ago

@mohamed-ezz Thank you! The prediction.py code helped a lot!