Skip to content

Novel Class Discovery in Semantic Segmentation. CVPR 2022

Notifications You must be signed in to change notification settings


Repository files navigation

Novel Class Discovery in Semantic Segmentation

License PyTorch

This repository contains the official implementation of our paper:

Novel Class Discovery in Semantic Segmentation, CVPR 2022

Yuyang Zhao, Zhun Zhong, Nicu Sebe, Gim Hee Lee

Paper: ArXiv
Project Page: Website

Abstract: We introduce a new setting of Novel Class Discovery in Semantic Segmentation (NCDSS), which aims at segmenting unlabeled images containing new classes given prior knowledge from a labeled set of disjoint classes. In contrast to existing approaches that look at novel class discovery in image classification, we focus on the more challenging semantic segmentation. In NCDSS, we need to distinguish the objects and background, and to handle the existence of multiple classes within an image, which increases the difficulty in using the unlabeled data. To tackle this new setting, we leverage the labeled base data and a saliency model to coarsely cluster novel classes for model training in our basic framework. Additionally, we propose the Entropy-based Uncertainty Modeling and Self-training (EUMS) framework to overcome noisy pseudo-labels, further improving the model performance on the novel classes. Our EUMS utilizes an entropy ranking technique and a dynamic reassignment to distill clean labels, thereby making full use of the noisy data via self-supervised learning. We build the NCDSS benchmark on the PASCAL-5^i dataset and COCO-20^i dataset. Extensive experiments demonstrate the feasibility of the basic framework (achieving an average mIoU of 49.81% on PASCAL-5^i) and the effectiveness of EUMS framework (outperforming the basic framework by 9.28% mIoU on PASCAL-5^i).

Illustration of Novel Class Discovery in Semantic Segmentation (NCDSS).


  • [Jan 3 2023] πŸ”” Training and evaluation code for COCO-20i dataset is released.


  • Python = 3.7
  • Pytorch = 1.8.0
  • CUDA = 11.1
  • Install other packages in requirements.txt

Data preparation


We follow MaskContrast to prepare the data.

Download PASCAL VOC 2012. Unzip the dataset and ensure the file structure is as follows:

β”œβ”€β”€ images
β”œβ”€β”€ SegmentationClassAug
β”œβ”€β”€ saliency_supervised_model
└── sets


Download COCO 2014. Unzip the dataset and preprocess the dataset with the following command:

cd data/data_preprocess
python train2014
python val2014

Download the saliency maps from Google Drive. The saliency maps are estimated via BASNet. Specifically, we directly download the BASNet pre-trained model and inference on the COCO dataset.

The file structure is as follows:

β”œβ”€β”€ train2014
β”œβ”€β”€ val2014
β”œβ”€β”€ masks_train2014
β”œβ”€β”€ masks_val2014
β”œβ”€β”€ saliency_supervised_model
β”œβ”€β”€ val2014.txt
└── train2014.txt



You can download the pre-trained models in this paper from Google Drive. Then run the command.

sh scripts/


  • Base Training.

    sh scripts/
  • Clustering Pseudo-labeling.

    sh scripts/
  • Novel Fine-tuning.

    The pseudo-labels generated in the Clustering Pseudo-labeling stage is used for Novel Fine-tuning stage. To ensure the reproducibility, you can directly download our generated clustering pseudo-labels from Google Dive.

    • Basic framework.

      sh scripts/
    • Entropy ranking.

      sh scripts/

      The clean and unclean splits are also provided in Google Dive.

    • EUMS framework.

      sh scripts/


The training and evalution scripts for coco-20i dataset are available at:



This project is based on the following open-source projects. We thank their authors for making the source code publically available.


We hope you find our work useful. If you would like to acknowledge it in your project, please use the following citation:

title={Novel Class Discovery in Semantic Segmentation},
author={Zhao, Yuyang and Zhong, Zhun and Sebe, Nicu and Lee, Gim Hee},
booktitle={Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},

Contact me

If you have any questions about this code, please do not hesitate to contact me.

Yuyang Zhao


Novel Class Discovery in Semantic Segmentation. CVPR 2022







No releases published