---
title: Scale-Attentive maMBA (SAMBA) in RetinexDual
url: https://www.emergentmind.com/topics/scale-attentive-mamba-samba
type: topic
---

# Scale-Attentive maMBA (SAMBA) in RetinexDual

Searching arXiv for the exact SAMBA usage and related naming ambiguities.
Scale-Attentive maMBA (SAMBA) is the reflectance-restoration sub-network in RetinexDual, a Retinex-based dual-branch framework for generalized ultra-high-definition image restoration. In RetinexDual, a degraded image is decomposed into an effective reflectance component and an effective illumination component; SAMBA operates on the reflectance branch, while the Frequency Illumination Adaptor (FIA) operates on the illumination branch. Within this formulation, SAMBA is designed to correct artifacts and distortions in reflectance, reduce artifacts, and restore intricate details through a coarse-to-fine, multi-scale, Mamba-based mechanism [2508.04797].

## 1. Definition within RetinexDual

RetinexDual models a degraded image through a Retinex decomposition in which reflectance and illumination are restored by different modules. The paper writes
\[
R_{eff},L_{eff}=\psi_d(x), \qquad \hat R=-\mathcal S(R_{eff}), \qquad \hat L=-\mathcal F(L_{eff}),
\]
with \(\mathcal S\) denoting SAMBA and \(\mathcal F\) denoting FIA. The restored image is reconstructed as
\[
I = R \odot L,
\]
where
\[
R = R_{eff}-\hat R,\qquad L=L_{eff}-\hat L.
\]
In this decomposition, SAMBA is assigned to reflectance because reflectance is treated as carrying object structure, textures, hidden details, and degradation artifacts, whereas illumination correction is handled in the frequency domain by FIA [2508.04797].

The architectural role is therefore narrower and more specific than the acronym alone might suggest. SAMBA is not the whole RetinexDual system; it is the reflectance-restoration branch placed after the decomposer and before final recombination. Its target degradations are the spatially localized failures that dominate UHD restoration: local blur, localized corruption, texture loss, and fine-structure degradation. This division of labor is central to RetinexDual’s design, because the paper argues that pure downsampling loses crucial details irreversibly, while pure frequency-domain restoration is weak for spatially localized artifacts due to loss of degradation locality [2508.04797].

## 2. Motivation and meaning of “scale-attentive”

SAMBA is introduced against two lines of criticism. First, prior UHD restoration pipelines based on “Downsampling–Enhancement–Upsampling” are said to be ill-suited to UHD inputs because extreme downsampling removes crucial details irreversibly. Second, pure frequency-domain pipelines are described as useful for global degradations such as illumination or haze patterns, but weak for spatially localized artifacts because the frequency representation loses the locality of degradation. RetinexDual answers this by restoring reflectance spatially with SAMBA and illumination in the frequency domain with FIA [2508.04797].

A second motivation is specific to Mamba-like vision models. The paper argues that many vision adaptations of Mamba still inherit causal modeling: in the authors’ formulation, the \(i\)-th pixel can only observe the previous \(i-1\) pixels in the scanned sequence. This produces three problems for image restoration: causal information restriction, mismatch with spatial inductive bias, and long-range decay defects. SAMBA is introduced to mitigate these issues through a coarse-to-fine design that makes Mamba aware of multiple feature-map scales [2508.04797].

In this paper, “scale-attentive” does not mean standard attention over scales in the Transformer sense. It refers instead to using three explicit feature-map scales—\(1\), \(1/2\), and \(1/4\) resolution versions of the same feature—and letting the Mamba-based processing adapt according to relations among regions at different scales. Coarser scales are used to expose long-range and semantically similar structures that are difficult to connect causally at full resolution, while the fine scale preserves textures and local structure. This suggests that scale-attentiveness in SAMBA is implemented as content-adaptive weighting and fusion of multi-scale features inside a Mamba-derived restoration block, rather than as a separate scale-attention operator [2508.04797].

## 3. Encoder–decoder structure and the Scale Adaptive Mamba Block

SAMBA is described as an encoder–decoder-based model with 3 Scale Adaptive Mamba Blocks (SAMBs). The paper does not provide a full stage-by-stage table with exact channel widths or block counts, but it states that each SAMB uses a Residual Diluted Block (RDB), a Diluted convolution Block (DB) over three scales, a Group State Space Block (GSSB), split/fusion operations, and residual addition [2508.04797].

