SAM-DCE: Decoupled Context Enhancement for Prompt-Free Medical Image Segmentation

arXiv:2509.16886 · cs.CV · Submitted 2025-09-21 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: Hi, I'm Tom.

Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.

Tom: We're looking at the paper: "SAM-DCE: Decoupled Context Enhancement for Prompt-Free Medical Image Segmentation".

Jane: Here's the gist of the paper. The gist The proposed SAM-DCE framework introduces a prompt-free medical segmentation method that addresses token uniformity and semantic over-smoothing in Segment Anything Model (SAM) by employing a dual-path module, ML-DCE, to balance local discrimination and global semantics.

Tom: Problem Definition Prior studies have demonstrated that the self-attention mechanism in ViTs essentially functions as a low-pass filter, smoothing input features and reducing their variance.

Jane: As shown Fig.2, SAM stacks ViT layers repeatedly perform spatial smoothing, leading to homogeneous representations of mask tokens.

Tom: As a result, the model tends to overemphasize high-frequency, strongly discriminative regions while underrepresenting boundaries and tail classes.

Paper summary: Tom: So to wrap up what we’ve heard about this paper, SAM-DCE is a framework that addresses token uniformity and semantic over-smoothing in medical segmentation by employing a dual-path module, ML-DCE, to balance local discrimination and global semantics.

Jane: They propose SAM-DCE as a prompt-free medical segmentation method that alleviates over-smoothing in SAM-based architectures. The paper introduces ML-DCE to disentangle mask representations while balancing class separability and the segmentation of low-frequency categories.

Lu: Essentially, they tackle the problem where deep image features lose fine local structural evidence, and mask tokens become semantically ambiguous because of that smoothing effect in the ViT layers.

Meng: So they are trying to make sure those tokens aren't just blurry averages, but have consistent class information attached to them so the final segmentation is accurate across different organs.

Tom: They achieve this by using MCC and ICC branches, where MCC focuses on class semantics from deep layers, and ICC aggregates spatial details from shallow encoder features to ground the representations structurally.

Jane: The mechanism involves a residual fusion stage where they separate the background token tbg from TMask before fusing the deep and shallow class information with the original class tokens.

Lu: They define their overall loss function as a weighted combination of Cross-Entropy loss and Dice similarity loss to guide this disentanglement process during training.

Meng: The results they show on Synapse multi-organ CT segmentation dataset yield a mean Dice score of eighty point five four percent and an HD95 of thirteen point six six mm, which is better than the SAMed variant by improving the mean Dice by plus two point one seven percent <ref:2509.16886#pg3>.

Tom: That improvement in boundary error, going from twenty-seven point eight one mm down to thirteen point six six mm on that same dataset, is substantial when you’re dealing with medical measurements like that <ref:2509.16886#pg3>.

Jane: So it’s a prompt-free approach that significantly enhances the spatial and semantic grounding of the model's output by refining those intermediate representations before recombining them using SAM’s original token-to-mask mechanism.

Conclusion: Tom: Looking at the title, SAM-DCE: Decoupled Context Enhancement for Prompt-Free Medical Image Segmentation, it really highlights the core idea of separating the spatial and semantic parts of the mask generation process.

Jane: It’s about taking something that works well for natural images and applying a decoupled context enhancement specifically to medical contexts where those domain shifts are so significant.

Lu: What this means for the field is that they've shown a way to improve prompt-free segmentation in models like SAM by explicitly disentangling how the model learns what’s spatially present versus what it actually knows about the class of tissue.

Meng: From a deployment standpoint, this suggests that if we can develop these decoupled modules, we might be able to deploy powerful segmentation tools without needing extensive manual labeling for every single new medical case.

Tom: It moves the goalposts for how we adapt foundation models like SAM for specialized domains without having to rewrite the whole architecture from scratch.

Jane: The implication is that prompt-free methods can become more reliable and adaptable if we build this kind of internal structure to compensate for the inherent smoothing issues in deep features.

