Skip to content
Projetos

Sobre

SVGFaith: a two-layer meta-evaluation of faithfulness metrics for text-to-SVG generation

Design e mídia

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
0
em 7 dias
+1
em 15 dias
Coletando histórico
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original
SVGFaith: A Two-Layer Meta-Evaluation of Faithfulness Metrics for Text-to-SVG Generation

arXiv 2611.06048 Hugging Face Benchmark SVGFaith-Decomposer Quick Start 简体中文

Guotao Liang1,2  ·  Haitao Zhou2  ·  Biao Liu1  ·  Huanxuan Liao1  ·  Lingfeng Qiao1
Qian-Wen Zhang1*  ·  Qian Yu2  ·  Di Yin1  ·  Xing Sun1
1Tencent Youtu Lab  ·  2Visual Computing Group, Beijing  ·  *Corresponding author

Most text-to-SVG benchmarks evaluate generated vector code by rendering it to pixels and scoring the image with CLIPScore, a human-preference reward model, or a vision-language judge. In practice, we rarely check whether those metrics actually prefer the SVG that follows the prompt. Even on clean vector graphics without photographic background clutter, CLIPScore frequently gives a higher score to a clown missing its nose, a whale and starfish with swapped colors, or a broken microchip icon than to a faithful rendering.

SVGFaith examples comparing SVGFaith-Score and CLIPScore on Diagnostic and Arena pairs

SVGFaith evaluates the evaluation metrics themselves. Rather than ranking SVG generators with an unverified score, we test each metric on pairs where the more faithful candidate is already established by controlled construction or by human annotation:

  • SVGFaith-Diagnostic (1,842 pairs): Controlled contrastive pairs spanning eight compositional capability axes, split evenly into 921 image-side pairs (two renderings for one prompt) and 921 text-side pairs (two prompts for one rendering). Because each pair alters a single targeted constraint, every reversal exposes a specific blind spot.
  • SVGFaith-Arena (1,327 pairs): Human-annotated comparisons of real outputs from six text-to-SVG generators (OmniSVG1.1-8B, InternSVG-8B, SVGen, GPT-5.4, Gemini-3.1-Pro, and Claude-Opus-4.6), judged strictly on prompt faithfulness rather than visual style.

Alongside the benchmark, we release SVGFaith-Score, an interpretable pointwise metric built on 9B models. It decomposes a prompt into a prerequisite graph of atomic visual checks, evaluates each check on the rendered image, and discounts dependent attributes when their parent object is missing. Across Arena and both Diagnostic directions, SVGFaith-Score outperforms all nine evaluated baselines (including a 122B VLM judge) and reaches single-annotator human agreement on Arena (0.880 vs. 0.875).

Key Findings

  1. Overall leaderboard rankings hide sharp compositional blind spots. Image-text embeddings and preference reward models identify objects reliably (0.789 to 0.976 on object identity), yet drop near or below random guessing (0.500) on compositional constraints: CLIP-L/14 scores 0.455 on spatial relations, SigLIP-L/16-384 scores 0.562 on attribute binding, and HPS v2.1 scores 0.447 on negation (preferring renderings that include the forbidden object).
  2. Compressed score ranges and coarse rating scales hurt pairwise resolution. Under a modest tie margin ($\tau = 0.01$, ties given zero credit), embedding and reward metrics drop steeply because their raw scores sit within a narrow numerical band (PickScore v1 falls from 0.799 to 0.313 on image Diagnostic). Meanwhile, a 5-point 122B VLM judge assigns identical integer scores to 17.9% of Arena pairs. Continuous requirement-level probabilities keep SVGFaith-Score's Arena tie rate down to 2.8%.
  3. Automated metrics struggle when strong generators make mistakes. On Arena pairs involving Claude-Opus-4.6, the 122B judge achieves 0.877 strict accuracy when humans prefer Claude, but falls to 0.194 on the subset where humans reject Claude in favor of another generator (SVGFaith-Score drops from 0.952 to 0.516). Clean visual style can still mask prompt violations for current evaluators.
  4. Domain tuning lets a 9B decomposer match a 397B teacher. Replacing SVGFaith-Decomposer with an unmodified Qwen3.5-9B drops Arena accuracy from 0.880 to 0.073, as most runs exhaust their reasoning budget without producing a usable graph. After three-stage training (teacher SFT, rejection-sampling SFT, and GRPO), our 9B decomposer (0.880) matches the Qwen3.5-397B-A17B teacher (0.876).

