# YOLO - does the Intersection over Union is actually a part of Non Maximum Suppresion

In the Stack Overflow thread Intersection Over Union (IOU) ground truth in YOLO they say that in YOLO actually the IoU (intersection over union) is used twice:

1. during training to compare ground truth box to predicted box

2. during the usage of already trained YOLO network this technique is being used to eliminate overlapping boxes which include same object many times.

As far as I know eliminating overlapping boxes is being done by process called Non Maximum Suppression (NMS). Thus I wonder maybe the IOU is a part of a NMS process?

• IoU is used as an threshold parameter for NMS. You just need to choose how much common space two boxes have to have to be considered as overlapping and to merge them. Details are in this link. Jan 31, 2022 at 12:48
• Thank you sir! p.s I have asked here a few more questions about YOLO which I am trying now to use in my research. I would be more than glad if you could help me there also.
– Igor
Feb 3, 2022 at 11:33

IoU is way to measure how much two areas overlap. As said in the comments IoU is used as a threshold parameter for NMS, so You could decide how much common space two areas have to have to be considered as overlapping.

1. According to first YoLo paper IoU is used first time to calculate confidence score for each bounding box according to the formula:

Confidence is 5th parameter in prediction vector: (x, y, w, h, c) predicted for every bounding box and it tells how good the bounding box is according to ground truth. Thanks to usage of IoU, confidence gives the full information about bounding box position, dimensions and its class probability.

1. Using NMS algorithm to merge overlapping boxes is very popular technique in object detection algorithms. However in original YoLo architecture You can see that output is a tensor of SxSx(B*5+C) where SxS are grid dimensions, B is number of bounding boxes per grid and C is number of possible classes. 5 is there because it's the length of prediction vector. It means that output tensor is constant, and You have to analyze the results it gives by yourself.

Authors claim that

Non-maximal suppression can be used to fix these multiple detections. While not critical to performance as it is for R-CNN or DPM, non-maximal suppression adds 2- 3% in mAP.

Reading the VOC 2007 Error Analysis section of the Yolo paper also might be useful.

Hope it helps.