Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How does iou work?

3 Answer(s) Available
Answer # 1 #

Let’s jump in.

In general, Deep Learning algorithms combine Classification and Regression tasks in various ways. For example, in the Object Detection task, you need to predict a bounding box (Regression) and a class inside the bounding box (Classification). In real life, it might be challenging to evaluate all at once (mean Average Precision can help you with that), so there are separate metrics for the Regression and Classification parts of the task. This is where Intersection over Union comes into the mix.

To define the term, in Machine Learning, IoU means Intersection over Union - a metric used to evaluate Deep Learning algorithms by estimating how well a predicted mask or bounding box matches the ground truth data. Additionally, for your information, IoU is referred to as the Jaccard index or Jaccard similarity coefficient in some academic papers.

So, to evaluate a model using the IoU metric, you need to have:

Fortunately, Intersection over Union is a highly intuitive metric, so you should not experience any challenges in understanding it. IoU is calculated by dividing the overlap between the predicted and ground truth annotation by the union of these.

It is not a problem if you are unfamiliar with the mathematical notation because the Intersection over Union formula can be easily visualized.

You might be wondering why we are calculating some overlap/union area, not the (x, y) pairs straightaway. In a real-life scenario, it is highly unlikely that the predicted coordinates will exactly match the ground truth ones for various reasons (basically, the model’s parameters). Still, we need a metric to evaluate the bounding boxes (and masks), so it seems reasonable to reward the model for the predictions that heavily overlap with the ground truth.

So, the Intersection over Union algorithm is as follows:

In the IoU case, the metric value interpretation is straightforward. The bigger the overlapping, the higher the score, the better the result.

The best possible value is 1. Still, from our experience, it is highly unlikely you will be able to reach such a score.

Our suggestion is to consider IoU > 0.95 as an excellent score, IoU > 0.7 as a good one, and any other score as the poor one. Still, you can set your own thresholds as your logic and task might vary highly from ours.

Let’s say that we have two bounding boxes with the coordinates as presented in the image below.

In such a case:

Intersection over Union is widely used in the industry (especially for the Deep Learning tasks), so all the Deep Learning frameworks have their own implementation of this metric. Moreover, IoU is relatively simple in its concept, so you can manually code it without any issues. For this page, we prepared two code blocks featuring using Intersection over Union in Python. In detail, you can check out:

[5]
Edit
Query
Report
Kai Shinde
SUBSTATION INSPECTOR
Answer # 2 #

An IOU is a written acknowledgement of debt that one party owes another. In business transactions, an IOU may be followed by a more formal written contract. The informality of the IOU can make it difficult to enforce, and usually impossible to sell or trade.

[4]
Edit
Query
Report
fsvxhv McBreazy
SUPERVISOR BROOMMAKING
Answer # 3 #

IOUs can be used for many purposes although they are not usually used by banks or issuing large amounts of formal debt. Most commonly they are used to acknowledge a small monetary debt between two trusting parties. Read on to learn how IOUs work in practice and some of the legal contract alternatives to it as a note payable form.

Get Your IOU Form

IOUs are the most basic of notes payable but in order to have any validity, they must contain a number of important details. This includes the following information about a debt:

It must be remembered that an IOU is not a legal agreement and it relies entirely on the trust of the lender that the borrower will comply as stated. There is more difficulty in legally enforcing an IOU compared to other options such as a promissory note or a loan contract.

An IOU is also not a negotiable instrument as it lacks the same level of detail on the repayment of the principal sum that can be found within other documents. This means that the debt that it details cannot be sold to another party.

The term IOU isn’t only used to record informal debts between friends and family. It is sometimes used by financial institutions in certain situations.

One example is in the bond market. Bonds are technically a form of IOU, whereby an individual loans an amount of money to a company or government and is given a contract promising to repay the money with interest by a certain date. Whilst this agreement is sometimes referred to as an “IOU”, it is in fact legally binding.

California Registered Warrants are also sometimes called “IOUs”. These note payable documents are a promise of payment on a future date from the State of California itself and are issued when the treasury cannot pay a cost immediately. They are also not negotiable instruments like regular IOUs.

The term IOU is also sometimes used in the world of Bookkeeping. In this case, it refers to a debt that is yet to be paid to the company or organization in question and that can be counted as a net asset on its balance sheet.

IOUs are considered the most flexible and informal examples of debt notices. They do not have the same legal enforceability as other types of note payable forms. If you wish to issue a debt whilst ensuring the best chance of being able to collect the money owed if a default occurs, lenders can use the following:

[3]
Edit
Query
Report
Dinanath Aacharya
POLY PACKER AND HEAT SEALER