Learning Relation Alignment for Calibrated Cross-modal Retrieval

Shuhuai Ren, Junyang Lin, Guangxiang Zhao, Rui Men, An Yang, Jingren Zhou, Xu Sun, Hongxia Yang

Introduction

Cross-modal retrieval—the task of identifying relevant images for a given text query or vice versa—is a fundamental challenge in multimodal artificial intelligence. While large-scale pre-trained models have significantly improved performance, they often encounter a "semantic gap" where internal representations are uncalibrated. Most current approaches focus on object-level alignment, which involves matching specific words (e.g., "dog") to corresponding visual regions. However, these models frequently overlook relation-level consistency, failing to capture how entities interact within a scene.

Comparison between object-level and relation-level alignment, illustrating the issue of intra-modal self-attention disagreement.

As illustrated in Figure 1, a model might correctly identify a "man" and a "red shirt" but fail to understand their relationship. In an uncalibrated state, the visual attention for the "red shirt" might erroneously focus more on an unrelated "dog" than on the "man" wearing it, even if the textual attention correctly links the shirt to the man. This research proposes a method to align these internal relations across modalities to produce more robust and interpretable retrievals.

Methodology

The authors introduce two primary mechanisms to enforce relation-level alignment:

1. Intra-modal Self-attention Distance (ISD)

ISD is a novel metric designed to quantify the "disagreement" between the self-attention distributions of different modalities. By calculating the symmetric Kullback-Leibler (KL) divergence between the text's self-attention and the image's self-attention, the model can measure how consistently it perceives relations in both domains.

2. Inter-modal Alignment on Intra-modal Self-attentions (IAIS)

IAIS is a regularized training objective that minimizes the ISD. To bridge the modalities without requiring dense ground-truth annotations, the authors propose two alignment strategies:

  • Singular Alignment: Maps an anchor item in one modality (e.g., an image region) to its most relevant counterpart in the other (e.g., a specific word) to reconstruct a mirrored attention map.
  • Distributed Alignment: Uses the full cross-modal attention distribution to translate relations, providing a more holistic but coarser alignment.

To stabilize training, the researchers employ Training Signal Annealing, which gradually increases the weight of the relation-alignment loss. This allows the model to master basic object recognition before attempting to calibrate complex relational structures.

Experiments and Results

The proposed method was evaluated using the UNITER (Universal Image-TExt Representation) backbone on two benchmark datasets: Flickr30k and MS COCO.

Performance Gains

The IAIS regularizer acted as a "pluggable" enhancement, improving retrieval accuracy without increasing inference-time parameters. On Flickr30k, the model significantly outperformed the UNITER-base and UNITER-large baselines. Notably, the improvement was most prominent in text retrieval tasks, showing an average gain of 3.50 points in recall metrics.

Calibration and Correlation

The study confirmed a strong Pearson correlation of -0.60 between the ISD metric and retrieval performance. This result validates the hypothesis that reducing the relational "disagreement" between modalities directly leads to more accurate cross-modal matching.

Discussion

A key insight from the ablation studies is that the visual modality serves as a more effective "anchor" for reconstruction than text. Visual regions often provide a more concrete and structurally powerful description of a scene, making them a better baseline for aligning linguistic relations. Furthermore, the alignment process significantly improves model interpretability; attention maps become more logical, focusing on actual entity interactions rather than spurious correlations (e.g., a shirt attending to a dog).

Conclusion

This work demonstrates that aligning relations, rather than just objects, is crucial for calibrated cross-modal retrieval. While the current "Singular" and "Distributed" alignment methods provide a coarse-grained proxy for true relational ground truth, they offer a significant and efficient performance boost. Future research will explore more sophisticated proxy functions and extend this relation-alignment logic to other tasks like Visual Question Answering (VQA).

Summary updated

BibTeX
@inproceedings{ren2021learning,
  author = {Shuhuai Ren and Junyang Lin and Guangxiang Zhao and Rui Men and An Yang and Jingren Zhou and Xu Sun and Hongxia Yang},
  title = {{Learning Relation Alignment for Calibrated Cross-modal Retrieval}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.43},
}
Figure