NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Pixel Contrastive-Consistent Semi-Supervised Semantic Segmentation

Yuanyi Zhong, Bodi Yuan, Hong Wu, Zhiqiang Yuan, Jian Peng, Yu-Xiong Wang

Introduction

Semantic segmentation models typically require extensive pixel-level annotations, which are costly and time-consuming to produce. Semi-supervised learning (SSL) offers a solution by leveraging a small amount of labeled data alongside a larger pool of unlabeled images. Traditional SSL methods often rely on consistency regularization in the label space, ensuring that predictions remain stable under image augmentations. However, PC²Seg introduces a novel approach by jointly optimizing for both label-space consistency and feature-space contrastive learning.

Conceptual overview of PC²Seg optimizing across image, feature, and label spaces.

Methodology

The PC²Seg framework utilizes a dual-branch Siamese network architecture to process unlabeled data. The model generates two distinct versions of the same image: a weakly augmented view (e.g., simple crops and flips) and a strongly augmented view (e.g., heavy color jittering and distortion). Both views are passed through a shared Fully Convolutional Network (FCN) backbone. The high-dimensional features from the backbone are then processed by a decoder for label-space predictions and a projector for low-dimensional feature-space contrastive learning.

The PC²Seg architecture featuring labeled and unlabeled data branches with integrated consistency and contrastive losses.

Dual-Space Optimization

The model is trained using three primary loss functions designed to harmonize internal representations and final outputs:

  1. Supervised Loss: Applied to the labeled data branch using standard ground-truth masks to provide baseline semantic guidance.
  2. Label-Space Consistency Loss: This $\ell_2$ loss forces the predicted mask for a strongly augmented image to match the "pseudo-labels" generated from its weakly augmented counterpart. This ensures the model's output is invariant to non-semantic perturbations.
  3. Feature-Space Contrastive Loss: This is the core innovation of the framework. It encourages the model to group similar pixel representations together while pushing dissimilar ones apart. By pulling an "anchor" pixel toward its positive pair (the same pixel in a different augmentation) and repelling it from negative samples, the model learns more discriminative internal features. The authors found that applying this loss to the last layer of the backbone (e.g., Conv5 in ResNet) yields the best results.

Strategic Negative Sampling

To manage the computational complexity of pixel-level contrastive learning—which is naturally $O(N^2)$—PC²Seg employs efficient negative sampling. The authors found that comparing an anchor to just 200 well-chosen negative pixels is sufficient. The most effective strategy combines "Different Image" sampling with "Pseudo-Label Debiasing." This approach draws negatives from different images and uses current model predictions to filter out "false negatives"—pixels that might actually belong to the same semantic category as the anchor.

Experimental Results

PC²Seg was evaluated on PASCAL VOC 2012, Cityscapes, and COCO benchmarks, demonstrating state-of-the-art performance, particularly in extremely low-data regimes.

  • PASCAL VOC: In the 1/16 split (only 92 labeled images), PC²Seg achieved 57.00% mIoU, a significant improvement over the supervised baseline of 40.02%.
  • Cityscapes: On the 1/8 split, the model reached 72.29% mIoU, nearly matching the performance of models trained on significantly more data.
  • COCO: The method showed strong scalability, outperforming previous SSL methods like PseudoSeg as dataset complexity increased.

Qualitative analysis indicates that PC²Seg produces cleaner object boundaries and more complete object masks compared to methods relying solely on consistency regularization.

Limitations and Future Work

While highly effective, the contrastive branch increases training time, roughly doubling it compared to a simple supervised baseline. Additionally, the framework requires careful balancing of the consistency loss ($\lambda_1$) and contrastive loss ($\lambda_2$), which may vary by dataset. Future work may explore more sophisticated "hard" negative selection and extending the pixel-contrastive approach to other dense prediction tasks like depth estimation or instance segmentation.

Conclusion

PC²Seg demonstrates that combining label-space consistency with feature-space contrastive learning creates a powerful synergy for semi-supervised semantic segmentation. By sharpening feature boundaries and enforcing prediction stability, the framework achieves significant gains in accuracy and robustness. The introduction of efficient, debiased negative sampling makes pixel-level contrastive learning feasible for dense prediction tasks, setting a new standard for low-data semantic segmentation.

Summary updated

BibTeX
@inproceedings{zhong2021pixel,
  author = {Yuanyi Zhong and Bodi Yuan and Hong Wu and Zhiqiang Yuan and Jian Peng and Yu-Xiong Wang},
  title = {{Pixel Contrastive-Consistent Semi-Supervised Semantic Segmentation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.00718},
}
Figure