Page 2 of 2

Re: Dense CRF with DGM

Posted: Mon Jan 15, 2018, 21:09
by Creator
In my opinion, the code that you attached is OK. I have used variables m and i for testing on multiple images. Since you perform testing on a single image, these variable are not needed.

Please see attached the modified code. I have deleted the redundant code and added the dgm::vis::CMarker class represent the results in the same colours.

I saw, that the denseCRF produces worse results. However, I have noticed that with the small amount of iterations (e.g. 1) the result is more or less OK. The best results I got is 86,07% with 1 iteration:
res.png

I had approximately the same results with very small classes, when using denseCRF in my experiments with micro-organism dataset.

In order to enhance the results I would suggest to do 2 steps:
  1. Play with the parameters of the crf.addPairwiseGaussian(3, 3, 3); and crf.addPairwiseBilateral(60, 60, 20, 20, 20, img.data, 10); functions. I think, that the inference may simply “overblur” the minor classes. Reducing “stddev” values may help.
  2. During the training in DGM, use more train images. That will probably make the unary potentials more strong.
I hope my advices will help you.

Re: Dense CRF with DGM

Posted: Sat Jan 20, 2018, 15:34
by Zeinab Ghassabi
Thank you very much for your kind and help.
I used the code you sent and the same results. However, I will play with parameters, increase the number of classes and use different features to get better results. Maybe because of using local features, I have the result. if you mind, I will inform you if I get better results.
In addition to class labels from the CRF, how can I see the class probabilities for each pixel in the demoTrain of DGM ? I want to know how much a pixel is belong to each of 4 classes.
Sorry for such much inconvenience.
In the future, will you mind to release 3D version of DGM?

Re: Dense CRF with DGM

Posted: Sun Jan 28, 2018, 20:45
by Creator
I will be very glad if you let me know about your new results.
In order to see the class probabilities for each pixel, please check the Demo Visualization project: the visualization of the “Node potential vector” is exactly what you need.

The 3D version of the library would be interesting. Please feel free to make a pull request on GitHub, I will add your code to the repository.

Re: Dense CRF with DGM

Posted: Tue Jan 30, 2018, 21:10
by Zeinab Ghassabi
Thank you for your response. I run the code and got class probabilities for each pixel (1x4 vector for every pixel).
If there is any function which can get input image instead of just one pixel as "node_id" and produce four 2D images which each image corresponds to one class probability for all pixels?

Re: Dense CRF with DGM

Posted: Thu Feb 01, 2018, 20:42
by Zeinab Ghassabi
I myself wrote code for it. Thanks.