Main Results

Pairwise accuracy across SVGFaith-Arena and both SVGFaith-Diagnostic directions

Pairwise accuracy from Table 2 of the paper ($\tau = 0$ requires strict inequality $s(A) > s(B)$; $\tau = 0.01$ requires $s(A) - s(B) > 0.01$, with zero credit for ties). Diagnostic columns report unweighted macro averages across the eight capability axes. Mean individual-annotator agreement with the final Arena majority label is 0.875 (3,981 individual votes).

Family Method Arena (τ=0) Arena (τ=0.01) Diag. Image (τ=0) Diag. Image (τ=0.01) Diag. Text (τ=0) Diag. Text (τ=0.01)
Image-Text Embedding CLIP-L/14 0.769 0.699 0.660 0.470 0.658 0.328
Image-Text Embedding SigLIP-L/16-384 0.823 0.775 0.750 0.517 0.745 0.462
Image-Text Embedding Long-CLIP-L/14 0.791 0.739 0.713 0.481 0.754 0.376
Image-Text Embedding Qwen3-VL-Embedding-8B 0.861 0.843 0.777 0.717 0.799 0.668
Preference Reward PickScore v1 0.833 0.605 0.799 0.313 0.737 0.149
Preference Reward HPS v2.1 0.841 0.769 0.808 0.540 0.703 0.368
Preference Reward ImageReward v1.0 0.824 0.819 0.784 0.779 0.782 0.767
VLM & VQA Scoring FlanT5-XXL VQAScore 0.798 0.784 0.873 0.824 0.878 0.825
VLM & VQA Scoring LLM-as-a-Judge (122B) 0.754 0.754 0.902 0.902 0.857 0.857
Ours (9B + 9B) SVGFaith-Score 0.898 0.880 0.965 0.941 0.966 0.953

Constraint-Level Blind Spots

Per-axis pairwise accuracy matrix on image-based SVGFaith-Diagnostic at tau=0

At $\tau = 0$ on image-based Diagnostic (where random guessing is 0.500), warm red tiles mark constraints where existing metrics fall near or below chance despite strong object recognition scores. SVGFaith-Score stays at or above 0.903 on every image axis and at or above 0.890 across all sixteen axis-direction cells.

View per-axis Diagnostic tables (Tables 9 & 10) and component ablations (Table 3)

Image-Based Diagnostic (τ = 0 / τ = 0.01)

Method Negation (123) Attr. Binding (121) Comp. Size (124) Spatial Rel. (123) Obj. Identity (123) Counting (103) Part Complete. (101) Dense Prompt (103)
CLIP-L/14 0.846 / 0.683 0.628 / 0.355 0.508 / 0.379 0.455 / 0.195 0.789 / 0.756 0.612 / 0.291 0.693 / 0.505 0.748 / 0.592
SigLIP-L/16-384 0.780 / 0.675 0.562 / 0.157 0.597 / 0.347 0.626 / 0.195 0.976 / 0.951 0.893 / 0.621 0.782 / 0.574 0.786 / 0.612
Long-CLIP-L/14 0.772 / 0.610 0.669 / 0.223 0.468 / 0.282 0.577 / 0.228 0.911 / 0.878 0.641 / 0.408 0.812 / 0.683 0.854 / 0.534
Qwen3-VL-Embedding-8B 0.756 / 0.707 0.661 / 0.579 0.605 / 0.516 0.626 / 0.512 0.927 / 0.902 0.874 / 0.845 0.871 / 0.832 0.893 / 0.845
PickScore v1 0.797 / 0.293 0.636 / 0.000 0.565 / 0.048 0.732 / 0.073 0.886 / 0.691 0.864 / 0.340 0.960 / 0.624 0.951 / 0.437
HPS v2.1 0.447 / 0.236 0.628 / 0.050 0.734 / 0.411 0.724 / 0.350 0.951 / 0.837 1.000 / 0.777 0.990 / 0.861 0.990 / 0.796
ImageReward v1.0 0.439 / 0.439 0.851 / 0.843 0.694 / 0.677 0.789 / 0.780 0.959 / 0.959 0.748 / 0.738 0.921 / 0.921 0.874 / 0.874
FlanT5-XXL VQAScore 1.000 / 0.984 0.959 / 0.959 0.815 / 0.790 0.821 / 0.715 0.976 / 0.951 0.748 / 0.680 0.822 / 0.772 0.845 / 0.738
LLM-as-a-Judge (122B) 0.984 / 0.984 0.983 / 0.983 0.774 / 0.774 0.943 / 0.943 0.992 / 0.992 0.835 / 0.835 0.851 / 0.851 0.854 / 0.854
SVGFaith-Score 0.927 / 0.870 1.000 / 1.000 0.903 / 0.903 0.967 / 0.951 0.992 / 0.992 0.981 / 0.942 0.990 / 0.970 0.961 / 0.903

