Dense Affinity Matching for Few-Shot Segmentation

Hao Chen, Yonghan Dong, Zheming Lu, Yunlong Yu, Yingming Li, Jungong Han, Zhongfei Zhang · DOI

Introduction

Few-Shot Segmentation (FSS) aims to segment novel objects in a query image using only a handful of annotated support examples. The primary challenge in FSS is the scarcity of data and the significant intra-class diversity between support and query instances. Current methods typically rely on either "class-wise" prototypes, which lose spatial detail, or "pixel-wise" dense correspondences, which are often computationally heavy and sensitive to background noise.

Dense Affinity Matching (DAM) addresses these issues with an ultra-lightweight framework that prioritizes spatial structure and cross-domain generalization. By rethinking how support and query features interact, DAM achieves state-of-the-art performance with a fraction of the parameters used by previous models.

The DAM Framework

The DAM architecture is designed for efficiency and robustness, focusing on three core technical innovations:

Bidirectional 3D Convolutions (B3DConvs)

Rather than simple point-to-point matching, DAM utilizes bidirectional 3D convolutions to capture pixel-to-patch relationships. This approach treats the affinity matrix as a volume, allowing the model to learn local neighborhood correspondences. This naturally handles scale variations—such as a small support object matching a large query object—without requiring complex multi-scale processing modules.

Hysteretic Spatial Filtering Module (HSFM)

A common practice in FSS is to mask out the support image's background immediately. DAM introduces the Hysteretic Spatial Filtering Module, which argues that the support background is a valuable feature. By matching the support background to the query image, the model can identify and "filter out" similar-looking distractor objects in the query background, significantly reducing false positives.

The overall architecture of the DAM framework, highlighting the B3DConvs and the HSFM module.

Parameter-Efficient Decoder

To prevent overfitting on specific training domains (like natural images), the researchers removed the standard "linear heads" often found between the backbone and matching modules. They replaced standard convolutions with redesigned, deeper, yet parameter-efficient blocks. This results in a model with only 0.68M learnable parameters, making it significantly smaller than competitors like HSNet (2.6M) or DCAMA (14.2M).

Experimental Results

DAM was evaluated across 10 benchmarks, including cross-category, cross-dataset, and specialized cross-domain scenarios such as medical (Chest X-ray, ISIC2018) and satellite imagery (Deepglobe).

Comparison of DAM and HSNet across 10 benchmarks, demonstrating DAM's superior performance in cross-domain tasks.

Key Findings

  • Cross-Domain Superiority: DAM showed dramatic improvements in specialized domains. On the ISIC2018 skin cancer task, DAM achieved 51.2% mIoU, compared to HSNet’s 31.2%. On Chest X-rays, it reached 70.4% mIoU, outperforming HSNet's 51.9%.
  • Efficiency: Despite being 4x smaller than HSNet, DAM consistently outperformed it across nearly all metrics.
  • Comparison with Foundation Models: In 1-shot medical settings, DAM (70.4% on X-ray) significantly outperformed the Segment Anything Model (SAM-base, 27.8%), proving that specialized few-shot architectures remain superior to general-purpose foundation models in niche domains.

Conclusion

Dense Affinity Matching proves that "less is more" in Few-Shot Segmentation. By utilizing the support background and replacing heavy transformation layers with efficient 3D convolutions, DAM achieves high-fidelity segmentation and exceptional cross-domain generalization. While it still faces challenges with extremely small or heavily occluded objects, its lightweight nature and robust performance set a new standard for the field.

Summary updated

BibTeX
@article{chen2024dense,
  author = {Hao Chen and Yonghan Dong and Zheming Lu and Yunlong Yu and Yingming Li and Jungong Han and Zhongfei Zhang},
  title = {{Dense Affinity Matching for Few-Shot Segmentation}},
  journal = {Neurocomputing},
  year = {2024},
  doi = {10.1016/j.neucom.2024.127348},
}
Figure