Mean IoU (mIoU)

Mean intersection over union, or mIoU, is the standard metric for semantic segmentation. It computes the intersection over union between predicted and ground-truth regions for each class, then averages across classes, measuring how well predicted masks overlap the truth.

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.

Where a strong mIoU stops telling you the truth

mIoU averages IoU across classes, which keeps a common class like soil or road from drowning out a rare one. That's why it's the standard for semantic segmentation. It still squeezes a lot into one number, and three things slip through:
  • One bad class barely registers. With 20 classes, a class collapsing to zero moves the mean by at most five points.
  • The test set hides its own failures. A score over the whole set says nothing about which images or conditions failed, so a model that breaks at dusk or on wet ground can look fine overall.
  • Big regions dominate. Within a class, large regions outweigh small ones, so a model that misses every small weed can still post a healthy score for that class.
Getting past the number means looking at the masks. In Voxel51 you can filter a segmentation dataset by class and by any metadata you've attached, and compare ground truth and predicted masks on the same image. You can also sort samples by per-sample score to find where the model breaks. Those images tell you whether to fix the labels, collect more data, or change the model.

PhenoBench

2,179 images

Field images of sugar beet crops and weeds with semantic, plant, and leaf instance masks.

Try this: Find images where small weeds sit next to large crops. That's the case where a class-level score looks better than the model is.

Open PhenoBench in Voxel51

Free with a work or .edu email.

Go deeper

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

black and white photo of Jesse Mostipak
Director of Growth
Jesse Mostipak is the Director of Growth at Voxel51, where the work is helping humans find and trust what the brand knows, and teaching the Google knowledge graph and the LLMs answering on their behalf to do the same. That question, how knowledge gets built inside a system, is one Jesse has been chasing for years. Earlier versions of it ran through a New York City high school science classroom, data science and machine learning, and developer relations at Kaggle, Posit (formerly RStudio), and Baseten. The answer doesn't change much depending on whether the learner is a teenager, a software engineer, or a knowledge graph. Jesse holds a Master's in Education from CUNY Hunter College. LinkedIn
See all articles by Jesse Mostipak
Last updated November 3, 2026

Building visual or physical AI?

Let's talk.