Multimodal Image Understanding Evaluation: From OCR to Spatial Reasoning
Evaluating multimodal image understanding requires more than checking whether a model can describe what it sees. This article proposes a four-dimensional evaluation matrix covering text recognition, layout and reading-order recovery, robustness and hallucination control, and spatial reasoning and generation. It explains how to build tiered OCR tests, structured-output checks, degradation datasets, and closed-loop regression for generated front-end code. It also summarizes engineering recommendations and common pitfalls, with the goal of making image-understanding quality measurable, errors controllable, and pipelines repeatable.
1. Define the Problem First: What Is “Image-Understanding Mode” Actually Evaluating?
When a multimodal model receives an image, it does not simply “look and talk.” It converts pixels into representations that a language model can reason over, then jointly models those representations with a text instruction. Its capability should therefore not be judged only by whether it can identify what appears in an image; the problem should be broken down into measurable subtasks. In practice, I recommend fixing four dimensions to form a capability matrix:
| Dimension | Typical tasks | Key metrics |
|---|---|---|
| Text recognition (OCR) | Printed text, handwriting, vertical text, Traditional Chinese, calligraphy | Character error rate (CER), field-level accuracy |
| Structure recovery | Multi-column layouts, mixed text and images, reading order | Reading-order accuracy, block-level IoU |
| Robustness | Occlusion, glare, low resolution, small text | CER degradation, hallucination rate |
| Spatial and generation | Spatial relationship judgment, diagram/front-end code generation | Relationship-judgment accuracy, runnability rate |
The value of this matrix is that any single-point demonstration—such as one impressive screenshot—covers only one cell and cannot support a model-selection decision.
2. Dimension One: Difficulty Tiers for Text Recognition
Practical cases can be abstracted into three difficulty levels:
- Routine level: Clear printed text in horizontal Simplified Chinese. Most multimodal models can meet the requirement at this level, so it provides little discrimination.
- Difficult level: Vertical Traditional Chinese, calligraphic inscriptions, and artistic typography. The challenge is not only “recognizing characters” but also character order and glyph variants. Vertical text must be read from right to left; Traditional Chinese and variant characters, such as 襃/褒, may involve borrowed or variant forms; and connected calligraphic strokes blur character boundaries. During evaluation, score “single-character correctness” separately from “overall reading-order correctness”; otherwise, reading-order errors will be hidden.
- Extreme level: Tiny footer text, letters occluded by fingers or objects, glare, and wrinkles. Here the question is whether the model can use context to perform constrained reasoning completion—for example, inferring the first letter of an occluded word or a repeated digit in a door number—rather than freely inventing content.
It is important to emphasize that the stronger the completion capability, the higher the hallucination risk. In engineering practice, the model must be required to explicitly mark uncertain characters instead of giving an answer that merely looks complete.
An illustrative evaluation script (pseudo-code; API names depend on the actual platform):
def cer(pred: str, ref: str) -> float:# Edit distance / length of reference text; split Chinese by characterreturn edit_distance(pred, ref) / max(len(ref), 1)def run_case(client, image_path, ref_text, prompt="Recognize the text in the image"):resp = client.generate(image=image_path, prompt=prompt)return {"cer": cer(resp.text, ref_text), "raw": resp.text}# Tiered statistics: routine / difficult / extremereport = defaultdict(list)for case in load_cases():r = run_case(client, case.image, case.ref)report[case.level].append(r["cer"])print({k: sum(v)/len(v) for k, v in report.items()})
Key design point: compute averages by difficulty tier, rather than reporting only one overall accuracy rate. An overall average is diluted by many easy samples and hides capability gaps on the difficult tiers.
3. Dimension Two: Complex Layout and Reading-Order Recovery
Multi-column posters, mixed text and images, and layouts with formulas and annotations are among the most common inputs in real-world work involving invoices, contracts, course slides, and design mockups. For these samples, the output should not be a block of plain text; it should be a structure with position and hierarchy, for example:
[{"block": "title", "text": "2021", "bbox": [0.72, 0.05, 0.95, 0.12]},{"block": "formula", "text": "E = hν"},{"block": "aside", "text": "A gentle, pure expression / hidden in the embryo of art"}]
Three must-test points:
- Reading order: Human reading order is not always consistent with visual coordinate order—consider right-side vertical text, headers, footers, and figure captions.
- Block membership: Mistaking a short vertical side note for body text is a structural error, and it is more serious than getting one character wrong.
- Formulas and symbols: The difference between
E=hvandE=hνdirectly affects downstream computation, so formulas and symbols should be evaluated as a separate set.
4. Dimension Three: Robustness and Hallucination Control
Occlusion, blur, low light, and small text are normal in production. I recommend building a degraded dataset: apply occlusion, downsampling, noise, and compression to the same source image, then observe the CER degradation curve. A qualified system is characterized not by “still getting everything right after degradation,” but by the following:
- The degradation magnitude is predictable and explainable.
- The system marks invisible regions as uncertain—for example, with
[?]or a confidence score. - It does not fabricate nonexistent fields based on contextual guessing.
At the prompt level, constraints can be used to reduce hallucination:
Transcribe only the text visible in the image, preserving the original line order.Use [?] as a placeholder for unrecognizable characters; do not guess from semantics.Output JSON with blocks[], whose fields include text and bbox.
5. Dimension Four: Spatial Reasoning and Front-End/Graphical Generation
“Image understanding” is not limited to reading text. Two types of tasks deserve dedicated evaluation:
- Spatial relationship reasoning: Judge above/below and left/right relationships, occlusion relationships, and relative positions in drawings. Construct these tests with synthetic images whose ground truth is known, avoiding ambiguity in manual annotation.
- Graphics and front-end code generation: Convert interface screenshots or hand-drawn sketches into runnable code or vector graphics. Evaluation should focus not on whether the result “looks similar,” but on three items: runnability rate, structural similarity, and interaction completeness. A recommended pipeline is: screenshot input → code generation → automated build → headless rendering → pixel/structure comparison with the original image, forming a closed-loop regression.
6. Engineering Recommendations
- Preprocessing first: Cropping, denoising, orientation correction, and super-resolution often produce greater gains than switching models.
- Slicing and stitching: Slice long images at semantic boundaries and keep overlap between blocks so that fields spanning blocks are not truncated.
- Dual-channel validation: A general multimodal model performs extraction, while a dedicated OCR or structured service reviews critical fields; route inconsistencies to human review.
- Confidence and fallback: Low-confidence fields enter a human-review queue and are never silently passed.
- Observability: Connect CER, field accuracy, hallucination rate, latency, and per-call cost to logging and monitoring, and run regression by version.
- Data compliance: Identity documents and invoices contain personal information, so transmission and storage require redaction and encryption. When obtaining capabilities through a compliant cloud model service—for example, the model service category offered by Baidu AI Cloud, where available—combine it with general cloud products such as object storage and message queues.
7. Common Pitfalls
- Using demonstrations instead of evaluation: A single attractive screenshot does not constitute proof of capability.
- Ignoring character order and structure: Looking only at character accuracy misses the most serious errors.
- Confusing “reasoning completion” with “actually visible”: The stronger the completion capability, the more necessary uncertainty annotation becomes.
- Ignoring the boundaries of web access: Pure image-understanding tasks do not rely on web retrieval, but when time-sensitive information is involved, a retrieval chain must be explicitly introduced; otherwise, the answer is not trustworthy.
8. Conclusion
The right way to evaluate multimodal image understanding is to quantify it within a four-dimensional framework: tiered difficulty + structured output + robustness degradation + runnable generation. For developers, the real differentiator is not a single impressive recognition result, but whether metrics are measurable, errors are controllable, and the pipeline is regressable. Building the evaluation set and metric baseline first—before discussing model selection and cost optimization—is the sustainable engineering path.