Yingzhen Hu, Yiheng Zhong, Ruobing Li, Yingxue Su, Jiabao An, Feilong Tang, Jionglong Su, ×Imran Razzak

Mohamed bin Zayed University of AI, Abu Dhabi, UAE · Xi’an Jiaotong-Liverpool University · University of Liverpool · Monash University

cs.CV

Submitted: 2025-09-21

Updated: 2026-10-21

License: http://creativecommons.org/licenses/by-nc-nd/4.0/

Importance score: 79/100

The gist: The gist The proposed SAM-DCE framework introduces a prompt-free medical segmentation method that addresses token uniformity and semantic over-smoothing in Segment Anything Model (SAM) by employing a

Key concepts

Spatial Representation Compensation (SRC)
This component recovers anatomical evidence from intermediate Vision Transformer (ViT) features. It helps counteract the smoothing effect of deep layers, ensuring that fine local structural details are preserved in the mask tokens, which is crucial for accurate segmentation boundaries.
Semantic Token Calibration (STC)
This module improves the consistency of foreground mask tokens by aligning them with class semantics. It ensures that each generated token accurately represents its intended anatomical category, leading to better category separation and more reliable final segmentation results.
Mask-Conditioned Class Token (MCC)
The MCC module uses cross-attention to connect class semantics with candidate mask tokens. It employs class-initialized queries to guide the attention process, effectively decoupling the semantic information from the raw mask tokens to refine their category representation.
Image-Conditioned Class Token (ICC)
The ICC module aggregates spatial priors and local contextual semantics by using learnable class queries to attend to encoder image embeddings. This allows it to construct class-level representations that are structurally grounded in the input image context.

Terminology

Summary

The gist The proposed SAM-DCE framework introduces a prompt-free medical segmentation method that addresses token uniformity and semantic over-smoothing in Segment Anything Model (SAM) by employing a dual-path module, ML-DCE, to balance local discrimination and global semantics.

Problem Definition

Prior studies have demonstrated that the self-attention mechanism in ViTs essentially functions as a low-pass filter, smoothing input features and reducing their variance. As shown Fig.2, SAM stacks ViT layers repeatedly perform spatial smoothing, leading to homogeneous representations of mask tokens. As a result, the model tends to overemphasize high-frequency, strongly discriminative regions while underrepresenting boundaries and tail classes. Since SAM’s final segmentation results rely heavily on the outputs of deep mask tokens, this imbalance further undermines overall performance, particularly in fine-grained boundaries and low-contrast regions.

Multi-Level Decoupled Class Embedding (ML-DCE)

To address token homogenization, the paper proposes the ML-DCE module, which contains two complementary submodules: MCC and ICC. MCC extracts high-level semantic and boundary information from deep decoder layers, while ICC aggregates spatial details from shallow encoder features. Together, they enhance semantic separability and structural consistency, improving segmentation accuracy, particularly for boundaries and low-frequency classes.

Mask-Conditioned Class Token (MCC)

The MCC module employs cross-attention to decouple and aggregate class semantics from candidate mask tokens. Specifically, the mechanism involves using a set of class-initialized queries Q0 ∈ R 1×C×D, which are broadcast to the batch dimension as Q = expand(Q0, B) ∈ R B×C×D. Each class query corresponds to a foreground category and serves as a guide to attend to the mask tokens generated by the decoder. This operation is formalized as A = softmax (QWQ(KWK) T / sqrt(dk)), TMask agg = A(V WV). The final category-aligned representation is obtained by passing the interaction results through a non-linear feedforward network (MLP), yielding the final category-aligned representation: TMCC = MLPT Magg ∈ R B×C×D.

Image-Conditioned Class Token (ICC)

The ICC module incorporates a set of learnable class queries that attend to encoder-derived image embeddings via cross-attention. This design enables ICC to explicitly aggregate spatial priors, boundary-aware cues and local contextual semantics, thereby constructing class-level representations that are structurally grounded. Formally, given encoder embeddings S ∈ R B×N×D, crossattention produces intermediate outputs H(h) for each head h. The final output of ICC is TICC = MLP T Iagg ∈ R B×C×D.

