Exploring Uncertainty Measures for Image-caption Embedding-and-retrieval Task

Kenta Hama, Takashi Matsubara, Kuniaki Uehara, Jianfei Cai

TL;DR

This paper explores how to measure the "uncertainty" of deep learning models in image-caption retrieval tasks. They propose a new "posterior uncertainty" measure that effectively assesses the reliability of retrieval results, outperforming existing "feature uncertainty" methods, especially when dealing with dataset shifts.

What Problem Does This Paper Address?

As deep learning models become more powerful and are deployed in critical applications (like self-driving cars), understanding their reliability is crucial. When a model makes a "black box" decision, we need to know if it's confident and likely correct, or if it's uncertain and might be wrong. This is especially true for image-caption retrieval, where a model needs to find the best caption for an image (or vice-versa). While existing methods use "feature uncertainty" to improve retrieval performance through model averaging, they struggle to reliably indicate when a retrieval is likely to fail. This paper addresses this gap by proposing a new way to quantify uncertainty that directly assesses the reliability of the retrieval process itself.

Methods

The authors frame the image-caption embedding-and-retrieval task in two ways:

  1. Embedding as Regression (Feature Uncertainty): They treat the process of creating an embedded representation of an image or caption as a regression task. Uncertainty here is measured by the variance of the output feature vector. This "feature uncertainty" can be used to improve retrieval performance by averaging predictions from multiple model variations (model averaging). This is a common approach in Bayesian deep learning.
  2. Retrieval as Classification (Posterior Uncertainty): They then consider the retrieval process itself as a classification task. Given a query (image or caption) and a set of potential targets (captions or images), the model predicts the probability of each target being the correct match. "Posterior uncertainty" is derived from this probability distribution, specifically by measuring the mutual information between the predicted class (the correct target) and the model's parameters. This approach aims to directly assess the reliability of the final retrieval decision.

Datasets

  • MS COCO: Used for training and testing.
  • Flickr30k: Used for training and testing.
  • RecipeQA: Used for testing to evaluate performance under dataset shift.

The paper uses standard splits for MS COCO and Flickr30k, and RecipeQA is used to simulate a domain shift scenario.

Key Insights and Ideas

  • Two Faces of Uncertainty: Image-caption retrieval can be viewed through the lens of both regression (feature embedding) and classification (retrieval decision), leading to different types of uncertainty measures.
  • Feature Uncertainty is Good for Performance, Bad for Reliability: While feature uncertainty, when used with model averaging, can improve retrieval accuracy, it's not a reliable indicator of when a retrieval is likely to fail.
  • Posterior Uncertainty is Key for Reliability: The proposed "posterior uncertainty" measure, derived from the classification perspective of retrieval, is shown to be a strong indicator of retrieval reliability. It can accurately flag uncertain queries.
  • Dataset Bias Matters: The paper highlights how dataset biases (e.g., a dataset heavily featuring people and sports) can influence uncertainty measures. Feature uncertainty can be low for common subjects even if retrieval is difficult, while posterior uncertainty better captures this difficulty.
  • Detecting Dataset Shift: Posterior uncertainty is effective at detecting when a model is applied to data from a different distribution (dataset shift), a capability that feature uncertainty lacks.

Key Results

  • Improved Retrieval Performance: Model averaging using both feature and posterior uncertainty consistently improved retrieval performance over simple weight averaging across various datasets, architectures, and similarity functions.
  • Posterior Uncertainty for Reliability: Precision-recall curves for reliability assessment showed that posterior uncertainty (especially with a low temperature parameter) significantly outperformed feature uncertainty and even chance levels in identifying unreliable queries.
  • Consistency Across Settings: The effectiveness of posterior uncertainty for reliability assessment was consistent across different datasets (MS COCO, Flickr30k), architectures (VGG19, ResNet with batch normalization), and similarity functions.
  • Dataset Shift Detection: Posterior uncertainty showed a clear increase when applied to datasets further removed from the training data (e.g., RecipeQA vs. MS COCO), indicating its utility for detecting dataset shifts.

Limitations and Future Work

  • Feature Uncertainty's Limitations: The paper acknowledges that feature uncertainty, while improving performance, does not reliably assess retrieval reliability and can even perform worse than chance in some cases.
  • Model Averaging Requirements: For architectures like ResNet with batch normalization, model averaging requires a very large number of models (L > 300) to outperform weight averaging, suggesting that stochasticity from batch normalization alone might not be sufficient for effective model averaging.
  • Future Work: The paper implicitly suggests that further exploration of how different uncertainty measures interact with dataset biases and how to best leverage posterior uncertainty for active learning or model adaptation would be valuable. The authors also note that the posterior uncertainty quantifies dataset shift, suggesting its potential use in detecting out-of-distribution samples.

Summary updated

BibTeX
@article{hama2021exploring,
  author = {Kenta Hama and Takashi Matsubara and Kuniaki Uehara and Jianfei Cai},
  title = {{Exploring Uncertainty Measures for Image-caption Embedding-and-retrieval Task}},
  journal = {ACM Trans. Multim. Comput. Commun. Appl.},
  year = {2021},
  doi = {10.1145/3425663},
}
Figure