Labeling every pixel properly is a complex task, and it is common to obtain predicted label maps with poor contours and small incorrect areas. Thankfully, there are some methods that post-process the results, correcting some obvious defects. Among these methods, the conditional random fields (CRFs) methods are the most popular because of their overall efficiency.
The theory behind this is beyond the scope of this book, but CRFs are able to improve pixel-level predictions by taking into account the context of each pixel back in the original image. If the color gradient between two neighboring pixels is small (that is, no abrupt change of color), chances are that they belong to the same class. Taking into account this spatial and color-based model, as well as the probability maps provided by the predictors (in our case, the softmax tensors from CNNs), CRF methods return refined label maps, which are better with respect to visual contours...