BOSS: Bottom-up Cross-modal Semantic Composition with Hybrid Counterfactual Training for Robust Content-based Image Retrieval

Wenqiao Zhang, Jiannan Guo, Mengze Li, Haochen Shi, Shengyu Zhang, Juncheng Li, Siliang Tang, Yueting ZhuangarXiv 2022 · DOI

TL;DR

BOSS (Bottom-up crOss-modal Semantic compoSition) enhances Content-Based Image Retrieval (CIR) by hierarchically blending image and text features from local details to global concepts. By combining this "bottom-up" architecture with a hybrid counterfactual training strategy, the model achieves state-of-the-art performance, particularly in distinguishing fine-grained differences in complex queries.

The Challenge of Content-Based Image Retrieval

Content-Based Image Retrieval (CIR) is more complex than standard "search by image" or "search by text." In CIR, a user provides a reference image and a modification text (e.g., a photo of a black dress with the text "make it blue with white polka dots"). The system must understand which parts of the image to keep and which to change based on the text.

Conceptual overview of the BOSS framework, illustrating the global and local semantic spaces and the use of hybrid counterfactual samples.

Existing CIR models often suffer from two major gaps:

  1. Ignoring Granularity: Most models simply fuse the "top-layer" global features of images and text. This ignores the relationship between local characteristics (like a specific texture) and abstract global semantics (the overall style of a garment).
  2. Linguistic Insensitivity: Models often struggle to distinguish between very similar queries. If a model isn't trained to see the difference between "blue polka dots" and "yellow polka dots" in the context of the same reference image, it will produce ambiguous results.

The BOSS Framework

The researchers introduce the BOSS framework, which consists of two primary innovations designed to address these gaps: Bottom-up Semantic Composition and Hybrid Counterfactual Training.

1. Bottom-up Semantic Composition (BCSC)

Instead of a single fusion step, BOSS uses a three-level hierarchical inference process to build a composed representation from the ground up:

  • Local Characteristic Composition: Uses a CRM (Cross-modal Representation Modification) block to modify local image patches based on word-level embeddings.
  • Global-local Absorbing Composition: Uses a RAC (Representation Absorbing Composition) block to "absorb" the modified local details into the broader global context.
  • Global Semantic Composition: Finalizes the representation by aggregating high-level visual and linguistic features.

To support this, the authors developed Pyramid Pooling Self-Attention (PSA) and Cross-Attention (PCA). These mechanisms help Vision Transformers (ViTs) regain the "spatial locality"—the understanding that nearby pixels are related—that they often lack compared to traditional Convolutional Neural Networks (CNNs).

The BOSS architecture, featuring the Multimodal Representing Module and the hierarchical Bottom-up Semantic Composition process.

2. Hybrid Counterfactual Training (HCT)

To make the model "query-sensitive," the authors use three types of counterfactual (negative) samples during training:

  • Image-independent (ICS): Irrelevant images paired with the query text.
  • Text-independent (TCS): Irrelevant text paired with the reference image.
  • Context-preserving (PCS): The most difficult negatives—queries where only one or two attribute words are changed (e.g., changing "black" to "blue"). This forces the model to learn exactly which linguistic tweaks lead to which visual changes.

Evaluation and Key Insights

The model was evaluated on three major fashion-centric benchmarks: FashionIQ, Fashion200k, and Shoes. BOSS achieved State-of-the-Art (SOTA) results, outperforming existing techniques on FashionIQ by a margin of 2.53% to 16.09% in Recall@10. On Fashion200k, it showed a significant lead, reaching 59.6% Recall@10 compared to the previous best of 51.1%.

Several key insights emerged from the study:

  • Prior Guidance Matters: The "bottom-up" approach treats local features as "prior guidance" for global features. By refining the details first, the high-level representation becomes much more robust.
  • The Power of Hard Negatives: Standard training uses random negatives. By specifically generating "context-preserving" negatives, the authors significantly reduced the model's uncertainty and ambiguity when faced with similar-looking items.
  • Spatial Boost for Transformers: While Transformers are powerful, their lack of inductive bias regarding spatial locality is a hurdle in CIR. The Pyramid Pooling (PSA/PCA) blocks act as a bridge, allowing the model to focus on salient image regions that need modification.

Conclusion and Future Work

While BOSS demonstrates superior performance on large-scale datasets, it faces challenges with smaller datasets like Shoes, where Transformers struggle to generalize without sufficient data. Future work may involve refining the model's inductive bias for small-scale data or extending the BOSS framework to more complex multi-modal tasks, such as interactive image editing or dialogue-based search systems.

