Abstract
Training semantic segmentation models with few annotated samples has great potential in various real-world applications. For the few-shot segmentation task, the main challenge is how to accurately measure the semantic correspondence between the support and query samples with limited training data. To address this problem, we propose to aggregate the learnable covariance matrices with a deformable 4D Transformer to effectively predict the segmentation map. Specifically, in this work, we first devise a novel hard example mining mechanism to learn covariance kernels for the Gaussian process. The learned covariance kernel functions have great advantages over existing cosine similarity-based methods in correspondence measurement. Based on the learned covariance kernels, an efficient doubly deformable 4D Transformer module is designed to adaptively aggregate feature similarity maps into segmentation results. By combining these two designs, the proposed method can not only set new state-of-the-art performance on public benchmarks, but also converge extremely faster than existing methods. Experiments on three public datasets have demonstrated the effectiveness of our method.
Introduction
Few-shot segmentation (FSS) aims to segment specific objects in a query image using only a few annotated support examples. The core technical challenge lies in correspondence measurement: accurately identifying semantic similarities between the support and query features.
Traditional methods typically rely on a "cost volume"—a 4D tensor representing pixel-wise similarities. However, these methods often use fixed metrics like cosine similarity, which lack the flexibility to capture complex semantic relationships. Furthermore, processing these high-dimensional tensors with standard 4D convolutions is computationally expensive and often limited to local receptive fields, while global 4D Transformers suffer from high memory costs and slow convergence.
Proposed Method: DACM
The proposed framework, Doubly Deformable Aggregation of Covariance Matrices (DACM), introduces two primary innovations to overcome these limitations:
1. GP-based Kernel Learning with Hard Example Mining
Instead of a rigid similarity metric, DACM treats correspondence as a learning problem using a Gaussian Process (GP). A novel hard example mining mechanism identifies pixels likely to be misclassified during training, using them to refine the GP’s covariance kernels. This results in similarity maps (covariance matrices) that are significantly more accurate and cleaner than those produced by fixed cosine similarity.
2. Doubly Deformable 4D Transformer (DDT)
To aggregate the similarity maps, the authors developed the Doubly Deformable 4D Transformer (DDT). This module applies deformable attention across both support and query dimensions. By learning to "deform" its receptive field to focus on the most informative regions, the DDT achieves the long-range dependency benefits of Transformers without the prohibitive computational overhead of global attention.
Experimental Results
The DACM framework was evaluated on three major benchmarks: PASCAL-5i, COCO-20i, and FSS-1000.
- State-of-the-Art Accuracy: On PASCAL-5i with a ResNet101 backbone, DACM achieved a 1-shot mIoU of 69.1%, surpassing previous leading models like VAT.
- Rapid Convergence: A standout feature of DACM is its efficiency. It reaches peak performance in just 50 training epochs, whereas competing models like HSNet or VAT often require 200 or more epochs to converge to lower performance levels.
- Qualitative Improvements: Visualizations confirm that the learned covariance matrices align much more closely with ground-truth object shapes than traditional similarity metrics.
Conclusion and Future Work
DACM demonstrates that learnable similarity metrics combined with sparse, deformable attention can significantly improve both the accuracy and training speed of few-shot segmentation models. While the global context provided by the Transformer is powerful, the authors noted occasional failure cases where background reflections were misclassified as foreground. Future work will explore more nuanced ways to integrate global context with local feature representations to mitigate such over-generalization.
Summary updated