Generating Compositional Color Representations from Text

Paridhi Maheshwari, Nihal Jain, Praneetha Vaddamanu, Dhananjay Raut, Shraiysh Vaishay, Vishwa Vinay

TL;DR

Researchers have developed a Generative Adversarial Network (GAN) that predicts the "color profile" of a text phrase, even for implicit descriptions like "deep sea" or "ripe apple." By focusing on compositionality—the ability to combine known attributes and objects into new pairs—the model significantly improves the relevance of image search results by understanding the visual intent behind the text.

What Problem Does This Paper Address?

When you search for "deep sea," you expect dark blue images, even though the word "blue" isn't in your query. This is implicit color intent. While humans intuitively understand how adjectives modify nouns (e.g., "ripe" looks different on an apple than on a banana), machines often struggle with this compositional nature of language.

Existing cross-modal retrieval systems often treat words in isolation or rely on explicit color mentions. The challenge is twofold:

  1. Implicit Intent: Many high-intent queries don't name colors directly.
  2. Contextuality: The same attribute (like "dark") manifests differently depending on the object (like "sea" vs. "sky").

This paper aims to bridge the gap by generating realistic color histograms from (attribute, object) bigrams, enabling search engines to "see" the color a user is thinking of.

Methods

The authors propose a multi-stage pipeline centered around a conditional GAN:

  1. Visual Attention Mechanism: To get "clean" training data, they don't just take the average color of an image. They use a VGG-16 based attention model to identify the pixels most relevant to the (attribute, object) pair (e.g., focusing on the hair in "blond hair" and ignoring the background).
  2. The GAN Architecture:
    • Generator: Takes word embeddings (GloVe) of the attribute and object and generates a 1504-dimensional color histogram in LAB space.
  3. Discriminator: During training, it looks at the text, the generated color profile, and actual image features from a ResNet model to decide if the color profile is "real" or "fake." Crucially, image features are only needed during training; at test time, the model generates color from text alone.
  4. Contrastive Loss Functions: They experimented with L2, Triplet, and Quintuplet losses. The Quintuplet loss is particularly clever: it forces the model to distinguish between the target pair (dark sea) and "semi-negatives" that share either the same attribute (dark sky) or the same object (deep sea).

Datasets

The authors introduced a novel dataset curation pipeline:

  • Source: They started with Google’s n-gram corpus to find common (adjective, noun) pairs.
  • Graph Propagation: To ensure high color intent, they built a bipartite graph. Starting with "seed" colors (red, blue), they "hopped" to find frequently associated objects (rose, sea), then "hopped" again to find new attributes (wild, stormy).
  • Final Stats: 130 attributes, 211 objects, and 1,460 unique pairs, mapped to approximately 49,000 images retrieved via Google Image Search.

Key Insights and Ideas

  • Color as a First-Class Feature: Instead of relying on abstract embeddings, the model produces a literal color histogram. This makes the model's "thought process" interpretable—you can actually see the palette it predicts for a phrase.
  • The Power of "Semi-Negatives": By using Quintuplet loss, the model learns the nuance of context. It learns that "dark" isn't just one color; it's a transformation that applies differently to "sea" than it does to "sky."
  • Visual Grounding for Text Tasks: Even though the final task is text-to-color, including visual features in the GAN's discriminator during training leads to much more realistic color distributions (lower FID scores) than a purely discriminative text-only model.

Key Results

  • Generative Quality: The GAN-based approach achieved a significantly lower Fréchet Inception Distance (FID) (0.208) compared to a standard discriminative baseline (0.368), meaning the predicted color profiles much more closely match the statistical distribution of real images.
  • Zero-Shot Generalization: The model successfully predicted intuitive color profiles for "unseen" combinations (pairs not in the training set), demonstrating true compositional learning.
  • Downstream Search Boost: When the generated color profiles were used as features in an image retrieval task, the Mean Average Precision (MAP) jumped from 0.534 (base features) to 0.692 (base + color). This proves that understanding color intent directly translates to better search relevance.

Limitations and Future Work

  • Linguistic Complexity: The current model is limited to simple (attribute, object) bigrams. It cannot yet handle complex queries like "round metallic bottle" or phrases with multiple modifiers.
  • Beyond Color: While this paper focuses on color, the authors suggest their graph-propagation curation method could be extended to other visual dimensions like texture, aesthetics, or even emotions.
  • Vocabulary Constraints: The model relies on a predefined vocabulary of concrete nouns and descriptive adjectives, which may limit its application to highly niche or technical domains.

Summary updated

BibTeX
@inproceedings{maheshwari2021generating,
  author = {Paridhi Maheshwari and Nihal Jain and Praneetha Vaddamanu and Dhananjay Raut and Shraiysh Vaishay and Vishwa Vinay},
  title = {{Generating Compositional Color Representations from Text}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2021},
  url = {https://openreview.net/forum?id=41I-HKFMYNf},
}

Loading related content...

Figure