--- license: other pretty_name: VDC degradation embeddings tags: - image-restoration - embeddings - clip - dinov2 viewer: false --- # Degradation embeddings for the VDC attribute pairs Image embeddings of the degraded/clean pairs of the VDC author release (DeHaze, DeRain, DeNoise, DeBlur, SR), used to test whether each degradation is a consistent direction in an image-embedding space. Code, protocol and the human-readable report live in the project repository (branch `feat/embedding-concepts`, code at commit `11a4b16`): `embedding/` (pipeline), `docs/embedding-concept-validation.md` (protocol), `results/embedding-concepts/` (report). **Private.** The vectors are derived from the author-release images, whose licence has not been reviewed. Do not make this repository public before that review. ## Contents ``` /.npz stems (N,), groups (N,), deg (N, D), gt (N, D) /meta.json encoder, package versions, arguments of embed.py results/ report.md, concept_validation.json, dose-response.txt logs/ run script and logs of the full run SHA256SUMS ``` | Encoder tag | Model | D | |---|---|---| | `clip-vitl14` | `openai/clip-vit-large-patch14` image tower, 224x224 square bicubic resize | 768 | | `dinov2-224` | `facebook/dinov2-base`, CLS token, 224x224 | 768 | | `gemma2-t560-float32` | `google/embeddinggemma-2`, `max_soft_tokens=560`, float32, no prompt | 768 | | `pixel-stats` | 12 hand-made low-level statistics (control, not an encoder) | 12 | All vectors are L2-normalised. `deg[i]` and `gt[i]` are the degraded and clean image of the pair named `stems[i]`; `groups[i]` is the scene (for DeHaze the stem prefix before `_`), used for scene-level folds. Pairs: DeHaze 499 (491 scenes), DeRain 99, DeNoise 67, DeBlur 999, SR 999. The one-shot training pair of each attribute (`vdc/colab/attributes.json`) is excluded. DeHaze stems follow RESIDE naming `__`. Run: 2026-11-08, Tesla T4, torch 2.11.0+cu128, transformers 5.22.2, sentence-transformers 6.2.0, numpy 2.5.4 (also recorded in each `meta.json`). ## Summary of the results - Out of fold, every encoder places degraded images further along the learned direction than their own clean image for all five attributes (paired accuracy 0.985 to 1.000). The pixel-statistics control passes the same criterion on 4 of 5 attributes, so this alone shows a linear, consistent shift, not a semantic one. - Unpaired AUC (degraded vs clean images of different scenes) is the informative test. Haze is the hardest case: CLIP 0.864, EmbeddingGemma 2 0.780, DINOv2 0.682, pixel statistics 0.959. EmbeddingGemma 2 is not better than CLIP. - Dose-response on DeHaze: the projection on the haze direction grows with the nominal beta for every encoder; without the clean image Spearman rho is 0.52 (CLIP) and 0.63 (pixel statistics). ## Loading ```python import numpy as np from huggingface_hub import hf_hub_download path = hf_hub_download("dollyx/vdc-embedding-concepts", "clip-vitl14/DeHaze.npz", repo_type="dataset") d = np.load(path, allow_pickle=False) deg, gt, stems = d["deg"], d["gt"], d["stems"] ``` Re-run the analysis from the repository root with `python embedding/analyze.py --emb-root --out ` and `python embedding/dose_response.py `.