I've read the paper about edge detection, in this paper they treat edge detection as a learning problem which takes an image patch as input and output a label, a binary edge map or a segmentation mask, but I don't know what is a segmentation mask?

In the paper their image patch is 32*32 but segmentation mask is 16*16, why is that?

During training they transform a multidimensional segmentation mask into a binary label to calculate the information gain, but when making predictions, how can I transform a binary label back to a segmentation mask or edge map? the transformation seems to be irreversible.


1 Answer 1


This is a widely known paper (Fast Edge Detection Using Structured Forests).

I will address the points you rasied:

  1. Patch vs. Label Size
    The patches are 32x32 yet the labels are 16x16. This is explained in the subsection efficiency at section 4:

enter image description here

In order to reduce amount of data they sub sample patch by a factor of 2.

  1. Segmentation Mask
    Edge Mask is basically a segmentation mask with binary classes. So in edge you have values 1 for the edges and 0 for the others. But in other segmentations we can have multiple values. For instance segmentation of sky, grass and a soil. So you have for each pixel 4 possible values (3 classes and none). In the context of the paper the segmentation is by the side of pixel relative to the edge.

  2. Binary Label
    The binary labels are values of a binary operation on the pixels. Whether their class is the same:

enter image description here

So for each pair of pixels in the segmentation / edge mask they have a value 1 if they have the same label or 0 if not.
Pay attention that they do not actually use this as the labels, they reduce the number of the labels by using PCA and a trick to have a discrete label based on the orthant of the transformed data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.