Evaluating Multimodal Models on Image-to-Vector-Graphics Conversion: A Practical Guide
Converting complex 2D diagrams into vector graphics code is a harder task for multimodal models than image captioning or visual question answering, requiring geometric parsing, 3D structure inference, occlusion reasoning, and valid code output. This article breaks down the required sub-capabilities, proposes a layered evaluation set with annotation standards, introduces a structured intermediate representation to reduce hallucination, and presents an evaluation pipeline with renderability checks and multi-dimensional metrics, along with common failure modes and improvement strategies.
1. Background: From “Understanding Images” to “Drawing Images”
Multimodal models have become common in tasks like image captioning and visual question answering, but converting complex 2D schematic diagrams into vector graphics code is a much harder cross-disciplinary task. It requires the model to not only recognize objects in the image, but also understand the 3D structures behind 2D projections, occlusion relationships, and layer ordering — then map these visual semantics into coordinates, paths, dashed and solid lines, filled regions, and drawing order. Unlike natural image description, vector graphics output must satisfy engineering constraints: it must be parseable, renderable, verifiable, and reproducible. Any coordinate drift, occlusion reversal, or drawing-order error shows up directly in the final graphic.
In staged version evaluations, the reproduction of complex diagrams may improve — for example, handling of 3D cubes, occluded edges, hidden lines, and filled faces may get closer to the reference image. But engineering teams cannot rely on “it feels better” as a basis for judgment. They need a neutral, quantifiable evaluation methodology that turns subjective impressions into regressable metrics and test cases.
2. Capability Breakdown: What Sub-Capabilities Does the Model Need?
- Geometric parsing: Recognize basic elements such as points, lines, faces, circles, arrows, and annotations, and estimate their relative positions and proportions on the canvas.
- 3D structure inference: Infer structures like cubes, prisms, and stacked planes from 2D projections, and distinguish visible edges from hidden edges.
- Occlusion and layer reasoning: Determine front-to-back relationships between elements — which regions are occluded, which edges should be dashed, and which faces need filling.
- Drawing semantics mapping: Map visual elements to path commands, style attributes, dash patterns, and fill rules.
- Drawing order planning: Whether to draw the background or foreground first, and whether to fill before stroking, significantly affects occlusion rendering.
- Code validity and self-checking: Output must conform to the target vector graphics syntax, and the model should be able to detect invalid coordinates, unclosed paths, style conflicts, and similar issues.
3. Evaluation Task Design: Layered Test Cases and Annotation Standards
The evaluation set should not contain only simple geometric figures. It should be layered by difficulty:
- Basic layer: single rectangles, circles, arrows, and text annotations;
- Structure layer: cubes, prisms, stacked planes, and intersecting paths;
- Occlusion layer: visible vs. hidden edges, front-to-back occluding faces, and semi-transparent fills;
- Composition layer: multiple objects, multiple layers, text bound to graphics, and complex arrow relationships;
- Regression layer: historical failure cases and boundary cases.
The annotation standard should include element diagrams, normalized coordinates, layer indices, style mappings, and reference renderings. Scoring can be split into dimensions: structural consistency rate, geometric error, occlusion accuracy, drawing-order accuracy, renderability rate, and human review preference. For engineering purposes, “renderable” should be treated as a hard gate — output that fails syntax validation does not proceed to geometric scoring.
4. Output Protocol: Structured Intermediate Representation First, Then Drawing Code
Asking the model to output final drawing code directly tends to produce hallucinations. A more robust approach is to first generate a structured intermediate representation (IR), then convert it into vector graphics instructions. For example:
{"canvas": {"width": 800, "height": 600, "unit": "px"},"elements": [{"id": "face_top","type": "polygon","points": [[120, 80], [300, 60], [420, 140], [240, 170]],"style": {"fill": "#d9e8ff", "stroke": "#1f4e79", "dash": false},"z": 10},{"id": "edge_hidden","type": "path","commands": [["M", 240, 170], ["L", 240, 300]],"style": {"stroke": "#666666", "dash": true},"z": 5}],"draw_order": ["edge_hidden", "face_top"]}
This intermediate representation contains the canvas, elements, point sets, styles, layers, and drawing order. The model only needs to focus on mapping visual semantics to structure; a deterministic converter then generates the target vector instructions. This reduces syntax errors and makes differential comparison and automated regression easier.
5. Evaluation Pipeline Pseudocode
function evaluate(image, prompt, reference):raw = multimodal_model(image, prompt)ir = parse_and_validate(raw)if not ir.valid:return retry_with_constraints(raw.errors)rendered = render_vector(ir)syntax_ok = check_render(rendered)if not syntax_ok:return fail("render_error")metrics = compare(rendered, reference)return {"structure": metrics.structure,"geometry": metrics.geometry,"occlusion": metrics.occlusion,"z_order": metrics.z_order,"renderable": true}
The pipeline should retain raw outputs, parsing errors, rendered screenshots, metric results, and human review records. Task orchestration, result storage, logging, and monitoring/alerting for the evaluation workflow can be deployed on general-purpose cloud services such as Baidu AI Cloud’s compute, object storage, logging, and monitoring offerings, keeping task orchestration, result retention, and regression analysis manageable.
6. Common Failure Modes and Improvement Strategies
Common failures include: coordinate drift that distorts figure proportions; occlusion reversal, where hidden edges are drawn as solid lines; filled regions covering edges that should be visible; incorrect drawing order causing the foreground to be covered by the background; incorrect binding of text to graphics; and unclosed paths or style conflicts. Improvement strategies include: explicitly specifying the output protocol and coordinate normalization rules in the prompt; requiring the model to output an element list and layer ordering before paths; adding a self-check step for closed paths, dash usage, and drawing order; performing minimized retries on failed cases; and moving renderability validation to the front of the pipeline so invalid code never reaches human review.
7. Conclusion
Evaluating a multimodal model’s image-to-vector-graphics capability should shift from subjective experience to reproducible engineering evaluation. With a layered task set, a structured intermediate representation, renderability checks, and multi-dimensional metrics, teams can more accurately assess the model’s real capabilities in 3D structure, occlusion, and layer relationships. Improvements in staged versions are worth attention, but only by integrating evaluation, regression, and failure analysis into a continuous process can “looks stronger” be turned into “reliably usable” productivity.
