---
title: 'HG-Lane: Adverse-Condition Lane Generation'
url: https://www.emergentmind.com/topics/hg-lane
type: topic
---

# HG-Lane: Adverse-Condition Lane Generation

HG-Lane denotes a **High-fidelity Generation framework for Lane Scenes under adverse weather and lighting conditions without requiring re-annotation**. It is proposed to address a specific failure mode in lane detection for autonomous driving: standard benchmarks such as CULane and TuSimple contain almost no images captured in rain, snow, fog, night, or dusk, so detectors that perform strongly under normal conditions may degrade sharply in safety-critical scenarios. HG-Lane transforms existing normal-condition lane images into realistic adverse-condition scenes while retaining the original lane annotations exactly, and it is paired with a 30,000-image benchmark spanning Normal, Snow, Rain, Fog, Night, and Dusk [2603.10128].

## 1. Motivation, task setting, and design objective

Lane detection is treated as a crucial perception task because it supports the safe operation of autonomous vehicles. The motivating observation behind HG-Lane is that modern lane-detection networks, including UFLD, RESA, and CLRNet, achieve very high accuracy on standard benchmarks, but those benchmarks contain relatively limited data under extreme weather conditions and challenging lighting. The consequence is a domain gap between training distributions dominated by normal scenes and deployment conditions that include rain, snow, fog, night, and dusk [2603.10128].

HG-Lane is framed as a data-generation solution rather than a re-labeling or retraining-heavy solution. Its central claim is that adverse-condition lane scenes can be synthesized from already annotated normal-condition images **without any re-annotation** of lane markings. The framework is explicitly described as **training-free** and **high-fidelity**, and its architecture is organized to preserve lane geometry while altering weather and illumination appearance. This suggests a data-centric method for robustness improvement in lane detection, with the annotation map carried over from the source image rather than reconstructed after generation.

The paper identifies four contributions: a semantic-aware preprocessing that fuses annotation masks, color-threshold masks, and Canny edges into a unified control signal; a dual-stage diffusion strategy built on off-the-shelf pretrained components; a 30,000-image benchmark covering six categories; and extensive experiments reporting consistent gains across existing lane-detection networks [2603.10128].

## 2. Semantic-preserving control construction

The first stage of HG-Lane is a semantic-preserving preprocessing designed to lock lane geometry before image generation. Given an input image $x_0 \in \mathbb{R}^{H \times W \times 3}$ and its binary lane-annotation map $A \in \{0,1\}^{H \times W}$, the method constructs a fused control map $C_0$ by extracting a color-threshold mask $M$ and a Canny edge map $E$:

$$
M = T_{\text{color}}(x_0; c_{\text{low}}, c_{\text{up}}) \in \{0,1\}^{H \times W}
$$

$$
E = \text{Canny}(x_0; c_{\text{low}}, c_{\text{up}})
$$

and then defining

$$
C_0 = (A \odot M) \oplus E.
$$

Here, $\odot$ is element-wise multiply and $\oplus$ is pixel-wise logical OR [2603.10128].

The role of each component is narrowly specified. The term $A \odot M$ masks annotations to lane-color regions, and the OR with $E$ supplements those regions with structural boundaries extracted from the image. The paper states that this fusion guarantees that, even if lane markings are dashed or partially occluded, the generative model never “loses” the true lane geometry. In effect, the lane annotation is not merely metadata attached to the sample; it becomes part of the control signal that constrains subsequent synthesis.

This preprocessing is described as *semantic-aware* because it combines annotation-level information with image-derived structure and appearance cues. Within the logic of the framework, that fusion is the mechanism that makes “no re-annotation” technically plausible: the target weather or lighting condition is synthesized around a geometry signal already aligned with the original lane labels.

## 3. Dual-stage diffusion pipeline

HG-Lane uses a dual-stage, control-guided diffusion pipeline in which all major components are **pretrained** and **frozen**. The paper specifies that no adversarial, cycle-consistency, or perceptual losses are introduced. The implementation is therefore not presented as a new generative model trained from scratch, but as an orchestration of off-the-shelf pretrained modules, specifically Stable Diffusion’s VAE and UNet backbone together with two ControlNets [2603.10128].

In **Stage I**, the source image and fused control map are encoded into latent space:

$$
z_0 = E_{\text{VAE}}(x_0), \qquad c_0 = E_{\text{VAE}}(C_0),
$$

with forward noising defined as

