Intersection Over Union

Jino Rohit
2 min readJul 23, 2021

--

Today we’ll talk about object detection and evaluation

Object detection is simply a technique to identify and localize the classes present in the image like cats, dogs etc. This can be achieved by drawing something called bounding boxes around each classes . So every time you perform object detection on an image , you return 5 things — The predicted class, x, y, w, h which are dimensions of the predicted bounding box.

Now this post isn’t about object detection but metrics about evaluating our predictions in object detection. It’s very easy to manually inspect each and every image but what if we had millions of images? And also how does a computer manage to pull this off?

Here comes…..

Intersection Over Union( IOU)

The name itself seems intuitive and self-explanatory. All we do is take the intersection of the boxes and then divide by the total area of the boxes (which is union) to get a score between 0 and 1.

The yellow box now is your intersection(crisp painting huh )

The red box is the union

Formula = Yellow box / Red box = IOU

Look at the formula closely and think what would 0 or 1 mean in this case?

Yes ! A score of 1 means complete overlap which means perfect bounding boxes and a score of 0 means they share no area in common and they are completely away from each other, you might want to work on that model more.

Now the threshold of IOU can be decided by you depending on your use case but as a rule of thumb

IOU Score > 0.5 It’s aight

IOU Score > 0.7 You have my attention

IOU Score > 0.9 Perfect!

Since an IOU Score of 1.0 is nearly impossible to achieve every time, anything above 0.9 should be great to go.

Thanks for reading my post and have a good one :)

--

--

Jino Rohit
Jino Rohit

Written by Jino Rohit

Neurons that fire together, wire together

No responses yet