RefOnce: Distilling References into a Prototype Memory for Referring Camouflaged Object Detection

Yu-Huan Wu, Zi-Xuan Zhu, Yan Wang, Liangli Zhen, Deng-Ping FanarXiv 2025 · DOI

Abstract

RefOnce is a novel framework designed to eliminate the need for external reference images during the inference phase of Referring Camouflaged Object Detection (Ref-COD). By distilling category-level knowledge into a "prototype memory" during training, the model can synthesize its own guidance at test time. This approach achieves state-of-the-art performance while resolving the practical limitations of existing reference-dependent systems, making it significantly more viable for real-world deployment.

Introduction

Camouflaged Object Detection (COD) is a challenging task due to targets blending seamlessly into their environments. To improve detection accuracy, the Referring COD (Ref-COD) paradigm was introduced, providing models with a "clean" reference image to guide the search for a camouflaged counterpart. However, this setup introduces a "deployment paradox": requiring a reference image at test time implies that the object's category is already known, which undermines the utility of an automated detection system. Furthermore, the dual-branch architectures typically used in Ref-COD increase computational overhead and data requirements.

Comparison of standard Ref-COD approaches versus the proposed RefOnce framework.

RefOnce addresses these issues by transitioning from a reference-dependent model to one that operates reference-free during inference, as illustrated in Figure 1. By moving the reference branch to a training-only phase, the system becomes more efficient and practical.

Methodology

The RefOnce architecture is built upon three core innovations that allow it to "remember" reference information rather than requiring it as a constant input.

Class-Prototype Memory

During the training phase, the model extracts features from reference images and stores them as "prototypes" for each category. These prototypes are updated using an Exponential Moving Average (EMA), which helps the model build a stable, long-term memory of various object classes. This memory serves as the repository of semantic knowledge that the model will query during inference.

Query-Conditioned Reference Generation

At test time, the model operates without an external reference. Instead, it analyzes the camouflaged "query" image to predict the likelihood of different categories being present. It then synthesizes a guidance vector by creating a weighted mixture of the stored prototypes. This "soft mixture" approach allows the model to handle intra-class diversity more robustly than a simple hard selection.

The detailed RefOnce architecture, highlighting the Reference Feature Extraction (training only), Reference Generation, and Reference Guidance modules.

Bidirectional Attention Alignment (BAA)

To bridge the domain gap between clear reference prototypes and hidden camouflaged objects, the BAA module facilitates interaction between query features and the synthesized reference vector. As shown in Figure 2, the query image helps refine the reference vector for the specific scene, while the reference vector acts as a spatial gate to highlight the hidden object.

Experimental Results

The model was rigorously evaluated on the R2C7K dataset, a large-scale Ref-COD benchmark. To assess generalization, the authors also tested on standard COD datasets (CAMO, CHAMELEON, COD10K, and NC4K) and a curated "Unseen Classes" dataset.

  • State-of-the-Art Performance: Using a PVTv2-B2 backbone, RefOnce achieved a Structure-measure ($S_m$) of 0.890 and an Adaptive E-measure ($\alpha E$) of 0.937 on R2C7K, surpassing all previous reference-dependent models.
  • Generalization to Unseen Classes: On the "Unseen Classes" test, RefOnce demonstrated a significant performance gain ($+0.038$ $S_m$) over a reference-free baseline. This indicates that the prototype memory captures transferable semantic priors rather than just memorizing training classes.
  • Efficiency: By eliminating the reference branch at inference, the model is significantly lighter. The reference generation process adds a negligible 0.01 GFLOPs to the total computation.

Conclusion

RefOnce represents a significant step forward in making Referring Camouflaged Object Detection practical for real-world use. By distilling reference knowledge into a prototype memory, it maintains the high accuracy of guided detection without the deployment hurdles of external inputs. Future work may explore integrating multi-modal prompts (such as language) and scaling the prototype memory to handle thousands of object categories efficiently.

Summary updated

BibTeX
@misc{wu2025refonce,
  author = {Yu-Huan Wu and Zi-Xuan Zhu and Yan Wang and Liangli Zhen and Deng-Ping Fan},
  title = {{RefOnce: Distilling References into a Prototype Memory for Referring Camouflaged Object Detection}},
  year = {2025},
  eprint = {2511.20989},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.20989},
}
Figure