Boosting Unsupervised Semantic Segmentation with Principal Mask Proposals

Oliver Hahn, Nikita Araslanov, Simone Schaub-Meyer, Stefan Roth

Abstract

Unsupervised semantic segmentation aims to automatically partition images into semantically meaningful regions by identifying global semantic categories within an image corpus without any form of annotation. Building upon recent advances in self-supervised representation learning, we focus on how to leverage these large pre-trained models for the downstream task of unsupervised segmentation. We present PriMaPs – Principal Mask Proposals – decomposing images into semantically meaningful masks based on their feature representation. This allows us to realize unsupervised semantic segmentation by fitting class prototypes to PriMaPs with a stochastic expectation-maximization algorithm, PriMaPs-EM. Despite its conceptual simplicity, PriMaPs-EM leads to competitive results across various pre-trained backbone models, including DINO and DINOv2, and across different datasets, such as Cityscapes, COCO-Stuff, and Potsdam-3. Importantly, PriMaPs-EM is able to boost results when applied orthogonally to current state-of-the-art unsupervised semantic segmentation pipelines.

Introduction

Semantic segmentation—the task of assigning a category label to every pixel in an image—is traditionally a supervised learning challenge requiring massive amounts of annotated data. Labeling a single high-resolution image for tasks like urban driving can take a human expert up to 90 minutes. Unsupervised Semantic Segmentation (USS) seeks to bypass this bottleneck by discovering categories automatically across a dataset.

However, USS is notoriously difficult because "meaningful" boundaries are often subjective and ambiguous. While recent advances in Self-Supervised Learning (SSL), such as DINO, provide excellent feature representations, most current USS methods treat these features merely as a starting point to learn additional complex embeddings. This research introduces PriMaPs (Principal Mask Proposals), a method that directly exploits the geometry and statistics inherent in pre-trained SSL features to achieve competitive segmentation results with minimal overhead.

The PriMaPs Framework

The proposed approach consists of two main stages: local mask generation via PriMaPs and global consistency refinement via PriMaPs-EM.

1. Principal Mask Proposals (PriMaPs)

Instead of relying on complex clustering heads, PriMaPs utilizes Principal Component Analysis (PCA) on the dense features of a single image. The core observation is that the first principal component—the direction of maximum variance—often corresponds to a dominant semantic object in the scene.

To improve localization, the method employs Nearest-Neighbor Anchoring: it identifies the actual image feature most similar to the principal component and uses it as a "seed" to generate a similarity map. This process is iterative: once a mask is identified, those features are "masked out," and the process repeats until 95% of the image is covered. Finally, a Conditional Random Field (CRF) is applied as a post-processing step to align these masks with actual image edges.

Overview of the PriMaPs pipeline: from raw image to iterative mask proposals and final pseudo-labeling across diverse datasets.

2. Global Consistency with PriMaPs-EM

To ensure that semantic categories (e.g., "car" or "sheep") are labeled consistently across the entire dataset, the authors introduce a stochastic Expectation-Maximization (EM) algorithm.

  • E-step: Assign the generated mask proposals to global "class prototypes" based on current model predictions.
  • M-step: Update the class prototypes to better fit the features within those masks using a focal loss and an Exponential Moving Average (EMA) to maintain training stability.

Experimental Evaluation

The method was evaluated on three diverse benchmarks: Cityscapes (urban street scenes), COCO-Stuff (everyday objects and backgrounds), and Potsdam-3 (aerial imagery). Frozen backbones from DINO and DINOv2 (ViT-Small and ViT-Base) were used for all experiments.

Key Results and Insights

  • Performance Gains: On Cityscapes, PriMaPs-EM improved the DINO ViT-S/8 baseline from 15.8% to 19.4% mIoU.
  • Orthogonality and Synergy: A key advantage of PriMaPs-EM is its "orthogonality" to existing methods. It can be layered on top of state-of-the-art pipelines like STEGO or HP to further improve their results. For instance, on COCO-Stuff, it pushed STEGO's mIoU from 28.2% to 29.7%.
  • Efficiency: Fitting class prototypes with PriMaPs-EM is highly efficient, taking approximately 2 hours on a single NVIDIA A6000 GPU for the Cityscapes dataset, compared to the days required by many competing unsupervised methods.
  • Robustness: Simple linear tools like PCA, when applied to high-quality SSL features, naturally extract semantic objects, proving that complex non-linear clustering heads are not always necessary.

Conclusion and Future Work

PriMaPs-EM demonstrates that leveraging the intrinsic structure of SSL features through simple statistical methods can yield state-of-the-art unsupervised segmentation. While the method is robust across domains, it faces limitations due to the patch size of underlying Vision Transformers, which can hinder the segmentation of very fine structures. Additionally, distinguishing between visually similar classes (e.g., "truck" vs. "bus") remains a challenge. Future work may explore automated class discovery to remove the need for pre-specifying the number of categories.

Code is available at https://github.com/visinf/primaps.

Summary updated

BibTeX
@article{hahn2024boosting,
  author = {Oliver Hahn and Nikita Araslanov and Simone Schaub-Meyer and Stefan Roth},
  title = {{Boosting Unsupervised Semantic Segmentation with Principal Mask Proposals}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=UawaTQzfwy},
}
Figure