CP2: Copy-Paste Contrastive Pretraining for Semantic Segmentation

Feng Wang, Huiyu Wang, Chen Wei, Alan Yuille, Wei Shen
3/22/2022
cs.CVcs.AI
contrastive-ssl

Official code: wangf3014/CP2 (12 stars, Python, last commit 2024-06-10).

Abstract

Recent advances in self-supervised contrastive learning yield good image-level representation, which favors classification tasks but usually neglects pixel-level detailed information, leading to unsatisfactory transfer performance to dense prediction tasks such as semantic segmentation. In this work, we propose a pixel-wise contrastive learning method called CP2 (Copy-Paste Contrastive Pretraining), which facilitates both image- and pixel-level representation learning and therefore is more suitable for downstream dense prediction tasks.

Show full abstract

In detail, we copy-paste a random crop from an image (the foreground) onto different background images and pretrain a semantic segmentation model with the objective of 1) distinguishing the foreground pixels from the background pixels, and 2) identifying the composed images that share the same foreground.Experiments show the strong performance of CP2 in downstream semantic segmentation: By finetuning CP2 pretrained models on PASCAL VOC 2012, we obtain 78.6% mIoU with a ResNet-50 and 79.5% with a ViT-S.

View on arXivView PDF

Code Implementations(1)

wangf3014/CP2Official100%
121Python, ShellJul 17, 20222 years ago

Similar Papers

Cite this paper

@article{wang2022cp,
  title  = {CP2: Copy-Paste Contrastive Pretraining for Semantic Segmentation},
  author = {Feng Wang and Huiyu Wang and Chen Wei and Alan Yuille and Wei Shen},
  year   = {2022},
  eprint = {2203.11709},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.11709}
}

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/2203.11709.svg)](https://codeofpaper.com/paper/2203.11709)

Discussion