The core SAMB equations are
\[
\begin{aligned}
x_{s} =&\; RDB(x_{in})\\
x_{0}, x_{1}, x_{2} = &\; Up(DB(x_{s},x_{s \downarrow},x_{s\downarrow\downarrow}))\\
\hat{x}_{0}, \hat{x}_{1}, \hat{x}_{2} =&\; \mathcal{S}(GSSB(\mathcal{C}[x_{0}, x_{1}, x_{2}]))\\
x' = (&\sum_{i=0}^{2} x_{i} \odot \hat{x}_{i})+x_{s},
\end{aligned}
\]
where \(x_{in}\) is the block input, \(x_s\) is the locally refined feature, \(x_{s\downarrow}\) and \(x_{s\downarrow\downarrow}\) are the \(1/2\) and \(1/4\) downsampled features, \(Up\) is bilinear interpolation, \(\mathcal C[\cdot]\) is channel concatenation, and \(\mathcal S\) is the split operation [2508.04797].

Operationally, the block first performs local feature refining with RDB. It then constructs three scale-aligned feature maps: full, half, and quarter resolution, all upsampled back to the original size. These are concatenated and passed through GSSB, then split back into three scale-specific modulators \(\hat x_0,\hat x_1,\hat x_2\). The final fusion is scale-wise and multiplicative:
\[
\sum_{i=0}^{2} x_i \odot \hat x_i,
\]
followed by residual addition with \(x_s\). This is the paper’s practical meaning of scale adaptivity: the block does not average scales uniformly, but modulates each scale content-adaptively before fusion [2508.04797].

The explicit tensor convention given in the paper is
\[
x_{in} \in \mathbb R^{H\times W\times C},
\]
with
\[
x_s \in \mathbb R^{H\times W\times C},\quad
x_{s\downarrow}\in \mathbb R^{H/2\times W/2\times C},\quad
x_{s\downarrow\downarrow}\in \mathbb R^{H/4\times W/4\times C}.
\]
After upsampling,
\[
x_0,x_1,x_2 \in \mathbb R^{H\times W\times C},
\]
and concatenation gives
\[
\mathbb R^{H\times W\times 3C}.
\]
This makes SAMB a joint cross-scale mixer rather than a late-fusion pyramid [2508.04797].

## 4. Group State Space Block and attentive state-space modeling

The Mamba-derived sequence modeling enters through the Group State Space Block (GSSB), whose internal token mixer is the Group State Space Module (GSSM). GSSB is formulated as
\[
\begin{aligned}
\hat x &= GSSM(LN(x)) + s \cdot x, \\
x' &= FFN(LN(\hat x)) + s' \cdot \hat x,
\end{aligned}
\]
where \(x\in\mathbb R^{H\times W\times 3C}\), \(LN\) is Layer Normalization, \(FFN\) is a convolutional feed-forward network, and \(s,s'\in \mathbb R^{1\times 1\times 3C}\) are learnable residual scaling weights [2508.04797].

GSSM introduces two mechanisms intended to offset the causal limitation of Mamba. First, it applies positional encoding and uses local embedding \(E_l\) and global embedding \(E_g\) to construct an image-specific embedding
\[
E = (E_l E_g)Y_{cp},
\]
where \(Y_{cp}\) is a classification policy over embeddings for flattened input tokens and Gumbel-softmax is used to produce one-hot selection. Second, instead of a naive raster scan it uses Semantic Guided Neighboring (SGN), adopted from MambaIRv2, to order regions by semantic similarity across scales [2508.04797].

The paper’s most explicit change to the state-space equations is in the output equation. After presenting the standard preliminaries
\[
h'(t)=Ah(t)+Bx(t), \qquad y(t)=Ch(t)+Dx(t),
\]
and the discretization
\[
\bar A=e^{\Delta A}, \qquad \bar B=(\Delta A)^{-1}(e^{\Delta A}-I)\cdot \Delta B,
\]
SAMBA modifies the readout in GSSM to
\[
\begin{aligned}
h'(t) &= \bar{A}h(t) + \bar{B}x(t), \\
y(t) &= (C+E)h(t) + Dx(t).
\end{aligned}
\]
Here \(E\) is the image-specific embedding. This makes the state-space readout image-adaptive rather than using only a fixed \(C\) [2508.04797].

This modification is important because SAMBA’s remedy for causal blindness is not merely to change scan direction. The paper’s claim is that coarse-to-fine multi-scale features, semantic-guided scanning, and the image-specific embedding jointly provide missing information from unseen regions. A plausible implication is that SAMBA approximates a more non-causal, globally informed restoration process while retaining the efficiency advantages associated with Mamba-like state-space modeling [2508.04797].

## 5. Empirical evidence and implementation profile

The strongest direct evidence for SAMBA comes from the UHD-LL ablations reported inside RetinexDual. Under “Scale Attentive maMBA (SAMBA),” removing either the multi-scale design or the GSSB degrades restoration quality substantially [2508.04797].

| Variant | PSNR | SSIM |
|---|---:|---:|
| w/o Multi-scale | 26.96 | 0.906 |
| w/o GSSB | 25.49 | 0.908 |
| w/o GSSB & Multi-scale | 24.83 | 0.876 |
| Full model | 28.79 | 0.934 |

These results support three claims made in the paper. First, the multi-scale design matters: removing it drops PSNR from \(28.79\) to \(26.96\) and SSIM from \(0.934\) to \(0.906\). Second, the Mamba-based GSSB matters: removing it yields an even larger PSNR drop to \(25.49\). Third, the combination matters most: removing both gives the worst result, \(24.83/0.876\) [2508.04797].

The branch-level RetinexDuality ablation further supports SAMBA’s specific role on reflectance. On UHD-LL, using FIA for both \(R\) and \(L\) gives \(24.83/0.866\), using SAMBA for both branches gives \(27.91/0.920\), removing the FIA branch gives \(26.67/0.919\), removing the SAMBA branch gives \(23.83/0.866\), and the full dual-branch model reaches \(28.79/0.934\). This indicates that SAMBA is specifically well matched to the reflectance component, but the specialized dual-branch decomposition remains superior to using SAMBA alone for both branches [2508.04797].

The implementation details explicitly given for SAMBA are limited but consequential. SAMBA is an encoder–decoder model with 3 SAMBs, each using 3 scales \((1, 1/2, 1/4)\). Upsampling is bilinear interpolation. GSSB uses LayerNorm, a convolutional FFN, and learnable residual scales. Full RetinexDual training uses AdamW, an initial learning rate of \(10^{-4}\), a final learning rate of \(10^{-7}\) via cosine annealing, crop size \(768\times768\), batch size \(6\), and 4 NVIDIA H100 GPUs [2508.04797].

The full model loss is
\[
\mathcal{L} = \lambda_{cb}\mathcal{L}_{cb}(I,\hat I)+\lambda_{FFT}\mathcal{L}_{1}(FFT(I),FFT(\hat I)) +\lambda_{ssim}\mathcal{L}_{ssim}(I,\hat I)+\lambda_{p}\mathcal{L}_{p}(I,\hat I),
\]
with
\[
\lambda_{cb}=1,\quad \lambda_{FFT}=0.1,\quad \lambda_{ssim}=0.5,\quad \lambda_p=0.4.
\]
Deep supervision is applied at 3 output scales [2508.04797].

The paper also reports overall 4K-image inference time for RetinexDual: Wave-Mamba \(0.957\) s, ERR \(0.601\) s, D2Net \(1.63\) s, and RetinexDual \(0.955\) s. The conclusion explicitly states that the model is not optimized in inference time and size, so SAMBA is not presented as the fastest UHD solution [2508.04797].

## 6. Terminology, scope, and naming ambiguity

Within arXiv usage, “SAMBA” is not a unique acronym. The exact phrase “Scale-Attentive maMBA” is used for the reflectance branch in RetinexDual [2508.04797], but several other papers use “SAMBA” or “Samba” for unrelated models. In finance, “Mamba Meets Financial Markets” introduces SAMBA as a Graph-Mamba framework for stock return prediction and explicitly notes that the paper does not expand SAMBA as “Scale-Attentive maMBA” [2410.03707]. In long-context language modeling, “Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling” uses Samba for a hybrid Mamba–Sliding Window Attention language model, again without the scale-attentive expansion [2406.07522]. In EEG modeling, “SAMBA: Toward a Long-Context EEG Foundation Model via Spatial Embedding and Differential Mamba” defines yet another SAMBA, also not as Scale-Attentive maMBA [2511.18571]. In salient object detection, “Samba+” means Saliency Mamba rather than Scale-Attentive maMBA [2602.01593].

For the specific Scale-Attentive maMBA of RetinexDual, several limitations remain explicit. The paper does not provide exact channel widths, exact GSSM dimensionalities, exact downsampling operators in SAMB, the exact encoder–decoder stage layout, or a definitive statement on whether scanning is bidirectional or only SGN-reordered unidirectional. It also notes that the overall model is not optimized for inference time or size and still struggles on some hard images [2508.04797].

Taken in its own terms, SAMBA is best understood not as a general-purpose Mamba backbone, but as a UHD image restoration sub-network specialized for reflectance correction. Its defining idea is that coarse-to-fine, scale-attentive processing compensates for Mamba’s causal limitations by combining three-scale feature construction, joint cross-scale state-space mixing, and semantically guided image-adaptive readout inside a Retinex decomposition framework [2508.04797].

Source: https://www.emergentmind.com/topics/scale-attentive-mamba-samba