DFDNet: Frequency-Guided Nighttime Deflare
- The paper introduces a de-flare network that leverages frequency discrepancies to decouple flare artifacts from scene content in nighttime images.
- It integrates a global dynamic frequency-domain guidance module with a local detail guidance mechanism to suppress large-scale flares while repairing fine details.
- Experimental results demonstrate significant improvements in PSNR and SSIM, surpassing state-of-the-art methods on both synthetic and real-world datasets.
Searching arXiv for the specified paper to ground the article in the cited source. Dynamic Frequency-Guided De-Flare Network (DFDNet) is a nighttime image restoration method for removing flare artifacts produced by strong light sources while preserving scene content and repairing structural damage near the light source. It is presented as a de-flare network that exploits the observation that challenging flare artifacts exhibit more significant discrepancies from reference images in the frequency domain than in the spatial domain. On that basis, DFDNet decouples content information from flare artifacts in the frequency domain and combines a global dynamic frequency-domain guidance mechanism with a local detail guidance mechanism to address both large-scale flare suppression and fine-grained restoration (Xue et al., 23 Jul 2025).
1. Problem setting and motivating observation
Nighttime photography is frequently degraded by flare artifacts caused by strong light sources. These artifacts significantly reduce visual quality and also affect downstream tasks. Existing methods are described as continuing to struggle with two specific difficulties: removing large-scale flare artifacts and repairing structural damage in regions near the light source (Xue et al., 23 Jul 2025).
The central observation behind DFDNet is that these difficult flare artifacts show more significant discrepancies from reference images in the frequency domain than in the spatial domain. This motivates a restoration strategy that does not rely exclusively on spatial-domain processing, but instead explicitly models frequency characteristics in order to separate flare information from content information. In this formulation, flare removal is treated not merely as local artifact suppression but as a frequency-guided disentanglement problem.
This suggests that DFDNet is positioned within a broader class of restoration models that use spectral structure to distinguish degradations from semantic content, while also recognizing that frequency-domain filtering alone is insufficient for preserving the delicate structure around intense light sources. The addition of local feature alignment addresses that second requirement.
2. Network architecture
DFDNet is built on a U-shaped Transformer (Uformer) backbone augmented with two complementary components: Global Dynamic Frequency-Domain Guidance (GDFG) modules and a Local Detail Guidance Module (LDGM) (Xue et al., 23 Jul 2025). The architecture follows an encoder–bottleneck–decoder topology with GDFG inserted throughout the hierarchy.
The input flare-corrupted image is denoted by . It is first passed through a convolution followed by LeakyReLU to produce low-level features . The encoding path contains four stages. At stage , the incoming feature is processed by GDFG and then downsampled to form , where downsampling is implemented using a convolution with stride $2$. In the bottleneck, another GDFG module isolates flare signatures in latent space. The decoding path mirrors the encoder: each stage upsamples with a transposed convolution, concatenates the result with the corresponding encoder feature, applies GDFG, and produces . A final 0 convolution outputs both the restored image 1 and an estimated flare map 2 (Xue et al., 23 Jul 2025).
LDGM is applied on top of the final output and operates on small patches near the light source between 3 and the ground-truth clean image 4. In architectural terms, DFDNet therefore combines global frequency-domain guidance distributed across the backbone with local patch-level supervision at the output stage. The division of labor is explicit: GDFG targets flare/content separation, whereas LDGM targets preservation of local details that are vulnerable to over-smoothing during flare removal.
3. Global Dynamic Frequency-Domain Guidance
The GDFG module dynamically learns per-channel Fourier filters to suppress flare frequencies while preserving content (Xue et al., 23 Jul 2025). Its construction consists of three parts: discrete Fourier analysis and synthesis, learnable multichannel frequency weighting, and residual feature transformation.
For a feature map 5, GDFG first uses the discrete Fourier transform and inverse discrete Fourier transform: 6
7
The module initializes 8 complex filters 9, each in 0. Given input features 1, it computes per-channel global averages
2
The resulting vector 3 is then passed through a two-layer MLP with LayerNorm and StarReLU: 4 After reshaping 5 into logits 6, a softmax is applied across the filter index 7: 8 This yields a dynamic channel-specific frequency weight
9
Frequency filtering is then performed channel-wise: 0 The final GDFG output is formed through residual addition followed by LayerNorm and MLP: 1
The functional role of GDFG is to guide the network to perceive the frequency characteristics of flare artifacts by dynamically optimizing global frequency-domain features, thereby separating flare information from content information (Xue et al., 23 Jul 2025). A plausible implication is that the dynamic weighting over a small bank of complex filters allows the module to adapt to different flare patterns without fixing a single global frequency prior.
4. Local Detail Guidance Module
The Local Detail Guidance Module is designed via a contrastive learning strategy that aligns local features of the light source with the reference image, reduces local detail damage from flare removal, and improves fine-grained image restoration (Xue et al., 23 Jul 2025). It addresses the failure mode in which aggressive artifact suppression can damage structures in the vicinity of bright sources.
LDGM operates on local patches around the light source in the restored image 2 and the clean reference 3. A set of 4 patches is randomly cropped from the same spatial region. The query 5 is a patch feature from 6, the positive 7 is the same-position patch from 8, and the negatives 9 are all other patches, including background and halos. These are mapped to unit-normalized vectors 0, and cosine similarity is defined as
1
The contrastive objective is the InfoNCE loss with temperature 2: 3
In effect, LDGM enforces correspondence between restored and reference local patches while pushing the restored representation away from mismatched local structures. This suggests that the module is intended to preserve discriminative detail specifically in regions where flare corruption is most severe, rather than uniformly over the full image.
5. Training objective and optimization
During training, the flare-corrupted image is decomposed as 4, and the network 5 predicts 6 (Xue et al., 23 Jul 2025). The training objective combines three losses: perceptual/content reconstruction, frequency-domain consistency, and local detail guidance.
The perceptual/content reconstruction loss is
7
The frequency-domain consistency loss applies the Fourier transform 8 to the restored and ground-truth images, decomposes them into amplitude and phase, and penalizes both: 9
0
Together with the local detail guidance term 1, the combined loss is
2
with default 3 and 4.
The implementation details specify a Uformer backbone with four down/up stages and feature dimension 5 per stage, commonly 6. The GDFG filter count is 7, and the MLP hidden size is 8. Training uses input size 9, batch size 0, and Adam with 1, initial learning rate 2, halved at iterations 3 and 4, with a total of 5 iterations (Xue et al., 23 Jul 2025).
The data augmentation protocol follows Flare7K++ and includes inverse gamma correction with 6 on both scene and flare; random rotation in 7; translation of 8 px; shear of 9; scale in $2$0; blur with $2$1; horizontal and vertical flip; global color shift of $2$2; per-channel RGB scaling in $2$3; and additive Gaussian noise with $2$4 (Xue et al., 23 Jul 2025).
6. Experimental findings
The reported experimental results show that DFDNet outperforms existing state-of-the-art methods in performance (Xue et al., 23 Jul 2025). On Flare7K++ real and synthetic paired tests, PSNR increases from $2$5 dB to $2$6 dB on real data and from $2$7 dB to $2$8 dB on synthetic data. SSIM reaches $2$9 on real data and 0 on synthetic data. G-PSNR improves by approximately 1 dB on real data and approximately 2 dB on synthetic data, while S-PSNR improves by approximately 3 dB on real data and approximately 4 dB on synthetic data (Xue et al., 23 Jul 2025).
Qualitative comparisons indicate stronger suppression of large glare and streak artifacts and superior preservation of light-source details, including in spatial and frequency-spectrum comparisons. Relative to WaveDM and FPro, identified as FFT-based methods, DFDNet is reported to preserve mid- and high-frequency textures while suppressing low-frequency flare noise more effectively (Xue et al., 23 Jul 2025).
On unpaired real-world tests, DFDNet achieves the best NIQE, MUSIQ, and PI on two challenging consumer and real flare datasets, which is presented as evidence of robust generalization to varying camera hardware and unseen flare patterns (Xue et al., 23 Jul 2025). For downstream tasks, pre- versus post-deflare evaluation with YOLOv7 and SAM shows markedly improved detection recall and segmentation accuracy in nighttime scenes.
The ablation studies isolate the contribution of the architectural and loss components. GDFG alone yields PSNR 5 dB versus a baseline of 6 dB. LDGM alone gives an S-PSNR gain of 7 dB. Adding 8 yields PSNR 9 dB. The full model reaches 0 dB. The optimal filter count is reported as 1, the best LDGM temperature is 2, and the preferred loss weights are 3 and 4 (Xue et al., 23 Jul 2025).
| Setting | Reported result |
|---|---|
| Baseline | PSNR 5 dB |
| GDFG alone | PSNR 6 dB |
| LDGM alone | S-PSNR 7 dB |
| Adding 8 | PSNR 9 dB |
| Full model | PSNR 00 dB |
These results situate DFDNet as a method whose effectiveness depends on the interaction of global spectral guidance and local contrastive alignment rather than on either component alone.
7. Interpretation, scope, and relation to neighboring approaches
DFDNet is defined by the combination of a learnable, dynamic frequency-domain filter bank in GDFG and local contrastive feature alignment in LDGM (Xue et al., 23 Jul 2025). Within the de-flaring literature, its distinguishing premise is that flare removal benefits from explicit frequency-domain decoupling of artifacts from content, especially for large-scale degradations that are difficult to separate in purely spatial representations.
A common oversimplification would be to view DFDNet as only a Fourier filtering method. The reported design does not support that reduction. GDFG performs dynamic per-channel weighting in the Fourier domain, but its output is embedded inside a U-shaped Transformer with residual processing, and LDGM adds patch-wise contrastive supervision near the light source. Conversely, it would also be incomplete to interpret the method as purely local restoration, because the architecture repeatedly applies frequency-guided processing at every encoding and decoding stage and again in the bottleneck.
The reported comparisons with WaveDM and FPro specifically emphasize preservation of mid/high-frequency textures together with suppression of low-frequency flare noise (Xue et al., 23 Jul 2025). This suggests that DFDNet is intended to mediate between two competing restoration demands: elimination of broad, diffuse flare structures and retention of fine local signal. The inclusion of both amplitude and phase in 01 further indicates that the method treats frequency information as structurally informative rather than as a magnitude-only regularizer.
The paper also states that code is available at the project repository, indicating an implementation pathway for reproduction and extension (Xue et al., 23 Jul 2025). A plausible implication is that subsequent work may examine whether dynamic frequency guidance generalizes beyond de-flaring to adjacent restoration problems in which degradations exhibit clearer separability in the spectral domain than in the spatial domain.