Mean Dice
semantic_segmentation.mean_dice
Mean Dice overlap between predicted and ground-truth semantic masks.
Contract
| Field | Value |
|---|---|
version | 1.0.0 |
metric_type | pointwise |
scorer_contract | full_dataset |
direction | higher_is_better |
entrypoint | aip_scorers_semantic_segmentation.answered.mean_dice |
target_kind | None |
Required columns
image_idlabelpredictions
Accepted schemas
[
{
"name": "gdi_image_v1",
"task_types": [
"semantic_segmentation"
]
}
]
Methodology
- Decode canonical masks with one stable dataset class map.
- Accumulate cv-eval twice-intersection and total-area values for each observed class.
- Average each class across rows, then apply nanmean across available class scores.
Score semantics
Scores range from 0 to 1. Higher is better; 1 means perfect class-region overlap.
Worked example
Two finite class Dice scores of 0.9 and 0.7 produce a mean Dice of 0.8; an absent class remains NaN.
Configuration schema
{
"properties": {
"inverted": {
"default": false,
"title": "Inverted",
"type": "boolean",
"x-aip-param-role": "scoring_metadata"
},
"max": {
"default": 1.0,
"title": "Max",
"type": "number",
"x-aip-param-role": "scoring_metadata"
},
"metric_name": {
"default": "semantic_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"
},
"smooth": {
"default": 0.001,
"minimum": 0.0,
"title": "Smooth",
"type": "number"
},
"threshold": {
"default": 0.5,
"maximum": 1.0,
"minimum": 0.0,
"title": "Threshold",
"type": "number"
},
"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:
- semantic_segmentation
config_schema:
properties:
inverted:
default: false
title: Inverted
type: boolean
x-aip-param-role: scoring_metadata
max:
default: 1.0
title: Max
type: number
x-aip-param-role: scoring_metadata
metric_name:
default: semantic_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
smooth:
default: 0.001
minimum: 0.0
title: Smooth
type: number
threshold:
default: 0.5
maximum: 1.0
minimum: 0.0
title: Threshold
type: number
weight:
default: 1.0
title: Weight
type: number
x-aip-param-role: scoring_metadata
title: InitializationConfig
type: object
dependencies: []
description: Mean pixel Dice overlap across semantic classes.
direction: higher_is_better
display_name: Mean Dice
entrypoint: aip_scorers_semantic_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 canonical masks with one stable dataset class map.
- Accumulate cv-eval twice-intersection and total-area values for each observed
class.
- Average each class across rows, then apply nanmean across available class scores.
score_semantics: Scores range from 0 to 1. Higher is better; 1 means perfect class-region
overlap.
summary: Mean Dice overlap between predicted and ground-truth semantic masks.
worked_example: Two finite class Dice scores of 0.9 and 0.7 produce a mean Dice
of 0.8; an absent class remains NaN.
metric_type: pointwise
name: semantic_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