Position-Aware Contrastive Alignment for Referring Image Segmentation

Bo Chen, Zhiwei Hu, Zhilong Ji, Jinfeng Bai, Wangmeng ZuoarXiv 2022 · DOI

Introduction

Referring Image Segmentation (RIS) is a fundamental multi-modal task that requires generating a pixel-level mask for an object specified by a natural language expression. Unlike standard semantic segmentation, RIS demands a deep understanding of both visual features and complex linguistic relationships, such as "the second person from the left wearing a red hat."

A significant challenge in RIS is the presence of visually similar "distractor" objects. Most current methods rely on simple cross-modal fusion supervised only by the ground-truth mask. This often leads to failure when the model lacks an explicit perception of the surrounding context mentioned in the text. For instance, if a description mentions "the chair next to the table," a model focusing solely on the target chair might fail to distinguish it from other chairs if it doesn't explicitly align the "table" reference with the visual scene.

Conceptual comparison between vanilla alignment in previous works and the proposed contrastive alignment in PCAN.

The PCAN Framework

To address these limitations, the Position-Aware Contrastive Alignment Network (PCAN) explicitly teaches the model to perceive and contrast the target object with its surroundings during the training phase.

Position-Aware Module (PAM)

The PAM leverages a pre-trained vision-language detector (e.g., GLIP) to extract object-position priors from the image based on the input text. It identifies regions corresponding to various entities mentioned in the description. The ground-truth box is treated as a positive sample, while high-confidence non-target boxes are identified as "hard negatives." These priors provide the spatial context necessary for disambiguation.

Contrastive Language Understanding Module (CLUM)

The core of PCAN's alignment strategy is the CLUM, which utilizes a dual-decoder architecture:

  1. Contrastive Part: This branch takes the specific object regions identified by the PAM as input, learning distinct representations for the target and its distractors.
  2. Matching Part: This branch uses standard, randomly initialized queries typical of Transformer-based architectures to perform the final segmentation.
Detailed architecture of PCAN, highlighting the Position-Aware Module and the Contrastive Language Understanding Module (CLUM).

Contrastive Alignment Loss

During training, an InfoNCE-style Contrastive Alignment (CA) loss is applied. This loss pulls the features in the "Matching Part" closer to the "Positive" features from the Contrastive Part while pushing them away from the "Negative" (distractor) features. This process effectively transfers spatial and relational knowledge from the detector-based priors into the main segmentation branch.

Inference: The "Free Lunch"

A key advantage of PCAN is its efficiency. The PAM and the Contrastive branch of the CLUM are utilized exclusively during the training phase. At inference time, the model discards these auxiliary components and relies solely on the standard matching branch. Consequently, PCAN achieves superior accuracy without any additional computational overhead compared to baseline Transformer models.

Experimental Results

PCAN was evaluated on three major RIS benchmarks: RefCOCO, RefCOCO+, and G-Ref. It achieved state-of-the-art (SOTA) performance across the board:

  • RefCOCO: Reached 73.71% oIoU, a nearly 1% improvement over previous leaders.
  • G-Ref: Showed the most significant gains, outperforming competitors by 3.19% to 3.59%. This suggests that explicit position-awareness is particularly crucial for the long, complex linguistic expressions found in G-Ref.

Qualitative analysis confirms that PCAN excels in crowded scenes where distractors are prevalent, such as identifying a specific fruit in a bowl or a particular chair in a row, where baseline models often struggle.

Limitations and Future Directions

While PCAN sets a new standard for RIS, it remains dependent on the quality of the pre-trained detector used in the PAM. Noisy or missing detections for niche objects can limit the effectiveness of the training priors. Future research may explore more dynamic methods for discovering related objects that are not easily captured by bounding boxes, such as shadows or reflections, and streamlining the training process to reduce complexity.

Summary updated

BibTeX
@misc{chen2022position,
  author = {Bo Chen and Zhiwei Hu and Zhilong Ji and Jinfeng Bai and Wangmeng Zuo},
  title = {{Position-Aware Contrastive Alignment for Referring Image Segmentation}},
  year = {2022},
  eprint = {2212.13419},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.13419},
}
Figure