HEAP: Unsupervised Object Discovery and Localization with Contrastive Grouping

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

Abstract

Unsupervised object discovery aims to identify and localize objects without human-provided labels. While recent methods utilize self-supervised features, they often struggle with "local myopia" and semantic confusion between multiple objects. We present HEAP (Hierarchical mErging framework via contrAstive grouPing), which introduces a hierarchical approach—patch-to-region-to-image—to decompose scenes into semantically coherent regions. By leveraging adaptive grouping, foreground-background disentanglement, and cross-image clustering, HEAP achieves state-of-the-art performance on standard benchmarks, effectively distinguishing multiple distinct objects in complex scenes.

Introduction

The "holy grail" of computer vision is teaching machines to identify objects and their locations from raw images without explicit supervision. Current self-supervised methods, such as those based on DINO features, typically focus on patch-level similarities within a single image. This prevents them from capturing broader dataset-wide relationships. Furthermore, many existing frameworks treat object discovery as a binary foreground-background task, leading to semantic confusion when multiple distinct objects (e.g., a bird and a dog) appear in the same frame.

Comparison of HEAP's hierarchical approach against previous patch-level methods.

Methodology

HEAP addresses these limitations by explicitly modeling the transition from patches to regions to images. The framework consists of a lightweight head added to a frozen, pre-trained Vision Transformer (ViT) backbone.

The HEAP architecture and its three core training objectives: Intra-Image Grouping, FG-BG Contrasting, and Inter-Image Clustering.

1. Adaptive Intra-Image Grouping

Using learnable "group tokens" and a cross-attention mechanism, HEAP clusters image patches into regions. This process is guided by a self-distillation loss based on community detection principles (modularity), ensuring that spatially and semantically similar patches are grouped together.

2. Foreground-Background Disentanglement

A linear aggregator identifies which regions likely constitute the foreground. To enhance separation, a negative contrastive loss pushes foreground and background representations apart in the embedding space, preventing the model from merging objects with their surroundings.

3. Cross-Image Inter-Image Clustering

To ensure consistency across the entire dataset, HEAP employs a ranking-based clustering loss. This "pulls" similar foreground regions (e.g., different instances of cars) together across different images. This global context allows the model to learn that common backgrounds (like sky or grass) are distinct from unique object categories.

Experimental Results

HEAP was evaluated on several standard benchmarks, including PASCAL VOC07/12 and COCO20k, for tasks such as semantic segmentation retrieval, unsupervised object discovery, and saliency detection.

Quantitative Performance

HEAP achieved state-of-the-art (SOTA) results across nearly all benchmarks:

  • Object Discovery (CorLoc): On VOC12, HEAP reached 77.1%, surpassing the previous SOTA (FOUND) at 76.1%.
  • Multi-Object Retrieval: In complex scenes, HEAP achieved 46.0 mIoU on VOC12, a 3.3% improvement over FOUND.

Qualitative Insights

Visualizations demonstrate that HEAP successfully segments multiple different objects into distinct, semantically meaningful parts, whereas older methods often miss small objects or merge multiple objects into a single blob.

Discussion and Limitations

While HEAP provides a significant advancement, it currently produces somewhat "blocky" initial masks due to its operation on ViT patches. Post-processing techniques like Dense CRF (Conditional Random Fields) are used to refine boundaries. Additionally, the performance is tied to the quality of the underlying self-supervised backbone. Future work could involve integrating hierarchical grouping directly into the backbone training process.

Conclusion

HEAP demonstrates that global context and hierarchical modeling are essential for robust unsupervised object discovery. By moving beyond simple patch-level affinities, HEAP provides a more holistic understanding of image content, setting a new standard for label-free localization.

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