Introduction
Few-shot segmentation (FSS) is a challenging computer vision task that requires a model to segment objects of a specific class in a "query" image, guided by only one or a few annotated "support" images. The primary difficulty lies in generalization: the model must accurately identify and delineate classes it has never encountered during its training phase.
Existing approaches often struggle with two distinct types of bias. First, class-aware bias occurs when support prototypes are extracted independently of the query image, failing to account for differences in pose, lighting, or perspective. Second, class-agnostic bias arises because models are typically trained to treat all non-target classes as background, leading them to ignore potentially important foreground regions of unseen classes during testing. To address these limitations, we present the Joint Class-aware and Class-agnostic Alignment Network ($JC^2A$).
Addressing Dual Biases in FSS
The $JC^2A$ framework introduces a dual-pathway approach to mitigate both class-aware and class-agnostic biases through two novel modules: the Hybrid Prototype Alignment Module (HPAM) and the Class-agnostic Knowledge Mining Module (CKMM).
1. Hybrid Prototype Alignment Module (HPAM)
To overcome class-aware bias, HPAM moves beyond static global prototypes. Instead, it establishes multi-scale correspondences between query and support features using two complementary sub-modules:
- Point-to-Point (P2P) Alignment: This sub-module utilizes a linear attention mechanism to identify pixel-level similarities. While effective at capturing fine-grained visual details, P2P alignment can be susceptible to noise.
- Point-to-Block (P2B) Alignment: To provide more robust guidance, P2B focuses on larger feature blocks (e.g., specific anatomical parts like a wing or a wheel). By ranking these blocks based on their mask coverage and importance, the module provides stable, contextual information that is less sensitive to pixel-level fluctuations.
By combining P2P and P2B outputs, the framework ensures that the model captures both intricate details and robust semantic structures.
2. Class-agnostic Knowledge Mining Module (CKMM)
To solve the problem of background confusion (class-agnostic bias), $JC^2A$ leverages the rich information contained within the "base classes" seen during training. The CKMM maintains a bank of feature prototypes for all base classes. During inference, the query image is compared against this entire bank to generate a class-agnostic prior mask.
This mask serves as a general "objectness" indicator, signaling to the model which regions are likely to be objects rather than background (such as sky or road), regardless of whether they belong to the specific target class. This prior helps the decoder distinguish between true background and foreground objects of novel, unseen classes.
3. Multiple Information Aggregation (MIA)
The final stage of the framework, Multiple Information Aggregation, concatenates the class-aware guidance from HPAM and the class-agnostic guidance from CKMM. This combined feature set is fed into a standard decoder to produce the final, high-fidelity segmentation mask.
Experimental Evaluation
The authors evaluated $JC^2A$ on two standard FSS benchmarks, PASCAL-$5^i$ and COCO-$20^i$, using a ResNet101 backbone.
- COCO-$20^i$: In the challenging 1-shot setting, the model achieved 44.7% mIoU, representing a 3.5% improvement over previous state-of-the-art methods like HSNet.
- PASCAL-$5^i$: The model reached 66.4% mIoU in the 1-shot setting, demonstrating strong competitive performance.
An ablation study confirmed the importance of the dual-pathway approach. Specifically, removing the CKMM (class-agnostic) module resulted in a performance drop of approximately 2.7% mIoU, highlighting that general object knowledge is a vital prior for few-shot tasks.
Key Insights
- Efficiency via Linear Attention: To maintain computational efficiency at high resolutions, the framework employs a linear attention variant that decouples query and key/value calculations.
- The Value of Objectness: A significant finding of this research is that the ability to recognize any object (class-agnostic) significantly enhances the ability to segment a specific object (class-aware).
- Selective Guidance: The P2B module's use of top-k block selection prevents background noise in the support image from polluting the query guidance, ensuring the model focuses only on relevant foreground features.
Conclusion
The $JC^2A$ framework provides a robust solution to the common pitfalls of few-shot segmentation. By balancing specific class alignment with general objectness mining, it achieves state-of-the-art results on complex datasets. While the dual-pathway architecture introduces some complexity, the modular nature of HPAM and CKMM offers a flexible foundation for future improvements in alignment and feature mining techniques.
Summary updated