[CVPR 2021] Semi-Supervised Semantic Segmentation with Cross Pseudo Supervision

Overview

TorchSemiSeg


[CVPR 2021] Semi-Supervised Semantic Segmentation with Cross Pseudo Supervision

by Xiaokang Chen1, Yuhui Yuan2, Gang Zeng1, Jingdong Wang2.

1 Key Laboratory of Machine Perception (MOE), Peking University 2 Microsoft Research Asia.

[Poster] [Video (YouTube)]

Simpler Is Better !


News

  • [June 3 2021] Please check our paper in Arxiv. Data and code have been released.

Installation

Please refer to the Installation document.

Getting Started

Please follow the Getting Started document.

Citation

Please consider citing this project in your publications if it helps your research.

@inproceedings{chen2021-CPS,
  title={Semi-Supervised Semantic Segmentation with Cross Pseudo Supervision},
  author={Chen, Xiaokang and Yuan, Yuhui and Zeng, Gang and Wang, Jingdong},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2021}
}

TODO

  • Dataset release
  • Code for CPS + CutMix
  • Code for Cityscapes dataset
  • Other SOTA semi-supervised segmentation methods
Comments
  • About the performance of 1/8 labels.

    About the performance of 1/8 labels.

    I follow the default setting of codes and obtained 71.687% mIoU when training with 1/8 labels on pascal voc,but this paper reported 73.67% mIoU. Why the performance gap so huge, and anyone can tell me how to improve this code? Thanks very much!

    opened by yh-pengtu 10
  • About ohem loss

    About ohem loss

    Hi, Xiaokang, Thanks for sharing so solid work! I noticed that the loss in supervised learning is ohem loss. Have you ever done the experiments for ce loss and how about the result?

    opened by jinhuan-hit 7
  • Reproduce the results with a newer version of pytorch

    Reproduce the results with a newer version of pytorch

    When I use pytorch 1.0, apex DDP will automatically exit without error message, so I try to run this code with pytorch 1.8.1. However I got similar results reported in #14 (72.0±0.2 mIU for cps, 1/8 voc r50 setting), can anyone figure out the possible reason that causes the performance decay? @yh-pengtu, @frank-xwang

    opened by lliuz 6
  • Parameter Initialization for Mean Teacher

    Parameter Initialization for Mean Teacher

    Thanks for sharing this excellent work!

    I have a question for the parameter initialization in this Teacher-Student paradigm:

    • At the very beginning of training, the parameters for the Teacher net are initialized by that of the Student net, as in https://github.com/charlesCXK/TorchSemiSeg/blob/main/exp.voc/voc8.res50v3%2B.MeanTeacher/network.py#L30.
    • Under this case, will the copy destroy the original setting? The parameters (of the semantic segmentation head) for the Teacher and Student are initialized differently as you said, but they are now unified by param_t.data.copy_(param_s.data).

    Looking forward to your clarification! Thank you

    opened by ldkong1205 5
  • some confusion of iters setting.

    some confusion of iters setting.

    Hi.According to the Getting Started.md, there is different epochs for different label ratio. but i'm confused about the setting's meaning. if i'm right, here you only need to specify the total iters.It is not necessary to calculate the epoch corresponding to different label ratio?

    If I want to train supervised baseline, does it mean that if my total iters are 40k and the label ratio is 0.125, then I need to do 40k iterations(maybe batch size is 8) on this 0.125*10852 labeled images only? But if i use semi supervised method, one iteration means fetching the labeled data once and fetching the unlabeled data once?

    Hope to receive your reply. very thanks.

    best,

    opened by CuberrChen 5
  • How can I disable BatchNormalization layer?

    How can I disable BatchNormalization layer?

    Hi again, I have more question about BN layer.

    I want to disable batchnormalization layer, so I tried to change model status from model.train() to model.eval() in train.py. (And also tried replacing BatchNorm layer with Identity layer but same error occurred)

    The train script occurred this error: """ ValueError: Expected input batch_size (21) to match target batch_size (2). """

    How can I disable the BN layer? Thank you!

    opened by JihwanEom 5
  • questions about the results

    questions about the results

    Hi! I want to know that how do you get the result. For Pascal VOC 2012,labeled ratio is 1/8,epochs is 34,Performing it for three times and getting the average of the last epoch i.e 33 epoch OR Performing it only once and getting the max result of 20 epoch to 33 epoch ?

    opened by ruichen0319 4
  • The performance of default voc8.res50v3+.CPS

    The performance of default voc8.res50v3+.CPS

    thank you for release the code. we run the default config as your public in voc8.res50v3+.CPS, the best performance is 72.76, a little lower than the 73.20 in paper. have any other tricks? the default epoch is 34, the paper is 60? but your released log, 73.28 is also use 34 epoch.

    opened by yangkai798 4
  • overlap in you supervised and unsupervised data-set, for few supervision data

    overlap in you supervised and unsupervised data-set, for few supervision data

    In you few-supervise setting, which is in here which seems is labeled data but over lap with here.

    Also, in you 1/8 ratio, labeled with unlabeled

    in you 1/4 ratio, labeled with unlabeled,

    in you 1/2 ratio, https://github.com/charlesCXK/TorchSemiSeg/blob/bab3a31ef7a5b59b932820b4d5d93a1b8bfc41ec/DATA/pascal_voc/subset_train_aug/pseudoseg_labeled_1-2.txt#L732 and https://github.com/charlesCXK/TorchSemiSeg/blob/bab3a31ef7a5b59b932820b4d5d93a1b8bfc41ec/DATA/pascal_voc/subset_train_aug/pseudoseg_unlabeled_1-2.txt#L321.

    In each ratio, there is one overlap, and I suspect it should be a mis-operation.

    opened by ghost 4
  • About number of epochs/iters

    About number of epochs/iters

    Hi @charlesCXK, I was reading your paper and code, and I got a question concerning the numbers of epochs (max number of iters), did you choose it arbitrary ? Or do you take the fully supervised number of iters from deeplabv3+ as a starting point and adapt it to the various splits ?

    I hope my question is clear :)

    opened by PLoic 4
  • configs for resnet101

    configs for resnet101

    Hi,

    Thank you for the sharing and excellent work. I have run the code for resnet50 but I fail to find the configs for resnet101, would you like to share them?

    Besides, I notice there are some tiny changes in the resnet50 and ASPP. Is there any reason? and how to get the pre-trained model trained on ImageNet? (I mean using standard supervised learning or self-supervised learning?)

    Besides, I try to download the city.zip and unzip it. But I fail to unzip it. So would you like to have a check?

    By the way, thank you for your code, it is very helpful.

    Best regards, Yuhang

    opened by dyh127 3
  • Questions related to Cut-Mix.

    Questions related to Cut-Mix.

    First of all, please understand that I am asking you a similar question.

    in your code ( https://github.com/charlesCXK/TorchSemiSeg/blob/main/exp.voc/voc8.res50v3%2B.CPS%2BCutMix/train.py ) and my previous question, ( https://github.com/charlesCXK/TorchSemiSeg/issues/60 )

    I double-checked it several times, but DistributedSampler returns the same order of images in the same rank. ( DistributedSampler : shuffle=True , DataLoader : shuffle=False ) That is, since unsuperviced_train_loader_0 and unsuperviced_train_loader_1 use the same rank, the same image is called. (However, it is slightly different due to randomness of image augmentation)

    Also, if you look at the shuffle condition code in the class DistributedSampler at the URL below, it is set to "g.manual_seed(self.seed + self.epoch)" . ( https://pytorch.org/docs/stable/_modules/torch/utils/data/distributed.html#DistributedSampler ) Therefore, each sampler is shuffled with "seed+epoch". -> each sampler is shuffled with seed+epoch, and your seed=0 (default) so the same image file is used for each epoch. (if same rank)

    I think both unsuperviced_train_loader_0 and unsuperviced_train_loader_1 seeds should be different to mix different images using your code. ( i.e., unsuperviced_train_loader_0(train_dataset,seed=10+engine.local_rank) , unsuperviced_train_loader_0(train_dataset,seed=20+engine.local_rank) )

    Like other recent studies, (i.e., PSMT cut-mix : https://github.com/yyliu01/PS-MT/blob/main/VocCode/train.py#L83 or U2PL cut-mix : https://github.com/Haochen-Wang409/U2PL/blob/b818f01c9c11cf6ebfb9fe4d679d2901eefa3f3c/u2pl/dataset/augmentation.py#L498 ) I think each should be mixed within the batch image.

    I have checked several times, but unsuperviced_train_loader_0 and unsuperviced_train_loader_1 output the same image file within the same rank. Therefore, I think your code is mixed with the same image.

    If I'm mistaken, I'd appreciate it if you let me know. Thank you!

    opened by DeepHM 0
  • About the cps_weight with different labeled_ratio

    About the cps_weight with different labeled_ratio

    Hi! a nice work! But I get some trouble when I try different label_ratio setting. The performance of the 1/4 is lower than the 1/8. Whether it should be smaller cps_weight with higher labeled_ratio? Any hint will be appreciate!

    opened by mai556 0
  • a question about CPC you mentioned in your paper

    a question about CPC you mentioned in your paper

    Hi, a nice work! However, I have a question about CPC(Cross probability consistency). image The results of the first and second calculations should be the same. Why should you keep the two?

    Thanks.

    opened by ql1074754250 1
  • About the explaination of Single-network pseudo supervision

    About the explaination of Single-network pseudo supervision

    Hi, there. Thanks for your paper, it's very inspiring! And I have a question to ask you, in Discussion you mentioned that the empirical results performs poorly in single-network pseudo supervision, for the network may tends to learn the wrong direction, but for multi-network, might play the regularizer for each other to prevent from going worst.

    But now, for regularization consisitency, some paper proposed like Fixmatch, for the X is differently augmented( one is weak and one is strong) and hope the results keep consistent. And it worked. image

    What's the difference of the single-network mode and FixMatch? Just the augmentation way? Will the augmentation strength plays the main role in here?

    Thanks a lot!

    opened by DISAPPEARED13 0
  • Pseudo labeling question

    Pseudo labeling question

    As I looked at your code, "model.eval()" is not used. (Instead, "torch.no_grad()" is used) ( ex. https://github.com/charlesCXK/TorchSemiSeg/blob/main/exp.voc/voc8.res50v3%2B.CPS%2BCutMix/train.py

    line 209~219 )

    However, I found that when each model generates a pseudo-label as a prediction, the accuracy of the pseudo-label is much higher when using "model.eval()" than when using "torch.no_grad()" .

    Is this part okay? Or is the author's other intentions?

    Thank you!

    opened by DeepHM 2
Owner
Chen XiaoKang
Master student at Peking University, Computer Vision Explorer
Chen XiaoKang
Learning Pixel-level Semantic Affinity with Image-level Supervision for Weakly Supervised Semantic Segmentation, CVPR 2018

Learning Pixel-level Semantic Affinity with Image-level Supervision This code is deprecated. Please see https://github.com/jiwoon-ahn/irn instead. Int

Jiwoon Ahn 337 Dec 15, 2022
Prototypical Pseudo Label Denoising and Target Structure Learning for Domain Adaptive Semantic Segmentation (CVPR 2021)

Prototypical Pseudo Label Denoising and Target Structure Learning for Domain Adaptive Semantic Segmentation (CVPR 2021, official Pytorch implementatio

Microsoft 247 Dec 25, 2022
Mixup for Supervision, Semi- and Self-Supervision Learning Toolbox and Benchmark

OpenSelfSup News Downstream tasks now support more methods(Mask RCNN-FPN, RetinaNet, Keypoints RCNN) and more datasets(Cityscapes). 'GaussianBlur' is

AI Lab, Westlake University 332 Jan 3, 2023
Semi-supervised Semantic Segmentation with Directional Context-aware Consistency (CVPR 2021)

Semi-supervised Semantic Segmentation with Directional Context-aware Consistency (CAC) Xin Lai*, Zhuotao Tian*, Li Jiang, Shu Liu, Hengshuang Zhao, Li

Jia Research Lab 137 Dec 14, 2022
Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation (CVPR 2021)

Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation Input Image Initial CAM Successive Maps with adversar

Jungbeom Lee 110 Dec 7, 2022
Semi-supervised Semantic Segmentation with Directional Context-aware Consistency (CVPR 2021)

Semi-supervised Semantic Segmentation with Directional Context-aware Consistency (CAC) Xin Lai*, Zhuotao Tian*, Li Jiang, Shu Liu, Hengshuang Zhao, Li

DV Lab 137 Dec 14, 2022
git《Pseudo-ISP: Learning Pseudo In-camera Signal Processing Pipeline from A Color Image Denoiser》(2021) GitHub: [fig5]

Pseudo-ISP: Learning Pseudo In-camera Signal Processing Pipeline from A Color Image Denoiser Abstract The success of deep denoisers on real-world colo

Yue Cao 51 Nov 22, 2022
DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision

The Official PyTorch Implementation of DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision

Shiyi Lan 3 Oct 15, 2021
The PyTorch implementation of DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision.

DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision The PyTorch implementation of DiscoBox: Weakly Supe

Shiyi Lan 1 Oct 23, 2021
[ICCV 2021] A Simple Baseline for Semi-supervised Semantic Segmentation with Strong Data Augmentation

[ICCV 2021] A Simple Baseline for Semi-supervised Semantic Segmentation with Strong Data Augmentation

CodingMan 45 Dec 12, 2022
[CVPR 2021] MiVOS - Mask Propagation module. Reproduced STM (and better) with training code :star2:. Semi-supervised video object segmentation evaluation.

MiVOS (CVPR 2021) - Mask Propagation Ho Kei Cheng, Yu-Wing Tai, Chi-Keung Tang [arXiv] [Paper PDF] [Project Page] [Papers with Code] This repo impleme

Rex Cheng 106 Jan 3, 2023
An unofficial implementation of "Unpaired Image Super-Resolution using Pseudo-Supervision." CVPR2020

UnpairedSR An unofficial implementation of "Unpaired Image Super-Resolution using Pseudo-Supervision." CVPR2020 turn RCAN(modified) --> xmodel(xilinx

JiaKui Hu 10 Oct 28, 2022
Shape-aware Semi-supervised 3D Semantic Segmentation for Medical Images

SASSnet Code for paper: Shape-aware Semi-supervised 3D Semantic Segmentation for Medical Images(MICCAI 2020) Our code is origin from UA-MT You can fin

klein 125 Jan 3, 2023
ST++: Make Self-training Work Better for Semi-supervised Semantic Segmentation

ST++ This is the official PyTorch implementation of our paper: ST++: Make Self-training Work Better for Semi-supervised Semantic Segmentation. Lihe Ya

Lihe Yang 147 Jan 3, 2023
[cvpr22] Perturbed and Strict Mean Teachers for Semi-supervised Semantic Segmentation

PS-MT [cvpr22] Perturbed and Strict Mean Teachers for Semi-supervised Semantic Segmentation by Yuyuan Liu, Yu Tian, Yuanhong Chen, Fengbei Liu, Vasile

Yuyuan Liu 132 Jan 3, 2023
Learning trajectory representations using self-supervision and programmatic supervision.

Trajectory Embedding for Behavior Analysis (TREBA) Implementation from the paper: Jennifer J. Sun, Ann Kennedy, Eric Zhan, David J. Anderson, Yisong Y

null 58 Jan 6, 2023
Self-supervised Augmentation Consistency for Adapting Semantic Segmentation (CVPR 2021)

Self-supervised Augmentation Consistency for Adapting Semantic Segmentation This repository contains the official implementation of our paper: Self-su

Visual Inference Lab @TU Darmstadt 132 Dec 21, 2022
Code for the paper One Thing One Click: A Self-Training Approach for Weakly Supervised 3D Semantic Segmentation, CVPR 2021.

One Thing One Click One Thing One Click: A Self-Training Approach for Weakly Supervised 3D Semantic Segmentation (CVPR2021) Code for the paper One Thi

null 44 Dec 12, 2022
Semi-supervised Video Deraining with Dynamical Rain Generator (CVPR, 2021, Pytorch)

S2VD Semi-supervised Video Deraining with Dynamical Rain Generator (CVPR, 2021) Requirements and Dependencies Ubuntu 16.04, cuda 10.0 Python 3.6.10, P

Zongsheng Yue 53 Nov 23, 2022