How to Evaluate Visual Grounding and Counting Capabilities in Multimodal Models
Evaluating the visual capabilities of multimodal models requires more than a few trial queries. This article explores how to systematically assess a model's visual grounding and counting abilities by distinguishing between perception and referencing gaps. It covers two main technical approaches, evaluation task design for counting and localization, environment control for reproducibility, and common pitfalls to avoid.
1. Background
When evaluating multimodal models, many people draw conclusions based on just one or two Q&A exchanges. This approach is prone to error, as results are heavily influenced by prompts, image resolution, inference modes, and runtime environments. A common reason a model performs differently in a research paper versus a live product is differences in inference configuration, model versions, or cherry-picked demos.
To judge a model’s visual capabilities, we must first answer two questions: Can the model see the image content clearly? Can it accurately map what it sees to specific objects? These two questions correspond to different technical bottlenecks and must be evaluated separately.
2. Two Main Technical Approaches
2.1 Natural Language Intermediate Reasoning
This approach prompts the model to first describe the image in natural language and then reason based on that description. The industry often refers to this as “Thinking with images.” Its advantage is simple implementation, allowing it to reuse the reasoning capabilities of general-purpose language models.
However, the drawbacks are clear. Describing objects in natural language often relies on relative positions, such as “the second person on the left” or “the bird near the window.” When an image contains many similar objects, these descriptions become ambiguous, causing the reasoning chain to break at some step.
2.2 Structured Visual Referencing
This approach requires the model to output structured visual units during the reasoning process, such as point coordinates, bounding boxes, or polygon vertices. Each unit directly binds to a region in the image without relying on language descriptions. The industry often calls these output units “visual primitives.”
Its main advantage is unambiguous referencing. The model can output each object’s location individually, making counting easy to verify since every object has corresponding coordinates. The cost is that the model must be trained to master the output format, and coordinate precision is affected by input resolution, coordinate normalization methods, and training data.
| Dimension | Natural Language Intermediate Reasoning | Structured Visual Referencing |
|---|---|---|
| Referencing Method | Language description | Coordinates or regions |
| Ambiguity Risk | High, similar objects easily confused | Low, unique positions |
| Verifiability | Weak, requires manual interpretation | Strong, can be validated by rules |
| Implementation Cost | Low | Higher, depends on training and format conventions |
| Typical Applications | General Q&A, image description | Counting, localization, path planning |
3. Perception Gap vs. Referencing Gap
During evaluation, it is crucial to distinguish between two types of errors.
Perception Gap means the visual encoder fails to see details. For example, small text is unreadable, or distant object textures blend into the background. These errors usually improve with local zooming or higher resolution.
Referencing Gap means the model sees the content but cannot accurately bind the reasoning process to the objects. For example, the model can correctly describe everyone’s clothing but misses a few people during counting or counts the same person twice. These errors are largely unrelated to resolution and depend more on the model’s referencing mechanism.
The diagnosis method is straightforward: Ask the model to describe a specific region locally. If the description is correct but the global count is wrong, the issue likely lies in referencing. If the local description is already wrong, the issue is mostly perception.
4. Evaluation Task Design
4.1 Counting Task
Counting is an effective task for distinguishing referencing capabilities because error modes are clear: under-detection, over-detection, and duplicate counting.
Implementation points are as follows:
- Construct images with known quantities, manually label ground truths, and control object density gradients (e.g., 5, 15, and 30 objects per image).
- Require the model to output an itemized list, each item with location information for easy verification, rather than just a total number.
- Metrics include exact match rate, mean absolute error (MAE), under-detection rate, and over-detection rate.
Example code:
def evaluate_counting(samples, ask_model, parse_count):results = []for item in samples:reply = ask_model(item["image"], item["prompt"])pred = parse_count(reply) # Returns None if parsing failsgt = item["count"]results.append({"id": item["id"],"gt": gt,"pred": pred,"exact": pred == gt,"abs_err": abs(pred - gt) if pred is not None else None,})return summarize(results)def summarize(results):valid = [r for r in results if r["pred"] is not None]exact_rate = sum(r["exact"] for r in valid) / len(results)mae = sum(r["abs_err"] for r in valid) / len(valid) if valid else float("nan")return {"exact_rate": exact_rate, "mae": mae, "parse_fail": len(results) - len(valid)}
Parsing failures should be tracked separately. They reflect the stability of the output format, which is a different issue from visual capability.
4.2 Localization Task
Localization tasks require the model to output bounding boxes for targets. Evaluation typically uses Intersection over Union (IoU) to measure the overlap between predicted and ground truth boxes.
def iou(a, b):"""a and b are both (x1, y1, x2, y2), coordinate systems must be consistent."""x1, y1 = max(a[0], b[0]), max(a[1], b[1])x2, y2 = min(a[2], b[2]), min(a[3], b[3])inter = max(0.0, x2 - x1) * max(0.0, y2 - y1)area_a = (a[2] - a[0]) * (a[3] - a[1])area_b = (b[2] - b[0]) * (b[3] - b[1])union = area_a + area_b - interreturn inter / union if union > 0 else 0.0
Pay special attention to coordinate conventions during localization evaluation. Model outputs might be in pixel coordinates, normalized to a fixed range, or relative to a scaled image. If the evaluator and the model interpret the coordinate system differently, IoU will be systematically low, leading to misleading conclusions. The correct approach is to specify the coordinate format explicitly in the prompt and perform explicit conversions in the evaluation code.
4.3 Path Planning Task
Maze navigation tasks are suitable for testing whether a model can convert visual information into executable action sequences. Evaluation should avoid human visual judgment of whether a route “looks right.” Instead, execute the model’s output action sequence in a simulator, using successful arrival at the endpoint as the pass criteria.
MOVES = {"U": (0, -1), "D": (0, 1), "L": (-1, 0), "R": (1, 0)}def run_path(grid, start, goal, actions):"""grid: 1 means wall, 0 means passable. Returns whether the goal is reached."""x, y = startfor a in actions:if a not in MOVES:return Falsedx, dy = MOVES[a]nx, ny = x + dx, y + dyif not (0 <= ny < len(grid) and 0 <= nx < len(grid[0])):return Falseif grid[ny][nx] == 1:return Falsex, y = nx, nyreturn (x, y) == goal
5. Controlling the Runtime Environment
Many evaluation results are irreproducible because the runtime environment is undocumented. Even with the exact same model, different system prompts, tool calling strategies, inference modes, or framework versions will yield different outputs.
It is recommended to record at least the following information:
- Model name, version number, and invocation time;
- Inference mode (e.g., whether extra reasoning steps are enabled);
- Complete system and user prompt templates;
- Whether tool calling is enabled, and the conditions for triggering it;
- Image preprocessing methods, including scaling dimensions, cropping strategies, and compression quality;
- Sampling parameters, such as temperature and random seed.
Runtime configurations should be written into version-controlled files rather than relying on manual operations. Manual config changes without records make results irreproducible months later.
When comparing different frameworks or inference modes, keep other variables constant. A common practice is to fix the framework version, export complete call logs, run each sample 3 to 5 times, and report the median and variance.
6. Common Pitfalls
- Treating demo examples as proof of capability. Demos are usually cherry-picked and only prove the model can perform in specific cases, not that it is generally reliable.
- Looking only at single-run results. Generative models have inherent randomness; a single success or failure has limited reference value.
- Using natural language to judge natural language. Letting an LLM judge its own answers easily introduces bias. Tasks that can be rule-validated should prioritize rule-based validation.
- Ignoring resolution and preprocessing. Scaling or cropping alters object visibility, which can significantly change counting results.
- Assuming a path is correct because it “looks reasonable.” Path planning tasks must be judged by simulator execution results.
7. Practical Recommendations
- Differentiate between perception errors and referencing errors before deciding optimization directions. Perception errors are mostly solved by increasing resolution or improving the encoder, while referencing errors are addressed by improving output formats or reasoning mechanisms.
- Build small-scale gold standard sets for each task type. A few hundred items are enough to start, and the set can be expanded later.
- Prioritize rule-based validation, such as exact match for counting, IoU thresholds, and simulator execution. Only introduce manual interpretation for tasks that cannot be rule-validated.
- Evaluation reports should include success rates, error type distributions, and runtime configurations. Results lacking runtime configurations should only serve as references, not direct comparisons.
In summary, evaluating the visual capabilities of multimodal models hinges on separating “seeing clearly” from “accurate referencing,” and managing the runtime environment as an experimental variable. Only then can conclusions be reproducible and effectively guide subsequent model selection and system design.
