Papers
Topics
Authors
Recent
Search
2000 character limit reached

Distance-aware Focal Loss for HD Map Construction

Updated 5 July 2026
  • The paper introduces a novel modification to focal loss by replacing binary labels with continuous, distance-based targets derived from localization error.
  • DAFL addresses task misalignment in DETR-like one-to-many matching by calibrating classification scores with geometric accuracy, ensuring high-confidence predictions reflect precise localization.
  • Empirical results on nuScenes show that using DAFL and a Hybrid Loss Scheme improves mAP, effectively aligning predicted map elements with their true geometric quality.

Searching arXiv for the cited papers to ground the article in current paper metadata. Distance-aware Focal Loss (DAFL) most directly denotes a quality-aware variant of focal loss introduced in the context of online vectorized HD map construction, where the classification target for a matched prediction is made a function of geometric localization quality rather than a fixed binary foreground label (Dong et al., 26 Oct 2025). In that formulation, DAFL addresses task misalignment in DETR-like one-to-many matching by converting a per-instance localization loss into a continuous confidence target and using that target inside a focal-style classification objective, so that high classification scores are more closely aligned with well-localized map elements. The acronym is not fully uniform across the literature: one paper on federated medical image classification uses DAFL to mean Dynamic Adaptive Focal Loss and explicitly frames it as distribution-aware rather than distance-aware (Zhao et al., 2 Feb 2026), while a light-field depth-estimation paper does not use the term DAFL but describes an uncertainty-aware focal loss with DAFL-like behavior because a distribution-distance term modulates a regression loss (Chao et al., 2022).

1. Definition and scope

In DAMap, DAFL is defined for online HD map construction from multi-view RGB images, where a DETR-like pipeline predicts vectorized map elements such as road boundaries, lane dividers, pedestrian crossings, and, in some experiments, centerlines (Dong et al., 26 Oct 2025). The central objective is “high quality predictions,” meaning simultaneously high classification confidence and high localization accuracy. Localization quality is evaluated with Chamfer Distance under hard thresholds {0.2,0.5,1.0}m\{0.2, 0.5, 1.0\}\,\text{m} and easy thresholds {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}.

The defining departure from standard focal loss is that DAFL does not assign the same positive label to all matched queries. Instead, for each matched prediction–ground-truth pair, the label is softened according to localization quality. Good localizers receive targets near $1$, while poor localizers receive targets closer to $0$, even if they are matched positives. This makes classification scores reflect both class membership and geometric accuracy (Dong et al., 26 Oct 2025).

A related but distinct usage appears in federated learning for medical image classification, where DAFL stands for Dynamic Adaptive Focal Loss: LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t). That loss introduces a dynamic imbalance coefficient based on client-level and global class-level statistics, not an explicit geometric distance term (Zhao et al., 2 Feb 2026). In a different domain, light-field depth estimation introduces an uncertainty-aware focal loss,

UAFL=Uβdd^1,UAFL = \| U \|^{\beta} \odot \| d - \hat{d} \|_1,

which can be interpreted as DAFL-like because a divergence between predicted and target disparity distributions acts as a distance-aware difficulty signal (Chao et al., 2022).

2. Origin in HD map construction and the task-misalignment problem

The immediate motivation for DAFL in DAMap is the task misalignment that arises in DETR-like HD map detectors with one-to-many matching (Dong et al., 26 Oct 2025). In that setting, each ground-truth map element is matched to multiple query predictions. Under standard focal loss, all such matched queries are trained as positives with the same label y=1y=1, irrespective of whether their geometric predictions are accurate.

The paper identifies two causes of misalignment. The first is inappropriate task labels due to one-to-many matching: queries with very different localization quality receive identical classification supervision. The second is sub-optimal task features due to task-shared sampling in the decoder. DAFL addresses the first issue by changing the classification label assignment, while Task Modulated Deformable Attention addresses the second (Dong et al., 26 Oct 2025).

The practical implication is that, under standard focal loss, a poorly localized query matched to a ground-truth polyline can still be pushed toward a high foreground score. This weakens the correspondence between score ranking and geometric correctness. The DAMap analysis states that this harms high-quality mAP because predictions with high classification scores may have poor geometry, while some accurate polylines may be scored less favorably (Dong et al., 26 Oct 2025).

This same alignment concern appears in another form in light-field depth estimation. There, the authors argue that supervising only the scalar expectation of a disparity distribution with an L1L_1 loss is suboptimal because multiple distributions can share the same mean disparity. Their remedy is not called DAFL, but it similarly seeks to align the learned distribution with a more informative target rather than supervising only a reduced projection (Chao et al., 2022).

3. Mathematical formulation

The baseline focal loss used in DAMap is

$\text{FL}(p,y)= \begin{cases} -(1-p)^\gamma\log(p), & y = 1,\[4pt] -p^\gamma\log(1-p), & y = 0, \end{cases}$

where p[0,1]p \in [0,1] is the predicted foreground probability and {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}0 is the binary label (Dong et al., 26 Oct 2025).

DAFL replaces the binary positive target with a continuous quality target derived from localization error. For a matched prediction–ground-truth instance {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}1, the localization loss is defined as

{0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}2

and the corresponding per-instance distance can be written as

{0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}3

Here, the loss sums {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}4 distances over points along the vectorized map element (Dong et al., 26 Oct 2025).

That distance is converted into a localization confidence: {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}5 with {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}6. If {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}7, then {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}8; as the localization loss grows, the confidence decays toward {0.5,1.0,1.5}m\{0.5, 1.0, 1.5\}\,\text{m}9 (Dong et al., 26 Oct 2025).

The DAFL objective is then

$1$0

where $1$1 is the soft target for the foreground class. For positive matched queries, $1$2; for unmatched background queries, $1$3 (Dong et al., 26 Oct 2025).

The structure combines two elements. The inner term,

$1$4

is binary cross-entropy with a soft label. The modulation factor $1$5 focuses the loss on cases where the predicted score differs from the target quality. In this sense, distance is not inserted merely as a sample weight; it becomes the classification target itself (Dong et al., 26 Oct 2025).

4. Label assignment, one-to-many matching, and score calibration

DAFL is specifically motivated by one-to-many matching. In DAMap, each ground-truth instance can be matched to multiple query slots, for example across branches or decoder outputs. Under conventional supervision, all matched queries are treated as positives for the ground-truth category. DAFL changes only the target assignment: each matched positive is re-labeled with a localization-dependent soft target rather than a universal foreground label (Dong et al., 26 Oct 2025).

This yields a finer ordering among multiple positives associated with the same ground truth. A query whose predicted polyline is close to the matched ground-truth polyline obtains $1$6 and is encouraged to predict a high score. A matched query with worse geometry obtains a smaller $1$7 and is correspondingly encouraged to predict a lower score. The result is that classification confidence is more closely calibrated to geometric quality (Dong et al., 26 Oct 2025).

The paper explicitly compares this behavior to quality-aware detection losses such as Quality Focal Loss and VarifocalNet, while emphasizing a task-specific difference: DAFL uses an exponential transform of a distance-based polyline loss instead of IoU. This avoids the need for an explicit IoU representation, which is awkward for vectorized polylines (Dong et al., 26 Oct 2025).

A similar conceptual pattern appears in the light-field disparity work, though the mathematical object is different. There, the “hardness” signal is the Jensen–Shannon divergence between a predicted disparity distribution and a discretized ground-truth distribution: $1$8 and the loss becomes

$1$9

That paper argues that easy examples correspond to small divergence and hard examples to large divergence, which is DAFL-like in the sense of using a distribution-distance measure to focus learning on misaligned predictions (Chao et al., 2022).

5. Hybrid supervision and architectural context

In DAMap, DAFL is not applied uniformly across all decoder layers. The authors introduce a Hybrid Loss Scheme because early decoder layers often have very poor localization during the initial stage of training. If DAFL is used too early, the quality targets derived from poor regressions may become nearly zero and provide noisy supervision (Dong et al., 26 Oct 2025).

The hybrid classification objective is

$0$0

