PerSense: Personalized Instance Segmentation in Dense Images

Muhammad Ibraheem Siddiqui, Muhammad Umer Sheikh, Hassan Abid, Muhammad Haris Khan · DOI

Abstract

Segmenting specific object categories in crowded, real-world scenes remains a significant challenge for existing foundation models. While the Segment Anything Model (SAM) offers powerful zero-shot capabilities, it lacks semantic specificity in dense environments, often requiring manual intervention or failing to distinguish between tightly packed instances. We present PerSense, a training-free, one-shot framework that bridges this gap. By utilizing density maps as spatial priors and implementing a novel feedback mechanism for iterative refinement, PerSense achieves state-of-the-art performance on dense segmentation tasks without requiring any fine-tuning.

Introduction

Dense image segmentation—identifying and outlining every individual instance of a specific object in a crowded scene—is a "needle in a haystack" problem. Standard tools like SAM often struggle with a "semantic gap," where they either segment everything indiscriminately (including background) or require extensive manual prompting. Existing automated one-shot methods typically rely on bounding boxes, which become cluttered and overlap in dense scenes, leading to poor instance separation.

PerSense addresses these limitations by converting density maps into precise point prompts. This approach allows the model to handle extremely crowded environments, such as quality control in food processing or medical imaging, where object counts can reach into the hundreds.

Methodology

PerSense operates as a model-agnostic framework in three primary stages, utilizing pre-trained foundation models without additional training.

1. Instance Detection Module (IDM)

Instead of relying on bounding boxes, PerSense leverages a Density Map Generator (DMG) to create a spatial heatmap of object locations. The IDM identifies object centers from this map. To handle "composite contours"—where multiple overlapping objects appear as a single blob—the module applies a distance transform to identify internal sub-regions and separate individual instances.

2. Point Prompt Selection Module (PPSM)

Not all points identified by the IDM are accurate. The PPSM filters candidate points using an adaptive threshold that scales based on the estimated object density (specifically, the square root of the object count). It also incorporates "box gating" by cross-referencing points with a grounding detector (like GroundingDINO) to ensure prompts are both semantically correct and spatially grounded.

The PerSense architecture, illustrating the flow from query image and support set through the IDM, PPSM, and the iterative feedback loop.

3. The Feedback Mechanism

A core innovation of PerSense is its self-correcting loop. After an initial segmentation pass, the system identifies the highest-quality segmented instances based on SAM confidence scores. These "perfect" examples are fed back into the Density Map Generator as new exemplars, creating a refined density map for a second, more accurate segmentation pass. This allows the model to recover from poor initial estimates, a process typically requiring human-in-the-loop intervention.

Step-by-step visualization of the PerSense pipeline, showing the transition from similarity maps to initial segmentation and the subsequent refinement through the feedback mechanism.

Datasets and Results

To evaluate performance in truly crowded scenes, the authors introduced PerSense-D, a new benchmark containing 717 images across 28 categories, averaging 53 instances per image.

  • Performance: On PerSense-D, the framework achieved a 71.61% mIoU, outperforming the previous best one-shot method (Matcher) by 8.83% and significantly surpassing PerSAM by over 47%.
  • Efficiency: Despite the iterative feedback loop, PerSense remains efficient with an average inference time of 2.7 seconds on a single RTX 4090.
  • Versatility: The model demonstrated robust "in-the-wild" success, effectively segmenting diverse objects from medical bone marrow cells to retail inventory.

Conclusion

PerSense demonstrates that density maps, traditionally used only for counting, are powerful spatial priors for segmentation when processed correctly. By combining these maps with an adaptive point-prompting strategy and a training-free feedback loop, PerSense provides a robust, automated solution for personalized instance segmentation in complex, dense environments. Future work will focus on improving the initial density map generation to capture instances that fall below the initial detection threshold.

Summary updated

BibTeX
@misc{siddiqui2024persense,
  author = {Muhammad Ibraheem Siddiqui and Muhammad Umer Sheikh and Hassan Abid and Muhammad Haris Khan},
  title = {{PerSense: Personalized Instance Segmentation in Dense Images}},
  year = {2024},
  eprint = {2405.13518},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.13518},
}
Figure