---
title: Haze-to-Clear Text Loss for Real Dehazing
url: https://www.emergentmind.com/topics/haze-to-clear-text-directed-loss
type: topic
---

# Haze-to-Clear Text Loss for Real Dehazing

Haze-to-Clear Text-Directed Loss denotes a dehazing objective in which restoration is supervised by a vision-language model rather than by paired real hazy/clean images. In the explicit form introduced by "Bilevel Layer-Positioning LoRA for Real Image Dehazing" [2603.10872], the loss treats real-image dehazing as a semantic alignment problem in CLIP latent space: the semantic displacement induced by the dehazing network should align with a text-defined direction from haze to clarity. A plausible broader usage includes functionally similar CLIP-guided adaptation losses such as HazeCLIP, which does not use the exact phrase but likewise replaces unavailable real-image ground truth with frozen CLIP-based semantic supervision [2407.13719].

## 1. Definition and problem setting

The haze-to-clear text-directed loss arises from a standard failure mode in real image dehazing: models are commonly pretrained on synthetic hazy/clear pairs, but their performance drops on real hazy photographs because of the synthetic-to-real domain gap. The central difficulty is that paired clean references for real hazy scenes are usually unavailable, which makes direct pixel reconstruction losses inapplicable during real-domain adaptation [2603.10872].

In the formulation of BiLaLoRA, the loss is explicitly presented as an unsupervised objective for adapting a synthetic-data-pretrained dehazing model to unlabeled real hazy images. Instead of regressing toward an unavailable clean target, it uses semantic supervision in CLIP’s joint image-text latent space. The dehazed output is expected to move from the semantic pole associated with haze toward the semantic pole associated with a clear image [2603.10872].

This establishes an important conceptual shift. Classical dehazing losses optimize reconstruction, adversarial realism, perceptual similarity, or physics consistency. Haze-to-clear text-directed loss instead optimizes a semantic transformation. The task is not formulated as “match this clean image,” but as “change the input in the haze-to-clear direction while preserving scene identity.” That distinction is central to its role in unsupervised real-domain adaptation [2603.10872].

## 2. Directional formulation in CLIP latent space

The canonical H2C formulation uses a frozen CLIP model to encode the hazy input image \(I_{\text{in}}\), the dehazed output \(I_{\text{out}}\), a negative haze-related prompt, and a positive clear-image prompt. The paper describes the corresponding embeddings as \(V_{\text{in}}\), \(V_{\text{out}}\), \(T_{\text{neg}}\), and \(T_{\text{pos}}\), with example prompts **“a photo with haze”** and **“a clear photo”**. For nighttime adaptation, the negative prompt can be changed to **“a photo with nighttime haze”** [2603.10872].

The key quantities are the image displacement and the text displacement:
\[
\Delta V_{\text{img}} = V_{\text{out}} - V_{\text{in}},
\qquad
\Delta T_{\text{text}} = T_{\text{pos}} - T_{\text{neg}}.
\]
The haze-to-clear text-directed loss is then
\[
L_{\text{H2C}} = 1 - \frac{\Delta V_{\text{img}} \cdot \Delta T_{\text{text}}}{\|\Delta V_{\text{img}}\|_{2}\cdot \|\Delta T_{\text{text}}\|_{2}}
= 1 - \cos(\Delta V_{\text{img}}, \Delta T_{\text{text}}).
\]
Minimizing this objective maximizes directional agreement between the semantic change produced by the dehazing network and the text-defined haze-to-clear direction [2603.10872].

The directional form matters because it is explicitly relative. The loss does not simply force \(V_{\text{out}}\) toward a generic positive embedding. Instead, it models dehazing as a semantic displacement from the input. The paper argues that this helps preserve content: absolute alignment to “a clear photo” could pull different inputs toward a generic clear-image region, whereas displacement matching asks only that the transformation itself follow the correct semantic direction [2603.10872].

