Home

Awesome

Exploring Cross-Image Pixel Contrast for Semantic Segmentation

Exploring Cross-Image Pixel Contrast for Semantic Segmentation,
Wenguan Wang, Tianfei Zhou, Fisher Yu, Jifeng Dai, Ender Konukoglu and Luc Van Gool <br> ICCV 2021 (Oral) (arXiv 2101.11939)

News

Abstract

Current semantic segmentation methods focus only on mining “local” context, i.e., dependencies between pixels within individual images, by context-aggregation modules (e.g., dilated convolution, neural attention) or structureaware optimization criteria (e.g., IoU-like loss). However, they ignore “global” context of the training data, i.e., rich semantic relations between pixels across different images. Inspired by the recent advance in unsupervised contrastive representation learning, we propose a pixel-wise contrastive framework for semantic segmentation in the fully supervised setting. The core idea is to enforce pixel embeddings belonging to a same semantic class to be more similar than embeddings from different classes. It raises a pixel-wise metric learning paradigm for semantic segmentation, by explicitly exploring the structures of labeled pixels, which are long ignored in the field. Our method can be effortlessly incorporated into existing segmentation frameworks without extra overhead during testing.

We experimentally show that, with famous segmentation models (i.e., DeepLabV3, HRNet, OCR) and backbones (i.e., ResNet, HRNet), our method brings consistent performance improvements across diverse datasets (i.e., Cityscapes, PASCALContext, COCO-Stuff).

Installation

This implementation is built on openseg.pytorch. Many thanks to the authors for the efforts.

Please follow the Getting Started for installation and dataset preparation.

Performance

Cityscapes Dataset

BackboneModelTrain SetVal SetIterationsBatch SizeContrast LossMemorymIoULogCKPTScript
ResNet-101DeepLab-V3trainval400008NN72.75logckptscripts/cityscapes/deeplab/run_r_101_d_8_deeplabv3_train.sh
ResNet-101DeepLab-V3trainval400008YN77.67logckptscripts/cityscapes/deeplab/run_r_101_d_8_deeplabv3_contrast_train.sh
HRNet-W48HRNet-W48trainval400008NN79.27logckptscripts/cityscapes/hrnet/run_h_48_d_4.sh
HRNet-W48HRNet-W48trainval400008YN80.18logckptscripts/cityscapes/hrnet/run_h_48_d_4_contrast.sh

It seems that the DeepLab-V3 baseline does not produce the expected performance on the new codebase. I will tune this later.

Study of the temperature

BackboneTrain SetVal SetIterationsBatch SizeTemperaturemIoU
HRNet-W48trainval4000080.0579.80
HRNet-W48trainval4000080.0779.59
HRNet-W48trainval4000080.1080.18
HRNet-W48trainval4000080.2080.01
HRNet-W48trainval4000080.3079.27
HRNet-W48trainval4000080.4079.40

t-SNE Visualization

<p align="center"> <img src="figures/tsne1.png" width="400"> </p> <p align="center"> <img src="figures/tsne2.png" width="400"> </p>

Citation

@inproceedings{Wang_2021_ICCV,
    author    = {Wang, Wenguan and Zhou, Tianfei and Yu, Fisher and Dai, Jifeng and Konukoglu, Ender and Van Gool, Luc},
    title     = {Exploring Cross-Image Pixel Contrast for Semantic Segmentation},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    year      = {2021},
    pages     = {7303-7313}
}