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

Learning Neural Eigenfunctions for Unsupervised Semantic Segmentation

Zhijie Deng, Yucen LuoICCV 2023

Abstract

Unsupervised semantic segmentation is a long-standing challenge in computer vision with great significance. Spectral clustering is a theoretically grounded solution to it where the spectral embeddings for pixels are computed to construct distinct clusters. Despite recent progress in enhancing spectral clustering with powerful pre-trained models, current approaches still suffer from inefficiencies in spectral decomposition and inflexibility in applying them to the test data. This work addresses these issues by casting spectral clustering as a parametric approach that employs neural network-based eigenfunctions to produce spectral embeddings. The outputs of the neural eigenfunctions are further restricted to discrete vectors that indicate clustering assignments directly. As a result, an end-to-end NN-based paradigm of spectral clustering emerges. In practice, the neural eigenfunctions are lightweight and take the features from pre-trained models as inputs, improving training efficiency and unleashing the potential of pre-trained models for dense prediction. We conduct extensive empirical studies to validate the effectiveness of our approach and observe significant performance gains over competitive baselines on Pascal Context, Cityscapes, and ADE20K benchmarks.

Introduction

Semantic segmentation—labeling every pixel in an image—usually requires massive amounts of human-annotated data. Unsupervised methods try to bypass this, but they often struggle with complex scenes. This paper looks back at spectral clustering, a classic "graph-cut" approach that groups pixels based on similarity. While mathematically elegant, traditional spectral clustering has three major flaws in the modern era:

  1. Semantic Blindness: Traditionally, it uses raw pixel colors, which don't capture high-level "meaning."
  2. Computational Cost: It requires solving a massive eigenvalue problem (spectral decomposition) for every image, which is incredibly slow.
  3. Transductive Nature: It only works on the data it's currently looking at, making it difficult to apply to new, unseen test images without re-running the optimization.

Methodology

The researchers propose a parametric version of spectral clustering. Instead of calculating eigenvectors for a specific matrix, they train a lightweight neural network to approximate the eigenfunctions of a graph kernel.

Overview of the proposed neural eigenfunction framework for unsupervised segmentation.

Key components include:

  • The Dual-Graph Kernel: They build a connectivity graph that combines high-level semantic features (from a frozen, pre-trained Vision Transformer) with low-level spatial details (from raw pixels). This ensures the model respects both object boundaries and category-level similarities.
  • NeuralEF (Neural Eigenfunctions): They use a specific objective function that forces the neural network to output the principal eigenfunctions of the graph. This turns a "matrix math" problem into a "gradient descent" problem.
  • End-to-End Quantization: To avoid a separate K-means clustering step at the end, they use the Gumbel-Softmax estimator. This constrains the network to output discrete cluster assignments directly during training.
  • Efficiency: Because the neural eigenfunctions are lightweight and the backbone (ViT) is frozen, the training is efficient and the inference is a simple forward pass.

Results and Discussion

The proposed method achieves a new state-of-the-art for unsupervised semantic segmentation across major benchmarks:

  • Pascal Context: Achieved 39.6% mIoU, a massive jump over previous leaders like MaskCLIP (25.5%) and ReCo (27.2%).
  • Cityscapes: Reached 30.7% mIoU, significantly outperforming ReCo+ (24.2%).
Qualitative comparison of segmentation results against K-means and Ground Truth.

Key Insights

  • From Matrices to Functions: Moving from eigenvectors (fixed values for a fixed set of pixels) to eigenfunctions (a general rule that can be applied to any pixel) allows the model to generalize to new images instantly.
  • Unleashing Pre-trained Models: The paper shows that "frozen" features from models like ViT already contain nearly all the information needed for segmentation; the spectral pipeline acts as the right mathematical tool to organize them.
  • Symmetry Breaking: Learning multiple eigenfunctions is tricky because the network might learn redundant information. The authors use a specific "stop-gradient" trick to force the network to learn distinct, ordered eigenfunctions.

Conclusion

This work transforms the classic technique of spectral clustering into a modern, scalable deep learning pipeline. By replacing expensive matrix decompositions with neural eigenfunctions, the authors create an end-to-end unsupervised segmentation model that is faster and generalizes to new images instantly. While the method still requires a small amount of labeled data for final category matching and faces challenges with high-granularity datasets like ADE20K, it represents a significant step forward in unsupervised dense prediction.

Summary updated

BibTeX
@inproceedings{deng2023learning,
  author = {Zhijie Deng and Yucen Luo},
  title = {{Learning Neural Eigenfunctions for Unsupervised Semantic Segmentation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=Dv5Rvw3mbZ0},
}
Figure