What is mean IoU?
Mean IoU is intersection over union averaged across classes. For each class, you compute the overlap between the predicted region and the ground-truth region as the area of their intersection divided by the area of their union, then average those per-class scores. It is the dominant metric for semantic segmentation because it directly rewards pixel-accurate masks.
Averaging across classes keeps common classes from dominating the score, so a model must segment rare classes well too.
Key takeaways
- mIoU is per-class intersection over union, averaged over classes.
- It is the standard metric for semantic segmentation.
- Class averaging prevents frequent classes from hiding weak ones.
How it works
For a class, true positive pixels are the overlap between prediction and ground truth, while false positives and false negatives are the mismatched pixels on each side. IoU is the intersection divided by the union of those regions, and mIoU averages this over all classes. A perfect segmentation scores 1.0 per class.
Why it matters
mIoU rewards models that get boundaries and regions right, not just the overall pixel count, which is what matters for tasks like scene parsing or medical segmentation. Because it is standardized, it lets segmentation models be compared cleanly on shared benchmarks.
Frequently asked questions
How is mIoU different from pixel accuracy?
Pixel accuracy can be high just by labeling large background regions correctly. mIoU is computed per class and averaged, so it reflects performance on small and rare classes too.
How does mIoU relate to the Dice coefficient?
Both measure overlap. IoU and Dice are monotonically related but weight the intersection differently, and Dice tends to give higher values for the same prediction.
Related terms