Probabilistic Embeddings for Cross-Modal Retrieval

Sanghyuk Chun, Seong Joon Oh, Rafael Sampaio de Rezende, Yannis Kalantidis, Diane Larlus

Standard cross-modal retrieval maps images and text to single points in a shared space, but this fails to capture the inherent ambiguity of real-world data. This paper introduces Probabilistic Cross-Modal Embedding (PCME), which represents samples as probability distributions, allowing the model to "hedge its bets" and naturally represent one-to-many relationships while providing useful uncertainty estimates.

The Challenge of Ambiguity in Retrieval

In cross-modal retrieval (e.g., finding an image based on a caption), we usually try to learn a "common embedding space." Traditional methods are deterministic: they map an image or a sentence to a single vector (a point) in that space.

The authors argue this is fundamentally flawed. A single image of a busy train station could be described by dozens of different, equally valid captions. Conversely, a generic caption like "a bird flying" could match thousands of different images. This is a one-to-many or many-to-many mapping problem. Deterministic points can't easily represent this "spread" of meaning. Furthermore, popular benchmarks like MS-COCO suffer from "non-exhaustive" labels—many valid image-caption pairs are marked as negatives simply because the human annotators didn't happen to pair them, leading to noisy training signals.

Conceptual overview of probabilistic cross-modal retrieval mapping queries to distributions in a common embedding space.

Methodology: Learning Distributions

The core innovation is PCME, which maps each input into a Gaussian distribution $\mathcal{N}(\mu, \sigma^2I)$ rather than a single point.

  • The Encoders: The model uses standard backbones (ResNet for images, GloVe + Bi-GRU for text) but adds specialized "head modules." These heads predict both a mean vector ($\mu$), representing the core semantic concept, and a variance vector ($\sigma$), representing the uncertainty or ambiguity.
  • Local Attention: They incorporate a local attention branch to help the model aggregate spatial (image) or temporal (text) features more effectively before producing the distribution parameters.
  • Soft Contrastive Loss: To train these distributions, they use a probabilistic version of the contrastive loss. Instead of measuring the distance between two points, they estimate the match probability between two distributions using Monte Carlo sampling.
  • Regularization: To prevent the model from letting the variance collapse to zero (becoming deterministic), they use a KL-divergence loss to keep the distributions somewhat close to a standard normal distribution.
The variance computation module utilizes a local attention branch to predict the uncertainty parameter $\sigma$.

Key Insights and Results

The authors evaluate PCME on MS-COCO and CUB-2011. On the CUB dataset, PCME significantly outperforms deterministic baselines, achieving a 26.3% R-Precision for image-to-text retrieval, compared to 22.4% for the deterministic VSE0 model.

Uncertainty as Information

The predicted variance $\sigma$ isn't just noise; it's a feature. Generic captions (e.g., "a bird") result in high-variance embeddings that cover a large area of the embedding space, while specific captions result in "sharp" low-variance embeddings. This allows the model to "hedge its bets." If an image could match five different captions, the model learns to "spread" its distribution to overlap with all of them, rather than struggling to find a single point that sits in the middle of different clusters.

Interpretability and Robustness

The model "knows what it doesn't know." There is a clear correlation between the model's predicted uncertainty and its actual retrieval performance. On MS-COCO, PCME excels at retrieving "plausible" matches that weren't officially labeled, as measured by the new Plausible Match R-Precision (PMRP) metric.

Limitations

While powerful, PCME has a higher computational cost at test time due to Monte Carlo sampling. Additionally, the assumption of a Gaussian distribution with a diagonal covariance matrix may be too simple for complex semantic ambiguities. Future work could explore multi-modal distributions or integrating this approach with fine-grained region-to-word matching models.

Summary updated

BibTeX
@inproceedings{chun2021probabilistic,
  author = {Sanghyuk Chun and Seong Joon Oh and Rafael Sampaio de Rezende and Yannis Kalantidis and Diane Larlus},
  title = {{Probabilistic Embeddings for Cross-Modal Retrieval}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00831},
}
Figure