$$
q(z_t \mid z_0) = \mathcal{N}(\sqrt{\bar{\alpha}_t}\, z_0,\; (1-\bar{\alpha}_t)I), \quad t=1\ldots T.
$$

A frozen latent-diffusion UNet backbone $U_\phi$ is then guided by a Canny-ControlNet $\mathcal{C}_{\text{canny}}$ and weather-prompt embeddings $e_t$:

$$
f_c = \mathcal{C}_{\text{canny}}(c_0, z_t)
$$

$$
\hat{\epsilon}_t = U_\phi(z_t, t, e_t, f_c)
$$

$$
z_{t-1} = R_1(z_t, \hat{\epsilon}_t).
$$

After $T$ steps, the process yields a geometry-consistent latent $z_0^{(1)} = R_1^{(T)}(z_T \mid c_0, e)$. Within the UNet cross-attention layers, the paper uses the usual formulation

$$
Q = z_t W^Q, \qquad K = e_t W^K, \qquad V = e_t W^V
$$

$$
\text{Attn}(z_t,e_t)=\text{Softmax}(QK^\top/\sqrt{d})V.
$$

In **Stage II**, appearance is conditionally refined for **night** and **dusk**, since those scenarios require global tone and lighting changes beyond edge preservation. The second reverse diffusion uses an InstructPix2Pix ControlNet $\mathcal{C}_{\text{iP2P}}$:

$$
z_0' =
R_2\bigl(\mathcal{C}_{\text{iP2P}}(z_0^{(1)}, z_0),\; z_0^{(1)},\; e_{\text{style}}\bigr),
$$

where $e_{\text{style}}$ encodes a textual instruction such as “turn the scene to night with streetlights on.” For **snow**, **rain**, and **fog**, the paper states that the high-frequency stochastic cues produced by Stage I already look realistic, so the method simply sets

$$
z_0' = z_0^{(1)}.
$$

Finally, the refined latent is decoded back to pixel space:

$$
x_0' = D_{\text{VAE}}(z_0') \in \mathbb{R}^{H \times W \times 3}.
$$

Because lane geometry is locked through $C_0$, the synthetic image inherits the original annotation map $A$ exactly. The architectural separation between a structure-aware first stage and an appearance-aware optional second stage is further supported by the ablation results discussed below.

## 4. Benchmark composition and evaluation protocol

HG-Lane is accompanied by a benchmark containing **30,000 images** distributed evenly across six categories: **Normal**, **Snow**, **Rain**, **Fog**, **Night**, and **Dusk**. Each category contains **5,000 images**, and the split is **7:1:2** for train, validation, and test, corresponding to **3,500 / 500 / 1,000** images per category [2603.10128].

| Category | Images | Split |
|---|---:|---|
| Normal | 5,000 | 3,500 / 500 / 1,000 |
| Snow | 5,000 | 3,500 / 500 / 1,000 |
| Rain | 5,000 | 3,500 / 500 / 1,000 |
| Fog | 5,000 | 3,500 / 500 / 1,000 |
| Night | 5,000 | 3,500 / 500 / 1,000 |
| Dusk | 5,000 | 3,500 / 500 / 1,000 |

The evaluation protocol follows CULane. The reported metrics are **F1@50** and **F1@75**, defined by matching any predicted lane after **30-pixel dilation** with **IoU $\ge 0.5$** or **$0.75$**, together with **mean F1 (mF1)** averaged over thresholds **$0.50:0.05:0.95$**. By integrating synthetic categories with the original Normal set, the dataset is described as a 6-domain benchmark that plugs seamlessly into existing training pipelines [2603.10128].

This benchmark is not merely an auxiliary artifact. It is part of the methodological contribution: the generation framework supplies adverse-condition data without re-annotation, and the benchmark provides the testbed required to quantify detector robustness under those same conditions.

## 5. Empirical results and ablation evidence

The paper reports extensive experiments using **CLRNet (ResNet-18)** as a representative case. Three training settings are compared: **w/o augmentation on 4,000 normal images**, **w/o augmentation on 24,000 normal images (6×4,000)**, and **w/ augmentation on 6×4,000 across all 6 conditions**. The corresponding scores are:

- **w/o aug (4 k)**: Normal 83.01, Snow 46.08, Rain 70.34, Fog 58.54, Night 70.09, Dusk 79.95, F1@50 68.74, F1@75 46.39, mF1 42.16  
- **w/o aug (4 k*6)**: Normal 87.28, Snow 51.79, Rain 71.48, Fog 58.31, Night 62.67, Dusk 75.62, F1@50 68.89, F1@75 50.87, mF1 45.42  
- **w/ aug (4 k*6)**: Normal 91.64, Snow 84.88, Rain 85.30, Fog 85.38, Night 91.59, Dusk 91.99, F1@50 88.49, F1@75 72.79, mF1 63.03 [2603.10128]

