Abstract
Accurate counting of surgical instruments in Operating Rooms (OR) is a critical prerequisite for ensuring patient safety during surgery. Despite recent progress of large visual-language models and agentic AI, accurately counting such instruments remains highly challenging, particularly in dense scenarios where instruments are tightly clustered. To address this problem, we introduce Chain-of-Look, a novel visual reasoning framework that mimics the sequential human counting process by enforcing a structured visual chain, rather than relying on classic object detection which is unordered. This visual chain guides the model to count along a coherent spatial trajectory, improving accuracy in complex scenes. To further enforce the physical plausibility of the visual chain, we introduce the neighboring loss function, which explicitly models the spatial constraints inherent to densely packed surgical instruments. We also present SurgCount-HD, a new dataset comprising 1,464 high-density surgical instrument images. Extensive experiments demonstrate that our method outperforms state-of-the-art approaches for counting (e.g., CountGD, REC) as well as Multimodality Large Language Models (e.g., Qwen, ChatGPT) in the challenging task of dense surgical instrument counting.
Introduction
In operating rooms, accurately counting surgical instruments before and after a procedure is a mandatory safety protocol to prevent items from being accidentally left inside a patient. Currently, this is a tedious, manual process that is prone to human error, especially under time pressure or in emergencies.
Automating this task using computer vision is highly challenging. Surgical instruments are often tightly clustered on a tray, visually identical, and heavily occluded. Existing object detection and density-based counting models treat objects as independent entities. They lack the spatial reasoning that humans naturally use—such as scanning sequentially from left to right—to keep track of what has already been counted. Consequently, standard models frequently under-count or double-count in these highly cluttered environments.
Methodology: Chain-of-Look Spatial Reasoning (CoLSR)
To solve this, we propose the Chain-of-Look Spatial Reasoning (CoLSR) framework. CoLSR shifts the paradigm from unordered object detection to sequential visual reasoning.
Core Innovations
- Visual Chain Generator: Instead of predicting isolated bounding boxes, the model is guided to predict locations along a coherent spatial trajectory. This sequential reasoning reduces hallucinations by using highly confident detections as anchors to help resolve uncertain, ambiguous adjacent objects.
- Neighboring Loss: This loss function penalizes implausible gaps or overlaps between adjacent predicted bounding boxes. By forcing the distance between neighboring predictions to match the ground truth, the model learns to string objects together in a realistic, physical sequence (a "visual chain"). Ablation studies show that with this loss, attention maps form a distinct, snake-like structure.
- Class-Specific Learnable (CSL) Prompts: To help the model distinguish the fine-grained boundaries of highly similar instruments (like the circular handles of scissors), we use prompt tuning. We inject learnable text tokens into the model's feature enhancer, explicitly conditioning the network to focus on target-specific visual cues.
- Divide-and-Conquer Inference: Because the visual chain relies on proximity, we utilize a post-processing clustering algorithm to handle scenarios where multiple dense piles of instruments are spatially separated on the table.
The SurgCount-HD Dataset
We introduce SurgCount-HD, a novel dataset specifically designed for this high-stakes task. It contains 1,464 high-density images of surgical instruments collected from real-world clinical settings. The images feature tightly packed instruments with bounding-box annotations specifically targeting the "circular instrument handle," which is the most reliably visible feature in dense clusters.
Experimental Results
CoLSR drastically outperforms existing models on the SurgCount-HD benchmark:
- State-of-the-Art Accuracy: CoLSR achieved a Mean Absolute Error (MAE) of 0.88, significantly better than the base CountGD model (7.84), DQ-DETR (4.24), and large vision-language models like Qwen2.5-VL (17.06).
- Efficiency: A mobile application running the CoLSR model achieved an end-to-end latency of just 0.32 seconds. In contrast, manual human counting on the same dense trays took an average of 44 seconds—making the AI over 100x faster.
- Ablation Studies: Removing the neighboring loss caused errors to spike by 105%, and removing the CSL prompt tokens degraded performance by 133%, validating the necessity of the proposed architecture.
Conclusion and Future Work
Chain-of-Look Spatial Reasoning provides a robust solution for the critical task of surgical instrument counting. By mimicking human sequential scanning through a structured visual chain and neighboring loss, the model achieves unprecedented accuracy in dense environments. While performance can degrade when large gaps disrupt the visual continuity, future work integrating multi-view inputs or depth information promises to further enhance robustness in chaotic real-world operating rooms.
Summary updated