Dense Gaussian Processes for Few-Shot Segmentation

Joakim Johnander, Johan Edstedt, Michael Felsberg, Fahad Shahbaz Khan, Martin Danelljan

Abstract

Few-shot segmentation (FSS) requires models to generalize to novel classes using only a handful of annotated examples. Traditional prototype-based methods often suffer from information loss due to feature averaging and lack a principled way to handle uncertainty. This paper introduces DGPNet, a framework that employs Dense Gaussian Processes (GPs) as a differentiable layer. By treating the mapping from features to masks as a non-parametric inference problem, DGPNet captures complex object appearances, scales effectively with additional support data, and provides uncertainty maps that guide a CNN decoder. Our approach achieves state-of-the-art results on PASCAL-5$^i$ and COCO-20$^i$, with particularly significant gains in multi-shot scenarios.

Introduction

The core challenge of Few-Shot Segmentation (FSS) is the "unseen class" problem. A model trained on dogs and cats must suddenly segment a chair or a car given only one (1-shot) or five (5-shot) examples. Most existing methods rely on "prototypes"—global average pooling of support features—to represent a class. However, this approach has significant drawbacks:

  1. Information Loss: Averaging masks fine-grained details and struggles with multi-modal appearances (e.g., a dog partially obscured by a fence).
  2. Poor Scalability: Performance often plateaus as more support examples are added because the bottleneck remains a single vector.
  3. Uncertainty Blindness: Models lack a mechanism to signal when a query image is significantly different from the support set.

Methods: The DGPNet Architecture

DGPNet addresses these issues by replacing simple feature matching with a Dense Gaussian Process (GP) learner. Unlike prototypes, GPs are non-parametric and retain all support data points, allowing for a more flexible, non-linear mapping from local deep features to mask values.

The DGPNet architecture uses a Dense GP layer to infer a function $f$ that predicts query masks and uncertainty maps.

Dense GP Layer and Mask Encoding

The GP learns a mapping from support features $\mathbf{x}_{\mathcal{S}}$ to encoded mask values $\mathbf{y}_{\mathcal{S}}$. To capture rich spatial information, a mask encoder projects support masks into a high-dimensional space. The GP then predicts these high-dimensional encodings for the query image, which are subsequently decoded into a final mask. The system is end-to-end trainable, allowing the feature extractors and the GP kernel to be optimized simultaneously.

Uncertainty-Aware Decoding

A unique advantage of the GP framework is its ability to provide a predictive variance (uncertainty). When a query pixel's features are far from the support set in the feature space, the GP signals high uncertainty. This uncertainty map, along with the predicted mean, is fed into a CNN decoder (U). This allows the decoder to rely on learned spatial priors or shallow image features in regions where the GP is less confident.

Experimental Results

DGPNet was evaluated on the standard PASCAL-5$^i$ and COCO-20$^i$ benchmarks. The results demonstrate that the non-parametric nature of GPs allows the model to benefit significantly from additional support examples.

Segmentation performance (mIoU) vs. number of support examples on PASCAL-5$^i$ and COCO-20$^i$. DGPNet shows superior scalability compared to previous state-of-the-art methods.

Key Findings

  • State-of-the-Art Performance: DGPNet sets new records across both datasets. On COCO-20$^i$ (5-shot, ResNet-101), it achieved an absolute gain of +8.4 mIoU over previous methods.
  • Scalability: While many models plateau after 1-shot, DGPNet shows a consistent upward trajectory in performance as the number of support images increases from 1 to 10. This suggests the GP is effectively "learning" more from the extra data.
  • Generalization: In cross-dataset tests (train on COCO, test on PASCAL), DGPNet outperformed the previous best method by 11.3 mIoU in the 5-shot setting, highlighting its robustness against dataset-specific biases.

Discussion and Conclusion

DGPNet demonstrates that non-parametric inference is a powerful tool for few-shot learning. By avoiding the "unimodality assumption" of prototypes and leveraging uncertainty as a feature, the model achieves superior generalization.

While the $O(N^3)$ complexity of GPs presents a computational challenge, the authors mitigate this through feature downsampling and efficient implementation (approx. 70ms for 5-shot on an A100). Future work may explore sparse GP approximations to further enhance efficiency for high-resolution tasks. Overall, DGPNet provides a principled, scalable, and uncertainty-aware foundation for the next generation of few-shot segmentation models.

Summary updated

BibTeX
@inproceedings{johnander2022dense,
  author = {Joakim Johnander and Johan Edstedt and Michael Felsberg and Fahad Shahbaz Khan and Martin Danelljan},
  title = {{Dense Gaussian Processes for Few-Shot Segmentation}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19818-2\_13},
}
Figure