SAM2-UNeXT: An Improved High-Resolution Baseline for Adapting Foundation Models to Downstream Segmentation Tasks

Xinyu Xiong, Zihuang Wu, Lei Zhang, Lei Lu, Ming Li, Guanbin LiarXiv 2025 · DOI

Introduction

The Segment Anything Model (SAM) family has significantly advanced the field of image segmentation. However, these models often exhibit a "representational bias" due to their class-agnostic training objectives. While SAM excels at identifying object boundaries and local textures, its encoder frequently lacks the global semantic context necessary for specialized downstream tasks. Conversely, models like DINOv2 provide rich semantic understanding but often fail to achieve the precise localization required for high-quality segmentation.

SAM2-UNeXT addresses these challenges by introducing a framework that bridges the gap between general-purpose foundation models and specialized segmentation requirements. By integrating the fine-grained detail of SAM2 with the semantic depth of DINOv2, the proposed architecture establishes a high-resolution baseline that excels across diverse domains, including marine biology, camouflaged object detection, and remote sensing.

Methodology

The SAM2-UNeXT architecture is built upon a dual-resolution strategy designed to capture both microscopic details and macroscopic semantics efficiently. The framework consists of four primary components:

  1. SAM2 Encoder with Adapters: The model utilizes the Hiera encoder from SAM2, which remains frozen to preserve pre-trained knowledge. To adapt the encoder to specific tasks, lightweight "MLP-GeLU-MLP-GeLU" adapters are inserted before each block, following Parameter-Efficient Fine-Tuning (PEFT) principles.
  2. Auxiliary DINOv2 Encoder: A frozen DINOv2-L model serves as a semantic guide, providing the global context that the SAM2 encoder lacks.
  3. Dual-Resolution Design: To mitigate the "resolution tax" associated with large foundation models, SAM2 processes high-resolution inputs ($1024 \times 1024$) for sharp boundary detection, while DINOv2 operates on lower-resolution inputs ($448 \times 448$) to extract semantic features.
  4. Dense Glue Layer & U-Net Decoder: Instead of employing a heavy transformer-based decoder, the authors introduce a "Dense Glue Layer" to align and concatenate features from both encoders. These fused features are then processed by a standard U-Net-style CNN decoder, which is optimized for handling boundary details and computational efficiency.
The SAM2-UNeXT architecture, featuring dual encoders and a U-Net-style decoder.

Experimental Evaluation

The model's performance was rigorously evaluated across four distinct segmentation benchmarks:

  • Dichotomous Image Segmentation (DIS5K): Focused on objects with highly complex structures.
  • Camouflaged Object Detection (COD): Evaluated using datasets such as COD10K, NC4K, and CHAMELEON.
  • Marine Animal Segmentation: Tested on the MAS3K and RMAS datasets.
  • Remote Sensing Saliency Detection: Applied to satellite imagery datasets (EORSSD and ORSI-4199).

Results and Discussion

SAM2-UNeXT consistently outperformed existing baselines across all evaluated metrics. In marine animal segmentation, the model achieved a significant 5.4% improvement in mIoU on the MAS3K dataset. For camouflaged object detection, it improved the S-measure by 2.8% on the CHAMELEON dataset. Furthermore, on the DIS-VD subset for dichotomous segmentation, SAM2-UNeXT surpassed the previous state-of-the-art method, BiRefNet, by 1.2% in S-measure.

Qualitative analysis further highlights the model's superiority. As shown in Figure 2, SAM2-UNeXT excels at delineating extremely thin structures, such as tree branches and wire fences, which often pose significant challenges for other models.

Qualitative comparison of SAM2-UNeXT against state-of-the-art methods on challenging segmentation tasks.

Key Insights

  • Complementary Strengths: The integration of SAM2 and DINOv2 leverages their respective strengths in localization ("where") and semantic context ("what").
  • Architectural Simplicity: Enhancing the quality of features at the encoding stage allows for a simpler U-Net decoder, reducing complexity without sacrificing performance.
  • Resolution Optimization: Ablation studies confirmed that a $448 \times 448$ resolution for DINOv2 provides an optimal balance between semantic accuracy and inference cost.

Conclusion and Future Work

While SAM2-UNeXT sets a new benchmark for high-resolution segmentation, certain limitations remain. The memory footprint of two large foundation models necessitates significant VRAM during training. Additionally, the current framework is focused on binary segmentation. Future research will explore extending the model to multi-class or panoptic segmentation and investigating the use of other auxiliary encoders, such as CLIP, for domain-specific tasks.

Summary updated

BibTeX
@misc{xiong2025sam,
  author = {Xinyu Xiong and Zihuang Wu and Lei Zhang and Lei Lu and Ming Li and Guanbin Li},
  title = {{SAM2-UNeXT: An Improved High-Resolution Baseline for Adapting Foundation Models to Downstream Segmentation Tasks}},
  year = {2025},
  eprint = {2508.03566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.03566},
}
Figure