SAM-TTT: Segment Anything Model via Reverse Parameter Configuration and Test-Time Training for Camouflaged Object Detection

Zhenni Yu, Li Zhao, Guobao Xiao, Xiaoqin Zhang

Abstract

This paper introduces a new Segment Anything Model (SAM) that leverages reverse parameter configuration and test-time training to enhance its performance on Camouflaged Object Detection (COD), named SAM-TTT. While most existing SAM-based COD models primarily focus on enhancing SAM by extracting favorable features and amplifying its advantageous parameters, a crucial gap is identified: insufficient attention to adverse parameters that impair SAM's semantic understanding in downstream tasks. To tackle this issue, the Reverse SAM Parameter Configuration Module is proposed to effectively mitigate the influence of adverse parameters in a train-free manner by configuring SAM's parameters. Building on this foundation, the T-Visioner Module is unveiled to strengthen advantageous parameters by integrating Test-Time Training layers, originally developed for language tasks, into vision tasks. By integrating two modules, SAM-TTT simultaneously suppresses adverse parameters while reinforcing advantageous ones, significantly improving SAM's semantic understanding in COD task. Experimental results on various COD benchmarks demonstrate that the proposed approach achieves state-of-the-art performance, setting a new benchmark in the field.

Introduction: The Challenge of Camouflage

Camouflaged Object Detection (COD) is a challenging computer vision task that involves identifying objects seamlessly blended into their environment. While foundation models like the Segment Anything Model (SAM) have shown remarkable zero-shot capabilities, they often struggle with COD. This is primarily due to "semantic deficiency"—SAM's tendency to over-respond to fine-grained background textures that mimic the object, leading to fragmented or inaccurate segmentations.

Existing approaches typically focus on adding auxiliary networks to extract better features. However, SAM-TTT identifies a critical missing piece: the need to actively suppress "adverse parameters" that lead the model astray.

Methodology: Widening the Effect Distance

The core innovation of SAM-TTT lies in maximizing the Effect Distance, defined as the gap between the influence of advantageous parameters (which help identify the object) and adverse parameters (which respond to misleading textures).

Conceptual overview of widening the Effect Distance by weakening adverse parameters and enhancing advantageous ones.

To achieve this, the framework introduces two parallel modules:

1. Reverse SAM Parameter Configuration Module (R-SAMPC)

R-SAMPC is a train-free module designed to disrupt adverse parameters. It uses randomly initialized convolutional layers that remain frozen. By acting as a form of parameter-level noise or "dropout," it prevents the model from over-relying on high-frequency local textures, forcing it to prioritize more robust, global semantic features.

2. T-Visioner Module (TVM)

While R-SAMPC suppresses the "bad," TVM reinforces the "good." It adapts Test-Time Training (TTT) layers—originally designed for efficient sequence modeling in NLP—to the vision domain. TTT layers treat their hidden states as a learnable model, allowing for linear complexity while maintaining an expressive state that captures long-range dependencies more effectively than standard self-attention in this context.

The detailed architecture of SAM-TTT, showing the parallel R-SAMPC and TVM routes followed by a fusion phase.

Fusion Phase

The outputs from both routes are combined in a fusion phase using dilated and grouped convolutions. This multi-scale context is then fed into SAM’s mask decoder to produce the final segmentation.

Experimental Results

SAM-TTT was evaluated on three major COD benchmarks: CAMO, COD10K, and NC4K.

  • State-of-the-Art Performance: SAM-TTT outperformed 15 leading methods. On the COD10K dataset, it achieved a weighted F-measure ($F_\beta^\omega$) of 0.805 and a Mean Absolute Error (MAE) of 0.027.
  • Parameter Efficiency: Despite its high performance, the model is remarkably efficient, requiring only 6.65M trainable parameters—roughly 10% of the trainable parameters used by competitors like FSEL.
  • Qualitative Superiority: Visual analysis shows that SAM-TTT excels at capturing fine details (like insect limbs) and maintaining object integrity in highly complex scenes where other models often fail.

Conclusion

SAM-TTT represents a paradigm shift in adapting foundation models for niche tasks. By moving beyond simple feature enhancement to a strategy of "widening the gap" through adverse parameter suppression and TTT-based reinforcement, it sets a new standard for camouflaged object detection. Future research will explore the application of this "reverse configuration" strategy to other domains like medical imaging.

Paper Citation: Zhenni Yu, Li Zhao, Guobao Xiao, and Xiaoqin Zhang.

  1. SAM-TTT: Segment Anything Model via Reverse Parameter Configuration and Test-Time Training for Camouflaged Object Detection. In Proceedings of the 33rd ACM International Conference on Multimedia (MM ’25). https://doi.org/10.1145/3746027.3755291

Summary updated

Abstract

This paper introduces a new Segment Anything Model (SAM) that leverages reverse parameter configuration and test-time training to enhance its performance on Camouflaged Object Detection (COD), named SAM-TTT. While most existing SAM-based COD models primarily focus on enhancing SAM by extracting favorable features and amplifying its advantageous parameters, a crucial gap is identified: insufficient attention to adverse parameters that impair SAM's semantic understanding in downstream tasks. To tackle this issue, the Reverse SAM Parameter Configuration Module is proposed to effectively mitigate the influence of adverse parameters in a train-free manner by configuring SAM's parameters. Building on this foundation, the T-Visioner Module is unveiled to strengthen advantageous parameters by integrating Test-Time Training layers, originally developed for language tasks, into vision tasks. Test-Time Training layers represent a new class of sequence modeling layers characterized by linear complexity and an expressive hidden state. By integrating two modules, SAM-TTT simultaneously suppresses adverse parameters while reinforcing advantageous ones, significantly improving SAM's semantic understanding in COD task. Our experimental results on various COD benchmarks demonstrate that the proposed approach achieves state-of-the-art performance, setting a new benchmark in the field. The code will be available at https://github.com/guobaoxiao/SAM-TTT.
BibTeX
@misc{yu2025sam,
  author = {Zhenni Yu and Li Zhao and Guobao Xiao and Xiaoqin Zhang},
  title = {{SAM-TTT: Segment Anything Model via Reverse Parameter Configuration and Test-Time Training for Camouflaged Object Detection}},
  year = {2025},
  eprint = {2509.11884},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.11884},
}
Figure