Introduction
Few-shot instance segmentation (FSIS) aims to segment novel object categories using only a few annotated examples ($K$-shots). This is a critical task because pixel-level annotations are expensive and labor-intensive to acquire at scale. Traditionally, FSIS methods have relied on prototype learning, or "point estimation." In this paradigm, a model averages features from $K$-shot support examples into a single "prototype" vector, which then guides the segmentation of a query image.
However, a single vector is often insufficient to capture the complex, high-dimensional distribution of an object's possible masks, which can vary significantly due to pose, occlusion, and boundary variations. Furthermore, many existing methods utilize class-agnostic mask predictors, failing to leverage category-specific features that could improve accuracy.
The MaskDiff Approach
To address these limitations, this paper introduces MaskDiff, a novel framework that treats mask generation as a probabilistic distribution problem rather than a simple matching task. MaskDiff models the underlying conditional distribution of binary masks using a Diffusion Probabilistic Model (DPM).
Conditional Diffusion for Mask Generation
Instead of a standard fully convolutional network (FCN) mask head, MaskDiff employs a UNet-based diffusion model. It learns to reverse a Markov chain of Gaussian noise back into a clean binary mask. This reverse process is conditioned on the cropped RGB object region and the $K$-shot support samples, allowing the model to generate high-fidelity masks that account for the inherent variance in object appearance.
Classifier-Free Guided Mask Sampling
To ensure the generated masks are category-aware, MaskDiff leverages the off-the-shelf cosine classifier from the object detector's bounding box head. By applying classifier-free guidance during the diffusion sampling process, the model is explicitly steered to generate masks that align with the predicted object class, enhancing both accuracy and stability.
Two-Stage Training Pipeline
MaskDiff follows a structured two-stage training approach:
- Stage I: Base Training: The object detector and the diffusion mask head are trained separately on large-scale datasets with abundant base classes.
- Stage II: Few-Shot Fine-Tuning: The feature extractor is frozen, while the classification, bounding box, and diffusion mask heads are jointly fine-tuned on a balanced dataset containing both base and novel class examples.
Experimental Results
The authors evaluated MaskDiff on standard benchmarks including MS COCO and PASCAL VOC.
Performance Benchmarks
MaskDiff consistently outperforms state-of-the-art methods like iFS-RCNN and iMTFA:
- COCO-Novel (10-shot): MaskDiff achieves 21.58 AP for segmentation, surpassing iFS-RCNN's 20.61 AP.
- COCO-All (10-shot): It reaches 38.55 AP, a significant improvement over previous benchmarks.
- Cross-Dataset Generalization: In a challenging 1-shot setting (trained on COCO, evaluated on VOC), MaskDiff achieves 37.59 AP, vastly outperforming iMTFA (16.32 AP).
Stability and Detail Preservation
A key advantage of MaskDiff is its stability. Across multiple runs with different random seeds, it exhibited very low standard deviation (e.g., $\pm 0.09$ AP on COCO-All 1-shot). Additionally, by avoiding traditional pooling operations like RoIAlign and instead feeding cropped RGB regions directly into the UNet, MaskDiff preserves fine-grained spatial details, leading to superior performance at strict IoU thresholds.
Conclusion and Future Work
MaskDiff demonstrates that modeling the full distribution of masks via diffusion is far more robust than relying on single prototype vectors. While the iterative nature of diffusion models introduces some computational overhead (8.27 FPS vs. ~10-12 FPS for baselines), the gains in accuracy and stability are substantial. Future research may focus on accelerating the diffusion sampling process to enable real-time applications without sacrificing the model's generative power.
Summary updated