tezvyn:

Intersection over Union for detection

AI-drafted, machine-checkedSource: interviewbeginner
WHAT IT TESTS

the core overlap metric.

OUTLINE

IoU is the area of overlap divided by the area of union of predicted and ground-truth boxes; a threshold decides true positives.

WHAT THIS TESTS Whether you understand the fundamental spatial agreement metric that makes detection evaluation and post-processing possible.

A GOOD ANSWER COVERS Intersection over Union measures how well a predicted bounding box overlaps a ground-truth box. You compute the area of their intersection, the overlapping rectangle, and the area of their union, the total area covered by either box, then divide intersection by union. The result ranges from zero, no overlap, to one, perfect alignment. IoU is critical because detection produces boxes that rarely match ground truth exactly, so you need a continuous measure of agreement and a rule for deciding a hit. A prediction is counted a true positive when its IoU with a ground-truth box meets or exceeds a chosen threshold, commonly zero point five. IoU is also the criterion in non-maximum suppression, where overlapping duplicate boxes above an IoU threshold are pruned, and it defines the matching in mAP computation.

COMMON WRONG ANSWERS Dividing intersection by the predicted box area only, which is a different metric. Forgetting that union subtracts the double-counted intersection. Treating IoU as binary rather than continuous. Not mentioning the threshold that turns IoU into a true or false positive decision.

LIKELY FOLLOW-UPS How does IoU feed into non-max suppression. Why does COCO average over multiple IoU thresholds. What are limitations of IoU that GIoU or DIoU address. How do you compute union from the two areas.

ONE CONCRETE EXAMPLE A predicted box and a ground-truth box each cover one hundred square pixels and overlap in fifty square pixels. The union is one hundred plus one hundred minus fifty, which is one hundred fifty, so IoU is fifty over one hundred fifty, about zero point three three. At a zero point five threshold this prediction would be a false positive despite real overlap, illustrating how the threshold sets the strictness of what counts as a correct detection.

Read the original → en.wikipedia.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.