Operationally, no paired clean real image is required. The dehazing network outputs \(I_{\text{out}}\), CLIP encodes \(I_{\text{in}}\) and \(I_{\text{out}}\), fixed prompts are encoded once by the frozen text encoder, and gradients from \(L_{\text{H2C}}\) backpropagate through CLIP’s image branch into the trainable dehazing parameters or LoRA adapters. CLIP itself remains frozen [2603.10872].

## 3. Region-specific contrastive precursor in HazeCLIP

A closely related mechanism appears in HazeCLIP, where CLIP is used as a **frozen evaluator and loss provider** rather than as a trainable model component or a fused feature extractor. The dehazing backbone \(\mathcal{M}\) is first pretrained on synthetic paired data and then fine-tuned on unlabeled real hazy images. For an output \(\mathcal{M}(I)\), CLIP image and text embeddings are compared by cosine similarity, and the resulting score acts as adaptation supervision that tells the optimizer the output should look more like a *clear / high-quality* image and less like a *hazy / foggy* one [2407.13719].

HazeCLIP uses three contrastive prompt sets: an enhancing prompt set \(T_e\), a non-sky dehazing prompt set \(T_n\), and a sky-region dehazing prompt set \(T_s\). The dehazing prompt template is instantiated with region-dependent entities, including prompts such as **“a picture of \<entity\> in the fog.”** and **“a photo of a foggy \<entity\>.”** For \(T_s\), the entity is “sky.” For \(T_n\), entities include “building,” “people,” and “scene.” Multiple prompts are ensembled by averaging their text embeddings in CLIP latent space to form one positive and one negative embedding for each set [2407.13719].

For a prompt set \(T\in\{T_s,T_n,T_e\}\), HazeCLIP defines a softmax-style normalized positive similarity score \(\mathcal{L}_T(I)\) from exponentiated cosine similarities between the image embedding and the positive and negative text embeddings. The combined CLIP guidance is
\[
\mathcal{L}_{c}(I) = \mathcal{L}_{T_s}(\mathcal{M}(I_s)) + \mathcal{L}_{T_n}(\mathcal{M}(I_n)) + \lambda_1 \cdot \mathcal{L}_{T_e}(\mathcal{M}(I)),
\]
where \(I_s\) and \(I_n\) denote sky and non-sky regions. The paper explicitly characterizes this as guiding the pretrained dehazing network toward the real domain with a frozen CLIP model [2407.13719].

A second component stabilizes adaptation. To reduce catastrophic forgetting, HazeCLIP adds a CLIP-image-encoder fidelity regularizer,
\[
\mathcal{L}_{f}(I) = \sum_{l=0}^{4} \alpha_l \left\| \Phi_i^l(\mathcal{M}(I)) - \Phi_i^l(I) \right\|_2,
\]
and optimizes
\[
\mathcal{L}(I) = \mathcal{L}_c(I) + \lambda_2 \cdot \mathcal{L}_f(I).
\]
With \(\lambda_1 = 0.5\) and \(\lambda_2 = 0.1\), this yields a text-guided, label-free real-domain fine-tuning objective [2407.13719].

HazeCLIP is therefore not identical to the H2C loss of BiLaLoRA. It does not define a single displacement vector \((T_{\text{pos}}-T_{\text{neg}})\) or a cosine-distance alignment of image and text differences. Nevertheless, the paper itself supports the interpretation that its contrastive CLIP supervision is functionally haze-to-clear: increasing similarity to positive clarity-related text while decreasing similarity to haze-related negatives moves the image representation from the “hazy/foggy” side toward the “clear/enhanced” side in CLIP space [2407.13719].

## 4. Training regimes, adaptation mechanisms, and empirical behavior

In BiLaLoRA, training is explicitly two-stage. The baseline dehazing model is first pretrained on synthetic paired data with supervised \(\ell_1\) loss on THaze. Real-domain adaptation then uses H2C loss while training LoRA parameters and selecting their placement through a bilevel strategy. The paper states that adaptation is conducted on the top-\(3\) layers using H2C loss, with LoRA scaling factor \(\gamma = 2\), LoRA rank \(r = 8\), and learning rate \(1\times 10^{-6}\) [2603.10872].

