Papers
Topics
Authors
Recent
Search
2000 character limit reached

Bilateral Spectrum Aligner (Bi-SAB)

Updated 7 July 2026
  • Bi-SAB is a decoder block in DRWKV that fuses brightness and color features using cross-attentive alignment to mitigate brightness–color misalignment and artifact amplification.
  • It combines spectral enhancement, edge-guided refinement, and feature difference adjustment to ensure restored images have natural brightness, faithful color, and crisp edges.
  • Empirical tests demonstrate that integrating Bi-SAB improves PSNR and SSIM metrics while reducing computational cost in low-light image enhancement tasks.

Searching arXiv for the specified paper to ground the article in the primary source. Search query: (Bai et al., 24 Jul 2025) OR "DRWKV: Focusing on Object Edges for Low-Light Image Enhancement" The Bilateral Spectrum Aligner (Bi-SAB) is a decoder block introduced in DRWKV for low-light image enhancement, where it serves as the module responsible for jointly refining luminance and chrominance features so that enhanced outputs exhibit natural brightness, faithful color, and minimal artifacts. Within DRWKV, which also integrates Global Edge Retinex (GER) theory to decouple illumination and edge structures and Evolving WKV Attention to model spatial edge continuity, Bi-SAB functions as the principal brightness–color fusion mechanism in the decoder and is trained end-to-end under the tailored MS2^2-Loss regime (Bai et al., 24 Jul 2025).

1. Functional role within DRWKV

Bi-SAB is inserted in the decoder of DRWKV at each resolution level where a cross-scale skip connection joins the encoder and decoder. Its inputs and output share the same tensor shape, with low-level feature F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W} carrying fine details and brightness cues, higher-level feature F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W} carrying richer color and contextual information, and output feature FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W} (Bai et al., 24 Jul 2025).

In this placement, Bi-SAB is not a stand-alone enhancement network but a decoder-stage fusion unit. A common simplification is to treat it as only an attention block; in DRWKV it is instead a composite module whose operation combines cross-attentive alignment, spectral enhancement, and edge-guided refinement. This architectural role is central to the paper’s broader claim that low-light enhancement quality depends not only on illumination correction, but also on controlled coordination between brightness restoration, color consistency, and edge preservation.

2. Motivation: spectral alignment for brightness–color fusion

The paper motivates Bi-SAB by identifying two failure modes that arise under extreme low-light conditions when illumination and color are enhanced separately. The first is Brightness–Color Misalignment: a luminance-only branch may over-brighten regions without simultaneously correcting color statistics, producing hue shifts or patchy color reproduction, while a chrominance branch that depends on deeper features may lose edge fidelity when its color adjustments are applied after brightening. The second is Artifact Amplification: if noise is amplified in the brightness path and then recolored by chrominance corrections, ringing, halos, and color speckles become more visible (Bai et al., 24 Jul 2025).

Bi-SAB is designed specifically to address those two modes. The paper describes three design principles. Cross-Attentive Alignment allows the brightness feature to query the color feature through a lightweight cross-attention mechanism so that color statistics are drawn from the appropriate spatial locations. Spectral Enhancement uses a Spectral Alignment Enhancer (SAE) to adaptively fuse corrected feature spectra in order to suppress noise and reinforce weak edges. Edge-Guided Refinement adds a Scharr Edge Enhancement (SEE) path to preserve and sharpen fine structural detail. Together, these principles are intended to make the fusion both luminance-coherent and chrominance-faithful. A plausible implication is that Bi-SAB operationalizes “spectral alignment” not as a frequency-domain transform in isolation, but as a coordinated feature-space alignment between brightness-related and color-related representations.

3. Internal structure and data flow

Bi-SAB comprises four sub-modules arranged after initial query–key–value projection. The projections are

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),

with each convolution using CC input and CC output channels (Bai et al., 24 Jul 2025).

Component Core operation Declared purpose
Cross-Attention (CA) Brightness queries color through lightweight cross-attention Spatially aligned color statistics
Feature Difference Adjustment (FDA) Combines attended feature, key, value, and query with fixed λ\lambda Corrective fusion before spectral enhancement
Scharr Edge Enhancement (SEE) Fixed Scharr gradients plus convolutional restoration Preserve and sharpen structural detail
Spectral Alignment Enhancer (SAE) Layer-normalized, split-stream depth-wise processing and multiplicative fusion Suppress noise and reinforce weak edges

The Cross-Attention (CA) module produces

Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.

According to the paper, CA uses 1×11 \times 1 and then F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}0 depth-wise convolutions to generate F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}1, F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}2, and F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}3, splits channels into F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}4 heads, performs per-head F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}5 normalization, computes softmaxed cross-covariance attention, and re-projects the result to F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}6 channels. This makes the color/context feature F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}7 the source of both key and value information while the low-level detail feature F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}8 provides the query signal.

The Feature Difference Adjustment (FDA) stage then computes

F1RB×C×H×WF_1 \in \mathbb{R}^{B \times C \times H \times W}9

F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}0

F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}1

The fixed coefficient F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}2 constrains the scale of the attention-modulated correction.

The Scharr Edge Enhancement (SEE) branch computes F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}3, where fixed Scharr kernels F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}4 and F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}5 extract gradients, the gradients are fused, and the result is restored through a F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}6 convolutional path with SiLU. In parallel, the Spectral Alignment Enhancer (SAE) computes

F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}7

where the normalized feature is expanded by F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}8, split into two halves, each half is processed by F1RB×C×H×WF_1' \in \mathbb{R}^{B \times C \times H \times W}9 residual, the two streams are multiplied element-wise, and a final FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}0 reduces the channels back to FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}1. The final output is

FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}2

This decomposition makes clear that Bi-SAB is not a purely attentional decoder block. Its output is explicitly the sum of a spectrum-aligned branch and an edge-preserving branch, which is consistent with the paper’s emphasis on simultaneously maintaining color naturalness and edge continuity.

4. Exact mathematical formulation

The paper presents the complete Bi-SAB formulation for FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}3 as follows (Bai et al., 24 Jul 2025).

For the projection stage,

FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}4

where each FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}5 denotes a FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}6 convolution.

For cross-attention, the channels are split into heads:

FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}7

with analogous definitions for FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}8 and FoutRB×C×H×WF_{\text{out}} \in \mathbb{R}^{B \times C \times H \times W}9. Per-head normalization is

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),0

The cross-covariance attention matrix is

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),1

and the aggregated values are

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),2

After rearrangement and projection,

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),3

For Feature Difference Adjustment,

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),4

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),5

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),6

For Scharr Edge Enhancement,

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),7

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),8

FQ=Conv3×3(F1),FK=Conv3×3(F1),FV=Conv3×3(F1),F_Q = \mathrm{Conv}_{3 \times 3}(F_1), \qquad F_K = \mathrm{Conv}_{3 \times 3}(F_1'), \qquad F_V = \mathrm{Conv}_{3 \times 3}(F_1'),9

CC0

For the Spectral Alignment Enhancer,

CC1

CC2

CC3

CC4

The block concludes with

CC5

Formally, this structure couples channel-wise cross-covariance attention with multiplicative spectral fusion and explicit gradient-based structural injection. This suggests that the block’s behavior is governed by two complementary priors: cross-feature correspondence across luminance and chrominance pathways, and local edge stability under restoration.

5. Optimization under MSCC6-Loss and implementation choices

The entire DRWKV network, including Bi-SAB, is trained end-to-end using the multi-term MSCC7-Loss, which enforces five objectives: pixel-wise reconstruction CC8, edge sparsity CC9, illumination smoothness CC0, artifact suppression CC1, and parameter regularization CC2 (Bai et al., 24 Jul 2025).

The loss terms are defined as

CC3

CC4

CC5

CC6

CC7

The total loss is

CC8

The paper attributes distinct roles to Bi-SAB within this loss regime. Its cross-attention and spectral enhancer actively reduce CC9 by improving alignment of brightness and color, and reduce λ\lambda0 by suppressing noise–color misregistration, while the SEE branch supports λ\lambda1 by preserving true edges. This suggests that Bi-SAB is supervised indirectly through a coupled restoration objective rather than by an isolated color-alignment criterion.

Implementation details are specified with unusual precision. At each Bi-SAB resolution level, the channel count is λ\lambda2. All convolutions use kernel sizes λ\lambda3 or λ\lambda4, and the depth-wise convolutions in CA and SAE have one group per channel. Cross-attention uses λ\lambda5 heads with learnable temperature λ\lambda6 initialized to λ\lambda7, and the FDA weight λ\lambda8 is fixed. DRWKV is trained with Adam using λ\lambda9 and Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.0, initial learning rate Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.1, cosine annealing to Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.2 over 500 epochs, and batch size tuned to fill an A800-80 GB GPU. The loss weights are Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.3, Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.4, Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.5, Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.6, and Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.7. The input crop size is Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.8, and up/down-sampling in other DRWKV stages is performed via wavelet transforms.

6. Quantitative contribution, visual effects, and interpretation

On the LOLv2-Real test set, the paper reports a progressive ablation isolating Bi-SAB’s effect. A baseline with ES-RWKV + SIR and no Bi-SAB obtains Fattn=CA(FQ,FK)RB×C×H×W.F_{\text{attn}} = \mathrm{CA}(F_Q, F_K) \in \mathbb{R}^{B \times C \times H \times W}.9 dB and 1×11 \times 10. Adding Bi-SAB while still using SSIM + 1×11 \times 11 loss raises performance to 1×11 \times 12 dB and 1×11 \times 13, corresponding to gains of 1×11 \times 14 dB and 1×11 \times 15, respectively. Replacing the 1×11 \times 16 loss with MS1×11 \times 17-Loss further increases performance to 1×11 \times 18 dB and 1×11 \times 19 (Bai et al., 24 Jul 2025).

The same ablation is used to support an efficiency claim: spectral alignment alone yields a substantial improvement in both distortion and perceptual metrics while halving the model’s GFLOPS relative to a naïve UNet-style integration. Within the scope of the paper, this identifies Bi-SAB as a decoder mechanism intended to improve fidelity without disproportionate computational growth.

The paper also attributes several qualitative effects to Bi-SAB’s aligned outputs: elimination of color bleeding and hue shifts around bright edges, cleaner shadow regions without colored noise speckles, and crisp edge continuity consistent with human perception. It further states that these effects are validated by a user-study MOS increase over the nearest competitor. Because no separate MOS value is provided in the supplied data, the result is best interpreted qualitatively rather than as a quantified benchmark comparison.

Several clarifications follow from the ablation. First, Bi-SAB should not be understood as contributing only chromatic correction; the reported gains include both PSNR and SSIM improvement, indicating impact on distortion-oriented and structural quality measures. Second, its effect is not reducible to attention alone, because the block’s declared contribution depends on the combination of CA, SAE, and SEE. Third, its role is specifically decoder-centric: it aligns skip-connected low-level and high-level features during reconstruction, rather than replacing the paper’s separate mechanisms for illumination–edge decoupling or spatial continuity modeling.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Bilateral Spectrum Aligner (Bi-SAB).