---
title: Spatial-Frequency Focus Module (SFFM)
url: https://www.emergentmind.com/topics/spatial-frequency-focus-module-sffm
type: topic
---

# Spatial-Frequency Focus Module (SFFM)

Searching arXiv for the cited papers to ground the article in current literature.
Spatial-Frequency Focus Module (SFFM) is a decoder-stage refinement block introduced in HaLoBuild-Net for building extraction from optical remote sensing imagery under hazy and low-light conditions. Its function is to take a fused decoder feature tensor $F_{fused}\in\mathbb{R}^{B\times C\times H\times W}$ and produce a refined tensor $F_{out}$ of the same shape through the coupling of a large-receptive-field spatial-attention pathway and a frequency-aware channel reweighting pathway, followed by element-wise modulation of the original feature map [2604.15088]. Within the cited formulation, SFFM is designed to mitigate meteorological interference on building features by coupling large receptive field attention with frequency-aware channel reweighting guided by stable low-frequency anchors, while the surrounding HaLoBuild-Net architecture further incorporates a Global Multi-scale Guidance Module (GMGM) and a Mutual-Guided Fusion Module (MGFM) [2604.15088].

## 1. Conceptual role and problem setting

SFFM is defined in the context of building extraction from optical remote sensing imagery affected by real-world hazy and low-light degradation. The underlying premise is explicit: under both haze and low-light, high-frequency detail becomes unreliable, whereas low-frequency structure remains stable [2604.15088]. The module therefore combines spatial repair of broken or blurred edges with channel-wise suppression of noisy responses derived from frequency-domain statistics.

Architecturally, SFFM is inserted after multi-source feature fusion in the decoder. At each decoder stage, HaLoBuild-Net fuses features from multiple sources into a single feature tensor $F_{fused}\in\mathbb{R}^{B\times C\times H\times W}$; SFFM then refines this tensor and outputs $F_{out}$ with identical shape [2604.15088]. The described operational decomposition has three parts: a large-receptive-field spatial-attention pathway, a frequency-aware channel reweighting pathway using low-frequency anchors, and a final element-wise modulation that multiplies the two attention maps into the original feature [2604.15088].

This organization suggests that SFFM is not merely a late fusion block, but a feature-selection mechanism operating simultaneously in the spatial and spectral senses. A plausible implication is that its design targets failure modes typical of adverse remote-sensing imagery: edge fragmentation, haze-induced blur, low-light noise, and instability of fine-scale textural cues.

## 2. Decoder-stage formulation and tensor flow

The SFFM pipeline begins with a single input tensor:
\[
F_{fused}\in\mathbb{R}^{B\times C\times H\times W}.
\]

The module produces two intermediate attentional objects:

- a spatial-attention map
  \[
  Attn_{spatial}\in\mathbb{R}^{B\times C\times H\times W},
  \]
- a frequency-derived channel weight
  \[
  W_{freq}\in\mathbb{R}^{B\times C\times 1\times 1}.
  \]

These are combined with the original input through
\[
F_{out}=F_{fused}\odot Attn_{spatial}\odot W_{freq},
\]
where $F_{out}\in\mathbb{R}^{B\times C\times H\times W}$ and $\odot$ denotes element-wise multiplication [2604.15088].

The architectural overview characterizes SFFM as two parallel subnetworks whose outputs are multiplied together and then by the original feature [2604.15088]. This is significant because the two branches do not perform redundant transformations: the spatial branch remains pixel-sensitive and contour-oriented, whereas the frequency branch collapses spatial support into a channel descriptor computed from cropped low-frequency Fourier coefficients.

In implementation terms, the module is used implicitly as part of the full segmentation network rather than being trained with a separate module-specific objective. The source description further states that each convolution or MLP layer is followed by BatchNorm (or LayerNorm) and that a residual connection is placed around the SFFM block for stable gradient flow; no extra spectral or orthogonality regularizer is applied beyond standard weight decay [2604.15088].

## 3. Large-receptive-field spatial attention pathway

