Is Intersection over Union in object detection differentiable? Is IoU in object detection differentiable or can be back propagated? Is it used in the training process or just in the inference?

Yes, the intersection between two bounding boxes is differentiable with respect to the centers of each box, as well as their widths and heights.
Usually, IoU is only used as an evaluation metric in inference, not training. I can forsee some downsides of using IoU as a training loss:

*

*Suppose the predicted box entirely contains the target box. Then the gradient with respect to the box position will be 0.

*Likewise, suppose the target box entirely contains the predicted box. Again, the gradients with respect to position are 0.

*Suppose the predicted box and target box are disjoint. Now all gradients are 0, which impedes training.

Meanwhile, using the traditional regression loss, the gradients of box position, width, and height are nonzero almost everywhere.
