physically-disentangled-eval
Physically Disentangled Representations — Klinghoffer et al. (2022) (arXiv:2204.05281, 2022)
What this evaluates
Evaluates the utility of physically disentangled scene representations (geometry, albedo, lighting, camera) for downstream vision tasks. Probes robustness to out-of-distribution lighting and viewpoints, and measures how well learned features transfer to clustering, linear classification, and segmentation benchmarks.
Datasets
- CelebA — total 6000; splits: test (6000)
- Buffy — total 568; splits: test (568)
- BBT — total 644; splits: test (644)
- RAF-DB — total 3068; splits: test (3068)
- CelebA Mask — total 27012; splits: train (24127), test (2885)
- ShapeNet Cars — total 1000; splits: test (1000)
Metrics
clustering_accuracy (primary) — range: [0, 1]
- Weighted cluster purity: Acc = (1/N) * sum_{c=1}^{|C|} n_c * p_c, where N is total samples, n_c is samples in cluster c, and p_c is the fraction of the most frequent class in cluster c relative to n_c.
F1-score — range: [0, 1]
- Weighted average F1-score computed over clusters or classes.
mIoU — range: [0, 1]
- Mean intersection over union across all segmentation classes.
pixel_accuracy — range: [0, 1]
- Fraction of correctly classified pixels across the entire dataset.
Input / output format
Input: 64x64 RGB images (or video frames). For downstream tasks, the model extracts 1x256 geometry and albedo feature embeddings per image.
Output: Cluster assignments per sample, predicted class labels, or pixel-wise segmentation masks.
Scoring recipe
def clustering_accuracy(labels, clusters):
N = len(labels)
acc = 0.0
for c in unique_clusters:
n_c = count(labels in c)
p_c = max(count(label in c for label in unique_labels)) / n_c
acc += n_c * p_c
return acc / N
def linear_accuracy(predictions, gold):
return sum(p == g for p, g in zip(predictions, gold)) / len(gold)
def miou(pred_masks, gt_masks, num_classes):
ious = []
for cls in range(num_classes):
intersection = (pred_masks == cls) & (gt_masks == cls)
union = (pred_masks == cls) | (gt_masks == cls)
ious.append(intersection.sum() / union.sum())
return sum(ious) / num_classes
Common pitfalls
- For video datasets (Buffy/BBT), features must be averaged per video track before clustering, not evaluated frame-by-frame.
- Linear classification experiments require varying the labeled training set size (100, 500, or 1000 samples) and testing both frozen and fine-tuned pre-trained encoders.
- Only geometry and albedo features are used for downstream tasks unless explicitly stated otherwise; other physical parameters are ignored.
Evidence (verbatim from paper)
To measure clustering performance, we report clustering accuracy (also known as weighted cluster purity) and F1-score. F1-score is computed using a weighted average. Clustering accuracy is computed by assigning the most common ground truth label for a cluster to all points in the cluster, as defined below. ... For linear classification, we report accuracy using a threshold of 50%. For segmentation, we report mean intersection over union (mIoU) and pixel accuracy.
Citation
@misc{klinghoffer2022physicallydisentangled,
title={Physically Disentangled Representations},
author={Klinghoffer et al. (2022)},
year={2022},
note={arXiv:2204.05281}
}
1---2name: physically-disentangled-eval3description: Evaluates the utility of physically disentangled scene representations (geometry, albedo, lighting, camera) for downstream vision tasks. Probes robustness to out-of-distribution lighting and viewpoints, and measures how well learned features transfer to clustering, linear classification, and segmentation benchmarks. Use when the user wants to benchmark on CelebA, Buffy, BBT, RAF-DB, CelebA Mask, ShapeNet Cars, or asks about evaluating this task. Reports clustering_accuracy.4---56# physically-disentangled-eval78> Physically Disentangled Representations — Klinghoffer et al. (2022) (arXiv:2204.05281, 2022)910## What this evaluates1112Evaluates the utility of physically disentangled scene representations (geometry, albedo, lighting, camera) for downstream vision tasks. Probes robustness to out-of-distribution lighting and viewpoints, and measures how well learned features transfer to clustering, linear classification, and segmentation benchmarks.1314## Datasets1516- **CelebA** — total 6000; splits: test (6000)17- **Buffy** — total 568; splits: test (568)18- **BBT** — total 644; splits: test (644)19- **RAF-DB** — total 3068; splits: test (3068)20- **CelebA Mask** — total 27012; splits: train (24127), test (2885)21- **ShapeNet Cars** — total 1000; splits: test (1000)2223## Metrics2425- `clustering_accuracy` **(primary)** — range: [0, 1]26 - Weighted cluster purity: Acc = (1/N) * sum_{c=1}^{|C|} n_c * p_c, where N is total samples, n_c is samples in cluster c, and p_c is the fraction of the most frequent class in cluster c relative to n_c.27- `F1-score` — range: [0, 1]28 - Weighted average F1-score computed over clusters or classes.29- `mIoU` — range: [0, 1]30 - Mean intersection over union across all segmentation classes.31- `pixel_accuracy` — range: [0, 1]32 - Fraction of correctly classified pixels across the entire dataset.3334## Input / output format3536**Input**: 64x64 RGB images (or video frames). For downstream tasks, the model extracts 1x256 geometry and albedo feature embeddings per image.3738**Output**: Cluster assignments per sample, predicted class labels, or pixel-wise segmentation masks.3940## Scoring recipe4142```python43def clustering_accuracy(labels, clusters):44 N = len(labels)45 acc = 0.046 for c in unique_clusters:47 n_c = count(labels in c)48 p_c = max(count(label in c for label in unique_labels)) / n_c49 acc += n_c * p_c50 return acc / N5152def linear_accuracy(predictions, gold):53 return sum(p == g for p, g in zip(predictions, gold)) / len(gold)5455def miou(pred_masks, gt_masks, num_classes):56 ious = []57 for cls in range(num_classes):58 intersection = (pred_masks == cls) & (gt_masks == cls)59 union = (pred_masks == cls) | (gt_masks == cls)60 ious.append(intersection.sum() / union.sum())61 return sum(ious) / num_classes62```6364## Common pitfalls6566- For video datasets (Buffy/BBT), features must be averaged per video track before clustering, not evaluated frame-by-frame.67- Linear classification experiments require varying the labeled training set size (100, 500, or 1000 samples) and testing both frozen and fine-tuned pre-trained encoders.68- Only geometry and albedo features are used for downstream tasks unless explicitly stated otherwise; other physical parameters are ignored.6970## Evidence (verbatim from paper)7172> To measure clustering performance, we report clustering accuracy (also known as weighted cluster purity) and F1-score. F1-score is computed using a weighted average. Clustering accuracy is computed by assigning the most common ground truth label for a cluster to all points in the cluster, as defined below. ... For linear classification, we report accuracy using a threshold of 50%. For segmentation, we report mean intersection over union (mIoU) and pixel accuracy.7374## Citation7576```bibtex77@misc{klinghoffer2022physicallydisentangled,78 title={Physically Disentangled Representations},79 author={Klinghoffer et al. (2022)},80 year={2022},81 note={arXiv:2204.05281}82}83```8485- arXiv: 2204.05281