VSCode: General Visual Salient and Camouflaged Object Detection with 2D Prompt Learning

Ziyang Luo, Nian Liu, Wangbo Zhao, Xuguang Yang, Dingwen Zhang, Deng-Ping Fan, Fahad Khan, Junwei Han

Introduction

Salient Object Detection (SOD) and Camouflaged Object Detection (COD) represent two ends of a visual spectrum. SOD focuses on identifying objects that naturally stand out from their background, while COD aims to detect objects specifically evolved or designed to blend into their surroundings. Historically, these tasks have been treated as distinct challenges, further fragmented by the input modality—ranging from standard RGB images to Depth maps, Thermal data, and Optical Flow (motion).

The landscape of Salient and Camouflaged Object Detection tasks across various domains.

The traditional approach involves developing "specialist" models for each task-domain pair (e.g., RGB-D SOD vs. Video COD). This paradigm is inherently inefficient, leading to redundant architectures and failing to leverage shared "objectness" features across tasks. VSCode addresses this by introducing a "generalist" model capable of mastering both SOD and COD across multiple modalities simultaneously.

Methodology: 2D Prompt Learning

The core of VSCode is the Visual Saliency Transformer (VST) foundation, enhanced by a novel 2D Prompt Learning strategy. This approach disentangles the input domain from the specific detection task using two dimensions of learnable tokens.

Overview of the VSCode framework utilizing 2D prompts for task and domain disentanglement.
  1. Domain Prompts: These tokens are integrated into the Swin Transformer encoder to help the model interpret the specific characteristics of the input modality (RGB, Depth, Thermal, or Flow).
  2. Task Prompts: These tokens guide the model to perform either salient or camouflaged detection. They are utilized in both the encoder to focus attention and the decoder to refine object boundaries.
  3. Prompt Discrimination Loss ($\mathcal{L}_{dis}$): To ensure that domain and task prompts remain distinct and non-redundant, a specific loss function minimizes the correlation between different prompts. This forces the model to learn unique, non-overlapping features for each dimension.

Experimental Results and Generalization

VSCode was evaluated across a massive benchmark of 26 datasets. The results demonstrate that a single generalist model can outperform specialized state-of-the-art (SOTA) architectures.

Performance and Efficiency

The VSCode-S variant (using a Swin-S backbone) achieved SOTA results across nearly all 26 datasets. Remarkably, the 2D prompt mechanism adds only approximately 0.03M parameters, making it significantly more efficient than maintaining a suite of six or more separate specialist models.

Zero-Shot Capabilities

The disentangled nature of 2D prompts allows for "zero-shot" task execution. By pairing a "Depth" domain prompt with a "COD" task prompt, VSCode can perform RGB-D Camouflaged Object Detection—a task it was never explicitly trained on. In these evaluations, VSCode outperformed specialized models like PopNet, which were specifically designed for that task. On the standard COD10K benchmark, VSCode achieved a structure measure ($S_m$) of 0.882 compared to PopNet's 0.851.

Conclusion

VSCode demonstrates that SOD and COD, while seemingly opposite, share fundamental structural cues that a unified model can exploit. By using 2D prompt learning to separate domain-specific knowledge from task-specific logic, VSCode provides a highly efficient and generalizable framework for visual object detection. Future work may extend this multi-dimensional prompting to handle varying environmental conditions like lighting or image noise.

Summary updated

BibTeX
@inproceedings{luo2023vscode,
  author = {Ziyang Luo and Nian Liu and Wangbo Zhao and Xuguang Yang and Dingwen Zhang and Deng-Ping Fan and Fahad Khan and Junwei Han},
  title = {{VSCode: General Visual Salient and Camouflaged Object Detection with 2D Prompt Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure