Dense Contrastive Visual-Linguistic Pretraining

Lei Shi, Kai Shuang, Shijie Geng, Peng Gao, Zuohui Fu, Gerard de Melo, Yunpeng Chen, Sen Su

Abstract

Inspired by the success of BERT, several multimodal representation learning approaches have been proposed that jointly represent image and text. These approaches achieve superior performance by capturing high-level semantic information from large-scale multimodal pretraining. In particular, LXMERT and UNITER adopt visual region feature regression and label classification as pretext tasks. However, they tend to suffer from the problems of noisy labels and sparse semantic annotations, based on the visual features having been pretrained on a crowdsourced dataset with limited and inconsistent semantic labeling. To overcome these issues, we propose unbiased Dense Contrastive Visual-Linguistic Pretraining (DCVLP), which replaces the region regression and classification with cross-modality region contrastive learning that requires no annotations. Two data augmentation strategies (Mask Perturbation and Intra-/Inter-Adversarial Perturbation) are developed to improve the quality of negative samples used in contrastive learning. Overall, DCVLP allows cross-modality dense region contrastive learning in a self-supervised setting independent of any object annotations.

Introduction

Presented at ACM Multimedia 2021, Dense Contrastive Visual-Linguistic Pretraining (DCVLP) represents a paradigm shift in how AI models bridge the gap between visual and textual data. Traditional Vision-Language Pretraining (VLP) models often rely on unreliable human-annotated labels. DCVLP moves toward a self-supervised "dense" contrastive learning approach that eliminates the need for noisy, sparse object labels, allowing models to learn finer-grained relationships between image regions and text.

The Problem: Noisy Labels and Sparse Semantics

Most state-of-the-art VLP models, such as LXMERT and UNITER, utilize "pretext tasks" where they attempt to predict labels or features of image regions identified by a pre-trained object detector (like Faster R-CNN). However, this approach faces two significant hurdles:

  1. Noisy Labels: Labels from object detectors are frequently incorrect because the detectors themselves were trained on crowdsourced datasets with inconsistent quality.
  2. Sparse Semantics: A generic label like "cat" fails to capture rich contextual nuances—such as the difference between a cat sleeping versus a cat hunting. Forcing a model to classify both as simply "cat" provides misleading gradients that hinder complex scene understanding.
Figure 1: Comparison between traditional masked region loss (top) which relies on generic labels, and the proposed cross-modality region contrastive loss (bottom) which uses context to differentiate instances.

The DCVLP Framework

DCVLP replaces traditional region classification with a self-supervised contrastive framework. The architecture utilizes a Siamese-style setup consisting of a QueryNet and a KeyNet, which can be built upon standard backbones like LXMERT or UNITER.

RoI-Feature Dense Contrastive Loss

Instead of predicting a discrete label, the model attempts to match a specific image region in the QueryNet with the corresponding region in the KeyNet. Simultaneously, it learns to distinguish this "positive" pair from all other regions in the batch (negative samples). This ensures the model learns that a region is defined by its specific alignment with textual descriptions rather than a fixed category.

Advanced Data Augmentation

To ensure the contrastive task is sufficiently challenging for robust feature learning, the authors introduced two novel strategies:

  • Mask Perturbation: Symmetrically masking text in one network and image regions in the other.
  • Adversarial Perturbation (Intra/Inter): Using Projected Gradient Descent (PGD) to inject calculated noise. The "Inter-Adversarial" strategy is particularly effective; it uses Masked Language Modeling (MLM) loss to generate noise that forces the model to find deeper semantic links to succeed.
Figure 3: Overview of the DCVLP architecture compared to standard LXMERT and UNITER, highlighting the Siamese QueryNet/KeyNet setup and the integration of adversarial perturbations.

Experimental Results

DCVLP was pretrained on a massive corpus including MSCOCO, Visual Genome, Conceptual Captions, and SBU Captions. When evaluated against downstream benchmarks, the model showed consistent improvements over its base architectures:

  • VQA & GQA: Using the LXMERT backbone, DCVLP improved VQA scores by +0.65 and GQA by +0.4.
  • NLVR2: The model achieved a significant jump of +2.31, demonstrating its ability to bridge the "domain gap" that often plagues traditional models.
  • Zero-Shot Performance: The robustness of the learned features was further validated by strong results in image-text retrieval without task-specific fine-tuning.

Conclusion and Future Work

DCVLP demonstrates that context is often the best "label." By moving to a self-supervised region-level contrastive approach, the model becomes less biased by the errors of external object detectors. While the current implementation still relies on pre-trained detectors for initial region proposals (RoIs) and requires significant computational power for adversarial training, it paves the way for future "end-to-end" VLP systems that can learn to propose and understand regions simultaneously.

Summary updated

BibTeX
@inproceedings{shi2021dense,
  author = {Lei Shi and Kai Shuang and Shijie Geng and Peng Gao and Zuohui Fu and Gerard de Melo and Yunpeng Chen and Sen Su},
  title = {{Dense Contrastive Visual-Linguistic Pretraining}},
  booktitle = {ACM Multimedia},
  year = {2021},
  doi = {10.1145/3474085.3475637},
}
Figure