Introduction
Camouflaged Object Detection (COD) has traditionally focused on identifying the presence of hidden regions. However, Camouflaged Instance Segmentation (CIS) presents a significantly greater challenge: the model must not only detect camouflaged regions but also delineate individual instances designed to blend seamlessly into their surroundings. Traditional CIS methods often rely on two-stage frameworks like Mask R-CNN, which can be computationally intensive and may fail to capture the global context necessary to distinguish subtle boundaries.
Presented at ECCV 2022, OSFormer introduces the first one-stage transformer-based framework for CIS. By rethinking spatial information handling and local context, OSFormer achieves state-of-the-art results with significantly less training data than conventional transformer models.
Methodology
OSFormer utilizes a one-stage, bottom-up architecture designed to capture both global dependencies and local edge details. The framework is built upon four primary components:
- CNN Backbone: A standard ResNet backbone extracts initial multi-scale features, providing a foundation for subsequent processing.
- Location-Sensing Transformer (LST): The core of the model, the LST incorporates two key innovations:
- Blend-Convolution Feed-Forward Network (BC-FFN): By integrating 3x3 convolutions into the transformer's feed-forward layers, the model gains an inductive bias that enhances its understanding of local pixel correlations.
- Location-Guided Queries: Unlike vanilla DETR models that use zero-initialized queries, OSFormer initializes queries based on spatial feature grids. This "warm start" significantly accelerates convergence.
- Coarse-to-Fine Fusion (CFF): This module merges high-level global features from the transformer with low-level details from the CNN. It includes a Reverse Edge Attention (REA) module that forces the model to focus on the difficult-to-detect boundaries of camouflaged instances.
- Dynamic Camouflaged Instance Normalization (DCIN): Inspired by style transfer, this module uses transformer embeddings to dynamically generate filters for producing final instance masks.
Experiments and Results
The authors evaluated OSFormer on major camouflaged object benchmarks, including COD10K, NC4K, and CAMO++.
- Performance: OSFormer achieved 41.0% AP on the COD10K test set using a ResNet-50 backbone, outperforming the previous best one-stage model (SOLOv2) by 8.5%.
- Efficiency: The model reached peak performance in just 60 epochs using approximately 3,000 images, a significant improvement over the hundreds of epochs typically required by vision transformers.
- Real-Time Capabilities: A lightweight variant, OSFormer-550, operates at 25.8 FPS, making it suitable for real-time applications while maintaining a respectable 36.0% AP.
Qualitative analysis demonstrates that OSFormer is particularly effective at capturing slender boundaries, such as the legs of camouflaged insects, which often pose a challenge for traditional models like Mask R-CNN.
Conclusion
OSFormer demonstrates that combining the global context of transformers with the local perception of convolutions is highly effective for camouflaged instance segmentation. The introduction of location-guided queries and edge-focused supervision allows the model to achieve high accuracy with limited data. Future work may involve optimizing performance at lower resolutions and exploring the application of location-sensing logic to other data-scarce domains like medical imaging.
Summary updated