Contrastive Grouping with Transformer for Referring Image Segmentation

Jiajin Tang, Ge Zheng, Cheng Shi, Sibei Yang
2/14/2026

No official code found. Best implementation: SooLab/CGFormer (51 stars, MIT, last commit 2024-04-17).

Abstract

Referring image segmentation aims to segment the target referent in an image conditioning on a natural language expression. Existing one-stage methods employ per-pixel classification frameworks, which attempt straightforwardly to align vision and language at the pixel level, thus failing to capture critical object-level information. In this paper, we propose a mask classification framework, Contrastive Grouping with Transformer network (CGFormer), which explicitly captures object-level information via token-based querying and grouping strategy. Specifically, CGFormer first introduces learnable query tokens to represent objects and then alternately queries linguistic features and groups visual features into the query tokens for object-aware cross-modal reasoning. In addition, CGFormer achieves cross-level interaction by jointly updating the query tokens and decoding masks in every two consecutive layers. Finally, CGFormer cooperates contrastive learning to the grouping strategy to identify the token and its mask corresponding to the referent. Experimental results demonstrate that CG-Former outperforms state-of-the-art methods in both segmentation and generalization settings consistently and significantly. Code is available at https://github.com/Toneyaya/CGFormer.

View on arXivView PDF

Code Implementations(1)

SooLab/CGFormerCommunity57%
MIT

The official PyTorch implementation of the CVPR 2023 paper "Contrastive Grouping with Transformer for Referring Image Segmentation".

513PythonMar 24, 20232 years agoMIT

Similar Papers

Cite this paper

@article{tang2026contrastive,
  title  = {Contrastive Grouping with Transformer for Referring Image Segmentation},
  author = {Jiajin Tang and Ge Zheng and Cheng Shi and Sibei Yang},
  year   = {2026},
  eprint = {2309.01017},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.01017},
  journal = {CVPR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.01017.svg)](https://codeofpaper.com/paper/2309.01017)

Discussion