Using Image Captions and Multitask Learning for Recommending Query Reformulations

Gaurav Verma, Vishwa Vinay, Sahil Bansal, Shashank Oberoi, Makkunda Sharma, Prakhar Gupta

Abstract

Traditional query suggestion models rely on historical search logs, which often contain short, keyword-heavy, and linguistically limited user queries. This paper presents a novel approach for image search that leverages the rich, professional captions of clicked images as a supervision signal. By employing a Hierarchical Recurrent Encoder-Decoder (HRED) framework enhanced with multitask learning—specifically a pairwise ranking loss—the proposed model generates reformulations that are significantly more descriptive, diverse, and relevant. Evaluation on a massive real-world dataset from Adobe Stock demonstrates a 32% improvement in Mean Reciprocal Rank (MRR) and a substantial increase in query descriptiveness and diversity compared to standard baselines.

Introduction

When users fail to find a desired image, they typically reformulate their search query. Search engines assist this process by suggesting refinements. However, a significant "vocabulary gap" exists: users often struggle to articulate specific visual attributes (e.g., "bokeh" or "low angle"), resulting in poor-quality historical logs for training. In contrast, professional image repositories contain high-quality captions that accurately describe visual intent. This research explores whether these captions can be used to "teach" a search engine to suggest more expert-level queries.

Comparison of query reformulation strategies using historical logs vs. image captions.

Methodology

The core architecture is based on the Hierarchical Recurrent Encoder-Decoder (HRED), which encodes individual queries via a BiLSTM and tracks session context through a secondary LSTM. The authors introduce two primary innovations:

  1. HREDCap (Captions as Supervision): Instead of predicting the next user query, the decoder is trained to generate the caption of the image eventually clicked by the user. This forces the model to learn a richer, more descriptive vocabulary.
  2. Multitask Learning with Pairwise Ranking: A "Ranker" component is integrated, sharing representations with the generator. By utilizing a Pairwise Ranking Loss (comparing clicked vs. non-clicked images), the model is regularized to ensure that generated suggestions are grounded in actual search relevance.
The proposed architecture consisting of (a) Query Encoder, (b) Session Encoder, and (c) Query Decoder.

Experimental Results

The model was trained on over 1.3 million sessions from Adobe Stock, encompassing 10 million unique images. The best-performing configuration, HREDCap + Ranker (RO), achieved several key milestones:

  • Ranking Accuracy: Mean Reciprocal Rank (MRR) improved from 0.31 (baseline) to 0.41, a ~32% gain.
  • Descriptiveness: Suggested queries averaged 4.91 words, compared to 2.18 words for standard models, successfully incorporating novel descriptors like "during rush hour" or "minimalist."
  • Diversity: The diversity score for top-3 suggestions rose from 0.37 to 0.45, largely attributed to the pairwise ranking loss which helps the model distinguish between different aspects of search intent.

Conclusion

By bridging the gap between user queries and professional image metadata, this multitask learning approach significantly enhances the quality of query reformulations. While the method depends on high-quality captions, it demonstrates the power of using cross-modal signals (textual captions for visual search) to improve user experience. Future work may involve integrating visual features directly into the model bottleneck to further refine suggestions.

Summary updated

Abstract

Interactive search sessions often contain multiple queries, where the user submits a reformulated version of the previous query in response to the original results. We aim to enhance the query recommendation experience for a commercial image search engine. Our proposed methodology incorporates current state-of-the-art practices from relevant literature – the use of generation-based sequence-to-sequence models that capture session context, and a multitask architecture that simultaneously optimizes the ranking of results. We extend this setup by driving the learning of such a model with captions of clicked images as the target, instead of using the subsequent query within the session. Since these captions tend to be linguistically richer, the reformulation mechanism can be seen as assistance to construct more descriptive queries. In addition, via the use of a pairwise loss for the secondary ranking task, we show that the generated reformulations are more diverse.
BibTeX
@inproceedings{verma2020using,
  author = {Gaurav Verma and Vishwa Vinay and Sahil Bansal and Shashank Oberoi and Makkunda Sharma and Prakhar Gupta},
  title = {{Using Image Captions and Multitask Learning for Recommending Query Reformulations}},
  booktitle = {ECIR},
  year = {2020},
  url = {https://openreview.net/forum?id=5I2ksIxVcPK},
}
Figure