ViSTA: Vision and Scene Text Aggregation for Cross-Modal Retrieval

Mengjun Cheng, Yipeng Sun, Longchao Wang, Xiongwei Zhu, Kun Yao, Jie Chen, Guoli Song, Junyu Han, Jingtuo Liu, Errui Ding, Jingdong Wang · DOI

Abstract

Visual appearance is considered to be the most important cue to understand images for cross-modal retrieval, while sometimes the scene text appearing in images can provide valuable information to understand the visual semantics. Most of existing cross-modal retrieval approaches ignore the usage of scene text information and directly adding this information may lead to performance degradation in scene text free scenarios. To address this issue, we propose a full transformer architecture to unify these cross-modal retrieval scenarios in a single Vision and Scene Text Aggregation framework (ViSTA). Specifically, ViSTA utilizes transformer blocks to directly encode image patches and fuse scene text embedding to learn an aggregated visual representation for cross-modal retrieval. To tackle the modality missing problem of scene text, we propose a novel fusion token based transformer aggregation approach to exchange the necessary scene text information only through the fusion token and concentrate on the most important features in each modality. To further strengthen the visual modality, we develop dual contrastive learning losses to embed both image-text pairs and fusion-text pairs into a common cross-modal space. Compared to existing methods, ViSTA enables to aggregate relevant scene text semantics with visual appearance, and hence improve results under both scene text free and scene text aware scenarios. Experimental results show that ViSTA outperforms other methods by at least 8.4% at Recall@1 for scene text aware retrieval task. Compared with state-of-the-art scene text free retrieval methods, ViSTA can achieve better accuracy on Flicker30K and MSCOCO while running at least three times faster during the inference stage, which validates the effectiveness of the proposed framework.

Introduction

In cross-modal retrieval, such as finding an image based on a text query, models typically focus on visual appearance—pixels and objects. However, scene text (e.g., a brand name on a product or a sign on a building) often contains the most critical information for distinguishing between visually similar images.

Comparison between conventional cross-modal retrieval and ViSTA's aggregation approach.

Existing approaches face two primary challenges. First is the "modality missing" problem: models trained to rely on scene text often perform poorly on images without text. Second is the trade-off between efficiency and accuracy. "Single-encoder" models with deep fusion are accurate but slow, while "dual-encoder" models like CLIP are fast but usually ignore scene text semantics.

The ViSTA Framework

ViSTA (Vision and Scene Text Aggregation) is a transformer-based framework that treats scene text as a primary semantic cue. It adopts a dual-encoder architecture but introduces a sophisticated aggregation method.

The ViSTA architecture overview, showing the vision and scene text encoders, the fusion token, and dual contrastive losses.

The Fusion Token ([FUS])

Instead of using computationally expensive cross-attention layers to merge image patches and OCR-detected words, ViSTA introduces a special "fusion token." This token acts as a shared bridge between the Vision Transformer and the Scene Text Transformer. It exchanges only the most relevant information between the two towers, preventing noisy or irrelevant scene text from "polluting" the visual representation.

Dual Contrastive Learning

To address the modality missing problem, ViSTA is trained with two simultaneous losses:

  1. Image-Text Contrastive (ITC): Matches the visual-only embedding to the query text.
  2. Fusion-Text Contrastive (FTC): Matches the aggregated (visual + scene text) embedding to the query text.

This ensures the visual encoder remains robust even when scene text is absent, while the fused representation provides a performance boost when text is available.

Experimental Results

The authors evaluated ViSTA on several benchmarks, including CTC (COCO-Text Captioned) for scene-text-aware retrieval, and Flickr30K/MSCOCO for standard retrieval.

  • Scene Text Superiority: On the CTC-1K dataset, ViSTA-S outperformed the previous state-of-the-art (STARNet) by 8.4% in Recall@1.
  • General Purpose Strength: Even on standard datasets like Flickr30K, ViSTA achieved higher accuracy than many complex fusion models, with ViSTA-L reaching 79.2% R@1.
  • Efficiency: ViSTA-B processes queries in approximately 17ms, compared to ~900ms for models like UNITER or ViL-BERT. This significant speedup over state-of-the-art scene-text-free methods makes it highly viable for real-world applications.

Conclusion

ViSTA demonstrates that scene text provides a "fine-grained" semantic layer that pixels alone cannot capture. By forcing information exchange through a single fusion token, the model learns to be selective, making it both efficient and robust against noisy OCR data. Future work may extend this approach to other vision-language tasks like Visual Question Answering (VQA) where reading text is essential.

Summary updated

BibTeX
@inproceedings{cheng2022vista,
  author = {Mengjun Cheng and Yipeng Sun and Longchao Wang and Xiongwei Zhu and Kun Yao and Jie Chen and Guoli Song and Junyu Han and Jingtuo Liu and Errui Ding and Jingdong Wang},
  title = {{ViSTA: Vision and Scene Text Aggregation for Cross-Modal Retrieval}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.00512},
}
Figure