Multimodal Models and Visual Grounding: From Visual Primitives to Reliable Object Reference

    Multimodal models can recognize objects in images, but accurately locating and counting specific instances remains challenging. This article explains why visual grounding often fails, introduces structured visual primitives like boxes and points as a solution, and provides practical guidance for evaluating new model versions and integrating grounding capabilities into engineering workflows.

    The Problem: Seeing an Image Is Not the Same as Understanding It

    Multimodal models typically encode images into features and then reason over them jointly with text. Image feature extraction has become fairly mature, and in many tasks models can identify subjects, colors, and scenes. However, in tasks that require instance-level localization and precise counting, model performance tends to be unstable.

    Part of the problem lies in perception. Small objects, low-resolution regions, and densely packed arrangements cause detail loss. Another part lies in reasoning. During inference, models mostly describe objects in natural language, such as “the third red cup from the left” or “the person near the door.” Natural language descriptions depend on context and word order—the same phrase can refer to multiple objects, and the reference can drift over multi-step reasoning.

    As a result, even when a model can recognize every object, it may lose the correspondence between objects and their descriptions, leading to duplicate counts, missed items, or misaligned bounding boxes.

    Why Visual Grounding Fails

    Visual grounding involves three elements: which object is being referenced, where that object is located in the image, and how the reference remains stable throughout reasoning. An error in any of these three elements affects the final result.

    1. Ambiguity: Language descriptions rely on relative relationships. When objects are densely packed, descriptions can conflict with one another.
    2. Information loss: Compressing spatial position into text loses coordinate precision.
    3. Error accumulation: In multi-step reasoning, a grounding error in an earlier step propagates into later conclusions.

    Consider counting products on a shelf. If the model describes items row by row in text, such as “the fourth bottle in the second row,” a missed item in any row changes the total count. If each object carries an explicit spatial pointer instead, the system can check each one for duplicates.

    Visual Primitives: Grounding References in Continuous Space

    Visual primitives are structured spatial elements that a model can output during reasoning. Common forms include points, bounding boxes, and polygon regions. Their core purpose is to convert “which object is being referred to” from natural language into coordinates that can be programmatically verified.

    Here is an illustrative structure. The field names are for explanation only and do not represent a fixed interface:

    1. {
    2. "primitive": "box",
    3. "label": "bottle",
    4. "coords": [0.412, 0.238, 0.447, 0.361],
    5. "coord_space": "normalized_xyxy"
    6. }

    This structure offers three advantages:

    • Unique reference: Each object corresponds to one set of coordinates, reducing ambiguity caused by synonymous descriptions.
    • Verifiability: External programs can check whether boxes go out of bounds, overlap, or mismatch in quantity.
    • Traceability: Multi-step reasoning can repeatedly reference the same coordinates, preventing objects from being confused during inference.

    The coordinate convention must be established before use. Conversions between normalized coordinates and pixel coordinates, as well as image resizing and cropping, will change the values.

    How to Evaluate Newly Released Multimodal Models

    Release notes typically list capability directions but rarely reveal actual performance. Teams should build their own evaluation sets rather than relying solely on marketing materials.

    The evaluation set should cover the following task types:

    • Dense counting: scenes with more than twenty objects of the same category.
    • Small-object localization: targets that occupy a very small portion of the image.
    • Multi-instance grounding: tasks requiring the model to distinguish multiple visually similar objects.
    • Spatial relationships: judgments involving left/right, above/below, occlusion, etc.
    • Mixed text and images: scenes where text and visual objects appear together.

    The following metrics are recommended. For counting tasks, use exact match rate and mean absolute error. For localization tasks, use Intersection over Union (IoU) with a defined hit threshold. Results should be grouped by object density to observe how performance changes with complexity.

    When evaluating, control the variables. Keep prompt templates fixed, run the same samples multiple times to observe stability, and record latency and API cost.

    Example evaluation logic:

    1. def iou(a, b):
    2. x1, y1 = max(a[0], b[0]), max(a[1], b[1])
    3. x2, y2 = min(a[2], b[2]), min(a[3], b[3])
    4. inter = max(0, x2 - x1) * max(0, y2 - y1)
    5. area_a = (a[2] - a[0]) * (a[3] - a[1])
    6. area_b = (b[2] - b[0]) * (b[3] - b[1])
    7. union = area_a + area_b - inter
    8. return inter / union if union > 0 else 0.0
    9. def is_hit(pred, gold, threshold=0.5):
    10. return iou(pred, gold) >= threshold

    General Engineering Integration Practices

    Different tools and frameworks have different configuration methods, but some general principles apply to most scenarios.

    1. Verify the version first. Follow the official documentation to upgrade, then check the currently installed version number.
    2. Rely on official documentation. Configuration options may come from command-line arguments, configuration files, or environment variables—do not guess based on experience.
    3. Isolate scenarios with separate configuration profiles. For example, save separate parameter files for interactive use and batch processing to avoid overwriting each other.
    4. Store API keys in environment variables or a key management service, not in code or version control.
    5. Run a fixed regression sample set after each model version switch and compare results with the previous version.

    If the output does not match the documentation examples, first check the version number, parameter names, and working directory. After ruling out configuration issues, determine whether the problem is a model capability issue.

    Deployment Risks and Recommendations

    • Do not directly trust model-reported coordinates. Validate them with rules or a secondary detection pass.
    • Keep human review or fallback paths for high-risk scenarios.
    • When images contain personal information, follow the data minimization principle and confirm that transmission and storage meet compliance requirements.
    • Visual primitives improve reasoning interpretability but do not replace the need for high-resolution input and sufficient training coverage.

    Improving visual reasoning requires attention to three areas simultaneously: perception, grounding, and verification. For developers, the most valuable practice is to build a reproducible evaluation set and use it to test every model version update.