| name | vectra-metric-dataset-visual |
| description | Assess visual quality of translated product images using Vectra's 14-dimension scoring framework. Use when: 'evaluate translated image quality', 'score e-commerce product rendering', 'assess in-image translation defects', 'build IIMT quality pipeline', 'rate visual rendering of translated text on images', 'detect text hallucination in product photos'. |
Vectra: Visual Quality Assessment for E-Commerce In-Image Translation
This skill enables Claude to implement and apply the Vectra framework for assessing visual quality in e-commerce In-Image Machine Translation (IIMT). Vectra decomposes visual quality into 14 interpretable dimensions across textual and scene categories, uses a spatially-aware Defect Area Ratio (DAR) to quantify defect severity, and combines scores via multiplicative aggregation that treats accuracy failures as non-compensatory. This approach replaces opaque reference-based metrics (SSIM, FID) and underspecified model-as-judge prompts with a structured, explainable quality assessment pipeline grounded in e-commerce domain knowledge.
When to Use
- When the user asks to build a quality evaluation pipeline for translated product images or any in-image text rendering system
- When the user needs to score or rank visual quality of images where text has been overlaid, translated, or edited programmatically
- When the user wants to detect and categorize defects in translated e-commerce listings (hallucinated text, missing translations, style inconsistencies)
- When the user is constructing annotation guidelines or rubrics for human evaluation of image translation quality
- When the user needs a structured prompt template to evaluate visual rendering quality using a multimodal LLM (GPT-4o, Gemini, Qwen-VL, etc.)
- When the user wants to build a reward model or preference dataset for aligning image translation systems
- When the user asks to implement DAR-based spatial defect quantification for any image quality assessment task
Key Technique
Vectra's core insight is that visual quality in translated product images cannot be captured by a single score or pixel-level similarity metric. Instead, it decomposes quality into 14 dimensions organized in a two-level taxonomy. Textual Visual Quality covers 8 dimensions: Text Size, Text Color, Text Position, Font Style, Layout, Pixel Clarity Consistency (all style), plus Text Hallucination and Text Omission (accuracy). Scene Visual Quality covers 6 dimensions: Scene Size, Scene Color, Element Position, Pixel Clarity Consistency (style), plus Scene Hallucination and Scene Omission (accuracy). Each dimension is scored on a 3-point ordinal scale (1=Poor, 2=Fair, 3=Excellent) anchored by the Defect Area Ratio.
The Defect Area Ratio (DAR) measures what fraction of the relevant content area is affected by a defect. The scoring rule is: score 3 if DAR is approximately 0, score 2 if 0 < DAR <= 0.3, and score 1 if DAR > 0.3. The threshold of 0.3 was empirically calibrated: rejection rates stay below 40% for DAR < 0.3 and surge past 90% for DAR >= 0.3. This spatial grounding eliminates the ambiguity of subjective "good/bad" labels by tying scores to observable defect coverage.
The final Vectra Score uses multiplicative aggregation: Score = 100 * phi(mean_accuracy) * phi(mean_style), where phi normalizes the [1,3] range to [0,1]. This is deliberately non-compensatory -- a catastrophic accuracy failure (hallucinated product spec, missing safety text) drives the score toward zero regardless of how good the styling looks. This reflects e-commerce reality: a mistranslated product feature can violate consumer protection regulations, and no amount of pretty typography compensates for it.
Step-by-Step Workflow
-
Define the dimension taxonomy. Create a structured schema covering all 14 dimensions, split into Textual Visual Quality (8 dimensions) and Scene Visual Quality (6 dimensions), each tagged as either "style" or "accuracy" type. Store this as a JSON or Python dictionary that will drive downstream scoring.
-
Build the DAR scoring function. Implement the 3-point ordinal scoring rule: if the defect area ratio is ~0, return 3; if 0 < DAR <= 0.3, return 2; if DAR > 0.3, return 1. For automated pipelines, compute DAR as defect_pixels / total_content_pixels using bounding-box or segmentation masks. For MLLM-based pipelines, instruct the model to estimate DAR visually.
-
Construct the evaluation prompt template. Build a structured prompt that: (a) presents the image, (b) lists all 14 dimension definitions with DAR-anchored rubrics, (c) requires per-dimension reasoning in the pattern CONTENT -> ISSUE -> POSITION -> EFFECT (DAR estimate) -> SCORE, and (d) mandates structured output (XML or JSON) with both reasoning and numeric scores per dimension.
-
Collect per-dimension scores. For each image, run the evaluation (via human annotators or MLLM) to produce 14 individual scores. If using multiple annotators, resolve disagreements by statistical mode with lowest-value tiebreaking (conservative bias favoring defect detection).
-
Compute the aggregate Vectra Score. Separate accuracy dimensions from style dimensions. Compute the mean score for each group. Normalize each mean from the [1,3] range to [0,1] via phi(x) = (x - 1) / 2. Multiply the two normalized values and scale by 100: final_score = 100 * phi(mean_acc) * phi(mean_sty).
-
Generate diagnostic reasoning. For each image, produce a natural-language explanation citing the specific dimensions that failed, the estimated DAR, and the spatial location of defects. This transforms the score from an opaque number into an actionable diagnosis.
-
Rank and compare systems. To evaluate multiple IIMT systems, compute Vectra Scores across a benchmark set, then measure system-level agreement using Kendall's tau (rank correlation) and instance-level accuracy using Pearson's r against human ground truth.
-
Build training data for a scoring model (optional). If fine-tuning a smaller MLLM: (a) generate 30K reasoning annotations using a strong MLLM (e.g., Gemini-2.5-Pro) with the structured prompt, (b) collect 2.5-3.5K expert preference pairs for alignment, (c) fine-tune with supervised learning on the reasoning data, then align with GSPO using format + preference rewards.
Concrete Examples
Example 1: Building a Vectra scoring function in Python
User: "I need to evaluate the visual quality of translated product images. Can you implement the Vectra scoring system?"
Approach:
- Define the 14-dimension taxonomy as a data structure
- Implement the DAR-based scoring rule
- Implement the multiplicative aggregation formula
- Add diagnostic output
Output:
from dataclasses import dataclass
from enum import Enum
from typing import Optional
class DimensionType(Enum):
ACCURACY = "accuracy"
STYLE = "style"
class Category(Enum):
TEXTUAL = "textual"
SCENE = "scene"
VECTRA_DIMENSIONS = {
"text_size": {"category": Category.TEXTUAL, "type": DimensionType.STYLE,
"description": "Translated text size consistency with original layout"},
"text_color": {"category": Category.TEXTUAL, "type": DimensionType.STYLE,
"description": "Color harmony of rendered text with background"},
"text_position": {"category": Category.TEXTUAL, "type": DimensionType.STYLE,
"description": "Spatial alignment of translated text within design regions"},
"font_style": {"category": Category.TEXTUAL, "type": DimensionType.STYLE,
"description": "Font choice consistency with brand and product context"},
"text_layout": {"category": Category.TEXTUAL, "type": DimensionType.STYLE,
"description": "Line breaking, spacing, and text block arrangement"},
: {: Category.TEXTUAL, : DimensionType.STYLE,
: },
: {: Category.TEXTUAL, : DimensionType.ACCURACY,
: },
: {: Category.TEXTUAL, : DimensionType.ACCURACY,
: },
: {: Category.SCENE, : DimensionType.STYLE,
: },
: {: Category.SCENE, : DimensionType.STYLE,
: },
: {: Category.SCENE, : DimensionType.STYLE,
: },
: {: Category.SCENE, : DimensionType.STYLE,
: },
: {: Category.SCENE, : DimensionType.ACCURACY,
: },
: {: Category.SCENE, : DimensionType.ACCURACY,
: },
}
DAR_THRESHOLD =
() -> :
dar <= :
dar <= DAR_THRESHOLD:
:
() -> :
acc_scores, sty_scores = [], []
dim_name, score dimension_scores.items():
dim_info = VECTRA_DIMENSIONS[dim_name]
dim_info[] == DimensionType.ACCURACY:
acc_scores.append(score)
:
sty_scores.append(score)
mean_acc = (acc_scores) / (acc_scores)
mean_sty = (sty_scores) / (sty_scores)
phi_acc = (mean_acc - ) /
phi_sty = (mean_sty - ) /
final_score = * phi_acc * phi_sty
{
: (final_score, ),
: (mean_acc, ),
: (mean_sty, ),
: (phi_acc, ),
: (phi_sty, ),
: dimension_scores,
}
Example 2: Crafting an MLLM evaluation prompt
User: "I want to use GPT-4o to score my translated product images using the Vectra framework. Can you write the evaluation prompt?"
Approach:
- Structure the prompt with dimension definitions and DAR rubrics
- Enforce the CONTENT -> ISSUE -> POSITION -> EFFECT -> SCORE reasoning chain
- Require structured XML output for parseability
Output:
You are a visual quality assessor for e-commerce in-image machine translation.
Given a translated product image, evaluate it across 14 dimensions. For each
dimension, follow this reasoning chain:
CONTENT: What text or scene element does this dimension cover?
ISSUE: Is there a visible defect? Describe it specifically.
POSITION: Where in the image is the defect located?
EFFECT: Estimate the Defect Area Ratio (DAR) -- what fraction of the
relevant content area is affected by the defect?
SCORE: Assign 3 (Excellent, DAR~0), 2 (Fair, 0<DAR<=0.3),
or 1 (Poor, DAR>0.3).
## Textual Visual Quality -- Style Dimensions
- text_size: Is the translated text size consistent with the original layout?
- text_color: Does the text color harmonize with the background?
- text_position: Is translated text properly aligned within design regions?
- font_style: Is the font appropriate for the brand/product context?
- text_layout: Are line breaks, spacing, and text blocks well arranged?
- text_pixel_clarity: Is the rendered text sharp and free of artifacts?
## Textual Visual Quality -- Accuracy Dimensions
- text_hallucination: Does the translation contain fabricated content?
- text_omission: Is any original text content missing from the translation?
## Scene Visual Quality -- Style Dimensions
- scene_size: Are scene elements proportionally consistent after editing?
- scene_color: Are inpainted/modified scene regions color-consistent?
- element_position: Are scene objects spatially coherent after text replacement?
- scene_pixel_clarity: Are edited scene regions visually clear?
## Scene Visual Quality -- Accuracy Dimensions
- scene_hallucination: Were new visual elements incorrectly introduced?
- scene_omission: Were original scene elements lost during editing?
Respond in this XML format for EACH dimension:
<dimension name="[dim_name]">
<content>[what this dimension covers in this image]</content>
<issue>[defect description or "none"]</issue>
<position>[spatial location or "N/A"]</position>
<dar>[estimated DAR as decimal, e.g. 0.15]</dar>
<score>[1, 2, or 3]</score>
</dimension>
After all 14 dimensions, provide:
<summary>
<vectra_score>[computed as 100 * phi(mean_accuracy) * phi(mean_style)]</vectra_score>
<diagnosis>[1-2 sentence summary of primary quality issues]</diagnosis>
</summary>
Example 3: Building a benchmark evaluation pipeline
User: "I have 500 translated product images from two different IIMT systems. Help me compare them using Vectra."
Approach:
- Score all images from both systems using the evaluation prompt
- Parse structured outputs into per-dimension and aggregate scores
- Compute system-level ranking metrics
Output:
import json
import numpy as np
from scipy.stats import kendalltau, pearsonr
def evaluate_system_pair(scores_a: list[dict], scores_b: list[dict],
human_rankings: list[int]) -> dict:
"""Compare two IIMT systems using Vectra metrics.
Args:
scores_a: List of Vectra score dicts for system A (one per image)
scores_b: List of Vectra score dicts for system B (one per image)
human_rankings: Human preference per image (1=A better, 2=B better)
"""
vectra_a = [s["vectra_score"] for s in scores_a]
vectra_b = [s["vectra_score"] for s in scores_b]
auto_rankings = [1 if a >= b else 2 for a, b in zip(vectra_a, vectra_b)]
mean_a, mean_b = np.mean(vectra_a), np.mean(vectra_b)
agreement = sum(a == h for a, h in zip(auto_rankings, human_rankings))
accuracy = agreement / len(human_rankings)
all_auto = vectra_a + vectra_b
all_human = human_rankings
tau, tau_p = kendalltau(vectra_a, vectra_b)
dim_names = (scores_a[][].keys())
weak_dims_a = {}
dim dim_names:
dim_scores = [s[][dim] s scores_a]
weak_dims_a[dim] = (np.mean(dim_scores), )
{
: (mean_a, ),
: (mean_b, ),
: (accuracy, ),
: (tau, ),
: weak_dims_a,
}
Best Practices
-
Do use the multiplicative aggregation formula. Accuracy and style scores must be multiplied, not averaged. This ensures that a hallucinated product name (accuracy=1) cannot be offset by good font choice (style=3). The non-compensatory property is central to the framework's validity.
-
Do anchor every score to the DAR threshold of 0.3. When training annotators or prompting MLLMs, always specify this threshold explicitly. Unanchored "rate 1-3" instructions produce unreliable scores (Krippendorff's alpha drops from 0.86 to 0.44 without DAR grounding).
-
Do require the CONTENT -> ISSUE -> POSITION -> EFFECT -> SCORE reasoning chain. Skipping intermediate reasoning degrades scoring accuracy. The chain forces the evaluator to identify the specific defect before scoring.
-
Do separate accuracy from style dimensions in analysis. Report both sub-scores alongside the aggregate. A Vectra Score of 40 could mean "decent accuracy, poor style" or "catastrophic hallucination, great style" -- the sub-scores disambiguate.
-
Avoid using weighted averaging or learned weights across dimensions. The paper found that simple mean-then-multiply outperforms more complex weighting schemes. Added complexity here reduces interpretability without improving correlation with human judgments.
-
Avoid treating DAR as a precise pixel-level computation when using MLLM-based evaluation. Human annotators and MLLMs estimate DAR visually as a rough proportion. Demanding pixel-exact DAR values adds annotation cost without improving inter-rater agreement.
Error Handling
- Dimension score out of range: If any dimension score is not in {1, 2, 3}, clamp it and log a warning. The aggregation formula only works correctly on the [1,3] range.
- Missing dimensions in MLLM output: If the MLLM omits a dimension, retry with an explicit reminder listing the missing dimensions. Do not impute scores -- missing dimensions usually indicate the model was confused by the image.
- All scores are 3 (ceiling effect): If an MLLM rates every dimension as 3 for most images, the prompt likely lacks sufficient rubric detail. Add concrete examples of Fair (score=2) cases to the prompt.
- Low inter-rater agreement: If Krippendorff's alpha falls below 0.67, review whether annotators are applying DAR consistently. The most common failure is inconsistent estimation of "what counts as the content area" for the denominator.
- XML/JSON parse failures: Wrap output parsing in try/catch and fall back to regex extraction of score values. MLLM outputs occasionally include extra text outside the requested structure.
Limitations
- Domain specificity: The 14 dimensions and DAR threshold (0.3) were calibrated for e-commerce product images. Applying Vectra to other domains (medical imaging, document translation, game UI localization) requires recalibrating the threshold and potentially redefining dimensions.
- Reference-free trade-off: Vectra intentionally operates without a reference image, which makes it deployable at scale but means it cannot detect subtle semantic translation errors that require source-target comparison.
- 3-point scale granularity: The coarse 1-3 scale is robust for annotation but may not differentiate fine quality differences between strong systems. For close-performing systems, the 2K benchmark size may be insufficient for statistical significance.
- MLLM evaluator dependency: Prompt-based evaluation quality depends heavily on the MLLM's visual understanding. Smaller or weaker vision-language models may not reliably estimate DAR or detect subtle defects like font style mismatches.
- Dataset and model not yet public: As of the paper's publication, the Vectra dataset and fine-tuned model are pending release upon acceptance. The framework described here is based on the methodology and can be implemented using the prompt templates and scoring formulas.
Reference
Paper: Vectra: A New Metric, Dataset, and Model for Visual Quality Assessment in E-Commerce In-Image Machine Translation (Wu et al., 2026). Look for: Table 2 (full dimension taxonomy), Table 6 (annotation guidelines), Table 7 (MLLM prompt template), and Section 4.2 (DAR calibration experiments showing the 0.3 threshold derivation).