Text-Based Diagnostic (τ = 0 / τ = 0.01)

Method Negation (123) Attr. Binding (122) Comp. Size (124) Spatial Rel. (122) Obj. Identity (118) Counting (100) Part Complete. (112) Dense Prompt (100)
CLIP-L/14 0.797 / 0.537 0.492 / 0.107 0.661 / 0.161 0.566 / 0.197 0.822 / 0.712 0.660 / 0.260 0.554 / 0.250 0.710 / 0.400
SigLIP-L/16-384 0.902 / 0.740 0.557 / 0.139 0.734 / 0.250 0.533 / 0.148 0.975 / 0.907 0.900 / 0.670 0.679 / 0.402 0.680 / 0.440
Long-CLIP-L/14 0.797 / 0.504 0.541 / 0.090 0.847 / 0.306 0.574 / 0.221 0.907 / 0.839 0.800 / 0.350 0.723 / 0.339 0.840 / 0.360
Qwen3-VL-Embedding-8B 0.935 / 0.862 0.672 / 0.443 0.774 / 0.597 0.582 / 0.344 0.924 / 0.915 0.850 / 0.700 0.795 / 0.714 0.860 / 0.770
PickScore v1 0.878 / 0.179 0.516 / 0.008 0.645 / 0.016 0.500 / 0.025 0.932 / 0.475 0.950 / 0.280 0.768 / 0.098 0.710 / 0.110
HPS v2.1 0.992 / 0.854 0.533 / 0.025 0.766 / 0.097 0.475 / 0.139 0.958 / 0.831 0.850 / 0.390 0.348 / 0.098 0.700 / 0.510
ImageReward v1.0 0.967 / 0.943 0.934 / 0.934 0.911 / 0.887 0.590 / 0.574 0.983 / 0.983 0.820 / 0.810 0.571 / 0.554 0.480 / 0.450
FlanT5-XXL VQAScore 0.967 / 0.967 0.959 / 0.951 0.879 / 0.831 0.844 / 0.770 0.907 / 0.890 0.700 / 0.590 0.946 / 0.920 0.820 / 0.680
LLM-as-a-Judge (122B) 0.878 / 0.878 0.992 / 0.992 0.605 / 0.605 0.893 / 0.893 0.915 / 0.915 0.830 / 0.830 0.964 / 0.964 0.780 / 0.780
SVGFaith-Score 1.000 / 1.000 1.000 / 1.000 0.984 / 0.976 0.984 / 0.984 0.975 / 0.975 0.930 / 0.890 0.964 / 0.938 0.890 / 0.860

Component Controls on SVGFaith-Arena (τ = 0.01, Table 3)

Decomposition Model VQA Backend Win / Tie / Loss Accuracy Δ vs. Final (95% CI)
None (single holistic query) Qwen3.5-9B 1128 / 69 / 130 0.850 -0.030 [-0.048, -0.012]
Qwen3.5-9B (unmodified) Qwen3.5-9B 97 / 1221 / 9 0.073 -0.807 [-0.828, -0.784]
Qwen3.5-397B-A17B (teacher) Qwen3.5-9B 1163 / 38 / 126 0.876 -0.004 [-0.012, +0.005]
SVGFaith-Decomposer SVGFaith-Decomposer 1172 / 30 / 125 0.883 +0.003 [-0.010, +0.016]
SVGFaith-Decomposer Qwen3.5-9B 1168 / 37 / 122 0.880 0.000

