<p>Checkout this <a href="https://arxiv.org/pdf/1608.01471.pdf" rel="noreferrer">paper</a> where they come up with a way to make the concept of IoU differentiable. I implemented their solution with amazing results!</p>
Why does one not use IOU for training?
<p>When people try to solve the task of semantic segmentation with CNN's they usually use a softmax-crossentropy loss during training (see <a href="http://www.cv-foundation.org/openaccess/content_cvpr_2015/html/Long_Fully_Convolutional_Networks_2015_CVPR_paper.html" rel="noreferrer" title="FCN Longquot;">Fully conv. - Long</a>). But when it comes to comparing the performance of different approaches measures like intersection-over-union are reported.</p>

<p>My question is why don't people train directly on the measure they want to optimize? Seems odd to me to train on some measure during training, but evaluate on another measure for benchmarks.</p>

<p>I can see that the IOU has problems for training samples, where the class is not present (union=0 and intersection=0 => division zero by zero). But when I can ensure that every sample of my ground truth contains all classes, is there another reason for not using this measure?</p>