TL;DR
Models trained to clear up foggy or hazy photos usually stumble in the real world because synthetic training fog looks nothing like actual, patchy atmospheric haze. HazeFlux solves this by hijacking a powerful, pre-trained image-editing foundation model (FLUX.2) and teaching it to wipe away real-world haze in just four fast inference steps. By pairing latent-space fine-tuning with clever pixel-level shortcuts, it recovers crisp textures and true colors without hallucinating fake details.
What Problem Does This Paper Address?
Look out a window on a foggy morning: the haze isn't a neat, uniform gray filter. It clumps, swirls, and swallows colors unevenly depending on depth and lighting. Early computer vision algorithms tried to invert the physics of light scattering using hand-crafted rules, which broke down in dense fog or bright skies. Modern deep learning shifted to training neural networks on pairs of hazy and clear images. Because capturing identical real-world scenes with and without fog is nearly impossible at scale, researchers rely on synthetic haze—creating a massive domain gap when deployed in the wild.
Pre-trained generative models (like diffusion or flow-matching networks) offer a tantalizing fix: having seen billions of natural images, they inherently understand what a "clear" world looks like. However, repurposing them for image restoration hits two walls:
- Imagination vs. Fidelity: Generative models care about making images look plausible, not staying strictly faithful to the exact pixels of the underlying scene.
- The Latent Bottleneck: Modern generative models compress images into a compact "latent space" via a Variational Autoencoder (VAE) to save compute. That compression inevitably throws away fine-grained edges and micro-textures.
Methods
HazeFlux adapts FLUX.2 [klein], a step-distilled latent flow-matching Diffusion Transformer (DiT) designed for fast image editing, using a two-stage training recipe while keeping the massive base model and VAE frozen.
- Stage 1: Dual-Supervised LoRA Fine-Tuning. Instead of conventional step-by-step diffusion, flow matching learns a straight-line velocity path from noise to clean data. The authors condition the model on the hazy image and a fixed text prompt ("remove haze, restore clear visibility") and insert lightweight Low-Rank Adaptation (LoRA) layers into the transformer. Crucially, they don't just supervise the model in the compressed latent space; they decode the predicted clean latents during training and enforce pixel-level losses ($\ell_1$ for color/brightness, SSIM for local structure, and LPIPS for perceptual quality).
- Stage 2: Gated Image Structure Adapters. Even with Stage 1, the frozen VAE decoder blurs out tiny details like grass blades or tree bark. In Stage 2, the authors build multi-level skip connections directly from the raw hazy input image into the four levels of the VAE decoder. Because the raw input also contains haze, each adapter uses a learned per-pixel spatial gate (via a sigmoid activation) to selectively let sharp structural edges pass through while blocking foggy discoloration.
At test time, HazeFlux needs just four flow-matching steps and a single decoding pass.
Datasets
Because the pre-trained backbone already carries rich visual priors, HazeFlux requires very little real-world training data. The authors train and evaluate on four standard real-world benchmarks (where real haze was generated using professional haze machines):
- I-HAZE and O-HAZE: Indoor and outdoor scenes with homogeneous haze.
- Dense-Haze: Outdoor scenes with severe, heavy homogeneous haze.
- NH-HAZE: Outdoor scenes with complex, non-homogeneous (patchy) haze.
- Merge-HAZE: A unified benchmark compiled by the authors that aggregates the official train and test splits of all four datasets above to test multi-domain versatility.
Key Insights and Ideas
- Cleaner can mean structurally worse (at first): One of the paper's best "aha" moments comes from inspecting Stage 1 outputs. While Stage 1 visibly clears the fog, its pixel-level structural error relative to the ground truth is actually worse than the raw hazy image (0.247 vs. 0.146 error). Fine edges survive inside the hazy photo, even if faint, whereas VAE latent compression destroys them—proving why Stage 2's pixel-space skip connections are essential.
- Timing perceptual losses matters: During Stage 1, perceptual loss (LPIPS) is only applied when the flow timestep is close to the clean image ($t > 0.5$). Applying it earlier, when the estimate is still noisy and blurry, forces the network to hallucinate fake textures to satisfy the loss.
- Foundation priors unlock zero-shot generalization: Training on one small dataset and testing on three unseen ones usually tanks performance. HazeFlux dominates cross-dataset tests because the frozen FLUX.2 backbone does the heavy lifting of understanding natural scenes.
Key Results
HazeFlux sets a new state of the art across real-world benchmarks:
- Individual Datasets: Ranks 1st in 6 out of 8 PSNR/SSIM evaluations, boosting PSNR by +1.30 dB on I-HAZE (24.30 dB), +0.75 dB on Dense-Haze (18.01 dB), and +0.46 dB on NH-HAZE (21.69 dB) over the closest competitors (VIVNet and HNDiff).
- Merge-HAZE: Outperforms all retrained baselines on 8 out of 9 metrics, leading by +0.61 dB in PSNR, slashing distribution error (FID drops from 129.66 to 77.90), and improving color accuracy by 0.94 $\Delta E$ units.
- Cross-Dataset Generalization: Beats top generative and deterministic competitors in 20 out of 24 unseen dataset transfer scenarios, and cleanly dehazes casual smartphone photos without leaving sky artifacts or tile boundaries.
Limitations and Future Work
Because FLUX.2 [klein] was originally trained for creative image editing, its generative prior has a slight flair for the dramatic—occasionally producing overly saturated colors in complex, heavily hazed regions. In future work, the authors plan to design adaptive color-constraining objectives to rein in saturation while keeping the crisp structural restoration intact.
Summary updated