Home Artificial Intelligence Mapping photos to phrases for zero-shot composed picture retrieval – Google Analysis Weblog

Mapping photos to phrases for zero-shot composed picture retrieval – Google Analysis Weblog

Mapping photos to phrases for zero-shot composed picture retrieval – Google Analysis Weblog


Picture retrieval performs an important function in search engines like google. Usually, their customers depend on both picture or textual content as a question to retrieve a desired goal picture. Nevertheless, text-based retrieval has its limitations, as describing the goal picture precisely utilizing phrases might be difficult. For example, when trying to find a vogue merchandise, customers might want an merchandise whose particular attribute, e.g., the colour of a emblem or the brand itself, is completely different from what they discover in an internet site. But trying to find the merchandise in an present search engine will not be trivial since exactly describing the style merchandise by textual content might be difficult. To deal with this reality, composed picture retrieval (CIR) retrieves photographs based mostly on a question that mixes each a picture and a textual content pattern that gives directions on find out how to modify the picture to suit the supposed retrieval goal. Thus, CIR permits exact retrieval of the goal picture by combining picture and textual content.

Nevertheless, CIR strategies require massive quantities of labeled knowledge, i.e., triplets of a 1) question picture, 2) description, and three) goal picture. Gathering such labeled knowledge is expensive, and fashions educated on this knowledge are sometimes tailor-made to a particular use case, limiting their capacity to generalize to completely different datasets.

To deal with these challenges, in “Pic2Word: Mapping Footage to Phrases for Zero-shot Composed Picture Retrieval”, we suggest a job known as zero-shot CIR (ZS-CIR). In ZS-CIR, we goal to construct a single CIR mannequin that performs quite a lot of CIR duties, resembling object composition, attribute modifying, or area conversion, with out requiring labeled triplet knowledge. As an alternative, we suggest to coach a retrieval mannequin utilizing large-scale image-caption pairs and unlabeled photographs, that are significantly simpler to gather than supervised CIR datasets at scale. To encourage reproducibility and additional advance this house, we additionally launch the code.

Description of present composed picture retrieval mannequin.
We practice a composed picture retrieval mannequin utilizing image-caption knowledge solely. Our mannequin retrieves photographs aligned with the composition of the question picture and textual content.

Technique overview

We suggest to leverage the language capabilities of the language encoder within the contrastive language-image pre-trained mannequin (CLIP), which excels at producing semantically significant language embeddings for a variety of textual ideas and attributes. To that finish, we use a light-weight mapping sub-module in CLIP that’s designed to map an enter image (e.g., a photograph of a cat) from the picture embedding house to a phrase token (e.g., “cat”) within the textual enter house. The entire community is optimized with the vision-language contrastive loss to once more make sure the visible and textual content embedding areas are as shut as doable given a pair of a picture and its textual description. Then, the question picture might be handled as if it’s a phrase. This permits the versatile and seamless composition of question picture options and textual content descriptions by the language encoder. We name our methodology Pic2Word and supply an summary of its coaching course of within the determine beneath. We wish the mapped token s to signify the enter picture within the type of phrase token. Then, we practice the mapping community to reconstruct the picture embedding within the language embedding, p. Particularly, we optimize the contrastive loss proposed in CLIP computed between the visible embedding v and the textual embedding p.

Coaching of the mapping community (fM) utilizing unlabeled photographs solely. We optimize solely the mapping community with a frozen visible and textual content encoder.

Given the educated mapping community, we will regard a picture as a phrase token and pair it with the textual content description to flexibly compose the joint image-text question as proven within the determine beneath.

With the educated mapping community, we regard the picture as a phrase token and pair it with the textual content description to flexibly compose the joint image-text question.


We conduct quite a lot of experiments to judge Pic2Word’s efficiency on quite a lot of CIR duties.

Area conversion

We first consider the potential of compositionality of the proposed methodology on area conversion — given a picture and the specified new picture area (e.g., sculpture, origami, cartoon, toy), the output of the system ought to be a picture with the identical content material however within the new desired picture area or model. As illustrated beneath, we consider the power to compose the class info and area description given as a picture and textual content, respectively. We consider the conversion from actual photographs to 4 domains utilizing ImageNet and ImageNet-R.

To check with approaches that don’t require supervised coaching knowledge, we decide three approaches: (i) picture solely performs retrieval solely with visible embedding, (ii) textual content solely employs solely textual content embedding, and (iii) picture + textual content averages the visible and textual content embedding to compose the question. The comparability with (iii) exhibits the significance of composing picture and textual content utilizing a language encoder. We additionally examine with Combiner, which trains the CIR mannequin on Trend-IQ or CIRR.

We goal to transform the area of the enter question picture into the one described with textual content, e.g., origami.

As proven in determine beneath, our proposed method outperforms baselines by a big margin.

Outcomes (recall@10, i.e., the share of related situations within the first 10 photographs retrieved.) on composed picture retrieval for area conversion.

Trend attribute composition

Subsequent, we consider the composition of vogue attributes, resembling the colour of material, emblem, and size of sleeve, utilizing the Trend-IQ dataset. The determine beneath illustrates the specified output given the question.

Overview of CIR for vogue attributes.

Within the determine beneath, we current a comparability with baselines, together with supervised baselines that utilized triplets for coaching the CIR mannequin: (i) CB makes use of the identical structure as our method, (ii) CIRPLANT, ALTEMIS, MAAF use a smaller spine, resembling ResNet50. Comparability to those approaches will give us the understanding on how effectively our zero-shot method performs on this job.

Though CB outperforms our method, our methodology performs higher than supervised baselines with smaller backbones. This consequence means that by using a strong CLIP mannequin, we will practice a extremely efficient CIR mannequin with out requiring annotated triplets.

Outcomes (recall@10, i.e., the share of related situations within the first 10 photographs retrieved.) on composed picture retrieval for Trend-IQ dataset (increased is best). Gentle blue bars practice the mannequin utilizing triplets. Notice that our method performs on par with these supervised baselines with shallow (smaller) backbones.

Qualitative outcomes

We present a number of examples within the determine beneath. In comparison with a baseline methodology that doesn’t require supervised coaching knowledge (textual content + picture function averaging), our method does a greater job of appropriately retrieving the goal picture.

Qualitative outcomes on various question photographs and textual content description.

Conclusion and future work

On this article, we introduce Pic2Word, a technique for mapping photos to phrases for ZS-CIR. We suggest to transform the picture right into a phrase token to realize a CIR mannequin utilizing solely an image-caption dataset. By means of quite a lot of experiments, we confirm the effectiveness of the educated mannequin on various CIR duties, indicating that coaching on an image-caption dataset can construct a robust CIR mannequin. One potential future analysis course is using caption knowledge to coach the mapping community, though we use solely picture knowledge within the current work.


This analysis was carried out by Kuniaki Saito, Kihyuk Sohn, Xiang Zhang, Chun-Liang Li, Chen-Yu Lee, Kate Saenko, and Tomas Pfister. Additionally because of Zizhao Zhang and Sergey Ioffe for his or her useful suggestions.



Please enter your comment!
Please enter your name here