Within that framework, H2C is the semantic supervision signal and BiLaLoRA is the parameter-efficient adaptation mechanism. Their roles are explicitly separated: H2C specifies what semantic change the model should make, while BiLaLoRA determines where and how to adapt the network efficiently. The bilevel objective is written generically as
\[
\min_{\bm{\alpha}} \, \varphi(\bm{\omega}^*(\bm{\alpha}), \bm{\alpha})
\quad \text{s.t.}\quad
\bm{\omega}^*(\bm{\alpha}) \in \arg\min_{\bm{\omega}} \psi(\bm{\omega}, \bm{\alpha}),
\]
with H2C providing the task loss inside that optimization [2603.10872].

The ablation evidence reported for H2C is targeted. Averaged across RTTS, URHI, and Fattal, the variant with **No H2C, no layer positioning** has FADE 1.018, BIQME 0.582, Entropy 7.438, and MUSIQ 62.05, whereas the full method with **Both prompts + bilevel positioning** achieves FADE 0.638, BIQME 0.611, Entropy 7.572, and MUSIQ 64.40. The paper also reports that positive-only guidance produces **substantial color distortion artifacts**, while negative-only guidance can lead to **over-dehazing**; using both positive and negative prompts defines a better semantic path [2603.10872].

HazeCLIP follows a parallel synthetic-to-real adaptation logic. A pretrained network \(\mathcal{M}\), by default MSBDN but also validated with GDN and FFANet, is pretrained on RIDCP synthetic hazy-clean pairs and then fine-tuned on unlabeled real hazy images from the URHI split of RESIDE. The real adaptation stage uses region-specific CLIP guidance and the fidelity regularizer, with no reconstruction, adversarial, or classical perceptual losses against real clean targets. The paper reports that the full model performs best, that removing region-specific dehazing worsens haze-related performance especially FADE, and that removing the enhancement prompt set reduces BRISQUE and NIMA, indicating that pure haze prompts are insufficient to address dull colors and image “dirtiness” [2407.13719].

These two papers therefore document two closely related deployment modes for language-guided dehazing supervision. BiLaLoRA uses an explicit displacement-alignment H2C loss with LoRA-based parameter-efficient adaptation, whereas HazeCLIP uses frozen CLIP contrastive scoring plus feature fidelity to fine-tune a pretrained backbone on unlabeled real hazy images [2603.10872][2407.13719].

## 5. Relation to adjacent loss families and common confusions

Several nearby methods use text, CLIP, or haze-to-clear objectives, but they should not be conflated with haze-to-clear text-directed loss in the strict dehazing sense.

| Paper | Mechanism | Relation to H2C |
|---|---|---|
| "Learning Hazing to Dehazing" [2503.19262] | Text-to-image diffusion prior for HazeGen; image-conditioned denoising for DiffDehaze | No direct haze-to-clear text-directed objective |
| "Language Prompt vs. Image Enhancement" [2604.10637] | CLIP-guided Cross-Entropy Loss for object detection | Semantic compensation for detection, not dehazing |
| "Single Image Haze Removal using a Generative Adversarial Network" [1810.09479] | \(L_T = W_{gan}L_G + W_{L1}L_{L1} + W_{vgg}L_{vgg}\) | Hybrid haze-to-clear loss without text |
| "Unsupervised haze removal from underwater images" [2306.02912] | Haze disentanglement and haze-guided cycle consistency | Image-domain directional restoration, not text-directed |
| "Reconstruction Loss Minimized FCN for Single Image Dehazing" [1811.10788] | Physics-based haze reconstruction loss with \(L_1,L_2,L_3\) | Model-based supervision without language |
| "RTE-FM-Dehazer" [2607.01748] | Flow matching plus RTE-consistency regularizer | No language-guided supervision in dehazing objective |