The spatial pathway constructs a per-channel, per-pixel attention map intended to repair broken or blurred edges. Its equations are given as follows:
\[
A_1=\mathrm{Conv}_{1\times1}\bigl(\mathrm{DWConv}_{5\times5}(F_{fused})\bigr)
\]
\[
A_2=\mathrm{Conv}_{1\times1}\bigl(\mathrm{DWConv}_{7\times7,d=3}(A_1)\bigr)
\]
\[
A=\mathrm{concat}_c(A_1,A_2),
\]
with
\[
A_1,A_2\in\mathbb{R}^{B\times C\times H\times W},\qquad
A\in\mathbb{R}^{B\times 2C\times H\times W}
\]
[2604.15088].

Here, $\mathrm{DWConv}_{k\times k}$ is specified as a depthwise separable convolution of kernel size $k\times k$, and the second branch uses dilation $d=3$ so that its effective receptive field covers a much larger neighborhood [2604.15088]. The use of both $5\times5$ depthwise separable convolution and dilated $7\times7$ depthwise separable convolution indicates a two-scale local-to-expanded spatial encoding prior to attention estimation.

A two-channel spatial descriptor is then built by pooling along the channel dimension:
\[
S_{avg}=\mathrm{AvgPool}_c(A)\in\mathbb{R}^{B\times1\times H\times W}
\]
\[
S_{max}=\mathrm{MaxPool}_c(A)\in\mathbb{R}^{B\times1\times H\times W}
\]
\[
M_{spatial}=\sigma\bigl(\mathrm{Conv}_{7\times7}(\mathrm{concat}_c(S_{avg},S_{max}))\bigr)\in\mathbb{R}^{B\times2\times H\times W}
\]
[2604.15088].

After splitting $M_{spatial}$ into two single-channel masks $S_1$ and $S_2$, the final spatial attention is
\[
Attn_{spatial}=\mathrm{Conv}_{1\times1}(A_1\odot S_1 + A_2\odot S_2)\in\mathbb{R}^{B\times C\times H\times W}
\]
[2604.15088].

The stated qualitative effect is that this branch “lights up along the real building contours—even in regions where haze has blurred edges—restoring structural continuity” [2604.15088]. This suggests that the large-receptive-field design is used to stabilize contour inference when local gradients alone are insufficient.

## 4. Frequency-aware channel reweighting

The frequency pathway uses the low-frequency portion of the Fourier-transformed feature map as a stable anchor for channel reweighting. Its derivation is:
\[
X_{fft}=\mathrm{FFT}_2(F_{fused})
\]
\[
X_{shift}=\mathrm{FFTShift}(X_{fft})
\]
\[
X_{low}=\mathrm{Crop}_{h\times w}(X_{shift}),
\]
where, if $h=H/4$ and $w=W/4$, only the central low frequencies are retained [2604.15088].

The branch then computes
\[
V_{freq}=\mathrm{Mean}_{sp}(|X_{low}|)\in\mathbb{R}^{B\times C}
\]
and
\[
W_{freq}=\sigma(\mathrm{MLP}(V_{freq}))\in\mathbb{R}^{B\times C\times1\times1}
\]
[2604.15088].

The explicit motivation is that under haze and low-light, high-frequency detail becomes unreliable while low-frequency structure remains stable [2604.15088]. In operational terms, the module therefore transforms $F_{fused}$ to the frequency domain, extracts a small low-frequency square around the center, collapses it to a channel descriptor, and feeds that descriptor through a tiny MLP and sigmoid to generate channel weights [2604.15088].

The reported qualitative behavior is correspondingly channel-selective: the frequency branch down-weights channels that are noisy due to heavy haze scattering or sensor noise in low light and up-weights channels that still retain strong low-frequency building signatures [2604.15088]. The same source further states that, under heavy haze, the mid-frequency channels are completely suppressed, leaving only the most stable low-frequency structure [2604.15088]. This indicates a form of channel gating tied to spectral robustness rather than purely semantic saliency.

