Home

intersectionoverunion

Intersection over union (IoU), also known as the Jaccard index, is a measure of similarity between two sets and is widely used in computer vision to evaluate segmentation and object detection results. It quantifies how well a predicted region matches a ground-truth region.

For binary masks, IoU is defined as the size of the intersection divided by the size of

In practice, IoU is computed per class in semantic segmentation or per instance in instance segmentation, and

Related metrics include Dice coefficient, which is defined as 2|P ∩ G| / (|P| + |G|). IoU and Dice

Limitations of IoU include sensitivity to object size and class imbalance, and reduced informativeness for complex

the
union
of
the
predicted
mask
P
and
the
ground-truth
mask
G:
IoU
=
|P
∩
G|
/
|P
∪
G|.
In
pixel
terms,
this
corresponds
to
the
number
of
correctly
predicted
positive
pixels
divided
by
the
number
of
pixels
that
are
positive
in
either
the
prediction
or
the
ground
truth.
It
can
also
be
expressed
as
IoU
=
TP
/
(TP
+
FP
+
FN),
where
TP,
FP,
and
FN
are
counts
of
true
positives,
false
positives,
and
false
negatives.
a
mean
IoU
(mIoU)
can
be
taken
across
classes.
In
object
detection,
IoU
is
used
to
compare
predicted
bounding
boxes
with
ground-truth
boxes;
a
prediction
is
typically
counted
as
a
correct
detection
if
its
IoU
with
the
corresponding
ground-truth
box
meets
or
exceeds
a
threshold
(commonly
0.5).
are
both
measures
of
overlap
but
emphasize
different
aspects
of
similarity.
Generalized
IoU
(GIoU)
extends
the
concept
for
bounding
boxes
by
incorporating
spatial
relationships
to
improve
optimization.
shapes
or
partially
overlapping
regions.
It
is
one
of
several
tools
used
to
assess
and
compare
vision
models,
often
complemented
by
other
metrics.