← 输入框|github.com|刷新
Skip to content

dense_crf3d: No segm produced for single modality #2

Open

Description

@satrajitgithub

Hi taigw,

I am trying to run dense_crf3d on single modality (only T1c).
At first I used: dense_crf_param['BilateralModsStds'] = (3.0) but that didnt work. So I used dense_crf_param['BilateralModsStds'] = (3.0,) instead.
These are the parameters I use now and the module runs as well:

    dense_crf_param = {}
    dense_crf_param['MaxIterations'] = 2.0
    dense_crf_param['PosRStd'] = 3.0
    dense_crf_param['PosCStd'] = 3.0
    dense_crf_param['PosZStd'] = 3.0
    dense_crf_param['PosW'] = 1.0
    dense_crf_param['BilateralRStd'] = 5.0
    dense_crf_param['BilateralCStd'] = 5.0
    dense_crf_param['BilateralZStd'] = 5.0
    dense_crf_param['ModalityNum'] = 1
    dense_crf_param['BilateralW'] = 3.0
    dense_crf_param['BilateralModsStds'] = (3.0,)

But the segmentation produced is all zeros.

I did a gridsearch with several random values of PosStds,PosWs,BilateralStds,BilateralWs but its all zero. Do you have any suggestions on this?

Activity

  1. changed the title [-]No segm produced for single modality[/-] [+]dense_crf3d: No segm produced for single modality[/+] on Aug 6, 2019
  2. taigw commented on Dec 20, 2019

    @taigw
    Collaborator

    @satrajitgithub @MENG1996 Not sure what problem you have. I have updated the code and a demo for single-modality segmentation is added. See examples/demo_densecrf3d.py for details.

  3. sara-eb commented on May 5, 2020

    @sara-eb

    @taigw could you please explain what these parameters stand for? I need to post-process my data and do not know what changes should I do that best suits to my data.

    Hi taigw,

    I am trying to run dense_crf3d on single modality (only T1c).
    At first I used: dense_crf_param['BilateralModsStds'] = (3.0) but that didnt work. So I used dense_crf_param['BilateralModsStds'] = (3.0,) instead.
    These are the parameters I use now and the module runs as well:

        dense_crf_param = {}
        dense_crf_param['MaxIterations'] = 2.0
        dense_crf_param['PosRStd'] = 3.0
        dense_crf_param['PosCStd'] = 3.0
        dense_crf_param['PosZStd'] = 3.0
        dense_crf_param['PosW'] = 1.0
        dense_crf_param['BilateralRStd'] = 5.0
        dense_crf_param['BilateralCStd'] = 5.0
        dense_crf_param['BilateralZStd'] = 5.0
        dense_crf_param['ModalityNum'] = 1
        dense_crf_param['BilateralW'] = 3.0
        dense_crf_param['BilateralModsStds'] = (3.0,)
    

    But the segmentation produced is all zeros.

    I did a gridsearch with several random values of PosStds,PosWs,BilateralStds,BilateralWs but its all zero. Do you have any suggestions on this?

    I have a multi-class segmentation problem, once I am giving the probability map of all classes, the output is a blank image (an image with zero values).

    I have probability map of 4 classes (0: background, 1: object1, ..., 4: object4) and it has the shape of P: (166, 347, 82, 5) and I commented the line 31 to line 33, and I is float values between [0,1]. I commented out the line 27 and 28 in my case.

    Then I tried to send only one probability map:

        I = np.asarray([I1], np.uint8)            # (1, 166, 347, 82)
        I = np.transpose(I, [1, 2, 3, 0])           # (166, 347, 82, 1)
        # probability map for each class
        #P = 0.5 + (P - 0.5) * 0.8
        P = np.asarray([1.0 - P, P], np.float32)    # (2, 166, 347, 82)
        P = np.transpose(P, [1, 2, 3, 0])           # (166, 347, 82, 2)
    
        #pdb.set_trace()
        dense_crf_param = {}
        dense_crf_param['MaxIterations'] = 40.0   #2.0
    

    This is the output before sending to densCRF algorithm, and need to fill the holes and smooth the edges.
    pred_clean20
    and this is the probability map of single class that I am sending to densecrf3d
    probmap

    and changed the number of iteration to 40.0.
    prob_slc20-iter40

    then I changed the iterations to 70, the output did not change:
    prob_slc20-iter70

    The questions are:

    • why the algorithm does not work for multi-class probability map? where I am doing mistake?

    • How to change the parameters, which parameters?

    Thank you

  4. taigw commented on Aug 27, 2020

    @taigw
    Collaborator

    @sara-eb I have now added a demo for multi-class segmentation, see examples/demo_densecrf.py
    To understand the meaning of each parameter, please check the original paper:
    Philipp Krähenbühl and Vladlen Koltun, "Efficient inference in fully connected crfs with gaussian edge potentials", in NIPS, 2011.

  5. sneh-debug commented on Nov 11, 2020

    @sneh-debug

    hello @sara-eb are you able to figure out why its generating blank image?

  6. JunMa11 commented on Mar 18, 2021

    @JunMa11

    @sara-eb Following is my personal understanding of the parameters.
    @taigw Please correct me if I’m wrong. Thank you for the awesome repository.

        dense_crf_param = {}
        dense_crf_param['MaxIterations'] = 2.0
        # weights of the unary potential
        dense_crf_param['PosW'] = 2.0
        # standard deviation in the kernel
        dense_crf_param['PosRStd'] = 5 
        dense_crf_param['PosCStd'] = 5
        dense_crf_param['PosZStd'] = 5
        # weights of the pairwise potential
        dense_crf_param['BilateralW'] = 3.0
        # standard deviation in the kernel (pairwise potential)
        dense_crf_param['BilateralRStd'] = 5.0
        dense_crf_param['BilateralCStd'] = 5.0
        dense_crf_param['BilateralZStd'] = 5.0
        dense_crf_param['ModalityNum'] = 1
        dense_crf_param['BilateralModsStds'] = (5.0,)
  7. taigw commented on Sep 23, 2021

    @taigw
    Collaborator

    @JunMa11 Yes, your comments are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions