Multi-axis External Weight Block (MEWB)
- MEWB is a Transformer-style residual block that replaces conventional self-attention with multi-axis frequency-domain modulation and local depthwise convolution.
- It splits input features into branches processed by three distinct 2D DFTs on different axis pairs to combine global spectral mixing with detailed spatial information.
- Empirical studies show that MEWB boosts segmentation performance by significantly improving metrics like mIoU and DSC compared to traditional methods.
Searching arXiv for the cited papers and closely related work to ground the article. arxiv_search query="(Ruan et al., 2023) OR (Ruan et al., 2022) OR (Lu et al., 19 Sep 2025) OR (Tu et al., 2022)" max_results=10 The Multi-axis External Weights Block (MEWB) is a Transformer-style residual block for medical image segmentation in which the usual self-attention sublayer is replaced by the Multi-axis External Weights mechanism (MEW), a frequency-domain operator that performs axis-pair-specific 2D discrete Fourier transforms, applies learnable external weights in the spectral domain, and reconstructs features by inverse transforms before a feed-forward sublayer refines the result (Ruan et al., 2022). It was introduced as the core token-mixing component of MEW-UNet and later adopted in FMD-TransUNet as a module for injecting multi-axis frequency-domain representation learning into a TransUNet-style architecture (Ruan et al., 2023).
1. Terminology and design rationale
The original terminology distinguishes between the Multi-axis External Weights mechanism (MEW) and the Multi-axis External Weights Block (MEWB). MEW denotes the core frequency-domain operation itself, while MEWB denotes the Transformer-like residual wrapper formed by inserting MEW into a pre-normalized block with an FFN (Ruan et al., 2022). The full segmentation model built around the block is MEW-UNet.
MEWB was proposed to address two linked limitations of prior medical image segmentation systems. First, ViT-based and self-attention-based methods were described as concentrating on the spatial domain, even when the task involved weak boundaries, low contrast, or anatomically complex structures. Second, prior frequency-based approaches were described as relying mainly on single-axis frequency representations, which the authors argued were insufficient when semantic regions remained overlapping under one spectral view. In this formulation, “multi-axis” does not denote a single 3D transform over the full tensor and does not denote three independent 1D transforms. Instead, it denotes three separate 2D DFTs defined on three different axis pairs of a feature tensor: , , and (Ruan et al., 2023).
The intended effect is to combine global spectral structure with local spatial detail. The three frequency branches provide global mixing through Fourier-domain modulation, while a fourth depthwise convolution branch preserves local information. In the authors’ framing, this is especially relevant when organ or lesion boundaries are ambiguous in the spatial domain but occupy more distinguishable signal bands in the frequency domain (Ruan et al., 2023).
2. Formal structure of the block
The MEW mechanism takes an input feature map
splits it into four equal channel branches,
and processes the first three branches in the frequency domain while sending the fourth through a local spatial branch (Ruan et al., 2023).
For branch , the spectral modulation is defined as
where is one of , , or 0, and 1 denotes element-wise multiplication. The inverse step is
2
The branch outputs are then fused by channel concatenation and residual addition: 3
Because the split is into four equal channel groups, each branch is implicitly of shape
4
when 5 is divisible by 4, and the concatenated output returns to
6
The mechanism is therefore shape-preserving (Ruan et al., 2023).
MEWB wraps this mechanism in a Transformer-style pre-normalized residual block: 7
8
Its ordered structure is therefore GroupNorm 9 MEW 0 residual add 1 GroupNorm 2 FFN 3 residual add. In MEW-UNet, GroupNorm with 4 groups is explicitly used rather than LayerNorm or BatchNorm (Ruan et al., 2022).
3. External weights and the Weights Generator
A defining feature of MEWB is the use of external weights rather than self-attention affinities. In self-attention, weights are input-dependent and arise from pairwise interactions such as 4. In MEW, the weighting is instead
5
so the modulation is performed directly in the frequency domain by learnable spectral filters rather than by sample-adaptive token-to-token relations (Ruan et al., 2023).
The paper further states that these spectral weights are generated by an External Weights Generator rather than used as raw randomly initialized tensors. Its compact formulation is
6
where 7 is an initial learnable tensor, 8 denotes bilinear interpolation, and 9 denotes inverted residual block(s) (Ruan et al., 2023). In the more implementation-oriented description of MEW-UNet, the 0 branch uses bilinear interpolation followed by 3 1 2D Inverted Residual blocks, whereas the 2 and 3 branches use the same general strategy with 1D Inverted Residual blocks (Ruan et al., 2022).
The rationale given for the generator is that medical image segmentation is layout-specific, so purely random learnable weights may be insufficient to encode stable semantic and layout structure across samples. The generated external weights are therefore intended to serve as more suitable modulation filters. The text also indicates that the generator is driven by initialized learnable tensors rather than by the current feature map, so the weights are described as externally parameterized filters rather than dynamically conditioned attention maps (Ruan et al., 2023).
Several low-level implementation details are not specified in the supplied descriptions. These include the exact shapes of the spectral weight tensors, the real-versus-complex parameterization of the weights, the precise FFT normalization convention, and the exact handling of complex-valued intermediate representations (Ruan et al., 2022).
4. Architectural placement in segmentation networks
In MEW-UNet, MEWB is the core replacement for self-attention within a five-stage U-shaped encoder-decoder network. The architecture uses stage widths
4
with Stage 1 using only depthwise convolution to aggregate local features and Stages 2–5 first using depthwise convolution to change the number of channels and then applying MEWB. The number of MEWB blocks in the last four stages is
5
The overall network retains the U-shape and skip connections of UNet, while MEWB replaces the self-attention module in the ViT-style components (Ruan et al., 2022).
In FMD-TransUNet, MEWB is not merely a bottleneck insertion but a module used across the encoder and decoder. In the encoder, convolutional layers first extract low-level spatial features; after these convolutions, the MEWB module is applied; then the DA+ block is used before transformer processing. In the decoder, each upsampling block is followed by MEWB, while skip-connected features are refined by DA+ blocks (Lu et al., 19 Sep 2025). The resulting division of labor is explicit: MEWB contributes multi-axis frequency-domain enhancement, DA+ contributes spatial/channel attention refinement and semantic-gap reduction, and the transformer layers provide long-range dependency modeling.
This architectural role clarifies that MEWB is not an auxiliary add-on. In both MEW-UNet and FMD-TransUNet, it functions as the principal mechanism for injecting frequency-domain representation learning into a segmentation backbone (Lu et al., 19 Sep 2025).
5. Empirical behavior and ablation evidence
The most direct evidence for MEWB in MEW-UNet comes from the ISIC18 ablation study, which isolates the contribution of the four branches. The reported results are as follows (Ruan et al., 2023).
| Configuration | mIoU | DSC |
|---|---|---|
| DW only | 80.14 | 88.98 |
| DW + 6 | 80.82 | 89.39 |
| DW + 7 | 81.27 | 89.67 |
| 8, no DW | 81.29 | 89.68 |
| DW + all three axis weights | 81.90 | 90.05 |
These results support two recurring interpretations in the MEW literature. First, multi-axis frequency modeling performs better than a single spectral branch. Second, global frequency information and local spatial information are complementary, since the best configuration combines all three frequency branches with the depthwise local branch (Ruan et al., 2023).
The same study also evaluates the effect of the generator. Replacing the generated spectral weights with only randomly initialized learnable weights degrades performance: mIoU drops from 81.90 to 80.59 and DSC drops from 90.05 to 89.25. This is the main evidence that the External Weights Generator improves the usefulness of the frequency-domain modulation weights (Ruan et al., 2023).
At the full-model level, MEW-UNet reports 81.38 mIoU / 89.73 DSC on ISIC17, 81.90 mIoU / 90.05 DSC on ISIC18, 78.92 DSC / 16.44 HD95 on Synapse, and 91.00 DSC / 1.19 HD95 on ACDC (Ruan et al., 2023). The earlier MEW-UNet report also states that on Synapse the method achieves 78.92 DSC and 16.44 HD95, outperforming MT-UNet by 10.15 mm in HD95 (Ruan et al., 2022).
In FMD-TransUNet, the ablation isolates MEWB relative to baseline TransUNet. Baseline TransUNet achieves average DSC 9 and HD 0 mm; adding only MEWB raises average DSC to 1 and reduces HD to 2 mm. The full model reaches 3 average DSC and 4 mm HD across eight abdominal organs (Lu et al., 19 Sep 2025). The authors explicitly associate the large HD reduction with improved boundary refinement, and they highlight organ-wise gains such as gallbladder DSC from 5 to 6 and spleen DSC from 7 to 8 under the “Only MEWB” setting (Lu et al., 19 Sep 2025).
6. Interpretation, boundaries of specification, and related mechanisms
Several common misunderstandings are explicitly corrected by the source descriptions. The phrase “three axes” is slightly informal: the actual transforms are three axis-pair-specific 2D DFTs on 9, 0, and 1. MEWB is therefore not a single 3D FFT over 2, and it is not a set of three independent 1D transforms (Ruan et al., 2023).
Another important distinction concerns the relation to attention. MEWB replaces self-attention structurally, but its weighting mechanism is not attention in the 3-based sense. Its global modeling comes from Fourier-domain modulation by learned external filters, supplemented by a local depthwise-convolution branch. This suggests a different trade-off: the design avoids explicit token-token affinity matrices and instead uses FFT-based global mixing plus elementwise spectral filtering, although the supplied texts do not provide formal FLOP or asymptotic complexity derivations for MEWB itself (Ruan et al., 2023).
The supplied papers also delimit what is and is not fully specified. What is explicit includes the use of 2D DFT/inverse DFT, the three axis pairs, the fourth DW convolution branch, channel-wise concatenation, GroupNorm, FFN, and residual connections. What remains underspecified includes exact spectral weight tensor shapes, complex-number handling, residual topology in some later adaptations, FFT library details, and several per-stage implementation hyperparameters (Lu et al., 19 Sep 2025).
A broader conceptual comparison appears in MAXIM, but the MAXIM paper does not use the term MEWB. Its nearest analogues are the Multi-Axis Gated MLP block (MAB) and the Cross Gating Block (CGB), which likewise employ multi-axis structured mixing and multiplicative modulation, but they do so through MLP-based spatial gating rather than Fourier-domain external weights (Tu et al., 2022). In that sense, MAXIM belongs to the wider family of multi-axis representation learning, while MEWB remains a specifically frequency-domain construction for segmentation.
Across these formulations, MEWB is best characterized as a frequency-domain alternative to self-attention for segmentation backbones: it preserves the residual-block logic of a Transformer layer, but substitutes relation-driven attention with multi-axis spectral modulation and a local convolutional complement (Ruan et al., 2022).