DEV Community

Cover image for How to Validate an AI-Generated Infographic Against a Source-of-Truth Schema
Voor AI
Voor AI

Posted on

How to Validate an AI-Generated Infographic Against a Source-of-Truth Schema

An AI-generated infographic should be treated as a rendering candidate, not as data. Validate it against a small source-of-truth schema before publication: required panels, exact labels, allowed claims, reading order, and delivery dimensions. The visual can pass aesthetic review and still fail the contract.

How to Validate an AI-Generated Infographic Against a Source-of-Truth Schema — real Voor example

Open the current Voor workspace

Define the contract

Store facts and visible copy outside the prompt. The current Voor route clearly says Qwen Image 3 is not yet available and runs Qwen Image 2512 instead. It exposes common aspect ratios, a Public · watermarked state, a visible Generate button, and showed a 7-credit quote during inspection.

Render from immutable inputs

Version the JSON fixture beside the prompt. The image model may compose the canvas, but your application must remain the authority for numbers, names, units, and citations.

Run structural and OCR checks

Use image dimensions and panel count as deterministic checks. OCR can flag missing or mutated labels, but it is evidence, not proof; route low-confidence text to human review. Never let a generated diagram become the source for the schema that validates it.

Test at delivery size

A 2720×1536 study may look convincing at fit-to-screen while tiny labels fail on a 1200-pixel blog render. Validate both native pixels and the exact compressed output your users will receive.

Copyable prompt or settings contract

Create a 16:9 editorial infographic titled “THE CITY THAT COOLS ITSELF”. Use exactly nine isolated panels. Render only the labels present in the supplied fixture. Reserve a source-note area but invent no statistics. Warm off-white paper, charcoal ink, restrained orange accent, generous margins, no logos.
Enter fullscreen mode Exit fullscreen mode

Minimal validation code

const contract = {
  title: "THE CITY THAT COOLS ITSELF",
  panels: 9,
  requiredLabels: ["SHADE", "GREEN ROOF", "WATER", "SOURCE"],
  forbiddenClaims: ["%", "guaranteed", "zero emissions"],
  delivery: { width: 1600, height: 900 }
};

function validateOcr(text, panelCount, size) {
  const missing = contract.requiredLabels.filter(x => !text.includes(x));
  const forbidden = contract.forbiddenClaims.filter(x => text.includes(x));
  return {
    pass: missing.length === 0 && forbidden.length === 0 &&
      panelCount === contract.panels &&
      size.width === contract.delivery.width && size.height === contract.delivery.height,
    missing, forbidden
  };
}
Enter fullscreen mode Exit fullscreen mode

Teaching comparison for How to Validate an AI-Generated Infographic Against a Source-of-Truth Schema

Review checklist

  • Dimensions match the downstream renderer
  • Panel count equals the contract
  • Every required label survives OCR and human review
  • No generated number is accepted without an external source
  • The compressed artifact still preserves reading order

Troubleshooting

OCR misses small labels

Crop each panel at native pixels and raise low-confidence regions for review.

The model invents a statistic

Forbid numeric copy in the prompt and compose verified data in HTML afterward.

Nine panels collapse together

Name the grid and gutters explicitly, then reject outputs with merged regions.

Limits and responsible use

The page's Qwen Image 3 name is an availability guide; the callable model today is Qwen Image 2512. OCR is probabilistic, diagrams may be factually wrong, and the generated bitmap should never replace accessible HTML or verified source data.

Try the workflow

Open the exact generator and check today’s settings before you generate

Top comments (0)