Adapt Before Comparison: A New Perspective on Cross-Domain Few-Shot Segmentation

Jonas HerzogCVPR 2024 · DOI

Abstract

Few-Shot Segmentation (FSS) typically relies on extensive source-domain training to learn generalizable features. However, this approach often fails in Cross-Domain FSS (CD-FSS) due to significant domain shifts. This paper introduces ABCDFSS (Adapt Before Comparison for Few-Shot Segmentation), a novel paradigm that eliminates source-domain training entirely. By utilizing a frozen ImageNet-pretrained backbone and optimizing lightweight task-specific adapters at test-time using only a few support samples, ABCDFSS achieves state-of-the-art performance across diverse benchmarks, including medical and satellite imagery.

Introduction: The Challenge of Cross-Domain Generalization

Few-Shot Segmentation aims to segment novel objects in a query image given only a few labeled support examples. While standard FSS methods perform well when training and testing data come from the same domain, they struggle with the domain shift inherent in CD-FSS. Traditional methods attempt to learn a "universal" segmentation logic on massive source datasets like PASCAL VOC. The authors argue that this focus on generalization is misplaced; instead, the key to overcoming domain shift lies in effective test-time adaptation.

Methods: Adapt Before Comparison (ABCDFSS)

The proposed ABCDFSS framework shifts the focus from pre-training on source tasks to rapid adaptation on target tasks.

Conceptual comparison between traditional meta-learning and the proposed ABCDFSS approach, which eliminates source-domain training.

Architecture and Workflow

The method consists of three main components:

  1. Frozen Backbone: A standard ResNet-50 backbone, pretrained on ImageNet, is used to extract multi-scale features. This backbone remains frozen to preserve general-purpose feature representations.
  2. Task-Specific Adapters: Lightweight $1 \times 1$ convolutional layers are attached to each level of the backbone’s feature pyramid. These adapters are the only trainable parameters during the adaptation phase.
  3. Test-Time Adaptation: Upon receiving a new task, the adapters are optimized using the provided support images. To prevent overfitting, the authors employ a dual-loss strategy:
  4. Self-Supervised Consistency: Ensures feature stability across geometric augmentations.
  5. Supervised Class Alignment: Maximizes similarity between foreground pixels while maintaining distinctness from the background.
Detailed architecture of the ABCDFSS framework, showing the feature pyramid, task-specific heads, and the cross-correlation mechanism.

Following adaptation, a parameter-free cross-attention mechanism compares query and support features to generate the final segmentation mask.

Experimental Evaluation

ABCDFSS was evaluated on the standard CD-FSS benchmark, which includes diverse domains such as satellite imagery (Deepglobe), medical imaging (ISIC, Chest X-ray), and underwater scenes (SUIM). Notably, the method requires no source segmentation data for training.

Key Results

ABCDFSS establishes a new state-of-the-art across the CD-FSS benchmark:

  • Performance Gains: It outperforms previous leading methods (e.g., PATNet) by an average of 4.6 mIoU in 1-shot and 3.0 mIoU in 5-shot scenarios.
  • Domain-Specific Success: Significant improvements were observed in specialized domains, such as a 13 mIoU increase in Chest X-ray lung segmentation.
  • Inference Efficiency: A "quick-infer" mode allows the model to run at 27 FPS once adapters are trained for a specific class, making it practical for real-world applications.

Discussion and Insights

The success of ABCDFSS challenges the necessity of source-domain training for FSS. The results suggest that a frozen ImageNet backbone often provides a superior starting point compared to a backbone fine-tuned on a specific source domain, provided it is adapted correctly. The "Adapt Before Comparison" strategy effectively restores feature discriminability lost to domain shift, allowing the model to identify relevant structures in novel environments more accurately.

Limitations and Future Work

Despite its success, ABCDFSS has limitations. The $1 \times 1$ convolutional adapters operate locally, potentially missing global semantic context. Additionally, the final mask generation relies on heuristic post-processing steps like Otsu’s method and CRFs. Future research could explore incorporating global context into the adapters or developing more robust, learnable refinement modules. The authors also highlight the need for higher-quality annotated datasets in domains like satellite imagery to further advance the field.

Summary updated

BibTeX
@inproceedings{herzog2024adapt,
  author = {Jonas Herzog},
  title = {{Adapt Before Comparison: A New Perspective on Cross-Domain Few-Shot Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  doi = {10.1109/cvpr52733.2024.02228},
}
Figure