The paper further summarizes improvements for the augmented condition relative to the non-augmented condition with the same total data as: **Overall F1@50 +19.75 %**, **Normal +8.63 %**, **Snow +38.8 %**, **Rain +14.96 %**, **Fog +26.84 %**, **Night +21.5 %**, and **Dusk +12.04 %**. In the abstract, the overall **mF1** improvement for **CLRNet** is reported as **20.87 percent**. Across **13 state-of-the-art lane detectors**—SCNN, SAD, UFLD, RESA, LaneATT, LaneAF, CondLaneNet, GANet, CLRNet, ADNet, CLRerNet, CLRKDNet, and FENet—the paper reports consistent gains in F1@50 and mF1 when trained on the 6-domain set rather than only on normal weather.

The ablation study isolates the contribution of mask fusion, module inclusion, and module order. Five variants are reported:

- **Full HG-Lane**: Mask ✓, Canny before, iP2P after, F1@50 88.49, F1@75 72.79, mF1 63.03  
- **Reversed order**: Mask ✓, Canny after, iP2P before, F1@50 62.56, F1@75 41.01, mF1 39.44  
- **iP2P only configuration**: Mask ✓, Canny omitted, iP2P ✓, F1@50 59.75, F1@75 40.33, mF1 39.33  
- **Canny only configuration**: Mask ✓, Canny ✓, iP2P omitted, F1@50 64.01, F1@75 43.78, mF1 40.12  
- **Without mask fusion**: Mask omitted, Canny before, iP2P after, F1@50 86.81, F1@75 70.12, mF1 61.35

The paper explicitly states that **mask fusion boosts F1@50 by $\sim 1.7 \%$ (1 vs 5)** and that the correct **structure→appearance** order is critical **(1 vs 2–4)**. This is a direct experimental justification for the two design choices that distinguish the pipeline: preserving geometry before changing appearance, and incorporating the fused mask rather than relying on generic edge structure alone.

Qualitative results are summarized as showing crisp lane preservation under heavy snowflakes, dense fog, rain streaks, and nighttime glare, with green predictions meeting blue ground truth.

## 6. Implementation, external comparisons, and terminological note

The generative pipeline is implemented in **ComfyUI**, **Python 3.8.0**, and **PyTorch 1.13.1**, and run on an **NVIDIA RTX 3090 (24 GB)** under **Ubuntu 24.04**. The sampler is **Euler with Karras scheduler**, using **30 steps** and **cfg=6.0**. Lane-detector training uses official codebases for **12 epochs**, with **no extra pretraining** and **uniform hyperparameters across models**. The code and dataset are publicly available at **https://github.com/zdc233/HG-Lane** [2603.10128].

The paper also reports a real-world generalization result on **200 real-world images each for rain, snow, fog, night, and dusk**: for **CLRNet**, **F1@50** improves from **53.03 %** to **68.54 %** when trained on HG-Lane versus the original CULane, corresponding to **+15.51 %**. Against classical image-restoration modules—**EfficientDeRain, NeRD-Rain, DeSnowNet, HDCW-Net, NLD, GFN**—HG-Lane is reported to yield higher detection F1 with **zero runtime overhead**. Qualitative comparisons further state that **Stable Diffusion, PITI, CycleGAN**, or suppression methods either fail to preserve lane labels or lack photorealism, whereas HG-Lane achieves both.

A terminological caution is warranted because the acronym “HG-Lane” is not unique in the broader lane-detection literature. In the paper **“HeightLane: BEV Heightmap guided 3D Lane Detection”**, the authors refer to their method as a **Height-map-Guided 3D Lane Detection (HG-Lane) framework** [2408.08270]. The two usages denote different problem settings and different technical programs. In [2603.10128], HG-Lane is a **training-free generative framework and benchmark** for adverse weather and lighting synthesis in 2D lane detection. In [2408.08270], the same acronym is used within a **monocular 3D lane detection** framework based on height-map prediction and deformable attention. This naming overlap can cause bibliographic ambiguity, but the substantive distinction is clear from the titles, objectives, and architectures.

Source: https://www.emergentmind.com/topics/hg-lane