Evaluating Multimodal Models on Complex Diagram Reconstruction: A Practical Framework
This article presents a reusable evaluation methodology for testing how well multimodal models reconstruct complex 2D diagrams into structured, renderable drawing code. It covers task definition, evaluation dimensions, tiered sample design, an intermediate output protocol, automated validation combined with human review, and cost control with version regression—helping engineering teams replace subjective impressions with repeatable, traceable benchmarks when trialing intermediate model versions.
Evaluating Multimodal Models on Complex Diagram Reconstruction: A Practical Framework
During rapid model iteration, teams often receive an “intermediate version” of a model for trial use. If such trials stay at the level of “look at a few examples and judge by subjective impressions,” they are easily misled by a handful of impressive samples and fail to answer the questions engineering teams actually care about: Where are the capability boundaries? Are failure modes reproducible? Is the model worth promoting to the next staged rollout? Are invocation costs controllable? This article uses a representative multimodal task—reconstructing complex 2D diagrams into structured drawing code—to present a reusable evaluation and engineering practice methodology.
1. Task Definition: From Image Understanding to Renderable Structured Descriptions
Complex diagram reconstruction is not a simple image captioning task. The input is a 2D image, and the model must understand 3D structure, occlusion relationships, layer relationships, the semantics of solid and dashed lines, text annotations, and geometric constraints, then output a structured description that a renderer or drawing system can execute. A reasonably complete output should include at least: canvas dimensions, an object list, object relationships, coordinates and paths, styles, layers, and drawing order.
The difficulty lies in four areas. First, depth cues in a 2D image are implicit—the model must infer occlusion and spatial hierarchy. Second, drawing code demands high coordinate consistency; constraints such as endpoint snapping, closed paths, and parallel/perpendicular relationships are easily ignored. Third, solid/dashed lines, fill regions, and drawing order carry semantics rather than being mere visual styling. Fourth, the output must be “executable, editable, and verifiable,” not a plausible-sounding natural language explanation.
Evaluations should therefore avoid comparing only text similarity, and should incorporate both “semantic correctness” and “program executability.”
2. Evaluation Dimensions: Don’t Just Look at Whether the Final Image Looks Right
We recommend splitting the evaluation into the following dimensions, each with interpretable failure categories:
- Semantic correctness: Are object types, counts, annotation texts, and connection relationships consistent with the input? This dimension concerns “what is drawn” and is the foundation for geometric reconstruction.
- Geometric consistency: Do coordinates, paths, endpoints, closed regions, and parallel/perpendicular relationships satisfy constraints? Rule-based validators can check for broken endpoints, out-of-bounds coordinates, duplicate paths, and illegal coordinates.
- Layering and occlusion: Are front-back ordering, parent-child layers, and occluded regions correct? In complex diagrams, occlusion errors often hurt readability more than line offsets do.
- Styles and line types: Do dashed/solid lines, fills, borders, and arrow directions match the intended semantics? Line types are not decoration—dashed lines often indicate hidden structures or auxiliary relationships.
- Executability and editability: Can the output be parsed by the target renderer? Are layers and objects individually editable, rather than fused into an unsplittable “mega path”?
- Robustness and cost: Stability under varying resolutions, noise, cropping, rotation, and annotation density, plus per-sample latency and invocation cost.
Every dimension should retain failed samples and failure reasons, forming a regression-ready asset rather than a one-off evaluation report.
3. Sample Design: Tiered Difficulty and Golden Standards
The sample set should be tiered by difficulty: basic geometry, composite structures, occlusion relationships, 3D projections, engineering diagrams, images with text annotations, and low-quality scans. Each sample should come with two types of golden standards: a structured scene description, and a rendered reference image. A reference image alone is insufficient, because image similarity cannot constrain layering and editability; a structured description alone is also insufficient, because you still need to validate the final rendered result.
Sample design should avoid “single-example heroism.” Strong performance on one complex case does not represent overall capability; watch for whether failures of the same type cluster. We recommend recording, for each sample, the prompt version, sample version, model invocation parameters, raw outputs, validation results, and human review conclusions, so the evaluation remains traceable.
4. Output Protocol: Use an Intermediate Representation to Reduce Generation Difficulty
Asking the model to output final drawing code directly often leads to coordinate drift and syntax errors. A more robust approach is to require the model to first output a scene graph, then drawing instructions. An example protocol:
input: imageoutput: scene_schema {canvas: {width, height},objects: [{id, type, bbox, depth, parent, style}],relations: [{from, to, relation}],draw_commands: [{op, coords, style, layer, order}]}
Validation pseudocode can be designed as follows:
def validate(schema, render_fn, golden):assert schema.canvas.width > 0for obj in schema.objects:assert obj.id uniqueassert obj.depth is validfor cmd in schema.draw_commands:assert cmd.coords in canvasassert cmd.layer is validrendered = render_fn(schema)semantic_score = check_objects(schema, golden)geometry_score = check_constraints(schema)visual_score = compare_render(rendered, golden.image)return semantic_score, geometry_score, visual_score
The value of this protocol: the scene graph explicitly expresses objects, relationships, and hierarchy, while drawing instructions handle renderability. During evaluation, you can check both semantics and geometric constraints, making it easy to localize whether failure occurred in the “understanding stage” or the “generation stage.”
5. Combining Automated Validation with Human Review
Automated validation suits deterministic constraints: format validity, out-of-bounds coordinates, path closure, endpoint snapping, whether layer references exist, and whether text annotations are missing. Rendered comparison helps catch large-scale structural errors but should not be the sole metric. Human review should focus on semantic judgment and occlusion relationships—especially cases where the model output looks plausible but is actually unrenderable, or renders as locally self-consistent but structurally wrong as a whole.
We recommend classifying failures into: parse failures, semantic omissions, geometric drift, occlusion errors, line-type errors, ordering errors, text errors, and non-editability. Each failure category should have an owner and a fix priority.
6. Cost Control and Version Regression
During intermediate-version trials, full regression runs are unnecessary. Use tiered sampling: run all basic samples, sample complex ones, and expand sampling preferentially around failure clusters. Set budget thresholds and alerts for invocation costs, cache intermediate results for identical inputs, and batch low-priority samples. When cost pressure is high, prioritize “failure mode coverage” over sample volume.
Version decisions should be based on baseline comparisons, metric dashboards, and failure classification—not single cases. The evaluation pipeline can be deployed on a general-purpose container platform with object storage, using logging services and monitoring alerts to track call volume, failure rates, and latency; for example, generic services such as object storage, logging, container platforms, and monitoring/alerting—such as those offered by Baidu AI Cloud—can host samples, logs, and evaluation tasks. Admission rules can be set as: no regression on key dimensions, failure clusters are explainable, costs stay within budget, and human review pass rates meet a team-agreed threshold.
7. Conclusion
Complex diagram reconstruction is an excellent scenario for testing a multimodal model’s spatial understanding and programmatic generation capabilities. When trialing intermediate versions, engineering teams should convert subjective impressions into repeatable evaluations: clarify task boundaries, design tiered samples, constrain the output protocol, combine automated validation with human review, control costs, and accumulate a regression set. Only then can a model move from “looks stronger” to “reliably usable in target scenarios.”
