email me if you want to read more about Conditional Random Fields.
https://ieeexplore.ieee.org/document/8991232 Please refer if you use this code.
Uses Conditional Random Fields to post process the images that are already segmented using any of the techniques. Just go and experiment with different images and probability values. Send me a text if you discover something interesting. Mail me the code if you try to make a trainable model out of this.