Thank you for your prompt reply Thomas. Regarding your answer to my second question, I completely understand that the error is ‘shared’ in the biggest part of the network. However, in the last layer, there are seven 1 * 1 * 16 kernels which depend only on their corresponding output, so how are these kernels trained? Indeed, if these kernels use the total error to train, then all the outputs will be train to do the same thing?
Also I think I have been a bit unclear regarding my first question (I misused the word mask). Basically among the two outputs passed to the ohem function, one is trained to output high values for a given pixel if it belongs to a text region and low values otherwise, and the other output is trained to do the exact opposite. How does the algorithm train them to do such different tasks? Indeed since only one error is outputed, intuitively, it seems to me that they are trained to do the same thing (although it’s not what’s happening of course).