Skip to main content

Mean Dice

Available

instance_segmentation.mean_dice

Mean Dice overlap between matched predicted and ground-truth object instances.

Contract​

FieldValue
version1.0.0
metric_typepointwise
scorer_contractfull_dataset
directionhigher_is_better
entrypointaip_scorers_instance_segmentation.answered.mean_dice
target_kindNone

Required columns​

  • image_id
  • label
  • predictions

Accepted schemas​

[
{
"name": "gdi_image_v1",
"task_types": [
"instance_segmentation"
]
}
]

Methodology​

  1. Decode per-object masks with one stable dataset class map.
  2. Pair predictions to ground truth within each class, highest confidence first, keeping pairs at or above the match IoU threshold.
  3. Score each matched pair by Dice; count every unmatched instance on either side as zero.
  4. Average within each class, then across the classes the dataset observed.

Score semantics​

Scores range from 0 to 1. Higher is better; 1 means every object was found once with a pixel-perfect mask.

Worked example​

Two ground-truth objects matched at Dice 0.9 and 0.7, plus one missed object, give (0.9 + 0.7 + 0) / 3 = 0.53 for that class.

Configuration schema​

{
"properties": {
"inverted": {
"default": false,
"title": "Inverted",
"type": "boolean",
"x-aip-param-role": "scoring_metadata"
},
"match_iou_threshold": {
"default": 0.5,
"description": "Minimum IoU at which a predicted instance is accepted as the same object as a ground-truth instance. Pairs below it leave both instances unmatched.",
"maximum": 1.0,
"minimum": 0.0,
"title": "Match Iou Threshold",
"type": "number"
},
"max": {
"default": 1.0,
"title": "Max",
"type": "number",
"x-aip-param-role": "scoring_metadata"
},
"metric_name": {
"default": "instance_segmentation_metric",
"title": "Metric Name",
"type": "string",
"x-aip-param-role": "scoring_metadata"
},
"min": {
"default": 0.0,
"title": "Min",
"type": "number",
"x-aip-param-role": "scoring_metadata"
},
"weight": {
"default": 1.0,
"title": "Weight",
"type": "number",
"x-aip-param-role": "scoring_metadata"
}
},
"title": "InitializationConfig",
"type": "object"
}

Execution​

{
"emits_metric_family": false,
"function_name": null,
"max_concurrency": null,
"processing_kind": "cpu",
"stream_batch_size": null,
"timeout_seconds": 600
}

Complete manifest​

accepts:
- name: gdi_image_v1
task_types:
- instance_segmentation
config_schema:
properties:
inverted:
default: false
title: Inverted
type: boolean
x-aip-param-role: scoring_metadata
match_iou_threshold:
default: 0.5
description: Minimum IoU at which a predicted instance is accepted as the same
object as a ground-truth instance. Pairs below it leave both instances unmatched.
maximum: 1.0
minimum: 0.0
title: Match Iou Threshold
type: number
max:
default: 1.0
title: Max
type: number
x-aip-param-role: scoring_metadata
metric_name:
default: instance_segmentation_metric
title: Metric Name
type: string
x-aip-param-role: scoring_metadata
min:
default: 0.0
title: Min
type: number
x-aip-param-role: scoring_metadata
weight:
default: 1.0
title: Weight
type: number
x-aip-param-role: scoring_metadata
title: InitializationConfig
type: object
dependencies: []
description: Mean Dice overlap of matched object instances, averaged across classes.
direction: higher_is_better
display_name: Mean Dice
entrypoint: aip_scorers_instance_segmentation.answered.mean_dice
execution:
emits_metric_family: false
function_name: null
max_concurrency: null
processing_kind: cpu
stream_batch_size: null
timeout_seconds: 600
kind: metric
manifest_version: '1'
max_prompt_slots: 0
metric_metadata:
methodology:
- Decode per-object masks with one stable dataset class map.
- Pair predictions to ground truth within each class, highest confidence first,
keeping pairs at or above the match IoU threshold.
- Score each matched pair by Dice; count every unmatched instance on either side
as zero.
- Average within each class, then across the classes the dataset observed.
score_semantics: Scores range from 0 to 1. Higher is better; 1 means every object
was found once with a pixel-perfect mask.
summary: Mean Dice overlap between matched predicted and ground-truth object instances.
worked_example: Two ground-truth objects matched at Dice 0.9 and 0.7, plus one missed
object, give (0.9 + 0.7 + 0) / 3 = 0.53 for that class.
metric_type: pointwise
name: instance_segmentation.mean_dice
partition_types: []
required_columns:
- image_id
- label
- predictions
required_kinds: []
scorer_contract: full_dataset
target_kind: null
unsupported_trace_shapes: []
version: 1.0.0