with $0$1. The reported best configuration for a $0$2-layer decoder uses focal loss on only the first decoder layer and DAFL on the remaining five layers (Dong et al., 26 Oct 2025).

Within the overall DAMap architecture, DAFL operates at the classification heads of decoder layers. The pipeline is multi-view images to a backbone, then a view-transform module to BEV features, then a transformer decoder producing classification and localization outputs. The localization branch supplies the distance signal that DAFL turns into a soft classification label (Dong et al., 26 Oct 2025).

The loss-side modification is complemented by Task Modulated Deformable Attention, which provides task-specific features for classification and localization rather than a single shared query feature. The paper presents TMDA as orthogonal to DAFL: better task-specific features make the distance-aware label more meaningful, but DAFL can also be used independently (Dong et al., 26 Oct 2025).

The federated medical-imaging usage of DAFL differs structurally. There, the loss is the sole local training objective within a synchronous federated learning protocol, and the “adaptive” component is tied to imbalance statistics rather than localization quality. The client-aware aggregation weight

$0$3

is coupled to the same imbalance signal used in the loss, but no geometric distance or localization-derived soft label is involved (Zhao et al., 2 Feb 2026).

The empirical evidence reported for DAMap indicates that DAFL improves the alignment between scores and localization quality. On nuScenes with a ResNet-50 backbone and a 24-epoch MapTRv2 baseline, the ablation reports $0$4 mAP for the baseline, $0$5 with DAFL alone, $0$6 with DAFL plus Hybrid Loss Scheme, and $0$7 with DAFL plus Hybrid Loss Scheme plus Task Modulated Deformable Attention (Dong et al., 26 Oct 2025). In a longer 110-epoch setting, the combination of DAFL and Hybrid Loss Scheme improves the reproduced MapTRv2 baseline from $0$8 to $0$9 mAP on the hard metric and from LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).0 to LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).1 on the easy metric (Dong et al., 26 Oct 2025).

The same study reports that the distance-to-quality mapping parameter is not highly sensitive within the tested range: LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).2 gives LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).3 mAP, LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).4 gives LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).5, and LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).6 gives LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).7 (Dong et al., 26 Oct 2025). It also states that DAFL and the Hybrid Loss Scheme add no parameters or inference-time computation relative to the baseline, since they alter only the training loss (Dong et al., 26 Oct 2025).

The acronym DAFL is therefore domain-dependent. In the federated ViT paper, DAFL consistently denotes Dynamic Adaptive Focal Loss, not Distance-aware Focal Loss, and the paper explicitly states that it is “not a distance-aware loss in the sense of using explicit feature or logit distances” (Zhao et al., 2 Feb 2026). Its reported gains are associated with imbalanced, heterogeneous medical datasets and with a dynamic class imbalance coefficient

LDAFL=(1+cf,t)(1pt)γlog(pt).\mathcal{L}_{\text{DAFL}} = - (1 + c_{f,t}) \cdot (1 - p_t)^\gamma \cdot \log(p_t).8

rather than geometric supervision (Zhao et al., 2 Feb 2026).

The light-field depth paper adds a further terminological caution. It does not name its loss DAFL, but the paper’s own interpretation is that its uncertainty-aware focal loss has “DAFL-like characteristics,” because a Jensen–Shannon divergence between predicted and target disparity distributions increases when probability mass lies farther from the true disparity in disparity space (Chao et al., 2022). A plausible implication is that “distance-aware focal loss” can refer either to explicit geometric quality targets, as in DAMap, or more loosely to focal-type losses modulated by a distance or divergence in an ordered output space.

Taken together, the literature supports a narrow and a broad reading. In the narrow reading, Distance-aware Focal Loss is the DAMap loss for HD map construction that transforms localization loss into a continuous classification target (Dong et al., 26 Oct 2025). In the broader reading, the term can denote focal-style objectives that incorporate a notion of distance from the correct output—geometric, distributional, or ordinal—into the focusing mechanism. The papers considered here, however, make clear that these are not interchangeable formulations and should be distinguished by task, target construction, and the specific meaning of “distance.”

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Distance-aware Focal Loss (DAFL).