Region-level Contrastive and Consistency Learning for Semi-Supervised Semantic Segmentation

Jianrong Zhang, Tianyi Wu, Chuanghao Ding, Hongwei Zhao, Guodong Guo

Introduction

Semantic segmentation is a fundamental task in computer vision, requiring the assignment of a categorical label to every pixel in an image. While deep learning has achieved remarkable success in this domain, the performance of these models typically hinges on the availability of massive, pixel-perfect labeled datasets. Semi-supervised learning (SSL) offers a solution by leveraging a small set of labeled data alongside a much larger pool of unlabeled images.

Traditionally, SSL methods for segmentation have focused on pixel-level regularization. These approaches typically enforce consistency between predictions of the same pixel under different augmentations or use pixel-wise contrastive learning. However, pixel-level methods face two significant hurdles: sensitivity to prediction noise (where a single misclassified pixel in a pseudo-label propagates error) and high computational complexity, as contrastive learning scales quadratically with the number of pixels. To address these issues, this paper introduces Region-level Contrastive and Consistency Learning ($RC^2L$), a framework that shifts the focus from individual pixels to robust image regions.

The $RC^2L$ Framework

$RC^2L$ moves away from the traditional per-pixel classification paradigm, instead adopting a mask-based classification approach inspired by architectures like MaskFormer. By treating an image as a collection of segments or "regions," the model becomes significantly more resilient to noise and more computationally efficient.

Student-Teacher Architecture

The framework utilizes a standard Student-Teacher setup. The teacher model generates "pseudo-labels" from weakly augmented unlabeled images. These labels then guide the student model as it processes strongly augmented versions of the same images. The innovation lies in how the student is supervised through four distinct region-level loss functions:

  1. Region Mask Contrastive (RMC) Loss: This loss ensures that the spatial shape of a predicted region in the student model aligns with the corresponding region in the teacher model, while simultaneously pushing it away from unrelated regions in the embedding space.
  2. Region Feature Contrastive (RFC) Loss: While RMC focuses on shapes, RFC focuses on the mathematical representations (embeddings) of the regions, ensuring that regions of the same class across different images are clustered together.
  3. Region Class Consistency (RCC) Loss: This loss enforces that the student predicts the same semantic category for a specific region as identified by the teacher.
  4. Semantic Mask Consistency (SMC) Loss: This "global" loss merges all regions belonging to the same class into a single unified mask. By enforcing consistency on these unified shapes, the model learns to produce more coherent global structures.

Experimental Setup

The researchers evaluated $RC^2L$ on two primary benchmarks:

  • PASCAL VOC 2012: A standard object-centric dataset featuring 21 classes. Tests were conducted on both the original set and the augmented version (VOC Aug) containing over 10,000 images.
  • Cityscapes: A dataset focused on complex urban street scenes with high-resolution images and 19 classes.

The model was tested across various data "splits," simulating scenarios where only 1/2, 1/4, or 1/8 of the labeled data is available.

Key Insights and Results

Robustness and Efficiency

The shift to region-level learning provides two major advantages. First, it offers noise tolerance: a few misclassified pixels within a large region do not significantly alter the region's overall feature vector or mask, preventing the error propagation common in pixel-level methods. Second, it provides computational efficiency: by representing an image as a small set of $N$ queries (e.g., 100 regions) rather than hundreds of thousands of pixels, the contrastive learning step becomes computationally trivial ($O(N^2)$ where $N$ is small).

Performance Benchmarks

$RC^2L$ consistently outperformed previous state-of-the-art methods. On the PASCAL VOC 1.4k labeled split, the model achieved a mean Intersection over Union (mIoU) of 79.33%, representing a +5.18% improvement over the previous leading method, $PC^2Seg$. On Cityscapes, the model improved the supervised baseline by approximately 2.5% in low-data regimes, demonstrating its effectiveness in complex environments.

Ablation Studies

Ablation experiments highlighted the importance of the Semantic Mask Consistency (SMC) loss. Adding SMC alone improved the baseline performance by nearly 4%, confirming that enforcing consistency on the global shape of object classes is a highly effective regularization strategy.

Conclusion and Future Work

$RC^2L$ demonstrates that region-level analysis is a superior alternative to pixel-level methods for semi-supervised semantic segmentation. By focusing on masks and region embeddings, the framework achieves state-of-the-art results with greater efficiency and noise resilience.

However, some challenges remain. The model's performance is sensitive to the number of "queries" (the maximum number of regions it can identify), and it can struggle with very small objects that do not easily form distinct regions. Future research may focus on automatically optimizing query counts and adapting these region-level losses to traditional U-Net style architectures.

Summary updated

BibTeX
@inproceedings{zhang2022region,
  author = {Jianrong Zhang and Tianyi Wu and Chuanghao Ding and Hongwei Zhao and Guodong Guo},
  title = {{Region-level Contrastive and Consistency Learning for Semi-Supervised Semantic Segmentation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/226},
}
Figure