Accuracy
image_classification.accuracy
The fraction of images whose top-scoring predicted class matches the ground-truth label.
Contract
| Field | Value |
|---|---|
version | 1.0.0 |
metric_type | pointwise |
scorer_contract | full_dataset |
direction | higher_is_better |
entrypoint | aip_scorers_image_classification.answered.accuracy |
target_kind | None |
Required columns
image_idlabelpredictions
Accepted schemas
[
{
"name": "gdi_image_v1",
"task_types": [
"classification"
]
}
]
Methodology
- Deterministic - no LLM. Uses numpy over the per-class score vectors.
- For each image, pick the top-scoring class (argmax of the score vector).
- Count the images where the predicted class equals the true label.
- Divide by the number of images to get the 0-1 accuracy.
Score semantics
Scores range 0-1, the share of images classified correctly. A high score means most images were labelled correctly; a low score means many were misclassified. Higher is better.
Worked example
For 4 images where the top predicted class matches the truth on 3 of them -> 3/4 = 0.75.
Configuration schema
{
"description": "Shared image-classification metric configuration.",
"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": "image_classification_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:
- classification
config_schema:
description: Shared image-classification metric configuration.
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: image_classification_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: Fraction of images where the top-scoring class matches the ground-truth
label.
direction: higher_is_better
display_name: Accuracy
entrypoint: aip_scorers_image_classification.answered.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'
max_prompt_slots: 0
metric_metadata:
methodology:
- Deterministic - no LLM. Uses numpy over the per-class score vectors.
- For each image, pick the top-scoring class (argmax of the score vector).
- Count the images where the predicted class equals the true label.
- Divide by the number of images to get the 0-1 accuracy.
score_semantics: Scores range 0-1, the share of images classified correctly. A high
score means most images were labelled correctly; a low score means many were misclassified.
Higher is better.
summary: The fraction of images whose top-scoring predicted class matches the ground-truth
label.
worked_example: For 4 images where the top predicted class matches the truth on
3 of them -> 3/4 = 0.75.
metric_type: pointwise
name: image_classification.accuracy
partition_types: []
required_columns:
- image_id
- label
- predictions
required_kinds: []
scorer_contract: full_dataset
target_kind: null
unsupported_trace_shapes: []
version: 1.0.0