Composed Image Retrieval (CIR) is a fascinating challenge in computer vision: given a "reference" image and a "modifier" text (e.g., an image of a dog and the text "have the dog wear a sweater"), the system must retrieve a "target" image that matches both. While humans find this intuitive, AI models often struggle because they tend to look at the image as a whole rather than focusing on the specific local regions that need to change.
In their recent paper, researchers from Adobe Research introduce Multi-modal Gradient Attention (MMGrad), a novel approach that forces models to "look" at the right spots, leading to better retrieval and, for the first time, clear visual explanations of why a model chose a specific image.
TL;DR
The authors propose MMGrad, a new gradient-based attention mechanism and loss function that explicitly trains models to focus on local image regions specified by modifier text. This approach significantly improves retrieval accuracy on complex real-world datasets and provides built-in explainability through intuitive attention maps.
What Problem Does This Paper Address?
Most current state-of-the-art CIR models rely on global features. They encode the entire image and the entire text into a single vector space. However, modifier texts usually describe local changes—adding a hat, changing the color of a shirt, or replacing a fence with a wall.
When models use global features, they often get distracted by background elements or irrelevant details, leading to incorrect retrievals. The authors argue that for a model to be truly effective at CIR, it must learn to localize the regions of interest. The core challenge they tackle is: How can we train a model to automatically highlight and focus on the specific regions being modified during the learning process?
Methods
The researchers developed a pipeline that integrates local focus directly into the training objective.
- Architecture: They use a Siamese transformer setup. Images are processed by a Vision Transformer (ViT), and the combination of image and text is handled by a Vision-Language Transformer (Visual-BERT).
- MMGrad (Multi-modal Gradient Attention): This is the heart of the paper. Unlike standard attention, MMGrad is computed by taking the gradient of the similarity score between the reference and target features with respect to the model's internal layers. Crucially, this attention is conditioned on the text, meaning the model generates a map of where it thinks the changes described in the text should be.
- Attention Learning Objective ($L_{MMGrad}$): To ensure the model focuses on the right areas, they generate "ground-truth" saliency maps using an off-the-shelf text-conditioned segmenter. During training, the model is penalized if its internal MMGrad maps don't align with these ground-truth maps.
- Overall Loss: The final model is trained using a combination of this new attention loss and a standard quadruplet loss to ensure the retrieved features are discriminative.
Datasets
The model was evaluated on two primary benchmarks:
- CIRR (Composed Image Retrieval on Real-life images): A challenging dataset featuring "in-the-wild" images with complex scenarios and fine-grained text modifications.
- Fashion-IQ: A domain-specific dataset focused on clothing, where modifiers typically describe attribute changes like color, pattern, or sleeve length.
Key Insights and Ideas
- Training with Explanations: Usually, gradient-based attention (like Grad-CAM) is used after training to explain a model. This paper flips that, using the attention map as a supervisory signal during training.
- Text-Conditioned Localization: By making the attention multi-modal, the model learns that the "region of interest" isn't just the most prominent object, but specifically the object mentioned in the text.
- Local Focus Improves Global Retrieval: Even though the final retrieval uses a feature vector, forcing that vector to be "informed" by local regions leads to a significant jump in quantitative performance.
Key Results
The proposed method achieved impressive results, particularly on the complex CIRR dataset:
- Quantitative Gains: On CIRR, the model achieved a Recall@1 of 19.11%, a significant jump from the 14.15% achieved without the attention loss. It outperformed existing state-of-the-art models like ARTEMIS (16.96%) and CIRPLANT (15.18%).
- Reasoning Ability: On the
Recall_subsetmetric (which tests the model's ability to distinguish between very similar images), the model showed a massive ~25% improvement over the baseline. - Qualitative Explainability: The generated attention maps clearly highlight the modified regions (e.g., highlighting the "onion rings" or the "dog's head"), providing a "window" into the model's reasoning.
Limitations and Future Work
While the model excelled on real-world images, its performance on the Fashion-IQ dataset was competitive but did not set a new state-of-the-art. The authors suggest this is because Fashion-IQ is highly domain-specific and less complex than "in-the-wild" data, where their localization-heavy approach shines brightest.
Future work could involve refining the ground-truth saliency generation or exploring how this local focus can be applied to other multi-modal tasks like visual question answering or image editing.
Summary updated