The most frequent confusion concerns methods that exploit text-conditioned generative priors for haze synthesis. "Learning Hazing to Dehazing" uses Stable Diffusion and IRControlNet to generate realistic hazy images in HazeGen and then trains DiffDehaze with a standard conditional denoising loss. The paper states explicitly that it does **not** define an explicit loss called a *Haze-to-Clear Text-Directed Loss*; text guidance is central to haze generation, not to the dehazing objective itself [2503.19262].

A second confusion concerns tasks other than image restoration. "Language Prompt vs. Image Enhancement" introduces CLIP-CE and FAME for object detection in hazy environments. Its “clear” side is semantic clarity at the object level, implemented through prompt-based reweighting of detector cross-entropy. The paper explicitly states that this is not a dehazing or image restoration loss in the usual pixel-space sense [2604.10637].

The remaining works illustrate the broader loss-design landscape. Earlier dehazing research emphasizes paired reconstruction, adversarial realism, perceptual similarity, disentanglement, cycle consistency, or atmospheric-scattering reconstruction rather than language supervision [1810.09479][2306.02912][1811.10788]. More recent physics-guided approaches such as RTE-FM-Dehazer again avoid language-guided supervision in the training objective, using vision-language models only in the data pipeline [2607.01748]. This suggests that haze-to-clear text-directed loss is a specific branch of unsupervised real-domain adaptation rather than a generic label for all dehazing losses.

## 6. Limitations, prompt sensitivity, and open directions

The principal limitation of haze-to-clear text-directed loss is prompt dependence. BiLaLoRA explicitly relies on fixed textual phrases such as **“a photo with haze”** and **“a clear photo,”** and the paper notes that the same mechanism can be adapted to nighttime settings by changing the negative prompt to **“a photo with nighttime haze.”** This demonstrates flexibility, but it also implies prompt sensitivity. The paper does not systematically benchmark alternative wordings beyond the reported examples [2603.10872].

The failure modes exposed by the ablations are also prompt-structural. In BiLaLoRA, positive-only guidance can induce **substantial color distortion artifacts**, and negative-only guidance can cause **over-dehazing**. The two-sided semantic axis matters because it specifies both the direction away from haze and the direction toward clarity [2603.10872].

HazeCLIP identifies a different but related limitation: CLIP’s haze semantics are biased toward sky content. The paper reports that whole-image similarity to haze-related captions can overlook residual haze in buildings or other non-sky regions because gray skies dominate similarity, and this is precisely why the framework introduces separate sky and non-sky prompt sets together with CLIP Surgery and SAM-based masking. It also states that prompt design is manual and that “contrastive prompt sets can be constructed through a learned or more systematic approach,” which implies that the current prompt engineering is potentially suboptimal [2407.13719].

A further caveat is that CLIP-based semantics are not a physics-based haze estimator. HazeCLIP explicitly notes that CLIP is a semantic and perceptual prior rather than a guarantee of faithful recovery of scene radiance, and that robust real-world dehazing evaluation metrics remain limited. BiLaLoRA similarly uses a purely semantic objective during real-domain adaptation and does not directly enforce pixel fidelity, exact color calibration, or physical consistency; those properties are inherited from the pretrained backbone rather than from the H2C loss itself [2407.13719][2603.10872].

These limitations suggest a research agenda already hinted at by the current literature. A plausible implication is that future haze-to-clear text-directed losses may combine directional cross-modal supervision with more systematic prompt construction, region-aware semantics, or complementary low-level constraints. That inference is consistent with the present division of labor: current methods use text to specify the semantic direction of dehazing, while relying on pretrained restoration backbones, fidelity regularization, or parameter-efficient adaptation schemes to preserve structure and content [2407.13719][2603.10872].

Source: https://www.emergentmind.com/topics/haze-to-clear-text-directed-loss