NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Contrastive Learning with Expectation-Maximization for Weakly Supervised Phrase Grounding

Keqin Chen, Richong Zhang, Samuel Mensah, Yongyi Mao

Abstract

Weakly supervised phrase grounding (WSPG) aims to associate textual phrases with image regions using only image-caption pairs, avoiding the high cost of manual bounding-box annotations. This paper introduces a novel framework that integrates an Expectation-Maximization (EM) algorithm with contrastive learning. By shifting from coarse caption-image matching to fine-grained phrase-object alignment, the model iteratively refines latent alignments through pseudo-labels. Our approach achieves state-of-the-art performance on Flickr30K Entities and RefCOCO+ benchmarks, notably outperforming larger pre-trained vision-language models.

Introduction

Phrase grounding is a critical task in computer vision and natural language processing, requiring the localization of specific objects in an image based on a text query. While fully supervised models excel at this, they rely on massive datasets with expensive manual annotations. Weakly supervised phrase grounding (WSPG) attempts to learn these associations using only image-level captions.

However, WSPG faces a significant challenge: the "chicken and egg" dilemma where a model needs accurate alignments to train, but requires a trained model to find those alignments. Previous methods often relied on coarse-grained matching, which struggles to distinguish between multiple objects appearing in the same context. To address this, we propose a shift toward fine-grained phrase-object contrastive learning.

Comparison of caption-image level vs. phrase-object level contrastive learning.

Methodology

Our framework utilizes a two-stage paradigm. First, a pre-trained object detector identifies potential regions of interest, while a text encoder processes query phrases using GloVe embeddings. Second, we treat the alignment between phrases and objects as a latent variable, optimized through an Expectation-Maximization (EM) framework.

The EM Framework

  • E-step (Expectation): The model estimates "pseudo-labels"—the probability that a specific object region matches a given phrase—based on current model predictions. A moving average update is employed to maintain stability in these estimates.
  • M-step (Maximization): The model optimizes a contrastive loss. It treats all objects in the paired image as potential positives, weighted by their pseudo-labels, while pushing the phrase representation away from "negative" objects found in other images within the training batch.
The proposed EM-driven contrastive learning architecture, showing the iterative update of pseudo-labels and contrastive loss calculation.

A key innovation is the use of intrinsic similarity. By pushing away objects from different images, the model naturally disambiguates incorrect objects within the same image. We provide theoretical grounding showing that this contrastive loss serves as a proxy for maximizing the likelihood of the data given the latent alignments.

Experimental Results

We evaluated our model on two primary benchmarks: Flickr30K Entities and RefCOCO+.

  • Flickr30K Entities: The model achieved 63.05% top-1 accuracy, a nearly 1% improvement over previous state-of-the-art methods.
  • RefCOCO+: Our framework showed substantial gains, reaching 59.51% on TestA and 43.46% on TestB, representing improvements of 11.62% and 5.26% respectively over prior records.

Ablation studies confirmed that both the EM update mechanism and the contrastive loss are essential; removing either component resulted in a significant drop in localization accuracy.

Discussion and Conclusion

Our results demonstrate that fine-grained supervision via EM-driven contrastive learning is highly effective for WSPG. Despite using relatively simple text embeddings, the method outperforms complex pre-trained models like W-visualBERT.

However, limitations remain. The model's performance is inherently capped by the quality of the initial object detector. Furthermore, while it excels at simple grounding, it still struggles with complex linguistic reasoning and spatial logic (e.g., "the object next to the woman"). Future work will explore detector-free architectures and more sophisticated text encoders to capture deeper semantic nuances.

Summary updated

BibTeX
@inproceedings{chen2022contrastive,
  author = {Keqin Chen and Richong Zhang and Samuel Mensah and Yongyi Mao},
  title = {{Contrastive Learning with Expectation-Maximization for Weakly Supervised Phrase Grounding}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.586},
}
Figure