CamSAM2: Segment Anything Accurately in Camouflaged Videos

Yuli Zhou, Yawei Li, Yuqian Fu, Luca Benini, Ender Konukoglu, Guolei Sun

Abstract

Video Camouflaged Object Segmentation (VCOS) is a specialized computer vision task where objects are evolved or designed to be indistinguishable from their surroundings. While the Segment Anything Model 2 (SAM2) has set new benchmarks for general video segmentation, it exhibits a "natural scene bias" that hinders its performance on camouflaged data. We introduce CamSAM2, a lightweight enhancement that adapts SAM2 for VCOS without modifying its original weights. By incorporating a specialized "decamouflaged token" and novel feature fusion modules, CamSAM2 achieves significant performance gains—up to 19.6 mDice—while adding negligible computational latency.

Introduction

Standard video segmentation typically relies on clear object boundaries and high contrast. In contrast, VCOS involves objects like leaf-mimicking insects or medical lesions that blend seamlessly into their environments. Foundation models like SAM2, trained on millions of high-contrast masks, often fail to perceive the full extent of these hidden objects when prompted with simple clicks. The challenge lies in adapting these massive models for niche tasks efficiently, preserving their general capabilities while enabling "X-ray vision" for camouflage.

Methodology

CamSAM2 functions as a plug-and-play enhancement for the frozen SAM2 architecture, adding only 0.5M learnable parameters. The system introduces four primary innovations to bridge the gap between general and camouflaged segmentation:

  1. Decamouflaged Token: A learnable token added to the mask decoder that specifically learns to "unhide" camouflaged regions during decoding.
  2. Implicit Object-aware Fusion (IOF): Camouflage is often broken by subtle texture differences. IOF extracts high-resolution features from early image encoder layers to capture these fine-grained details.
  3. Object Prototype Generation (OPG): Using Farthest Point Sampling (FPS) and k-means clustering, the model condenses an object's appearance from previous frames into representative "prototypes."
  4. Explicit Object-aware Fusion (EOF): A cross-attention mechanism that queries current frame features against stored prototypes, maintaining a consistent "mental image" of the object across temporal changes.
Detailed architecture of CamSAM2 showing the IOF, EOF, and OPG modules integrated with the frozen SAM2 components.

Experimental Evaluation and Results

CamSAM2 was evaluated across three major benchmarks: MoCA-Mask (wildlife), CAD (zero-shot generalization), and SUN-SEG (medical polyp segmentation). The results demonstrate a substantial leap in accuracy over the baseline SAM2:

  • Performance Gains: On the MoCA-Mask dataset, CamSAM2 achieved a 12.2 mDice improvement over SAM2 with a 1-click prompt. In medical contexts (SUN-SEG-Hard), the gain reached 19.6 mDice.
  • Efficiency: The enhancement adds only 6ms of latency per frame and 14.4 GFLOPs, making it highly suitable for real-time applications.
  • Qualitative Superiority: Heatmap analysis shows that while standard SAM2 often misses the target or produces fragmented masks, CamSAM2 accurately localizes the entire camouflaged object.
Qualitative comparison of SAM2 and CamSAM2 heatmaps against Ground Truth (GT) across various camouflaged scenarios.

Conclusion

CamSAM2 demonstrates that massive foundation models can be effectively specialized for difficult, niche tasks through lightweight, modular additions. By focusing on low-level texture fusion and temporal prototype consistency, CamSAM2 overcomes the natural scene bias of SAM2. Future work will explore integrating explicit motion cues and improving robustness during long-term occlusions or sudden shot changes.

Summary updated

BibTeX
@inproceedings{zhou2025camsam,
  author = {Yuli Zhou and Yawei Li and Yuqian Fu and Luca Benini and Ender Konukoglu and Guolei Sun},
  title = {{CamSAM2: Segment Anything Accurately in Camouflaged Videos}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=WbpzGpVWVx},
}
Figure