## 5. Fusion rule, optimization, and empirical effects

The final SFFM output is formed by multiplicative modulation:
\[
F_{out}=F_{fused}\odot Attn_{spatial}\odot W_{freq}.
\]
This preserves the original feature tensor as the carrier signal while applying spatially varying refinement and channel-wise spectral calibration [2604.15088].

SFFM is trained as part of the full HaLoBuild-Net segmentation objective:
\[
L_{total}=L_{CE}+\lambda\cdot L_{Dice},
\]
where
\[
L_{CE}=-\sum_i\sum_c y_{i,c}\cdot \log p_{i,c}
\]
and
\[
L_{Dice}=1-\frac{2\sum_i p_i y_i+\epsilon}{\sum_i p_i+\sum_i y_i+\epsilon}.
\]
The description further specifies that $\lambda$ is typically set to $1.0$ and $\epsilon$ is a small constant for stability [2604.15088].

The ablation isolating SFFM compares a baseline decoder without SFFM, MGFM, or GMGM against an otherwise identical system with SFFM inserted at each stage. The exact results from Table 5 are as follows [2604.15088]:

| Setting | HaLo-L (IoU / F1) | HaLo-H (IoU / F1) |
|---|---:|---:|
| Baseline | 66.40 / 79.81 | 67.92 / 80.90 |
| + SFFM | 67.28 / 80.44 | 68.86 / 81.56 |

These correspond to absolute gains of $+0.88$ IoU and $+0.63$ F1 on HaLo-L, and $+0.94$ IoU and $+0.66$ F1 on HaLo-H [2604.15088]. When all three modules are used together, the network reaches HaLo-L IoU $=68.90$ and HaLo-H IoU $=70.88$, corresponding to gains of $+2.50$ and $+2.96$ over baseline, respectively [2604.15088].

The qualitative effects attached to these numbers are equally specific. The combined dual-domain modulation is reported to suppress spurious false positives such as bright vegetation under haze and to fill in gaps in texturally weak areas such as dark rooftops at night [2604.15088]. This suggests that the measured gains are associated both with boundary recovery and with noise-aware feature pruning.

## 6. Distinction from related spatial-frequency fusion modules

A recurrent source of confusion is nomenclature. SFFM in HaLoBuild-Net should be distinguished from the Spatial-Frequency Fusion Interaction Module (SFFIM) used in BASFNet for camouflaged object detection [2604.17879]. Although both modules operate across spatial and frequency cues, their roles, inputs, and internal logic are different.

In BASFNet, SFFIM is positioned after two upstream modules: the Frequency-Enhanced Edge Exploration Module (FEEM), which produces frequency-domain edge cues, and the Spatial Core Segmentation Module (SCSM), which produces spatial-domain object cues. At each scale, SFFIM receives $F_{fre}^i$, $F_{spa}^i$, and the previous fused feature $F_{fuse}^{i-1}$, then performs enhanced feature fusion, dual-branch local/global fusion, and refinement to produce $F_{fuse}^i$ [2604.17879]. By contrast, SFFM in HaLoBuild-Net starts from a single already fused decoder tensor $F_{fused}$ and applies parallel spatial and frequency attentional modulation to that tensor [2604.15088].

The distinction is not merely terminological. SFFIM in BASFNet explicitly merges outputs from separate frequency and spatial branches using local and global fusion blocks, whereas SFFM computes a large-receptive-field spatial-attention map and a low-frequency-guided channel weighting vector, then multiplies both into the original feature [2604.17879]. A plausible implication is that SFFIM is a cross-stream interaction module, while SFFM is a single-stream refinement module with dual-domain attentional calibration.

This comparison also clarifies a broader methodological point. Spatial-frequency design in recent dense prediction systems is not a single template: one formulation can emphasize branch interaction across modalities or domains, while another can emphasize robustness-oriented reweighting within a fused representation. SFFM belongs to the latter category as specified in HaLoBuild-Net [2604.15088].

Source: https://www.emergentmind.com/topics/spatial-frequency-focus-module-sffm