psgg-metrics-eval
A Review and Efficient Implementation of Scene Graph Generation Metrics — Lorenz et al. (2024) (arXiv:2404.09616, 2024)
What this evaluates
Evaluates panoptic scene graph generation models on their ability to predict object triplets with correct masks and relations. It probes recall-based performance at different top-k limits, mean recall across predicates, pair recall, and predicate ranking accuracy.
Datasets
- PSG — total ?; splits: test (-1)
Metrics
Recall@k — range: [0, 1]
- Fraction of ground truth triplets matched within the top-k predicted triplets. k can be absolute (e.g., 20, 50, 100) or relative to the number of ground truth annotations (e.g., ×1, ×10).
Mean Recall@k (primary) — range: [0, 1]
- Average of Recall@k computed separately for each predicate class, then averaged across all predicates. Higher values indicate better overall triplet prediction quality.
Pair Recall@k — range: [0, 1]
- Fraction of ground truth subject-predicate pairs matched in the top-k predictions, ignoring the object entity. Probes relation prediction quality independently of object detection.
Predicate Rank — range: other
- Average rank of the correct predicate for each subject-object pair in the predicted list. Lower values indicate better predicate ranking.
Input / output format
Input: Image, ground truth panoptic scene graph annotations (objects, masks, predicates, relations), and model-predicted scene graph triplets with associated masks and predicates.
Output: Model outputs a list of predicted triplets (subject, predicate, object) with corresponding masks/bounding boxes. Evaluation converts these to a standardized format for metric computation.
Scoring recipe
def compute_recall(preds, gold, k):
top_k = preds[:k]
matches = sum(1 for p in top_k if p in gold)
return matches / len(gold)
def compute_mean_recall(preds, gold, k):
recalls = []
for pred_type in unique_predicates(gold):
recalls.append(compute_recall(
[t for t in preds if t.predicate == pred_type],
[t for t in gold if t.predicate == pred_type], k))
return sum(recalls) / len(recalls)
# k can be absolute int or relative multiplier (e.g., len(gold) * 10)
Common pitfalls
- Confusing absolute k (fixed number like 20, 50, 100) with relative k (multiplier of ground truth count), which breaks cross-dataset comparability.
- Assuming high Pair Recall@k automatically implies good Predicate Rank; the paper shows they can be independent or inversely correlated.
- Failing to support overlapping masks in output formats, which breaks evaluation for modern panoptic scene graph models that require specific pickle formats.
Evidence (verbatim from paper)
Table 1 shows Recall@k values for different k. Apart from the common k ∈ {20,50,100}, we include two relative values for k. For R@×10, it is allowed to select 10 triplets per ground truth annotation. For R@×1, the number of output triplets has to be the same as the number ground truth triplets.
Citation
@misc{lorenz2024sgbench,
title={A Review and Efficient Implementation of Scene Graph Generation Metrics},
author={Lorenz et al. (2024)},
year={2024},
note={arXiv:2404.09616}
}
1---2name: psgg-metrics-eval3description: Evaluates panoptic scene graph generation models on their ability to predict object triplets with correct masks and relations. It probes recall-based performance at different top-k limits, mean recall across predicates, pair recall, and predicate ranking accuracy. Use when the user wants to benchmark on PSG, or asks about evaluating this task. Reports Mean Recall@k.4metadata:5 source: https://skillmd.com/skills/qhjqhj00/psgg-metrics-eval6 skill_kind: dataset_eval7 source_arxiv: 2404.096168 bibtex_key: lorenz2024sgbench9 confidence: high10---1112# psgg-metrics-eval1314> A Review and Efficient Implementation of Scene Graph Generation Metrics — Lorenz et al. (2024) (arXiv:2404.09616, 2024)1516## What this evaluates1718Evaluates panoptic scene graph generation models on their ability to predict object triplets with correct masks and relations. It probes recall-based performance at different top-k limits, mean recall across predicates, pair recall, and predicate ranking accuracy.1920## Datasets2122- **PSG** — total ?; splits: test (-1)2324## Metrics2526- `Recall@k` — range: [0, 1]27 - Fraction of ground truth triplets matched within the top-k predicted triplets. k can be absolute (e.g., 20, 50, 100) or relative to the number of ground truth annotations (e.g., ×1, ×10).28- `Mean Recall@k` **(primary)** — range: [0, 1]29 - Average of Recall@k computed separately for each predicate class, then averaged across all predicates. Higher values indicate better overall triplet prediction quality.30- `Pair Recall@k` — range: [0, 1]31 - Fraction of ground truth subject-predicate pairs matched in the top-k predictions, ignoring the object entity. Probes relation prediction quality independently of object detection.32- `Predicate Rank` — range: other33 - Average rank of the correct predicate for each subject-object pair in the predicted list. Lower values indicate better predicate ranking.3435## Input / output format3637**Input**: Image, ground truth panoptic scene graph annotations (objects, masks, predicates, relations), and model-predicted scene graph triplets with associated masks and predicates.3839**Output**: Model outputs a list of predicted triplets (subject, predicate, object) with corresponding masks/bounding boxes. Evaluation converts these to a standardized format for metric computation.4041## Scoring recipe4243```python44def compute_recall(preds, gold, k):45 top_k = preds[:k]46 matches = sum(1 for p in top_k if p in gold)47 return matches / len(gold)4849def compute_mean_recall(preds, gold, k):50 recalls = []51 for pred_type in unique_predicates(gold):52 recalls.append(compute_recall(53 [t for t in preds if t.predicate == pred_type],54 [t for t in gold if t.predicate == pred_type], k))55 return sum(recalls) / len(recalls)5657# k can be absolute int or relative multiplier (e.g., len(gold) * 10)58```5960## Common pitfalls6162- Confusing absolute k (fixed number like 20, 50, 100) with relative k (multiplier of ground truth count), which breaks cross-dataset comparability.63- Assuming high Pair Recall@k automatically implies good Predicate Rank; the paper shows they can be independent or inversely correlated.64- Failing to support overlapping masks in output formats, which breaks evaluation for modern panoptic scene graph models that require specific pickle formats.6566## Evidence (verbatim from paper)6768> Table 1 shows Recall@k values for different k. Apart from the common k ∈ {20,50,100}, we include two relative values for k. For R@×10, it is allowed to select 10 triplets per ground truth annotation. For R@×1, the number of output triplets has to be the same as the number ground truth triplets.6970## Citation7172```bibtex73@misc{lorenz2024sgbench,74 title={A Review and Efficient Implementation of Scene Graph Generation Metrics},75 author={Lorenz et al. (2024)},76 year={2024},77 note={arXiv:2404.09616}78}79```8081- arXiv: 2404.09616