Residual Fusion and Training Objective

The residual stage introduces a Class-Semantic Enhancement mechanism where the background token tbg is separated from TMask to prevent class semantics from being mixed with background information during fusion. A foreground-enhanced sequence is obtained by performing residual fusion between the deep and shallow class information learned by MCC and ICC and the original class tokens, yielding a foregroundenhanced sequence. Finally, the output Tnew is obtained by concatenating tbg with TfgMask, TMCC + α TMCC + β TICC. The overall loss function Lloss is defined as a weighted combination of the Cross-Entropy loss (LCE) and the Dice similarity loss (LDice)

Experimental Results

SAM-DCE achieves state-of-the-art performance with a Mean Dice of 80.54% and an HD95 of 13.66 mm. Our model substantially outperforms the best SAM-based variant, SAMed, improving the Mean Dice by +2.17% while more than halving the boundary error (13.66 mm vs. 27.81 mm). The ablation study shows that incorporating both MCC and ICC together achieves the best performance with a Mean Dice of 80.54%.

Conclusion

In this paper, we have presented SAM-DCE, a dual-path promptfree decoding framework designed to enhance SAM-based medical image segmentation. ML-DCE explicitly disentangles and refines mask tokens through two complementary modules.

Improvements for AI systems

  1. Dual-path token generation for enhanced representation: The ML-DCE module balances local discrimination and global consistency by extracting class semantics from mask tokens using MCC and capturing spatial cues from encoder features via ICC. This allows the system to alleviate token uniformity and enhance inter-class separability, leading to improved boundary delineation.

  2. Semantic refinement of mask tokens: The MCC module uses class-initialized queries to perform selective attention over decoder-generated mask tokens, yielding a category-aligned representation called TMCC. This process ensures that the model extracts features most relevant to its semantic category, mitigating the effect where self-attention mechanism in ViTs essentially functions as a low-pass filter.

  3. Global spatial context integration: The ICC module incorporates learnable class queries that attend to encoder embeddings via cross-attention, effectively integrating spatial priors, boundary-aware cues and local contextual semantics into globally aware class representations. This constructs tokens that are structurally grounded, improving the segmentation of low-frequency categories.

  4. Robust loss function for training: The model utilizes a hybrid loss function Lloss = weighted combination of the Cross-Entropy loss (LCE) and the Dice similarity loss (LDice). This formulation leverages the pixel-level classification accuracy of Cross-Entropy with the global structure awareness of the Dice score, providing a more comprehensive and robust supervisory signal for model optimization.

  5. Improved performance on medical benchmarks: SAM-DCE achieves state-of-the-art results by substantially improving Mean Dice by +2.17% over SAMed and halving boundary error (13.66 mm vs 27.81 mm), demonstrating superior accuracy in complex tasks like segmenting the Left Kidney (91.82%).

Abstract

The Segment Anything Model (SAM) is a promising foundation model for medical image segmentation, but its prompt-driven design is not directly suitable for fully automatic multi-class anatomical segmentation. Without manual point, box, or mask prompts, SAM faces a dual over-smoothing problem: deep image features may lose fine local structural evidence, while mask tokens may become semantically ambiguous. We propose SAM-DCE, a decoupled context enhancement framework for prompt-free medical image segmentation. SAM-DCE introduces Spatial Representation Compensation (SRC) to recover anatomical evidence from intermediate ViT features and Semantic Token Calibration (STC) to improve the category consistency of foreground mask tokens. Rather than replacing the pretrained decoder or fusing output masks, SAM-DCE refines the spatial and semantic representations before recombining them through SAM's original token-to-mask mechanism. On the Synapse multi-organ CT segmentation dataset, SAM-DCE achieved a mean Dice score of 83.86% and an HD95 of 16.04 mm, outperforming the representative CNN-, Transformer-, and SAM-based baselines evaluated here. Ablation experiments further showed that SRC and STC provide complementary improvements, supporting the proposed spatial--semantic factorization for prompt-free SAM adaptation.

Sources

Related papers