Summary updated

Abstract

Content-Based Image Retrieval (CIR) aims to search for a target image by concurrently comprehending the composition of an example image and a complementary text, which potentially impacts a wide variety of real-world applications, such as internet search and fashion retrieval. In this scenario, the input image serves as an intuitive context and background for the search, while the corresponding language expressly requests new traits on how specific characteristics of the query image should be modified in order to get the intended target image. This task is challenging since it necessitates learning and understanding the composite image-text representation by incorporating cross-granular semantic updates. In this paper, we tackle this task by a novel \underline{\textbf{B}}ottom-up cr\underline{\textbf{O}}ss-modal \underline{\textbf{S}}emantic compo\underline{\textbf{S}}ition (\textbf{BOSS}) with Hybrid Counterfactual Training framework, which sheds new light on the CIR task by studying it from two previously overlooked perspectives: \emph{implicitly bottom-up composition of visiolinguistic representation} and \emph{explicitly fine-grained correspondence of query-target construction}. On the one hand, we leverage the implicit interaction and composition of cross-modal embeddings from the bottom local characteristics to the top global semantics, preserving and transforming the visual representation conditioned on language semantics in several continuous steps for effective target image search. On the other hand, we devise a hybrid counterfactual training strategy that can reduce the model's ambiguity for similar queries.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
FashionIQBOSSRC@1031.61%+2.53 vs baselinesplit: test · backbone=BERT · categories=Dress, Toptee, Shirt (average)
Source quote
L274: BOSS (ours) │ \CheckmarkBold │ \textcolor{red}{29.05} │ \textcolor{red}{54.41} │ \textcolor{red}{34.73} │ \textcolor{blue}{60.08} │ \textcolor{red}{31.04} │ \textcolor{red}{53.78} │ \textcolor{red}{31.61} │ \textcolor{red}{56.09} │ \textcolor{red}{43.85}
FashionIQBOSSRC@5056.09%split: test · backbone=BERT · categories=Dress, Toptee, Shirt (average)
Source quote
L274: BOSS (ours) │ \CheckmarkBold │ \textcolor{red}{29.05} │ \textcolor{red}{54.41} │ \textcolor{red}{34.73} │ \textcolor{blue}{60.08} │ \textcolor{red}{31.04} │ \textcolor{red}{53.78} │ \textcolor{red}{31.61} │ \textcolor{red}{56.09} │ \textcolor{red}{43.85}
Fashion200KBOSSRC@1059.6%+8.8 vs baselinesplit: test · subset=33k test queries · backbone=pretrained Vision Transformer and BERT
Source quote
L298: BOSS (ours) │ \textcolor{red}{20.1} │ \textcolor{red}{59.6} │ \textcolor{red}{79.5} │ \textcolor{red}{53.1}
Fashion200KBOSSRC@5079.5%split: test · subset=33k test queries · backbone=pretrained Vision Transformer and BERT
Source quote
L298: BOSS (ours) │ \textcolor{red}{20.1} │ \textcolor{red}{59.6} │ \textcolor{red}{79.5} │ \textcolor{red}{53.1}
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
FashionIQSAC† (BERT variant) baselineRC@1029.08%split: test · backbone=BERT · categories=Dress, Toptee, Shirt (average)
Source quote
L272: SAC (\dagger)~\cite{jandial2022sac} │ \CheckmarkBold │ 26.52 │ 51.01 │ \textcolor{blue}{32.70} │ \textcolor{red}{61.23} │ \textcolor{blue}{28.02} │ \textcolor{blue}{51.86} │ \textcolor{blue}{29.08} │ \textcolor{blue}{54.70} │ \textcolor{blue}{41.89}
Fashion200KVAL baselineRC@1050.8%split: test · subset=33k test queries
Source quote
L290: VAL~\cite{chen2020image} │ \textcolor{blue}{22.9} │ \textcolor{blue}{50.8} │ \textcolor{blue}{72.7} │ \textcolor{blue}{48.8}
BibTeX
@misc{zhang2022boss,
  author = {Wenqiao Zhang and Jiannan Guo and Mengze Li and Haochen Shi and Shengyu Zhang and Juncheng Li and Siliang Tang and Yueting Zhuang},
  title = {{BOSS: Bottom-up Cross-modal Semantic Composition with Hybrid Counterfactual Training for Robust Content-based Image Retrieval}},
  year = {2022},
  eprint = {2207.04211},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.04211},
}
Figure