Per-Sample Dice
semantic_segmentation.per_sample_dice
Dice overlap for each image after semantic masks are decoded to dense arrays.
Contract
| Field | Value |
|---|---|
version | 1.0.0 |
metric_type | pointwise |
scorer_contract | per_row |
direction | higher_is_better |
entrypoint | aip_metrics_semantic_segmentation.answered.per_sample_dice |
target_kind | None |
Required columns
image_idlabelpredictions
Accepted schemas
[
{
"name": "gdi_image_v1",
"task_types": [
"semantic_segmentation"
]
}
]
Methodology
- Decode the row's ground truth to an integer class map and prediction to one-hot channels.
- Compute cv-eval micro Dice across all pixels and channels in that image.
Score semantics
Scores range from 0 to 1. Higher is better; 1 means perfect pixel overlap for the image.
Worked example
If twice the intersecting pixel count is 12 and the total predicted-plus-true area is 16, Dice is 0.75.
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": "per_sample_dice",
"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: per_sample_dice
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: Per-image Dice overlap between predicted and ground-truth semantic masks.
direction: higher_is_better
display_name: Per-Sample Dice
entrypoint: aip_metrics_semantic_segmentation.answered.per_sample_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 the row's ground truth to an integer class map and prediction to one-hot
channels.
- Compute cv-eval micro Dice across all pixels and channels in that image.
score_semantics: Scores range from 0 to 1. Higher is better; 1 means perfect pixel
overlap for the image.
summary: Dice overlap for each image after semantic masks are decoded to dense arrays.
worked_example: If twice the intersecting pixel count is 12 and the total predicted-plus-true
area is 16, Dice is 0.75.
metric_type: pointwise
name: semantic_segmentation.per_sample_dice
partition_types: []
required_columns:
- image_id
- label
- predictions
required_kinds: []
scorer_contract: per_row
target_kind: null
unsupported_trace_shapes: []
version: 1.0.0