HEAP: Unsupervised Object Discovery and Localization with Contrastive Grouping

Xin Zhang, Jinheng Xie, Yuan Yuan, Michael Bi Mi, Robby T. Tan

TL;DR

HEAP (Hierarchical mErging framework via contrAstive grouPing) is a novel unsupervised framework that discovers and localizes objects by hierarchically grouping self-supervised features. By moving beyond simple patch-level analysis to include region and image-level relationships across datasets, HEAP achieves state-of-the-art performance and, uniquely, the ability to distinguish multiple distinct object classes within a single image without any human labels.

What Problem Does This Paper Address?

Unsupervised object discovery aims to identify and segment objects in images without the help of manual annotations. While recent methods have leveraged powerful self-supervised Vision Transformer (ViT) features (like DINO), they typically suffer from two major limitations:

  1. Local Focus: They often operate solely at the patch level within a single image, ignoring broader semantic relationships between regions or across different images in a dataset.
  2. Binary Simplification: Most existing methods treat the problem as a simple binary task—separating a single "foreground" blob from the "background." This fails in complex scenes containing multiple objects of different categories (e.g., a person riding a horse).

The authors of HEAP set out to build a system that understands images as a hierarchy of semantically coherent regions, allowing for more precise localization and multi-object discrimination.

Methods

HEAP introduces a lightweight, plug-and-play head that sits on top of a frozen, pre-trained self-supervised encoder (like DINO-ViT). The core innovation lies in its Hierarchical Contrastive Grouping strategy, illustrated in the architecture overview below:

Figure 2: HEAP Overview showing the architecture and the three core unsupervised losses.

The framework employs three distinct unsupervised losses to guide the learning:

  • Intra-Image Grouping: Using a cross-attention mechanism with learnable "group tokens," HEAP adaptively clusters image patches into semantically coherent regions. A self-distillation loss, inspired by community detection in graph theory, encourages patches with similar features to group together.
  • Foreground-Background (FG-BG) Contrasting: This loss pushes foreground and background representations apart in the embedding space. It operates across a batch of images, based on the intuition that foreground objects share more semantic similarities with other foregrounds than they do with background regions.
  • Inter-Image Clustering: To ensure consistency across the dataset, this ranking-based loss pulls similar region-level features (e.g., "car" regions in different images) closer together. This helps the model learn universal semantic concepts without explicit category labels.

Datasets

The authors evaluated HEAP across several standard benchmarks for different tasks:

  • Semantic Segmentation Retrieval: VOC12.
  • Unsupervised Object Discovery: VOC07, VOC12, and COCO20k.
  • Unsupervised Saliency Detection: ECSSD, DUTS-TE, and DUT-OMRON.

No new datasets were introduced, but the extensive testing across these varied benchmarks demonstrates the model's generalizability.

Key Insights and Ideas

  • Beyond Binary Masks: By using multiple group tokens, HEAP can partition an image into several regions rather than just two. This allows it to naturally separate different objects in the same scene, a feat most previous unsupervised methods struggle with.
  • Cross-Image Context is Key: The paper demonstrates that looking at relationships between images is crucial. By pulling similar regions together across a dataset, the model learns more robust representations of what constitutes an "object" versus "background."
  • Efficiency Matters: Unlike some recent heavy-duty unsupervised models (like DINOSAUR), HEAP uses a lightweight head on top of frozen features. This makes it significantly faster to train and less memory-intensive while achieving better results on many tasks.

Key Results

HEAP achieves state-of-the-art (SOTA) results across all three evaluated tasks:

  • Object Discovery: On VOC07, HEAP achieves a 73.2% CorLoc, outperforming the previous SOTA (FOUND) at 72.5%.
  • Segmentation Retrieval: On the VOC12 21-class retrieval task, HEAP reaches 46.0 mIoU, a significant jump over FOUND's 42.7 mIoU.
  • Qualitative Superiority: As shown in the visual comparisons, HEAP produces much cleaner, more accurate masks and successfully distinguishes between different object instances that other methods merge together.
Figure 3: Qualitative results of unsupervised object discovery and localization obtained by HEAP, FOUND (SimÃl’oni et al. 2023), and TokenCut (Wang et al. 2022b) on VOC12. Our method could distinguish objects of multiple classes in a single image while recent works not. Note that colors only represent different objects in an image, not corresponding to specific classes.

Limitations and Future Work

While HEAP shows impressive results, the authors note some areas for improvement:

  • Coarse Boundaries: Because the method relies on patch-level features, the initial masks can be coarse. The authors currently use post-processing (like Dense CRF) to refine these boundaries. Integrating boundary refinement directly into the learning process could be a promising future direction.
  • Hyperparameter Tuning: The performance is somewhat dependent on the number of group tokens ($M$) and the clustering weight ($\alpha$), though ablation studies show the model is relatively stable within a reasonable range.
  • Complex Scenes: While better than previous methods, extremely cluttered scenes with many overlapping objects still pose a significant challenge for unsupervised discovery.

Summary updated

BibTeX
@inproceedings{zhang2024heap,
  author = {Xin Zhang and Jinheng Xie and Yuan Yuan and Michael Bi Mi and Robby T. Tan},
  title = {{HEAP: Unsupervised Object Discovery and Localization with Contrastive Grouping}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i7.28562},
}
Figure