Two-Layer Benchmark Design

Controlled synthetic pairs and real model comparisons answer complementary questions: controlled pairs tell us why a metric fails, while real outputs tell us whether those failures matter when multiple visual imperfections appear at once.

The eight capability axes of SVGFaith-Diagnostic
  • Layer 1: SVGFaith-Diagnostic (1,842 pairs) covers eight capability axes: Negation (246), Attribute Binding (243), Comparative Size (248), Spatial Relation (245), Object Identity (241), Counting (203), Part Completeness (213), and Dense Long Prompt (203). Half of the pairs hold the prompt fixed and perturb the SVG rendering (921 image-based pairs); the other half hold the SVG rendering fixed and perturb the caption (921 text-based pairs). Pairs are built through programmatic SVG edits, hard-negative retrieval, and paired synthesis, with every retained item verified by human annotators (1,799 unanimous 3-annotator pairs plus 43 expert-verified pairs).
  • Layer 2: SVGFaith-Arena (1,327 pairs) samples real outputs from three SVG-specialized models (OmniSVG1.1-8B, InternSVG-8B, SVGen) and three frontier multimodal models (GPT-5.4, Gemini-3.1-Pro, Claude-Opus-4.6). Each pair is independently annotated by three raters instructed to judge prompt faithfulness alone, reserving visual aesthetics only as a separate tie-breaker when two renderings are equally faithful.

How SVGFaith-Score Works

Three-stage pipeline of SVGFaith-Score

Given a text prompt $x$ and a rendered candidate image $I$, SVGFaith-Score produces a continuous faithfulness score $S(x, I) \in [0, 1]$ along with per-requirement diagnostics in three stages:

  1. Prompt-Only Requirement Decomposition: SVGFaith-Decomposer (fine-tuned from Qwen3.5-9B via teacher SFT, rejection-sampling SFT, and GRPO) parses the prompt into a directed acyclic graph of atomic visual requirements. Each node records a canonical yes/no question, an explicit polarity (present or absent, so negative constraints like "no text" are checked directly), and its prerequisite parent nodes. Because decomposition depends only on the prompt, the graph is built once and reused across any number of candidate renderings.
  2. Satisfaction-Aligned Direct VQA: An unmodified Qwen/Qwen3.5-9B model verifies each requirement against the rendered SVG (composited onto a white canvas at 448×448). Thinking is disabled and decoding is restricted to a single Yes or No token, where Yes always means the requirement is satisfied. Taking $q_i = P(\text{Yes}) / (P(\text{Yes}) + P(\text{No}))$ yields a smooth satisfaction probability rather than a coarse integer rating.
  3. Unique-Ancestor Gating: Downstream attributes should not earn full credit when the entity they describe is missing. For each requirement $i$ with distinct ancestor set $\text{Anc}(i)$, its gated score discounts low-scoring prerequisites ($\alpha = 0.5$):

$$g_i = q_i \prod_{j \in \text{Anc}(i)} \bigl((1 - \alpha) + \alpha , q_j\bigr), \qquad S(x, I) = \frac{1}{N} \sum_{i=1}^{N} g_i$$

Counting each distinct ancestor once ensures that diamond dependencies in the graph never double-penalize the same prerequisite. Inspecting $q_i$ alongside $g_i$ reveals both direct visual failures and discounts inherited from missing parent objects.

Quick Start

1. Installation

git clone https://github.com/Yukinonooo/SVGFaith.git
cd SVGFaith
pip install -r requirements.txt

2. Reproduce Paper Numbers from Released Scores

All per-pair SVGFaith-Score outputs used in the paper are included under scores/. You can verify the reported Arena and Diagnostic accuracies locally in under a second (no GPU required):

# Default tie margin (tau = 0.01)
python -m svgfaith.evaluate scores/arena.jsonl scores/diagnostic_image.jsonl scores/diagnostic_text.jsonl

# Strict ordering without tie margin (tau = 0)
python -m svgfaith.evaluate --tau 0 scores/arena.jsonl scores/diagnostic_image.jsonl scores/diagnostic_text.jsonl

