Skip to main content

Pixel Accuracy

Available

semantic_segmentation.pixel_accuracy

Per-class share of ground-truth pixels the predicted mask labels correctly.

Contract​

FieldValue
version1.0.0
metric_typepointwise
scorer_contractfull_dataset
directionhigher_is_better
entrypointaip_scorers_semantic_segmentation.answered.pixel_accuracy
target_kindNone

Required columns​

  • image_id
  • label
  • predictions

Accepted schemas​

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

Methodology​

  1. Decode canonical masks with one stable dataset class map.
  2. Pool true-positive and ground-truth pixel counts per class across the whole dataset, then divide once.
  3. Average the per-class values. Class id 0 covers pixels no annotation claims: it is excluded from the per-class artifact and from the macro average alike. A class the dataset never labels is left out of the average too, but is named in the artifact's unscored_classes list rather than dropped silently.

Score semantics​

Scores range from 0 to 1. Higher is better; 1 means every ground-truth pixel of every class carries the right class.

Worked example​

A class holding 5 ground-truth pixels of which 2 are predicted correctly scores 0.4, whichever images those pixels came from.

Configuration schema​

{
"description": "Configuration for the pooled per-class pixel-accuracy scorer.\n\nCarries no smoothing term: the denominator is a counted ground-truth area, and a\nclass whose area is zero is reported as unscored rather than smoothed towards a value.",
"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": "pixel_accuracy",
"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"
},
"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": "PixelAccuracyInitializationConfig",
"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:
description: 'Configuration for the pooled per-class pixel-accuracy scorer.


Carries no smoothing term: the denominator is a counted ground-truth area, and
a

class whose area is zero is reported as unscored rather than smoothed towards
a value.'
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: pixel_accuracy
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
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: PixelAccuracyInitializationConfig
type: object
dependencies: []
description: Share of each class's ground-truth pixels the model labels correctly.
direction: higher_is_better
display_name: Pixel Accuracy
entrypoint: aip_scorers_semantic_segmentation.answered.pixel_accuracy
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'
metric_metadata:
methodology:
- Decode canonical masks with one stable dataset class map.
- Pool true-positive and ground-truth pixel counts per class across the whole dataset,
then divide once.
- 'Average the per-class values. Class id 0 covers pixels no annotation claims:
it is excluded from the per-class artifact and from the macro average alike. A
class the dataset never labels is left out of the average too, but is named in
the artifact''s unscored_classes list rather than dropped silently.'
score_semantics: Scores range from 0 to 1. Higher is better; 1 means every ground-truth
pixel of every class carries the right class.
summary: Per-class share of ground-truth pixels the predicted mask labels correctly.
worked_example: A class holding 5 ground-truth pixels of which 2 are predicted correctly
scores 0.4, whichever images those pixels came from.
metric_type: pointwise
name: semantic_segmentation.pixel_accuracy
partition_types: []
required_columns:
- image_id
- label
- predictions
required_kinds: []
scorer_contract: full_dataset
target_kind: null
version: 1.0.0