Max suppression

Although during training we assign only one bounding box to a window, the one that owned the center, during testing it can happen that many windows think that they have the center of the best bounding box.

For example, we may have three bounding boxes, and therefore three windows on the center of the bounding boxes, and each of these windows thinks that they have the best bounding box:

But what we'll need is only one bounding box, and preferably the best one. Max suspension will solve this problem.

The max suppression algorithm looks like this if written in observable code:

Let's follow these steps to understand how max pooling resolves the bounding box problem:

  1. Assign all the bounding boxes to a list.
  2. Continue to repeat the previous code, as long as the list isn't empty.
  3. Choose the bounding box with a maximum value of the Pc, or the probability that the selected pixels have a bounding box. In this case, if we look at the probabilities in the car image, the 94% windows, that bounding box will be the max box in the car image.
  4. Remove the max box from the list.
  5. For the remaining bounding boxes, such as the yellow one in the center of the car image and the bunch of boxes surrounding it, do the following:
    1. If any of the bounding boxes left shares more than 50% with a max box, remove it. And as we can see, the yellow box on the left hand bunch of boxes, with 74% probability, shares more than 50% with the max box, so we remove it.
    2. Intersection over union (IOU) divides the intersection areas with the union, for example, in the car image inside the 94% probability box, and if that's more than 50%, it means the two boxes—76% and 94%share more than 50%. It removes that box from the list, so the yellow box of 76% will be removed.
    3. Choose the max box from the remaining boxes, and if the probabilities the max box is at 91%, we immediately remove the 90% box from the list.
    4. Go through the remaining bunch of boxes and check whether any of them share more than 50%. Remove them both. We'll be left with these bounding boxes:

  1. Now the list has only two bounding boxes. We choose the max again, which is 89%, remove the box it, then for the remaining boxes in the list, which is only the yellow box, we check to see if it shares more than 50% with the max box, which obviously it does, and therefore we remove the yellow box with 71% probability:

Now we check the list. The list is empty, and we have only three bounding boxes, and indeed they are the best bounding boxes with maximum probabilities.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.12.232