Evaluating and Optimizing Visual Grounding in Multimodal LLMs: A Practical Framework

    This article presents a practical framework for evaluating and improving the visual grounding capabilities of multimodal large language models. It explains why models that can describe an image often fail at precise localization, then walks through building a reproducible, stratified evaluation set, using same-viewpoint geometric priors to turn "cannot find it" into a computable problem, enforcing structured output protocols, and engineering the pipeline for cost control and observability. Readers will learn how a stable evaluation system, rather than chasing individual model releases, drives measurable progress in automated visual localization.

    1. Background: Why “Seeing” Is Not the Same as “Locating Precisely”

    In scenarios such as automated game testing, UI inspection, and defect screenshot review, teams increasingly rely on multimodal large models to “describe what they see” and even “point to where things are.” A common pain point stands out: a model can describe the contents of a scene, yet its fine-grained spatial localization becomes unstable. When a target is slightly farther away, occupies fewer pixels, is occluded, or blends into the background texture, the region the model returns shifts noticeably, or the model fails to find it at all. Meanwhile, human annotators have to circle each target one by one, which is extremely costly.

    It is worth clarifying that this is not a problem unique to any single model. It is a shared challenge across current multimodal models on visual grounding tasks. The root causes can be grouped into three layers:

    1. Input resolution and information bottleneck: A vision encoder typically splits an image into a fixed number of patches and compresses them into a limited-length sequence of visual tokens. After encoding, small targets lose a large amount of usable information.
    2. Training objective biased toward semantics rather than coordinates: Most models are optimized for image-text semantic alignment. Outputting coordinates is a “secondary capability” that lacks sufficiently dense localization supervision.
    3. Inconsistent evaluation methods: Different teams apply vastly different criteria for what counts as “found it,” causing a disconnect between perceived experience and quantitative conclusions.

    So instead of asking “is the version released in a given month any good,” it is better to build a stable capability evaluation framework, so that any new model can be measured with the same ruler when it is integrated.

    2. Building a Reproducible Visual Grounding Evaluation Set

    The reliability of evaluation depends first on the data. It is recommended to sample from real business screenshots and construct a stratified evaluation set:

    • Scale stratification: Divide targets by pixel occupancy into large (>10%), medium (1%–10%), and small (<1%) tiers, with small targets tracked separately.
    • Difficulty stratification: Clearly visible, lightly occluded, strong reflection / low contrast, and cross-shot camera position changes.
    • Task stratification: Existence judgment, region localization (output a bounding box or center point), same-viewpoint comparison (finding the same position across different frames), and difference detection.

    The annotation specification should state the criteria clearly, for example, counting a hit when the center point falls inside the ground-truth box, or requiring the Intersection over Union (IoU) to exceed a threshold. A schematic evaluation main loop is shown below:

    1. # Pseudocode: main flow of visual grounding evaluation
    2. def evaluate(model, samples, iou_threshold=0.5):
    3. buckets = {"large": [], "medium": [], "small": []}
    4. for s in samples:
    5. pred = model.locate(s.image, s.question) # returns normalized coordinates
    6. iou = compute_iou(pred, s.gt_box)
    7. hit = (iou >= iou_threshold) or center_in_box(pred, s.gt_box)
    8. buckets[s.scale].append(hit)
    9. return {k: sum(v) / len(v) for k, v in buckets.items() if v}

    The key point is reporting by tier rather than a single average. Overall accuracy often masks the collapse in small-target scenarios; only tiered data can pinpoint the direction for optimization.

    3. Same-Viewpoint Comparison: Turning “Cannot Find It” into a Computable Problem

    The core need mentioned in the original discussion is to “establish a comparison under the same viewpoint.” In engineering terms, this can be abstracted as a cross-frame spatial consistency problem: given the target position in a reference frame, the model must find the corresponding same entity or the same coordinate region in subsequent frames.

    A feasible engineering approach has three steps:

    1. Geometric prior injection: If the footage comes from a fixed camera or a known camera trajectory, first estimate the inter-frame transformation matrix via feature matching, then project the reference box onto the target frame to obtain a prior region.
    2. Joint prior-plus-model decision: Crop and enlarge the prior region, then feed it together with the full image, requiring the model to choose among candidates rather than search from scratch. Enlarged cropping significantly mitigates information decay for small targets.
    3. Consistency check: Compare the model output against the geometric projection result. If the deviation exceeds a threshold, trigger a fallback strategy (resample more frames, enlarge the candidate window, or hand off to a human).
    1. reference frame box --(feature matching / transformation matrix)--> prior box in target frame
    2. |
    3. crop + enlarge + full image -> model decision
    4. |
    5. consistency check -> pass / fallback

    The value of this pipeline is that it replaces the “global search” that models are poor at with “local confirmation.” In practice, it is usually far more stable than a pure prompt-based approach.

    4. Prompt and Output Protocol: Reducing Ineffective Round Trips

    Many localization failures actually stem from ambiguous output formats. It is recommended to constrain the model to produce structured results and explicitly require it to “return confidence and alternatives when uncertain”:

    1. {
    2. "found": true,
    3. "box": [x1, y1, x2, y2],
    4. "normalized": true,
    5. "confidence": 0.62,
    6. "alternatives": [[0.31, 0.44, 0.36, 0.51]]
    7. }

    Supporting techniques include: first having the model describe the target’s features and then give coordinates (chain-of-thought decomposition), requiring coarse localization via a nine-grid or row/column scheme before refinement, and sampling the same image multiple times to take the most consistent answer. These methods do not raise the model’s capability ceiling, but they can noticeably reduce the number of ineffective round trips where the model still fails despite repeated emphasis.

    5. Engineering Implementation: Cost Reduction and Observability

    In a real testing pipeline, it is recommended to package visual grounding as an independent service, with image preprocessing (denoising, contrast enhancement, super-resolution of the target region) on the front end, and result verification plus a human fallback queue on the back end. For observability, use a logging service to record each request’s input size, target scale, confidence, and hit result, and set threshold alerts via monitoring for “declining small-target hit rate.” Models and evaluation data are archived through object storage, and evaluation tasks are scheduled elastically on a container platform to avoid wasting fixed resources.

    If an enterprise wants to build this quickly, it can leverage the general capabilities of Baidu AI Cloud—such as container platform, object storage, logging service, and monitoring alerts—to complete the architecture above, focusing its energy on the evaluation set and the judgment criteria themselves.

    6. Conclusion

    The rational answer to “is the new model version any good” is not to wait for a release and then make a subjective judgment, but to first possess three things: a stratified evaluation set, same-viewpoint geometric priors, and a structured output protocol. Once the evaluation criteria are stable, any model iteration can be quickly quantified, the proportion of manual circling will keep declining, and the usability of automated testing will improve accordingly. Progress in visual grounding capability ultimately depends on the maturity of the evaluation system, not on expectations for a single version update.