# Run unit tests for graph salvage, ancestor gating, and VQA prompt formatting
python -m unittest discover -s tests -v

Expected output at $\tau = 0.01$:

SVGFaith-Arena image: n=1327 win/tie/loss=1168/37/122 micro=0.880181
SVGFaith-Diagnostic image: n=921 win/tie/loss=867/33/21 micro=0.941368
  equal-axis accuracy=0.941399
SVGFaith-Diagnostic text: n=921 win/tie/loss=881/14/26 micro=0.956569
  equal-axis accuracy=0.952686

3. Score a Prompt and Rendered SVG Image

Run end-to-end SVGFaith-Score inference on any prompt and rasterized SVG image (PNG or JPG):

python -m svgfaith.infer \
  --prompt "A red apple on a white table, with no text." \
  --image path/to/rendered_svg.png

To fit comfortably on a single GPU, svgfaith.infer runs Yukinonooo/SVGFaith-Decomposer first (temperature=0, thinking enabled), recovers the atomic requirement graph via svgfaith/salvage.py, frees the decomposer from memory, and then scores every requirement with Qwen/Qwen3.5-9B. It prints both the aggregated score and the per-question breakdown as JSON:

{
  "score": 0.9142,
  "questions": [
    {
      "id": 1,
      "question": "Is there an apple?",
      "polarity": "present",
      "parents": [],
      "probability": 0.9881
    },
    {
      "id": 2,
      "question": "Is the apple red?",
      "polarity": "present",
      "parents": [1],
      "probability": 0.9645
    },
    {
      "id": 3,
      "question": "Is the image free of any text?",
      "polarity": "absent",
      "parents": [],
      "probability": 0.7958
    }
  ]
}

If you are scoring many candidates per prompt in Python, import score_prompt_and_image from svgfaith/infer.py or unique_ancestor_score directly from svgfaith to keep both models resident.

4. Download the Full Benchmark Dataset

The full benchmark (rendered PNGs, SVG sources, metadata, and human annotations) is hosted on Hugging Face at Yukinonooo/SVGFaith:

huggingface-cli download Yukinonooo/SVGFaith --repo-type dataset --local-dir svgfaith-data
  • diagnostic/manifest.jsonl indexes all 1,842 controlled contrastive pairs across the eight axes and two evaluation directions.
  • arena/pairs.jsonl and arena/images/ contain all 1,327 human-annotated model comparisons (with the preferred candidate normalized to slot A, plus secondary tie-break labels on faithfulness-tied pairs).

Repository Structure

SVGFaith/
├── svgfaith/
│   ├── infer.py        End-to-end SVGFaith-Score CLI & Python entry (Decomposer + Qwen3.5-9B VQA)
│   ├── aggregate.py    Unique-ancestor prerequisite gating (alpha = 0.5)
│   ├── salvage.py      Lenient JSON graph recovery & parent ID remapping
│   ├── evaluate.py     Pairwise accuracy & equal-axis macro evaluation for score files
│   └── prompts/        Frozen decomposer system prompt, schema, 1-shot demo, and VQA templates
├── scores/             Released per-pair SVGFaith-Score predictions (Arena & both Diagnostics)
├── tests/              Unit tests for aggregation, tie handling, graph salvage, and prompts
└── assets/             Paper figures and benchmark visualizations (Light & Dark adaptive)

Citation

If you find SVGFaith or SVGFaith-Score useful in your research, please cite:

@misc{liang2026svgfaith,
  title         = {SVGFaith: A Two-Layer Meta-Evaluation of Faithfulness Metrics for Text-to-SVG Generation},
  author        = {Liang, Guotao and Zhou, Haitao and Liu, Biao and Liao, Huanxuan and Qiao, Lingfeng and Zhang, Qian-Wen and Yu, Qian and Yin, Di and Sun, Xing},
  year          = {2026},
  eprint        = {2611.06048},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CV},
  url           = {https://arxiv.org/abs/2611.06048}
}

License

Code in this repository is licensed under the Apache License 2.0. The SVGFaith benchmark dataset and released score files are licensed under CC BY 4.0.

Explore projetos relacionados

Carregando…