SAM-COD: SAM-Guided Unified Framework for Weakly-Supervised Camouflaged Object Detection

Huafeng Chen, Pengxu Wei, Guangqian Guo, Shan Gao

Introduction

Camouflaged Object Detection (COD) represents one of the most challenging frontiers in computer vision. Unlike standard object detection, where targets are visually distinct from their backgrounds, COD requires identifying objects that have evolved specifically to blend into their surroundings. The primary bottleneck in advancing this field is the high cost of data acquisition; generating pixel-perfect mask annotations for training is labor-intensive, often requiring up to 60 minutes per image.

While weakly-supervised methods—utilizing points, bounding boxes, or scribbles—offer a significantly faster alternative for annotation, they have historically suffered from a substantial performance gap compared to fully-supervised models. The Segment Anything Model (SAM) emerged as a potential solution due to its zero-shot segmentation capabilities. However, SAM lacks "camouflage literacy," often producing extreme responses (segmenting the entire background or nothing at all) or failing to recognize the subtle semantic cues of hidden animals. SAM-COD was developed to bridge this gap, creating a unified framework that leverages SAM’s geometric knowledge while refining its semantic understanding for camouflaged targets.

The SAM-COD Framework

SAM-COD treats SAM as a "teacher" model, distilling its geometric expertise into a smaller, task-specific "student" model. The framework is composed of four primary modules designed to handle weak labels and refine SAM's output:

  1. Prompt Adapter: To accommodate various weak labels, this module converts scribbles into discrete points using the Zhang-Suen skeletonization algorithm, allowing SAM to process them as standard point prompts.
  2. Response Filter: To mitigate SAM's tendency to over-segment or under-segment, this module calculates the ratio of the predicted mask to the total image size. Masks that are disproportionately large or small relative to the prompt are filtered out as likely errors.
  3. Semantic Matcher: This component acts as the framework's decision-maker. It utilizes a student model trained on COD data to calculate "semantic entropy." It then selects the SAM-generated mask that best balances fine-grained geometric detail with correct semantic identification.
  4. Prompt-Adaptive Knowledge Distillation (PKD): This training strategy weights the distillation loss to focus on "high-value" regions defined by the weak labels. By prioritizing the area around a point or inside a bounding box, the student model learns the most critical features of the camouflaged object rather than treating the entire image with equal importance.

Experimental Setup and Datasets

The researchers evaluated SAM-COD across three major benchmarks: CAMO (camouflaged animals), COD10K (large-scale diverse categories), and NC4K (generalization testing). To support this research, the authors re-annotated 4,040 images to create the P-COD (point-supervised) and B-COD (box-supervised) datasets, which complement the existing S-COD (scribble-supervised) dataset.

Key Insights and Results

The core innovation of SAM-COD lies in the separation of geometry and semantics. While SAM is a master of finding edges (geometry), it is a novice at identifying camouflaged entities (semantics). SAM-COD uses SAM for the "how to segment" and the task-specific student for the "what to segment."

Quantitative results demonstrate the effectiveness of this approach:

  • Performance Gains: SAM-COD outperformed the previous state-of-the-art weakly-supervised method (WS-SAM) by an average of 26.8% in Mean Absolute Error (MAE).
  • Surpassing Full Supervision: Remarkably, SAM-COD achieved results that surpassed ZoomNet, a leading fully-supervised model, on several metrics across the benchmarks despite using only weak labels.
  • Efficiency: Due to the effective knowledge transfer from SAM, the model converges rapidly, reaching high performance levels in just one training epoch—a significant improvement over previous models that required ten or more.
  • Cross-Domain Generalization: The framework proved robust beyond animal camouflage, achieving favorable results in Salient Object Detection (SOD) and medical imaging (polyp segmentation).

Conclusion and Future Work

SAM-COD represents a significant leap in weakly-supervised learning for camouflaged object detection. By effectively filtering and distilling SAM's outputs, the framework achieves performance that rivals or exceeds fully-supervised alternatives. Current limitations include the "offline" nature of the distillation process, where SAM's predictions are pre-computed. Future research may explore "online" distillation for real-time interaction or extending the framework to video-based COD, where temporal cues could further assist in distinguishing hidden objects from complex backgrounds.

Summary updated

BibTeX
@inproceedings{chen2024sam,
  author = {Huafeng Chen and Pengxu Wei and Guangqian Guo and Shan Gao},
  title = {{SAM-COD: SAM-Guided Unified Framework for Weakly-Supervised Camouflaged Object Detection}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72761-0\_18},
}
Figure