Dense CRF with DGM

Semantic Image Segmentation with Conditional Random Fields
User avatar
Creator
Posts: 151
Joined: Tue Dec 16, 2008, 20:52
Location: Hannover, Germany
Contact:

Re: Dense CRF with DGM

Postby Creator » Mon Jan 15, 2018, 21:09

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.

Zeinab Ghassabi
Posts: 12
Joined: Sun Dec 10, 2017, 03:31
Contact:

Re: Dense CRF with DGM

Postby Zeinab Ghassabi » Sat Jan 20, 2018, 15:34

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?

User avatar
Creator
Posts: 151
Joined: Tue Dec 16, 2008, 20:52
Location: Hannover, Germany
Contact:

Re: Dense CRF with DGM

Postby Creator » Sun Jan 28, 2018, 20:45

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.

Zeinab Ghassabi
Posts: 12
Joined: Sun Dec 10, 2017, 03:31
Contact:

Re: Dense CRF with DGM

Postby Zeinab Ghassabi » Tue Jan 30, 2018, 21:10

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?

Zeinab Ghassabi
Posts: 12
Joined: Sun Dec 10, 2017, 03:31
Contact:

Re: Dense CRF with DGM

Postby Zeinab Ghassabi » Thu Feb 01, 2018, 20:42

I myself wrote code for it. Thanks.


Return to “Direct Graphical Models”

Who is online

Users browsing this forum: No registered users and 2 guests