| --- |
| license: other |
| license_name: research-use-sdxl-openrail-derived |
| license_link: https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md |
| pretty_name: Improving CA-LoRA — CA measurements and generated images |
| tags: |
| - lora |
| - sdxl |
| - cityscapes |
| - concept-aware-lora |
| - synthetic-images |
| - reproducibility |
| - research |
| task_categories: |
| - text-to-image |
| size_categories: |
| - 1K<n<10K |
| --- |
| |
| # Improving CA-LoRA — CA measurements and generated images |
|
|
| The two large evidence sets behind the reproduction-and-extension study of **CA-LoRA |
| (Concept-Aware LoRA)** on SDXL / Cityscapes: |
|
|
| 1. **`measurements/`** — the raw head-granularity concept-attribution tensors for a 13-timestep |
| sweep (backs **Table 2** and **Figure 1** of the report). |
| 2. **`generated/`** — every image that was scored for the main results (backs **Table 3** of the |
| report). |
|
|
| The adapters that produced the images live in |
| [`chs35/improving-ca-lora-checkpoints`](https://huggingface.co/chs35/improving-ca-lora-checkpoints). |
|
|
| --- |
|
|
| ## `measurements/tsweep_sdxl_head/` — 39 files, 191 MB |
|
|
| Head-granularity CA measurements over the timestep grid |
| `[1, 41, 81, 121, 201, 301, 401, 481, 601, 701, 801, 901, 981]` — 13 timesteps × 3 files: |
|
|
| | file | what it is | |
| | --- | --- | |
| | `t<NNNN>.safetensors` | the full measurement at that timestep (256 samples) | |
| | `t<NNNN>_half0.safetensors` | first split half | |
| | `t<NNNN>_half1.safetensors` | second split half | |
|
|
| The `half0` / `half1` pair is what the **split-half agreement** column of Table 2 is computed from |
| (Spearman 0.956 for the primary ews metric); the full files carry the CA magnitudes and direction |
| statistics that rank the timesteps and drive Figure 1's per-head heatmaps. |
|
|
| Each file carries a `unit_granularity` metadata field (`head`), which the loading code verifies — |
| head- and module-granularity measurement products cannot be mixed. Measurements were taken at |
| `batch_size = 1` with `crop="center"`, and seeds are derived so that pairing holds across concept |
| axes and across timesteps. |
|
|
| --- |
|
|
| ## `generated/` — 11 runs × 900 PNG + manifest, ~12 GB |
|
|
| The exact 1024×1024 images scored for **CMMD** and **CLIP-Score** in Table 3. One directory per |
| evaluated arm: |
|
|
| ``` |
| generated/<RUN>/ |
| in_domain/ 00000.png … 00499.png (500 images) |
| foggy/ 00500.png … 00599.png (100) |
| night-time/ 00600.png … 00699.png (100) |
| rainy/ 00700.png … 00799.png (100) |
| snowy/ 00800.png … 00899.png (100) |
| manifest.json |
| ``` |
|
|
| Filenames are a **global index 00000–00899 across the whole run**, not per-condition counters — the |
| condition directory a file sits in is implied by its index range, as laid out above. 900 images per |
| run, 9,900 in total. |
|
|
| `manifest.json` records, for every single image: its `index`, the full `prompt` actually used, the |
| sampled `class_names`, the `condition`, the `seed` and `batch_seed_index`, and the relative `path`. |
| It also records the generation protocol (guidance scale 5.0, 25 steps, `EulerDiscreteScheduler`, |
| 1024², fp32, seed 0) and which adapter checkpoint was loaded. Per-image scores can therefore be |
| recomputed exactly from these files. |
|
|
| ### Runs, and the report rows they back |
|
|
| | directory | selection criterion | axis | Table 3 row | |
| | --- | --- | --- | --- | |
| | `A_t81_style` | t = 81 (the original paper's timestep) | style | "t = 81 (paper) / style" | |
| | `A_t81_viewpoint` | t = 81 (the original paper's timestep) | viewpoint | "t = 81 (paper) / viewpoint" | |
| | `B_top3_style` | multi-t, top-3 timesteps [41, 1, 81] | style | "multi-t [41, 1, 81] / style" | |
| | `B_top3_viewpoint` | multi-t, top-3 timesteps [41, 1, 81] | viewpoint | "multi-t [41, 1, 81] / viewpoint" | |
| | `C_t41_style` | t = 41 (this study's top-ranked timestep) | style | "t = 41 / style" | |
| | `C_t41_viewpoint` | t = 41 (this study's top-ranked timestep) | viewpoint | "t = 41 / viewpoint" | |
| | `D_t1_style` | t = 1 | style | "t = 1 / style" | |
| | `D_t1_viewpoint` | t = 1 | viewpoint | "t = 1 / viewpoint" | |
| | `E_random` | **control**: random 2% of heads, no CA | — | "random 2% (no CA)" | |
| | `E_all` | **control**: all attention projections, no CA selection | — | "full attention (no CA)" | |
| | `control_base` | **control**: base SDXL, no adapter at all | — | "0% control (base SDXL)" | |
|
|
| The four weather conditions are what the per-condition CLIP-Score columns and the weather-mean |
| column of Table 3 (and the gap analysis of Table 4) are computed over; `in_domain` is the CMMD set. |
|
|
| --- |
|
|
| ## ⚠️ Not included: the Cityscapes CMMD reference set |
|
|
| CMMD in Table 3 is measured against **500 centre crops of the Cityscapes `val` split**. Those |
| reference images are **not distributed here, or anywhere** — the Cityscapes license forbids |
| redistribution of the imagery. No real Cityscapes image appears in this repository. |
|
|
| The reference set is rebuildable from your own Cityscapes download: take the **first 500 images of |
| the `val` split in index order**, at **1024×1024**, **centre-cropped** and un-mirrored — the same |
| framing the training data was read with, so that CMMD measures a gap in content rather than a |
| difference in cropping. The exporter is `scripts/evaluate.py` (`export_reference`) in the code |
| repository, and the relevant config knobs (`eval.reference_split`, `eval.reference_num_images`, |
| `eval.seed`) are in the released `config.yaml`. Obtain Cityscapes from |
| <https://www.cityscapes-dataset.com/>. Every other number in the report is reproducible from the |
| artifacts here without it. |
|
|
| --- |
|
|
| ## License and intended use |
|
|
| **Research use.** The PNGs are **synthetic images generated by SDXL-derived adapters fine-tuned on |
| Cityscapes** — they are model output, not photographs, and they inherit the |
| [OpenRAIL++ use restrictions](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md) |
| of the SDXL base model, which apply to this data as they do to the model that produced it. Because |
| the adapters were fine-tuned on Cityscapes, users should also respect the |
| [Cityscapes terms](https://www.cityscapes-dataset.com/license/). Again: **no real Cityscapes images |
| are included** in this repository. |
|
|
| These images exist to make the report's metrics auditable and re-scorable. They are not a |
| general-purpose street-scene dataset, and they carry the domain and quality limitations discussed in |
| the report's Limitations section. |
|
|
| ## Verifying integrity |
|
|
| The code repository ships `results/sha256_measurements.txt` and `results/sha256_generated_images.csv` |
| (`path,bytes,sha256`), keyed by the same repo-relative paths used here. |
|
|