Intersection over Union (IoU) is defined as the ratio of the area of overlap between the predicted segmentation mask and the ground truth mask to the area of their union. The metric produces a score between 0 and 1, where 1 indicates perfect pixel-level alignment and 0 signifies no spatial overlap whatsoever. It is the standard benchmark for evaluating semantic segmentation, instance segmentation, and object detection models in medical imaging.
Glossary
Intersection over Union (Jaccard Index)

What is Intersection over Union (Jaccard Index)?
Intersection over Union (IoU), also known as the Jaccard Index, is the primary evaluation metric for object detection and semantic segmentation tasks, quantifying the spatial overlap between a predicted region and the ground truth annotation.
The Jaccard Index is mathematically equivalent to the IoU and is often used interchangeably in the literature. In medical image segmentation, an IoU threshold of 0.5 is commonly used to define a true positive detection, while the Dice Score (F1 Score)—a closely related metric—represents the harmonic mean of precision and recall. Unlike boundary-based metrics such as Hausdorff Distance, IoU provides a single, intuitive measure of region-based accuracy.
Key Characteristics of IoU
Intersection over Union (IoU), also known as the Jaccard Index, is the foundational metric for evaluating segmentation model accuracy. It quantifies the ratio of correctly predicted pixels to the total pixels in the union of the prediction and ground truth.
Core Mathematical Definition
IoU is calculated as the area of overlap divided by the area of union between the predicted segmentation mask and the ground truth annotation.
- Formula: IoU = |A ∩ B| / |A ∪ B|
- Range: Bounded between 0.0 (no overlap) and 1.0 (perfect match)
- Pixel-Level: Operates on a per-pixel basis, treating each class independently
- Differentiable Surrogate: The Jaccard Loss (1 - IoU) is used directly as a training objective
Relationship to Dice Score
IoU and the Dice Score (F1 Score) are monotonically related and convey the same ranking of segmentation quality, but differ in absolute value.
- Conversion: Dice = 2 * IoU / (1 + IoU)
- Penalty Profile: IoU always yields a lower numerical score than Dice for the same prediction, penalizing errors more severely
- Example: A Dice of 0.80 corresponds to an IoU of approximately 0.67
- Usage: IoU is standard in PASCAL VOC and COCO benchmarks; Dice is more common in medical imaging literature
Class-Wise vs. Mean IoU
In multi-class segmentation, IoU is computed per class and then aggregated to provide a holistic performance measure.
- Per-Class IoU: Calculates overlap independently for each semantic category (e.g., liver, tumor, kidney)
- Mean IoU (mIoU): The arithmetic average of IoU across all classes, the standard aggregate metric
- Weighted IoU: Averages per-class IoU weighted by each class's pixel frequency to account for class imbalance
- Background Dominance: mIoU prevents large background regions from masking poor performance on small, critical foreground objects
Thresholding and Binarization
IoU requires discrete binary masks, necessitating a thresholding step when model outputs are continuous probability maps.
- Default Threshold: Probabilities ≥ 0.5 are typically assigned to the foreground class
- Threshold Sensitivity: The choice of threshold directly impacts IoU; optimizing it per-class can improve reported performance
- Soft IoU: A differentiable approximation that operates directly on continuous probabilities, used during training to avoid the non-differentiable thresholding step
- Calibration: Well-calibrated models produce probabilities that reflect true likelihood, making the 0.5 threshold semantically meaningful
Limitations in Medical Imaging
While ubiquitous, IoU has known failure modes that motivate complementary metrics in clinical segmentation tasks.
- Boundary Insensitivity: IoU does not distinguish between a minor boundary shift and a complete miss on a small object; both yield zero overlap
- Size Bias: Small structures (e.g., a 10-pixel lesion) can have an outsized impact on per-class IoU due to high variance
- No Spatial Information: IoU is purely volumetric; it cannot capture the clinical acceptability of a boundary error
- Complementary Metrics: Use Hausdorff Distance to measure worst-case boundary deviation and Average Surface Distance for mean boundary error
IoU Thresholds for Object Detection
In object detection tasks, IoU serves as the criterion for determining whether a predicted bounding box constitutes a true positive detection.
- Standard Threshold: An IoU ≥ 0.5 is the conventional threshold for a correct detection in the PASCAL VOC challenge
- Strict Threshold: COCO evaluation uses IoU ≥ 0.75 for its strict metric (AP@75)
- Average Precision (AP): Computed by averaging precision across IoU thresholds from 0.5 to 0.95 in 0.05 increments
- Clinical Relevance: For medical object detection (e.g., nodule localization), higher thresholds (≥0.7) are often required to ensure clinical utility
IoU vs. Dice Score
A direct comparison of the two primary spatial overlap metrics used to evaluate medical image segmentation accuracy, highlighting their mathematical relationship and practical trade-offs.
| Feature | Intersection over Union (IoU) | Dice Score (F1) |
|---|---|---|
Formula | |A ∩ B| / |A ∪ B| | 2|A ∩ B| / (|A| + |B|) |
Range | [0, 1] | [0, 1] |
Mathematical Relationship | IoU = Dice / (2 - Dice) | Dice = 2 * IoU / (1 + IoU) |
Penalty for Disagreement | More severe; penalizes false positives and false negatives more harshly | Less severe; averages the per-class performance |
Sensitivity to Small Objects | Lower; small segmentation errors on tiny structures cause larger metric drops | Higher; more forgiving of small boundary errors on minor structures |
Common Use Case | Primary evaluation metric for segmentation challenges (PASCAL VOC, COCO) | Primary evaluation metric for medical imaging segmentation (BraTS, ISLES) |
Gradient Behavior During Training | Can be unstable when intersection is near zero | Generally more stable for gradient-based optimization |
Interpretation | Direct geometric interpretation as area of overlap over total occupied area | Harmonic mean of precision and recall; measures balance between the two |
Frequently Asked Questions
Clear, concise answers to the most common technical questions about the Jaccard Index and its role as the primary evaluation standard for medical image segmentation accuracy.
Intersection over Union (IoU), also known as the Jaccard Index, is a metric that quantifies the spatial overlap accuracy between a predicted segmentation mask and the ground truth annotation. It is calculated by dividing the area of overlap (the intersection) by the area of union between the two masks. The formula is IoU = |A ∩ B| / |A ∪ B|, where A is the set of predicted positive pixels and B is the set of ground truth positive pixels. The resulting score ranges from 0.0 (no overlap) to 1.0 (perfect, pixel-perfect alignment). In medical imaging, this metric is preferred over simple pixel accuracy because it naturally penalizes false positives and false negatives, making it robust against class imbalance where background pixels vastly outnumber the target lesion or organ pixels.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding Intersection over Union requires familiarity with the core loss functions, evaluation metrics, and model architectures that define modern medical image segmentation workflows.
Tversky Loss
A generalization of the Dice loss that introduces α and β weighting parameters to control the penalty for false positives and false negatives independently. This is critical when optimizing for IoU in highly class-imbalanced medical datasets. Setting β > α penalizes false negatives more heavily, improving recall for small lesion segmentation where missing a tumor is clinically unacceptable.
Connected Component Analysis
A post-processing algorithm that identifies isolated contiguous regions in a binary segmentation mask. It is often applied to remove small spurious predictions that degrade IoU by contributing false positive voxels without adding meaningful true positive overlap. In instance segmentation, it separates touching objects before computing per-instance IoU scores.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us