Next Article in Journal
Refractive Index Sensing-Based Sensitivity Enhancement Using Surface Plasmon Resonance Sensor with Integration of Tin Diselenide and Zirconium Diselenide
Previous Article in Journal
Vibration Error Compensation of LiDAR Imaging with the Aiding of INS for Precise Navigation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Topology-Aware Lane Detection with Relational Reasoning and Consistency Constraints

1
Center for Intelligent Autonomous Systems, Nantong University, Nantong 226019, China
2
Department of AI, SunnyWay LLC, Suzhou 215000, China
3
Thrust of Intelligent Transportation, The Hong Kong University of Science and Technology (Guangzhou), Guangzhou 511458, China
4
Department of Mechanical Engineering, University of California at Berkeley, Berkeley, CA 94720, USA
*
Authors to whom correspondence should be addressed.
These authors contributed equally to this work.
Sensors 2026, 26(13), 4278; https://doi.org/10.3390/s26134278 (registering DOI)
Submission received: 30 April 2026 / Revised: 4 June 2026 / Accepted: 15 June 2026 / Published: 5 July 2026
(This article belongs to the Section Vehicular Sensing)

Abstract

Lane detection is a fundamental perception task for autonomous driving and intelligent transportation systems. Although existing methods have achieved promising performance, many of them mainly focus on individual lane instances and insufficiently exploit the structural relationships among lanes, such as relative ordering, geometric continuity, and spatial parallelism. This limitation may lead to broken lanes, ordering errors, and geometric inconsistencies in complex road scenarios. To address these issues, we propose TPDNet, a topology-aware lane detection framework that incorporates structural reasoning into the detection pipeline at three complementary levels. First, a Topology-aware Perception Reasoner (TPR) is introduced at the feature level to capture relational dependencies among lane features and enhance the representation of global road topology. Second, a Topology-Decoupled Head (TDH) is designed at the prediction level to decouple geometric regression from lane classification, thereby reducing task interference and improving prediction stability. Third, a Topology Consistency Loss (TCL) is formulated as a complementary supervision term to encourage smoothness and ordering consistency in predicted lanes. Extensive experiments on three public benchmarks demonstrate the effectiveness of the proposed method. On CULane, TPDNet achieves an F1@50 of 81.46 with ResNet101 and remains competitive with the strongest compared methods, while showing improved robustness in challenging scenarios such as Curve and Dazzle light. On TuSimple, TPDNet obtains an F1 score of 98.01 among the compared methods, while maintaining competitive accuracy. On CurveLanes, TPDNet achieves an mF1 of 58.74, exceeding the strongest baseline by 4.98 points. These results suggest that topology-aware reasoning can improve the generalization capability of lane detection and help produce more structurally coherent lane predictions under diverse road conditions.

1. Introduction

Lane detection is a fundamental perception task for intelligent transportation systems [1,2] and autonomous driving, providing essential structural cues for vehicle localization, path planning, and driving safety. Accurate and robust lane detection remains challenging due to the intrinsic properties of lane markings, which are typically thin, elongated, and distributed across the entire image. In real-world driving scenarios, lane lines are often affected by occlusion, illumination variations, worn markings, and complex road geometries, making reliable perception particularly difficult. As illustrated in Figure 1, these challenges may lead to broken lane predictions, ordering ambiguities, and geometric inconsistencies, motivating the topology-aware design of TPDNet.
Early deep learning-based approaches predominantly formulate lane detection as a pixel-wise segmentation problem [3,4,5]. By predicting dense lane masks, segmentation-based methods are capable of flexibly modeling arbitrary lane shapes. To enhance robustness under weak visual cues, representative works introduce spatial message passing or recurrent feature aggregation [5,6] mechanisms to capture long-range contextual information. Despite their effectiveness, these methods usually involve dense pixel-level computation, resulting in high computational cost and limited efficiency [7,8], which hinders real-time deployment in practical systems.
To address these limitations, subsequent studies reformulate lane detection as a structured prediction problem. Among them, anchor-based approaches introduce predefined lane priors and regress lane positions as holistic entities, leveraging strong geometric constraints to improve stability and efficiency [7,8,9,10,11]. Early anchor-based methods demonstrate that incorporating global contextual information into anchor representations significantly improves robustness under occlusion. More recent works further enhance this paradigm by exploiting cross-layer refinement strategies, global context aggregation, and lane-aware loss functions, enabling better integration of high-level semantic information and low-level geometric details. These advances have shown strong performance in challenging scenarios such as dense lanes, curved structures, and complex topologies, while maintaining favorable real-time performance.
In parallel, inspired by the success of Transformer architectures in computer vision [12,13], attention-based lane detection methods have been proposed [14,15,16] to explicitly model long-range dependencies. By leveraging self-attention mechanisms, these approaches exhibit strong capabilities in capturing lane continuity and contextual relationships [14,16], particularly in scenarios with sparse or ambiguous visual evidence. Existing Transformer-style designs for lane detection can be roughly divided into image-token attention, which models dense spatial interactions in the feature map, and lane-query attention, which updates a set of lane proposals or queries. The former provides global context but often involves redundant background interactions, whereas the latter is more efficient but may still treat lane queries mainly as appearance-driven tokens. Several studies further introduce query-based or multi-granularity attention mechanisms to reduce redundancy and emphasize informative regions. However, existing attention-driven methods often rely on dense global attention or generic query similarity, which may weaken the focus on fine-grained geometric localization and explicit inter-lane topology. Effectively combining global relational reasoning with precise local structure modeling therefore remains a non-trivial challenge.
Despite these advances, many existing methods still primarily optimize lane predictions at the instance or point level [17,18], while the explicit modeling of inter-lane structural relationships remains insufficient. In real road scenes, lane markings are not isolated visual elements, but structured components of an organized road topology. Adjacent lanes usually maintain consistent relative ordering, lane trajectories exhibit smooth geometric continuity, and multiple lanes often follow spatially coherent layouts such as parallelism or gradual convergence. When such structural patterns are not explicitly encoded, lane predictions may become fragmented, incorrectly ordered, or geometrically inconsistent, particularly under unreliable visual cues such as occlusion, shadows, worn markings, curved roads, and Dazzle light.
To address these issues, we propose TPDNet, a topology-aware lane detection framework that explicitly incorporates structural reasoning into the lane detection pipeline. Rather than correcting inconsistent predictions through post-processing, TPDNet models lane topology at three complementary levels: feature representation, prediction decoupling, and supervised optimization. At the feature level, we introduce a Topology-aware Perception Reasoner (TPR) to capture relational dependencies among lane representations, enabling the network to reason about global road structure rather than processing each lane in isolation. At the prediction level, a Topology-Decoupled Head (TDH) disentangles geometric regression from lane classification, alleviating task interference and improving localization stability. At the supervision level, a Topology Consistency Loss (TCL) imposes smoothness and ordering regularization on predicted lanes, guiding the model toward structurally coherent outputs under challenging conditions.
Extensive experiments on CULane [5], TuSimple, and CurveLanes [19] validate the effectiveness of TPDNet. On CULane, our ResNet101 variant achieves an F1@50 of 81.46, with improved robustness in challenging scenarios such as Curve and Dazzle light. On TuSimple, TPDNet obtains an F1 score of 98.01 among the compared methods, while maintaining competitive accuracy under the same evaluation protocol. On CurveLanes, TPDNet achieves an mF1 of 58.74, exceeding the strongest baseline by 4.98 points. These results demonstrate that topology-aware reasoning improves lane detection accuracy and supports more structurally coherent predictions across diverse road conditions.
The main contributions of this work are summarized as follows:
  • We revisit lane detection from a structural topology perspective and identify insufficient inter-lane relationship modeling as a key limitation of existing lane detection pipelines. Based on this observation, we propose TPDNet, a unified topology-aware framework that incorporates structural reasoning at the feature, prediction, and supervision levels.
  • We introduce a Topology-aware Perception Reasoner (TPR) to capture relational dependencies among lane representations, allowing the network to reason about global road structure rather than treating lanes as isolated prediction targets.
  • We design a Topology-Decoupled Head (TDH) to disentangle geometric regression from lane classification, thereby alleviating task interference and improving localization stability.
  • We formulate a Topology Consistency Loss (TCL) as a complementary structural regularizer that imposes smoothness and ordering constraints on predicted lanes, encouraging structurally coherent lane predictions in complex driving scenarios.

2. Methodology

2.1. Overview

We propose TPDNet, a topology-aware lane detection framework that integrates inter-lane relational reasoning and structural consistency constraints into an iterative lane refinement pipeline. The overall architecture is illustrated in Figure 2. Section 2.2 introduces the lane representation and refinement pipeline, Section 2.3 describes the topology-aware reasoning module, Section 2.4 explains the decoupled prediction head, Section 2.5 presents the structural loss, and Section 2.6 summarizes training and inference. Given an input road image, a ResNet backbone [20] equipped with a Feature Pyramid Network [21] extracts multi-scale visual features. Built on CLRHead [9], TPDNet uses these features to generate initial lane priors, which are then progressively refined through T stages.
At each refinement stage, ROI features are first aggregated by the ROIGather module, which enhances each lane proposal with image-level contextual information. The resulting lane-query features are then fed into the TPR, where relational dependencies among candidate lanes are explicitly modeled to capture global road topology. In this way, each lane representation is updated not only according to local visual evidence, but also according to the structural configuration of other lanes.
After the final refinement stage, the topology-enhanced lane features are passed to the TDH. TDH separates geometric regression from lane classification into two independent branches, thereby alleviating task interference and improving prediction stability. During training, the TCL further imposes smoothness and ordering constraints on the predicted lanes, encouraging structurally coherent outputs. Through this design, TPDNet jointly exploits visual appearance, inter-lane topology, and structural supervision for robust lane detection in complex road scenarios.

2.2. Lane Representation and Iterative Refinement

Lane markings are thin, elongated, and continuous curvilinear structures. Instead of using bounding-box representations, which are not well suited for describing fine-grained lane geometry, we represent each lane as a structured sequence of N equidistantly sampled 2D points along the image height [8,9,22]:
P = { ( x n , y n ) } n = 0 N 1 .
The vertical coordinates are fixed and uniformly sampled along the image height H:
y n = H N 1 · n , n = 0 , 1 , , N 1 .
The network predicts the corresponding horizontal coordinates through lateral offsets. Specifically, each lane is initialized from a Lane Prior  P ˜ = { ( x ˜ n , y n ) } n = 0 N 1 , and the refined horizontal coordinate is obtained as:
x n = x ˜ n + Δ x n .
Following the CLRHead formulation [9], each Lane Prior is further parameterized by Θ = { p f g , l , x 0 , y 0 , θ } , where p f g denotes the foreground probability, l the lane length, and ( x 0 , y 0 , θ ) the starting position and initial orientation angle relative to the horizontal axis. This point-based representation provides a compact yet flexible description of lane geometry and is compatible with subsequent iterative refinement.
Given the initial lane priors, TPDNet progressively refines lane geometry through multiple stages. At each stage, ROI features are extracted according to the current lane geometry and used to predict residual updates for the lane parameters. Let { L t } t = 1 T denote the hierarchical feature maps used across the T refinement stages, where L 1 corresponds to the coarsest semantic features and L T corresponds to the finest spatial details. Starting from the initial lane priors P 0 , the lane parameters are iteratively updated as
P t = P t 1 + R t ( L t , P t 1 ) , t = 1 , , T ,
where R t denotes the stage-specific refinement function that extracts ROI features according to the previous-stage lane geometry P t 1 and predicts residual coordinate updates through fully connected layers [9,23]. This iterative refinement strategy enables coarse lane hypotheses to be gradually adjusted toward accurate lane positions.
To integrate multi-scale visual information, TPDNet adopts a cross-layer refinement strategy. High-level feature maps provide semantic context for identifying lane structures, while low-level feature maps preserve fine-grained spatial details for accurate localization. By progressively aggregating features across different FPN levels, the model can balance global structural integrity and local geometric precision.
At each refinement stage, the extracted ROI features are further enhanced by ROIGather. Specifically, ROIGather aggregates contextual information from the global image feature map and combines it with local lane proposal features through a residual connection. This step enriches each lane proposal with image-level context, which is particularly useful under weak visual cues such as occlusion, shadows, or illumination changes. Let X p ( t ) R C × N denote the local ROI features of a lane proposal at stage t, and let X f R C × H W denote the flattened global feature map from the FPN. Following the attention mechanism [12], the cross-attention weight matrix W R N × H W is computed as
W = softmax ( X p ( t ) ) X f C .
The aggregated global context feature G ( t ) R C × N is then obtained by
G ( t ) = X f W .
The context-enhanced lane feature is computed through a residual connection with a learnable scalar scaling factor γ :
X ^ p ( t ) = X p ( t ) + γ G ( t ) R C × N .
The enhanced lane-query features X ^ p ( t ) are then passed to TPR for topology-aware relational reasoning among candidate lanes.

2.3. Topology-Aware Perception Reasoner

After ROIGather enriches each lane proposal with image-level contextual information, the resulting lane-query features still need to interact with each other to capture the structural organization of the road. If lane candidates are processed independently, the model may fail to preserve inter-lane relationships such as relative ordering, spatial proximity, parallelism, and geometric continuity. To address this issue, we introduce the TPR, which is applied after ROIGather at each refinement stage to perform topology-aware relational reasoning among all lane candidates.
The key idea of TPR is to treat lane candidates as nodes in a geometry-aware relational graph. Each node represents one lane candidate, and each edge describes the structural dependency between a pair of lanes. Different from standard self-attention, which mainly relies on feature similarity, TPR incorporates both lane-level visual features and pairwise relative geometry to construct topology-aware lane affinities. In this way, each lane representation is updated according to not only its own visual evidence, but also the structural configuration of surrounding lanes.
Compared with previous graph-based lane detectors and generic relational reasoning modules, TPR is distinguished in three aspects. First, the graph nodes are not pixels, anchors, or manually grouped lane segments, but iteratively refined lane candidates whose geometry is updated at each refinement stage. The relational graph is therefore dynamic and evolves with the predicted lane layout. Second, the edge representation is not derived only from feature similarity or Euclidean proximity. It explicitly encodes lane-specific topology cues, including relative start position, orientation, length, shared valid support, mean lateral displacement, and top/bottom separation. Third, the relative geometry affects both the attention logits and the aggregated messages: the bias term changes which lanes communicate, whereas the relation message changes what geometric information is propagated. This dual use is intended to make the reasoning process sensitive to lane ordering, parallelism, convergence, and crossing tendency, rather than merely adding a generic positional encoding to self-attention.
For clarity, the following formulation is written for a single image in a mini-batch, and the batch dimension is omitted. Let M denote the number of candidate lanes, N denote the number of sampled lateral coordinates for each lane, and D denote the dimension of the lane-level feature. TPR uses H a attention heads, and the feature dimension of each head is d = D / H a . The superscript ( t ) denotes the refinement stage. When no ambiguity arises, the stage superscript is omitted in the attention formulation for compactness.
Lane-level Feature Preparation: At refinement stage t, ROIGather aggregates sampled lane features and image-level contextual information for each candidate lane. The output feature of the i-th candidate lane is denoted as f i ( t ) R D , where i = 1 , , M . The lane-level features of all candidates are stacked row-wise as
F ( t ) = [ f 1 ( t ) ; f 2 ( t ) ; ; f M ( t ) ] R M × D .
These compact lane-level features serve as node representations for subsequent topology-aware relational reasoning.
Each lane candidate is also associated with its current geometric prediction. Following the CLRNet-style lane representation, the geometry of the i-th candidate lane is written as
g i ( t ) = [ s i , s i + , y 0 , i , x 0 , i , θ i , l i , x i , 0 , x i , 1 , , x i , N 1 ] R 6 + N ,
where s i and s i + are the background and foreground classification scores, ( x 0 , i , y 0 , i ) denotes the starting position, θ i denotes the normalized orientation angle, l i denotes the predicted lane length, and { x i , n } n = 0 N 1 are the normalized lateral coordinates sampled along predefined vertical positions. Only the geometric terms are used to construct the relative geometry vector.
Relative Geometric Encoding: To make the relation modeling sensitive to lane topology, TPR explicitly encodes the pairwise geometric configuration between lane candidates. For each ordered lane pair ( i , j ) , we construct a relative geometry vector describing lane j with respect to lane i:
ϕ i j ( t ) = [ Δ x 0 , i j , Δ y 0 , i j , Δ θ i j , sin ( π Δ θ i j ) , cos ( π Δ θ i j ) , Δ l i j , Δ x ¯ i j , | Δ x | ¯ i j , Δ x i j bot , Δ x i j top , o i j ] R 11 .
Specifically, the relative start-point, orientation, and length terms are defined as
Δ x 0 , i j = x 0 , j x 0 , i , Δ y 0 , i j = y 0 , j y 0 , i ,
Δ θ i j = θ j θ i , Δ l i j = l j l i N .
Here, Δ θ i j is computed in the normalized angle space, and therefore sin ( π Δ θ i j ) and cos ( π Δ θ i j ) are used to provide a periodic encoding of the relative orientation.
Since not all sampled lateral coordinates are valid for every candidate lane, we define the common valid sampled-point set of lanes i and j as
Ω i j = { n 0 x i , n 1 , 0 x j , n 1 , n = 0 , , N 1 } .
Let c i j = max ( | Ω i j | , 1 ) denote the valid count used for normalization. The mean signed and absolute lateral displacements are then computed as
Δ x ¯ i j = 1 c i j n Ω i j ( x j , n x i , n ) ,
| Δ x | ¯ i j = 1 c i j n Ω i j | x j , n x i , n | .
The overlap ratio is defined as the proportion of commonly valid sampled points:
o i j = | Ω i j | N .
In the adopted lane representation, the sampled coordinates are ordered from bottom to top. Therefore, the bottom and top lateral displacements are defined as
Δ x i j bot = x j , 0 x i , 0 , Δ x i j top = x j , N 1 x i , N 1 .
The relative geometry vector is projected by a lightweight relation encoder:
e i j ( t ) = E rel ϕ i j ( t ) R D r ,
where E rel ( · ) is implemented by a multi-layer perceptron, and D r denotes the dimension of the relation embedding.
The relation embedding is further projected into two complementary geometry-aware terms:
β i j ( t ) = W b e i j ( t ) R H a , u i j ( t ) = W u e i j ( t ) R D ,
where W b R H a × D r and W u R D × D r are learnable linear projection matrices. The vector β i j ( t ) provides head-specific relative geometry biases for attention computation, and its h-th element is denoted as β i j h , ( t ) . The vector u i j ( t ) provides a geometry-aware relation message and is reshaped into { u i j h , ( t ) } h = 1 H a , where u i j h , ( t ) R d .
Topology-aware Lane Affinity Construction. Given the lane-level feature matrix F ( t ) , TPR first computes query, key, and value projections:
Q ( t ) = F ( t ) W Q , K ( t ) = F ( t ) W K , V ( t ) = F ( t ) W V ,
where W Q , W K , W V R D × D are learnable projection matrices. The projected features are reshaped into H a attention heads, yielding q i h , k i h , v i h R d for the h-th head.
The attention logit from lane i to lane j in the h-th head is computed by combining feature similarity with the relative geometry bias:
s i j h = ( q i h ) k j h d + β i j h .
The normalized topology-aware lane affinity is obtained by applying softmax over all source lanes:
a i j h = exp ( s i j h ) k = 1 M exp ( s i k h ) .
The resulting affinity matrix A h , ( t ) = [ a i j h ] R M × M indicates how much information lane i aggregates from lane j under both visual feature similarity and relative geometric constraints.
Relational Aggregation. Based on the learned topology-aware affinity matrix, TPR aggregates both visual content messages and geometry-aware relation messages for each lane candidate:
m i h = j = 1 M a i j h v j h + u i j h ,
where v j h denotes the visual content message from lane j, and u i j h denotes the geometry-aware message that describes lane j relative to lane i.
Messages from all attention heads are concatenated and projected back to the original feature space:
m i = W O Concat h = 1 H a m i h R D ,
where W O R D × H a d is a learnable output projection matrix, and H a d = D .
Finally, the topology-enhanced lane feature is obtained through residual updates, layer normalization, and a feed-forward network:
f ^ i ( t ) = LN f i ( t ) + m i ,
f ˜ i ( t ) = LN f ^ i ( t ) + FFN ( f ^ i ( t ) ) .
The output features { f ˜ i ( t ) } i = 1 M are topology-enhanced lane representations. Compared with the original lane features, they preserve local appearance cues while incorporating relational information from other candidate lanes. At each refinement stage, these features are fed into the subsequent prediction head to generate classification scores and geometric residuals. Since TPR is applied at every refinement stage, inter-lane relationships are progressively updated as lane geometry becomes more accurate.

2.4. Topology-Decoupled Head

In lane detection, classification and geometric regression emphasize different optimization objectives. Classification focuses on distinguishing foreground lane candidates from background proposals, whereas geometric regression requires accurate localization of lane start positions, orientations, lengths, and sampled lateral coordinates. Optimizing these objectives through a shared prediction pathway may introduce task interference, especially when visually ambiguous lane candidates require different discriminative and localization cues.
To alleviate this issue, we introduce a TDH to separate lane classification and geometric regression at the prediction level. Instead of applying the decoupled prediction only after the final refinement stage, TDH is used at each refinement stage. Let f ˜ i ( t ) R D denote the topology-enhanced feature of the i-th lane candidate at refinement stage t, where D is the feature dimension. TDH first initializes two branch-specific feature transformations from the same topology-enhanced lane feature:
f ˜ i ( t ) h i , geo ( t ) = MLP geo f ˜ i ( t ) , h i , cls ( t ) = MLP cls f ˜ i ( t ) ,
where h i , geo ( t ) and h i , cls ( t ) are the intermediate features of the geometry and classification branches, respectively. Each branch consists of stacked fully connected layers with nonlinear activations, allowing the two tasks to learn task-specific representations while still sharing the topology-aware lane feature as input.
The geometry branch predicts a regression vector r i ( t ) R N + 4 :
r i ( t ) = FC geo h i , geo ( t ) R N + 4 .
Specifically, the regression vector is written as
r i ( t ) = [ Δ y 0 , i ( t ) , Δ x 0 , i ( t ) , Δ θ i ( t ) , l i ( t ) , δ x i , 0 ( t ) , δ x i , 1 ( t ) , , δ x i , N 1 ( t ) ] ,
where Δ y 0 , i ( t ) , Δ x 0 , i ( t ) , and Δ θ i ( t ) are residual updates for the start position and orientation of the current lane prior, l i ( t ) denotes the predicted lane length, and { δ x i , n ( t ) } n = 0 N 1 are the point-wise lateral offsets for the N sampled positions.
Given the lane prior from the previous stage, the start position and orientation are updated as
y 0 , i ( t ) = y 0 , i ( t 1 ) + Δ y 0 , i ( t ) , x 0 , i ( t ) = x 0 , i ( t 1 ) + Δ x 0 , i ( t ) , θ i ( t ) = θ i ( t 1 ) + Δ θ i ( t ) .
The updated prior parameters define a coarse lane hypothesis x ¯ i , n ( t ) at each sampled vertical position y n . The final lateral coordinate is then obtained by adding the predicted point-wise offset:
x ^ i , n ( t ) = x ¯ i , n ( t ) + δ x i , n ( t ) , n = 0 , 1 , , N 1 .
In this way, TDH preserves the iterative refinement mechanism of the baseline lane representation while assigning geometry-specific parameters to an independent regression pathway.
The classification branch predicts a two-dimensional logit vector:
c i ( t ) = FC cls h i , cls ( t ) R 2 ,
where the two logits correspond to the background and foreground lane classes. During inference, the foreground confidence of the i-th lane candidate is obtained by applying a softmax operation:
p i , fg ( t ) = exp ( c i , fg ( t ) ) exp ( c i , bg ( t ) ) + exp ( c i , fg ( t ) ) .
Low-confidence candidates are filtered according to this foreground probability before non-maximum suppression.
To further encourage feature-level disentanglement between the two prediction tasks, we introduce an orthogonality regularization term on the branch-specific intermediate features. Let H geo ( T ) R B × M × d and H cls ( T ) R B × M × d denote the final-stage geometry and classification branch features, respectively, where B is the batch size, M is the number of lane candidates, and d is the hidden dimension of each branch. For the b-th image in a mini-batch, the cross-branch correlation matrix is computed as
C b = H geo b , T H cls b , T R d × d .
The orthogonality loss is defined as a normalized squared correlation penalty:
L orth = 1 Z · 1 B d 2 b = 1 B C b F 2 ,
where · F denotes the Frobenius norm and Z is a normalization factor used to stabilize the loss scale. In implementation, Z is set according to the number of lane candidates and the hidden dimension. This regularization suppresses excessive correlation between the geometry and classification feature subspaces, thereby reducing task interference without changing the inference pipeline.
Overall, TDH provides a lightweight prediction-level decoupling mechanism. The geometry branch focuses on lane shape refinement and coordinate localization, while the classification branch focuses on foreground confidence estimation. Combined with the topology-enhanced features provided by TPR, the decoupled design improves optimization stability and helps produce more reliable lane predictions.

2.5. Topology Consistency Loss

Standard geometric losses supervise lane candidates mainly through point-wise regression or lane-level overlap, but they do not explicitly penalize structurally implausible predictions such as local oscillations, lane crossings, or inconsistent relative ordering. To improve the structural coherence of predicted lanes, we introduce a TCL, which imposes both intra-lane smoothness and inter-lane ordering constraints.
During training, TCL is applied only to matched positive lane candidates after dynamic label assignment. This avoids imposing structural constraints on background proposals. The predicted lateral coordinates are first decoded into the image coordinate system. Therefore, unless otherwise specified, the coordinates used in this section are measured in pixels rather than in normalized coordinates.
Let P ^ i = { ( x ^ i , n , y n ) } n = 0 N 1 denote the i-th matched positive predicted lane, where x ^ i , n is the decoded lateral coordinate at the sampled vertical position y n , and N is the number of sampled points. Since not all sampled points are valid for every predicted lane, we define a validity mask
m i , n = I 0 x ^ i , n < W ,
where W is the image width and I ( · ) is the indicator function.

2.5.1. Smoothness Loss

Lane markings are continuous curvilinear structures, and their lateral coordinates should vary smoothly along the vertical direction. To suppress high-frequency oscillations, we penalize the second-order finite difference of the predicted lateral coordinates. For a valid triplet of consecutive sampled points, the second-order difference is computed as
d i , n = x ^ i , n + 1 2 x ^ i , n + x ^ i , n 1 , n = 1 , , N 2 .
The corresponding valid-triplet mask is defined as
m i , n sm = m i , n 1 m i , n m i , n + 1 .
The smoothness loss is then formulated as
L smooth = i n = 1 N 2 m i , n sm d i , n 2 i n = 1 N 2 m i , n sm + ϵ ,
where ϵ is a small constant for numerical stability. This loss is computed only over valid triplets whose three lateral coordinates fall inside the image boundary.

2.5.2. Order Loss

In real road scenes, adjacent lane markings usually preserve a consistent left-to-right spatial order. However, predicted lane candidates are not inherently ordered. Therefore, before applying the ordering constraint, we first sort valid predicted lanes according to their mean lateral positions. For the i-th matched positive lane, its mean lateral coordinate is computed as
x ¯ i = n = 0 N 1 m i , n x ^ i , n n = 0 N 1 m i , n + ϵ .
Let π ( · ) denote the permutation that sorts the valid lanes in ascending order of x ¯ i , from left to right. The ordering constraint is imposed only on adjacent lanes in this sorted sequence.
For two adjacent sorted lanes π ( i ) and π ( i + 1 ) , the common valid mask at the n-th sampled position is defined as
m i , n ord = m π ( i ) , n m π ( i + 1 ) , n .
The lateral separation between the two adjacent lanes is
s i , n = x ^ π ( i + 1 ) , n x ^ π ( i ) , n .
The order loss penalizes violations of a minimum lateral separation margin:
L order = i n = 0 N 1 m i , n ord max 0 , τ s i , n i n = 0 N 1 m i , n ord + ϵ ,
where τ is a pixel-level margin. This formulation prevents unnatural lane crossings and overly close adjacent predictions, while avoiding constraints on invalid or non-overlapping sampled positions.
The proposed topology consistency loss is defined as
L TCL = L smooth + λ order L order ,
where λ order balances the contribution of the ordering constraint.

2.5.3. Line IoU Loss

In addition to TCL, we retain the Line IoU (LIoU) loss as a complementary lane-level geometric supervision term. Unlike point-wise regression losses, LIoU treats each lane as a holistic geometric entity and measures the overlap between the predicted lane and its matched ground-truth lane.
Given a predicted lane { x ^ n } n = 0 N 1 and its matched ground-truth lane { x n g } n = 0 N 1 , each sampled point is extended to a horizontal line segment with half-width e. The per-point intersection and union are defined as
d n O = max 0 , min ( x ^ n + e , x n g + e ) max ( x ^ n e , x n g e ) ,
and
d n U = max ( x ^ n + e , x n g + e ) min ( x ^ n e , x n g e ) .
The LIoU loss is then computed as
L LIoU = 1 n = 0 N 1 d n O n = 0 N 1 d n U + ϵ .
In our implementation, the half-width parameter is set to e = 15 pixels, which provides a stable tolerance for lane-level geometric matching.
Compared with LIoU, which focuses on the global overlap between predicted and ground-truth lanes, TCL explicitly regularizes the internal smoothness of each predicted lane and the spatial ordering among adjacent lanes. Therefore, the two losses are complementary: LIoU improves lane-level geometric alignment, while TCL encourages structurally coherent lane predictions.

2.6. Training and Inference

2.6.1. Dynamic Label Assignment

During training, each ground-truth lane is assigned to a set of positive lane candidates through a dynamic label assignment strategy. The assignment is performed independently at each refinement stage, so that intermediate lane predictions can also receive direct supervision.
For each predicted lane candidate and ground-truth lane pair, we compute an assignment cost that combines classification confidence and geometric similarity. Let C cls denote the focal-loss-based classification cost. To measure geometric consistency, we consider three complementary terms: the average lateral distance between sampled lane points, the start-point distance, and the orientation difference.
Given a predicted lane p i and a ground-truth lane g j , let D dis ( i , j ) denote the average lateral point distance computed over valid ground-truth sampled positions. Let D x y ( i , j ) denote the Euclidean distance between their start points, and let D θ ( i , j ) denote the orientation difference. These distance terms are normalized and converted into similarity scores:
S dis ( i , j ) = 1 D dis ( i , j ) max i , j D dis ( i , j ) + ϵ ,
S x y ( i , j ) = 1 D x y ( i , j ) max i , j D x y ( i , j ) + ϵ ,
and
S θ ( i , j ) = 1 D θ ( i , j ) max i , j D θ ( i , j ) + ϵ ,
where ϵ is a small constant for numerical stability. The overall geometric similarity is then defined as
S geo ( i , j ) = S dis ( i , j ) · S x y ( i , j ) · S θ ( i , j ) 2 .
The final assignment cost is formulated as
C assign ( i , j ) = w cls C cls ( i , j ) w geo S geo ( i , j ) ,
where w cls and w geo balance the classification cost and geometric similarity. A lower assignment cost indicates that the predicted candidate is more suitable for the corresponding ground-truth lane.
Instead of assigning a fixed number of positive candidates to each ground-truth lane, we adopt a dynamic-k strategy. We first compute the pairwise LIoU between predicted lanes and ground-truth lanes. For the j-th ground-truth lane, the number of positive candidates is determined by the sum of the top-q LIoU values:
k j = max 1 , = 1 q TopIoU , j ,
where q = 4 in our implementation. For each ground-truth lane, the k j predicted candidates with the lowest assignment costs are selected as positive samples. If one predicted candidate is assigned to multiple ground-truth lanes, only the assignment with the lowest cost is retained.

2.6.2. Overall Training Objective

The proposed network is supervised by classification, prior-parameter regression, lane-level geometric alignment, auxiliary segmentation, topology consistency, and branch orthogonality losses. Since TPDNet follows an iterative refinement pipeline, the classification, prior-parameter regression, LIoU, and topology consistency losses are computed at each refinement stage and averaged over all stages.
At refinement stage t, the stage-wise detection loss is written as
L stage ( t ) = w cls L cls ( t ) + w xytl L xytl ( t ) + w LIoU L LIoU ( t ) + w TCL L TCL ( t ) .
Here, L cls ( t ) is the focal classification loss for foreground/background prediction, and L xytl ( t ) is the smooth- L 1 loss applied to the lane prior parameters, including start position, orientation, and length. L LIoU ( t ) measures lane-level geometric overlap, while L TCL ( t ) imposes smoothness and ordering constraints on matched positive lanes.
The stage-wise losses are averaged across all T refinement stages:
L det = 1 T t = 1 T L stage ( t ) .
In addition, an auxiliary segmentation loss L seg is applied to the segmentation branch to strengthen dense visual supervision. The orthogonality regularization L orth is computed using the final-stage geometry and classification branch features, encouraging feature-level disentanglement between the two prediction tasks.
The complete training objective is therefore
L total = L det + w seg L seg + w orth L orth .
Equivalently, expanding the stage-wise detection terms gives
L total = 1 T t = 1 T w cls L cls ( t ) + w xytl L xytl ( t ) + w LIoU L LIoU ( t ) + w TCL L TCL ( t ) + w seg L seg + w orth L orth .
All balancing weights are treated as hyperparameters and are set according to the validation performance.

2.6.3. Inference

During inference, only the predictions from the final refinement stage are used. For each lane candidate, the classification branch outputs a two-dimensional logit vector corresponding to the background and foreground classes. The foreground confidence is obtained by applying a softmax operation:
p fg = exp ( c fg ) exp ( c bg ) + exp ( c fg ) .
Candidates with foreground confidence lower than a predefined threshold are discarded.
After confidence filtering, Line-IoU-based non-maximum suppression is applied to remove redundant lane predictions. The remaining candidates are decoded into lane point sequences according to their predicted start position, length, and sampled lateral coordinates. Since the final lane geometry is decoded from the regression branch, the decoupled prediction design reduces direct interference from the classification branch during lane localization.
The final output is a set of lane instances:
Y = P ^ i p i , fg η , i I NMS ,
where η is the confidence threshold and I NMS denotes the set of lane candidates retained after non-maximum suppression.

3. Results

3.1. Datasets

To evaluate the effectiveness and generalization capability of the proposed TPDNet, we conduct experiments on three widely used lane detection benchmarks: CULane, TuSimple, and CurveLanes. These datasets cover different driving scenarios, ranging from regular highway scenes to complex urban roads and highly curved lane layouts.
  • CULane is a large-scale lane detection dataset collected in complex urban driving environments, containing approximately 133,000 images. It covers nine challenging scenarios, including Normal, Crowded, Dazzle light, Shadow, No line, Arrow, Curve, Cross, and Night. Following the official protocol, the dataset is split into 88,880 training images, 9675 validation images, and 34,680 testing images. Due to frequent occlusions, illumination changes, worn lane markings, and complex road layouts, CULane provides a challenging benchmark for evaluating robustness in real-world driving scenarios.
  • TuSimple mainly focuses on highway driving scenes under relatively stable illumination conditions. It consists of 6408 training images and 2782 testing images. Compared with CULane, TuSimple contains more regular lane structures and cleaner road scenes, making it suitable for evaluating the geometric localization accuracy of lane detection methods.
  • CurveLanes is designed for lane detection in complex curved road scenes. It contains 150,000 high-resolution images, including 100,000 training images, 20,000 validation images, and 30,000 testing images. Since the test annotations are not publicly available, we follow common practice in existing CurveLanes evaluations [19,24] and report results on the validation split. The dataset contains abundant sharp curves, dense lane structures, and multi-lane bifurcations, making it particularly suitable for evaluating topology-aware lane reasoning.
Data Preprocessing. For all datasets, input images are resized to a fixed resolution, e.g., 800 × 320 , to balance computational efficiency and feature resolution. Ground-truth lane annotations are converted into sampled point sequences according to the lane representation described in Section 2.2. During training, standard data augmentation strategies, including random horizontal flipping, rotation, and brightness jittering, are applied to improve generalization.

3.2. Implementation Details and Evaluation Metrics

Implementation Details. The proposed framework is implemented in PyTorch 2.0 and trained on an NVIDIA RTX 3090 GPU (Nvidia Corporation, Santa, Clara, CA, USA). We use ResNet-18, ResNet-34, and ResNet-101 as backbone networks, equipped with a Feature Pyramid Network (FPN) for multi-scale feature extraction. The model is optimized using AdamW with an initial learning rate of 1 × 10 4 and a cosine annealing learning-rate schedule. The batch size is set to 8, and the model is trained for 30 epochs. For data augmentation, we apply random horizontal flipping, rotation, and brightness jittering.
Evaluation Metrics. For fair comparison, all reported results are evaluated following the official evaluation protocols of the corresponding datasets. On CULane, a predicted lane is considered a true positive if its intersection-over-union with a ground-truth lane is greater than 0.5. Otherwise, it is counted as a false positive, while unmatched ground-truth lanes are counted as false negatives. Precision, recall, and F1 score are computed as
Precision = TP TP + FP , Recall = TP TP + FN ,
F 1 = 2 · Precision · Recall Precision + Recall .
For TuSimple, we report both the official accuracy metric and the F1 score. For CurveLanes, we report mF1, F1@50, F1@75, precision, recall, FPS, and computational cost following the commonly used evaluation setting. For FPS reporting, we use the same end-to-end inference pipeline as in deployment, including confidence filtering and Line-IoU-based non-maximum suppression, so the reported speed reflects the final prediction workflow rather than the raw network forward pass alone.
Because the proposed method is motivated by structural consistency, we also consider topology-aware diagnostic metrics in addition to standard F1-based scores. Let P denote the set of matched predicted lanes in an image, and let x i ( y ) be the lateral coordinate of lane i at vertical position y. We evaluate three complementary structural indicators:
  • Lane ordering accuracy (LOA) measures the proportion of valid adjacent lane pairs whose left-to-right order is consistent across their shared vertical support. Higher LOA indicates fewer ordering inversions.
  • Smoothness error (SE) is the average squared second-order difference in sampled lane coordinates, 1 | P | i mean y ( x i ( y + 1 ) 2 x i ( y ) + x i ( y 1 ) ) 2 . Lower SE indicates smoother lane trajectories.
  • Lane crossing rate (LCR) measures the percentage of valid adjacent lane pairs that exhibit at least one left–right sign reversal over their shared support. Lower LCR indicates fewer structurally implausible crossings.
These diagnostic metrics are not intended to replace official benchmark metrics, but to directly examine the structural properties targeted by TPR and TCL.

3.3. Comparative Analysis

To evaluate the effectiveness of TPDNet, we first conduct a comparative analysis on the CULane dataset, which is one of the most widely used benchmarks for urban-scene lane detection. We compare TPDNet with representative lane detection methods, including SCNN, RESA, UFLD, LaneATT, CondLane, CLRNet, and CLRerNet.
The quantitative results across the nine challenging CULane scenarios are summarized in Table 1. TPDNet achieves highly competitive overall performance. With ResNet-101, TPDNet obtains an F1@50 score of 81.46, which is slightly higher than the strongest compared method. Compared with existing methods, the improvement is more noticeable in topology-sensitive and visually challenging scenarios, such as Dazzle light, Shadow, No line, Arrow, Curve, and Cross.
These results suggest that explicitly modeling inter-lane structural relationships is beneficial for robust lane detection under degraded visual conditions. In particular, the improvements in Curve and Cross scenarios indicate that topology-aware reasoning helps preserve lane continuity and relative spatial ordering when the road layout becomes complex. The performance in Dazzle light and Shadow scenarios further shows that relational reasoning can provide useful structural cues when local lane appearance is unreliable.
To further evaluate the generalization capability of TPDNet, we report its performance on TuSimple and CurveLanes in Table 2 and Table 3, respectively.
On TuSimple, TPDNet achieves a strong F1 score among the compared methods while maintaining competitive accuracy. Since TuSimple contains relatively regular highway scenes, the strong F1 score indicates that the proposed method can preserve accurate lane localization in structured driving environments. Meanwhile, the low false-positive and false-negative rates show that TPDNet achieves a balanced trade-off between precision and recall.
The advantage of TPDNet is more evident on CurveLanes, as shown in Table 3. With ResNet-34, TPDNet achieves an mF1 score of 58.74, outperforming the strongest compared baseline by 4.98 points. This improvement is particularly meaningful because CurveLanes contains abundant curved lanes, dense lane layouts, and complex multi-lane structures. The strong performance gain suggests that geometry-aware inter-lane reasoning helps the model maintain coherent lane structures when the road topology is highly non-linear.
Overall, the results across the three benchmarks demonstrate that TPDNet achieves a favorable balance between local geometric accuracy and global structural consistency. Instead of treating lane candidates as isolated instances, the proposed topology-aware design allows lane features to interact with each other, which improves robustness in challenging road scenarios.
Efficiency Analysis. To further assess the accuracy–efficiency trade-off, we compare detection performance and inference speed, as shown in Figure 3. Lightweight variants of TPDNet maintain competitive inference speed while improving detection accuracy. The ResNet-101 variant achieves higher accuracy but introduces additional computational cost. This trend indicates that the proposed topology-aware modules can be integrated into different backbone settings, allowing a flexible trade-off between accuracy and efficiency according to practical deployment requirements.
The main additional cost of TPR comes from pairwise lane-candidate attention. For M lane candidates, feature dimension D, relation embedding dimension D r , and T refinement stages, the complexity of TPR is O ( T ( M 2 D + M 2 D r + M D 2 ) ) , and the dominant pairwise memory terms are the attention map of size H a M 2 and the relation embedding of size M 2 D r . In our default setting, M = 192 , D = 64 , D r = 64 , H a = 4 , and T = 3 . Thus, the TPR module introduces a quadratic dependency on the number of lane candidates, but the absolute cost remains bounded because lane detection uses a fixed and relatively small proposal set. For deployment-oriented settings, reducing M, sharing relation encoders across stages, or sparsely attending to the top-k geometrically relevant candidates can further lower the memory and latency overhead. We leave a module-wise breakdown of parameters, latency, and memory usage as future work for a more deployment-oriented study.

3.4. Ablation Study

To evaluate the contribution of each proposed component, we conduct ablation experiments on CULane by progressively adding TPR, TDH, and TCL to the baseline model. The results are summarized in Table 4.
The baseline model achieves an F1@50 of 80.13. After introducing TPR, the performance increases to 80.51, yielding a gain of 0.38 points. This is the largest single improvement among the three components, indicating that explicit inter-lane relational reasoning plays an important role in improving lane detection performance. By allowing lane candidates to aggregate information from other structurally related candidates, TPR helps the model capture global road layout information that is difficult to obtain from isolated lane features.
Adding TDH further improves the F1@50 score to 80.66. This result suggests that separating geometric regression and classification into branch-specific prediction paths can reduce task interference and improve optimization stability. Since lane classification focuses on foreground–background discrimination while geometric regression emphasizes precise coordinate localization, the decoupled design allows the two tasks to learn more suitable representations.
When TCL is further incorporated, the model achieves the best F1@50 score of 80.74. Although the numerical gain from TCL is moderate, it provides an explicit structural regularization that complements the LIoU loss. While LIoU encourages the predicted lanes to align with ground-truth lanes, TCL further regularizes the internal smoothness of each lane and the relative ordering among adjacent lanes. This helps reduce structurally implausible predictions such as local oscillations and lane crossings.
The complete model achieves a total improvement of 0.61 points over the baseline. These ablation results show that TPR, TDH, and TCL contribute complementary benefits: TPR enhances feature-level relational reasoning, TDH improves prediction-level task decoupling, and TCL strengthens supervision-level structural consistency.

3.5. Structural Consistency, Statistical Stability, and Sensitivity Analysis

To directly examine whether the proposed topology-aware components improve structural quality, we further evaluate the ablation variants using the topology-aware metrics defined in Section 3.2. As shown in Table 5, adding TPR and TCL is expected to improve lane ordering accuracy and reduce smoothness error and crossing rate, because TPR explicitly propagates inter-lane geometric context and TCL directly regularizes intra-lane smoothness and inter-lane ordering.
To assess experimental stability, we repeat the main CULane experiment with multiple random seeds and report the mean and standard deviation in Table 6. This analysis is particularly important because the overall F1 margin between the strongest methods is narrow.
We also analyze the sensitivity of TCL to the order margin τ and the order-loss weight λ order . Table 7 summarizes the validation performance under different settings. In practice, we select the default hyperparameters according to validation performance and use the same setting for all test-set comparisons. Although this analysis captures the main hyperparameter trend, a finer-grained decomposition of the smoothness loss, order loss, orthogonality regularization, and individual relative-geometry terms in TPR would provide an even more exhaustive picture and is left for future work.

3.6. Qualitative Analysis and Visualization

To qualitatively analyze the behavior of TPDNet, we visualize lane detection results under challenging CULane scenarios. As shown in Figure 4, TPDNet produces more continuous and coherent lane structures compared with representative baseline methods.
In scenes with weak lane markings, illumination disturbance, or partial occlusion, competing methods may generate fragmented predictions, miss partially visible lanes, or produce unstable lane structures. In contrast, TPDNet better preserves the continuity and relative ordering of adjacent lanes. This is consistent with the design of TPR and TCL: TPR enables candidate lanes to exchange structural information through topology-aware relational reasoning, while TCL encourages smooth and ordered lane predictions during training.
These qualitative results further support the quantitative findings. The proposed topology-aware design not only improves numerical performance, but also helps generate lane predictions that are more consistent with the underlying road structure.

3.7. Failure Case Analysis

We further inspect failure cases in scenarios that are not fully captured by standard F1-based evaluation. Under severe occlusion, TPDNet can still infer short missing lane segments when neighboring lanes provide reliable structural cues, but long-term disappearance may lead to missed detections because the current framework does not use temporal evidence across frames. In lane merging or splitting regions, the ordering constraint in TCL may become less reliable because the true topology changes along the vertical axis; in such cases, overly strong ordering regularization can suppress valid convergence patterns. For heavily degraded or nearly invisible lane markings, the proposal-based pipeline may fail when the initial lane candidates do not sufficiently cover the true lane positions. These cases indicate that topology-aware spatial reasoning improves structural coherence, but it cannot completely replace temporal modeling, adaptive topology switching, or stronger proposal generation under extreme visual degradation.

4. Discussion

This work revisits lane detection from the perspective of structural consistency. Instead of treating lane candidates as independent prediction targets, TPDNet introduces topology-aware reasoning into an iterative lane refinement framework. The core idea is to improve lane detection not only by enhancing local visual features, but also by modeling the structural relationships among lane instances.
The proposed TPR plays the central role in feature-level relational reasoning. By incorporating both lane-query features and pairwise geometric encodings, TPR allows each candidate lane to aggregate information from other structurally related candidates through learned topology-aware affinities. In this way, the model can exploit inter-lane cues such as relative ordering, spatial proximity, and geometric continuity. This is particularly useful when local visual evidence is unreliable due to occlusion, shadows, dazzle light, worn markings, or complex road curvature.
In addition to feature-level reasoning, TDH and TCL provide complementary improvements at the prediction and supervision levels. TDH separates geometric regression from foreground-background classification, reducing direct task interference during lane prediction. TCL further regularizes the predicted lane structures by encouraging intra-lane smoothness and inter-lane ordering consistency. Together, these components form a multi-level topology-aware design: TPR enhances relational representation, TDH improves task-specific prediction, and TCL encourages structurally coherent outputs.
The experimental results support this design. On CULane, TPDNet achieves competitive overall performance and shows clear improvements in several challenging scenarios where structural reasoning is important, such as Dazzle light, Shadow, No line, Arrow, and Curve. On TuSimple, the method maintains strong geometric localization performance under relatively regular highway scenes. On CurveLanes, where curved lanes and complex multi-lane layouts are more common, TPDNet obtains a more noticeable improvement, suggesting that geometry-aware inter-lane reasoning is especially beneficial for highly non-linear road topology.
Despite these advantages, several limitations remain. First, the current framework mainly models spatial relationships among lane candidates within a single image. It does not explicitly exploit temporal consistency across video frames, which may be useful for handling motion blur, intermittent occlusion, and short-term lane disappearance. Second, although TCL improves structural regularity, its smoothness and ordering constraints are still hand-crafted regularization terms. In extreme cases involving abrupt lane merging, splitting, or heavily degraded markings, these constraints may not fully capture the underlying road topology. Third, TPDNet is still built on a proposal-based iterative refinement pipeline, and its final performance can be affected by the quality of initial lane candidates, especially when lanes are severely occluded or nearly invisible.
Future work will focus on three directions. First, we plan to investigate adaptive topology modeling mechanisms that can dynamically adjust inter-lane relationships according to scene context, rather than relying only on pairwise geometric cues. Second, incorporating temporal information into the topology-aware reasoning process may further improve robustness in dynamic driving environments. Third, more lightweight topology reasoning modules will be explored to reduce computational overhead and improve deployment efficiency. Overall, this work shows that explicitly introducing structural reasoning into lane detection is a promising direction for improving both detection accuracy and road-layout consistency.

5. Conclusions

This paper presented TPDNet, a topology-aware lane detection framework that introduces structural reasoning into feature representation, prediction, and supervision. The proposed TPR performs dynamic geometry-aware relational reasoning among lane candidates, TDH decouples classification and geometric regression to reduce task interference, and TCL provides complementary smoothness and ordering regularization. Experiments on CULane, TuSimple, and CurveLanes show that TPDNet achieves competitive detection accuracy and is particularly effective in challenging scenarios involving curved lanes, degraded markings, and complex lane layouts. Beyond improving standard benchmark scores, the results suggest that explicitly modeling inter-lane topology is a useful direction for producing more coherent and reliable road structure perception in autonomous driving systems.

Author Contributions

Conceptualization, D.D., Q.Z., and Y.X.; methodology, D.D. and Q.Z.; software, D.D.; validation, D.D., Q.Z.; formal analysis, D.D.; investigation, D.D. and Y.Z.; resources, T.S.; data curation, Y.Z.; writing—original draft preparation, D.D.; writing—review and editing, Y.X.; visualization, D.D. and Y.X.; supervision, S.S.M., Q.S. and Y.X.; project administration, T.S. and Y.X.; funding acquisition, T.S. All authors have read and agreed to the published version of the manuscript.

Funding

The research was funded by the Jiangsu Provincial Department of Industry and Information Technology, grant number JSSCRC20250022.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding authors.

Acknowledgments

The authors would like to thank the members of the Center for Intelligent Autonomous Systems at Nantong University and Sunny Way LLC for their technical support and helpful discussions.

Conflicts of Interest

Author Tianqing Su was employed by the company SunnyWay LLC. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Narote, S.P.; Bhujbal, P.N.; Narote, A.S.; Dhane, D.M. A review of recent advances in lane detection and departure warning system. Pattern Recognit. 2018, 73, 216–234. [Google Scholar] [CrossRef]
  2. TuSimple. Tusimple Lane Detection Benchmark. 2017. Available online: https://github.com/TuSimple/tusimple-benchmark (accessed on 4 June 2024).
  3. Neven, D.; De Brabandere, B.; Georgoulis, S.; Proesmans, M.; Van Gool, L. Towards end-to-end lane detection: An instance segmentation approach. In Proceedings of the 2018 IEEE Intelligent Vehicles Symposium (IV); IEEE: New York, NY, USA, 2018; pp. 286–291. [Google Scholar]
  4. Hou, Y.; Ma, Z.; Liu, C.; Loy, C.C. Learning lightweight lane detection cnns by self attention distillation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October 2019–2 November 2019; pp. 1013–1021. [Google Scholar]
  5. Pan, X.; Shi, J.; Luo, P.; Wang, X.; Tang, X. Spatial as deep: Spatial cnn for traffic scene understanding. In Proceedings of the AAAI Conference on Artificial Intelligence, New Orleans, LA, USA, 2–7 February 2018; Volume 32. [Google Scholar]
  6. Zheng, T.; Fang, H.; Zhang, Y.; Tang, W.; Yang, Z.; Liu, H.; Cai, D. Resa: Recurrent feature-shift aggregator for lane detection. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtually, 2–9 February 2021; Volume 35, pp. 3547–3554. [Google Scholar]
  7. Qin, Z.; Wang, H.; Li, X. Ultra fast structure-aware deep lane detection. In Proceedings of the European Conference on Computer Vision; Springer: Berlin/Heidelberg, Germany, 2020; pp. 276–291. [Google Scholar]
  8. Tabelini, L.; Berriel, R.; Paixao, T.M.; Badue, C.; De Souza, A.F.; Oliveira-Santos, T. Keep your eyes on the lane: Real-time attention-guided lane detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 294–302. [Google Scholar]
  9. Zheng, T.; Huang, Y.; Liu, Y.; Tang, W.; Yang, Z.; Cai, D.; He, X. Clrnet: Cross layer refinement network for lane detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 898–907. [Google Scholar]
  10. Zheng, T.; Huang, Y.; Liu, Y.; Lin, B.; Yang, Z.; Cai, D.; He, X. CLRNetV2: A Faster and Stronger Lane Detector. IEEE Trans. Pattern Anal. Mach. Intell. 2025, 47, 4271–4284. [Google Scholar] [CrossRef] [PubMed]
  11. Sun, L.; Zhu, H.; Qin, W. SP-Det: Anchor-based lane detection network with structural prior perception. Pattern Recognit. Lett. 2025, 188, 60–66. [Google Scholar] [CrossRef]
  12. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł; Polosukhin, I. Attention is all you need. Adv. Neural Inf. Process. Syst. 2017, 30. [Google Scholar]
  13. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An image is worth 16 × 16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  14. Liu, R.; Yuan, Z.; Liu, T.; Xiong, Z. End-to-end lane shape prediction with transformers. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Virtually, 5–9 January 2021; pp. 3694–3702. [Google Scholar]
  15. Wang, Z.; Guo, J.; Hu, Z.; Zhang, H.; Zhang, J.; Pu, J. Lane transformer: A high-efficiency trajectory prediction model. IEEE Open J. Intell. Transp. Syst. 2023, 4, 2–13. [Google Scholar] [CrossRef]
  16. Gao, R.; Hu, S.; Yan, L.; Zhang, L.; Wu, J. CFI-Former: Efficient lane detection by multi-granularity perceptual query attention transformer. Neural Netw. 2025, 187, 107347. [Google Scholar] [CrossRef] [PubMed]
  17. Zhang, Y.; Xiong, Z.; Zang, Y.; Wang, C.; Li, J.; Li, X. Topology-aware road network extraction via multi-supervised generative adversarial networks. Remote Sens. 2019, 11, 1017. [Google Scholar] [CrossRef]
  18. Lu, P.; Xu, S.; Peng, H. Graph-embedded lane detection. IEEE Trans. Image Process. 2021, 30, 2977–2988. [Google Scholar] [CrossRef] [PubMed]
  19. Xu, H.; Wang, S.; Cai, X.; Zhang, W.; Liang, X.; Li, Z. Curvelane-nas: Unifying lane-sensitive architecture search and adaptive point blending. In Proceedings of the European Conference on Computer Vision; Springer: Berlin/Heidelberg, Germany, 2020; pp. 689–704. [Google Scholar]
  20. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  21. Lin, T.Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 2117–2125. [Google Scholar]
  22. Li, X.; Li, J.; Hu, X.; Yang, J. Line-cnn: End-to-end traffic line detection with line proposal unit. IEEE Trans. Intell. Transp. Syst. 2019, 21, 248–258. [Google Scholar]
  23. Cai, Z.; Vasconcelos, N. Cascade r-cnn: Delving into high quality object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 6154–6162. [Google Scholar]
  24. Liu, L.; Chen, X.; Zhu, S.; Tan, P. Condlanenet: A top-to-down lane detection framework based on conditional convolution. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Virtually, 19–25 June 2021; pp. 3773–3782. [Google Scholar]
  25. Qin, Z.; Zhang, P.; Li, X. Ultra fast deep lane detection with hybrid anchor driven ordinal classification. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 46, 2555–2568. [Google Scholar] [CrossRef]
  26. Han, J.; Deng, X.; Cai, X.; Yang, Z.; Xu, H.; Xu, C.; Liang, X. Laneformer: Object-aware row-column transformers for lane detection. In Proceedings of the AAAI Conference on Artificial Intelligence, Online, 22 February–1 March 2022; Volume 36, pp. 799–807. [Google Scholar]
  27. Qu, Z.; Jin, H.; Zhou, Y.; Yang, Z.; Zhang, W. Focus on local: Detecting lane marker from bottom up via key point. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 19–25 June 2021; pp. 14122–14130. [Google Scholar]
  28. Xiao, L.; Li, X.; Yang, S.; Yang, W. Adnet: Lane shape prediction via anchor decomposition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Virtually, 19–25 June 2023; pp. 6404–6413. [Google Scholar]
  29. Honda, H.; Uchida, Y. Clrernet: Improving confidence of lane detection with laneiou. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Waikoloa, HI, USA, 3–8 January 2024; pp. 1176–1185. [Google Scholar]
Figure 1. Motivation and conceptual overview of TPDNet. Existing lane detection methods may suffer from broken lanes, ordering errors, and geometric inconsistencies under challenging road conditions. TPDNet introduces topology-aware reasoning at the feature, prediction, and supervision levels through TPR, TDH, and TCL, respectively, producing more continuous, ordered, and robust lane predictions.
Figure 1. Motivation and conceptual overview of TPDNet. Existing lane detection methods may suffer from broken lanes, ordering errors, and geometric inconsistencies under challenging road conditions. TPDNet introduces topology-aware reasoning at the feature, prediction, and supervision levels through TPR, TDH, and TCL, respectively, producing more continuous, ordered, and robust lane predictions.
Sensors 26 04278 g001
Figure 2. Detailed Architecture of the proposed TPDNet. (a) The overall multi-stage refinement framework. Given multi-scale visual features extracted by the backbone and FPN, lane priors are progressively refined through repeated refinement stages. ROIGather enhances lane proposal features with contextual information, while TPR explicitly models inter-lane relational dependencies for topology-aware road-structure reasoning. (b) Illustration of TPR, which incorporates relative position encoding and attention-based aggregation to refine lane features according to the structural relationships among candidate lanes. (c) Illustration of TDH, which separates geometric regression and lane classification into two branches to alleviate task interference. The network is supervised by Line IoU Loss, Focal Loss, and the proposed topology consistency losses, including topology smoothness loss and lane order loss.
Figure 2. Detailed Architecture of the proposed TPDNet. (a) The overall multi-stage refinement framework. Given multi-scale visual features extracted by the backbone and FPN, lane priors are progressively refined through repeated refinement stages. ROIGather enhances lane proposal features with contextual information, while TPR explicitly models inter-lane relational dependencies for topology-aware road-structure reasoning. (b) Illustration of TPR, which incorporates relative position encoding and attention-based aggregation to refine lane features according to the structural relationships among candidate lanes. (c) Illustration of TDH, which separates geometric regression and lane classification into two branches to alleviate task interference. The network is supervised by Line IoU Loss, Focal Loss, and the proposed topology consistency losses, including topology smoothness loss and lane order loss.
Sensors 26 04278 g002
Figure 3. Accuracy–efficiency comparison on the CULane and TuSimple datasets. TPDNet provides a favorable balance between detection performance and inference speed under different backbone settings.
Figure 3. Accuracy–efficiency comparison on the CULane and TuSimple datasets. TPDNet provides a favorable balance between detection performance and inference speed under different backbone settings.
Sensors 26 04278 g003
Figure 4. Qualitative comparison on the CULane dataset. TPDNet produces more continuous and structurally coherent lane predictions under challenging conditions.
Figure 4. Qualitative comparison on the CULane dataset. TPDNet produces more continuous and structurally coherent lane predictions under challenging conditions.
Sensors 26 04278 g004
Table 1. Comparison on the CULane test set across nine scenarios. Higher is better for all metrics except Cross-FP, which is reported as the number of false positives (lower is better) following the official evaluation protocol. GFlops are reported when available or measured under the same input setting.
Table 1. Comparison on the CULane test set across nine scenarios. Higher is better for all metrics except Cross-FP, which is reported as the number of false positives (lower is better) following the official evaluation protocol. GFlops are reported when available or measured under the same input setting.
MethodBackboneF1@50F1@75FPSGFlopsNormalCrowdedDazzleShadowNo LineArrowCurveCrossNight
SCNN [5]VGG1671.6035.097.5338.490.6069.7058.5066.9043.4084.1064.40199066.10
RESA [6]ResNet3474.5045.542.191.9072.4066.5072.0046.3088.1068.60189669.80
RESA [6]ResNet5075.3053.3935.743.092.1073.1069.2072.8047.7088.3070.30150369.90
UFLDv1 [7]ResNet1868.4040.012828.587.7066.0058.4062.8040.2081.0057.90174362.10
UFLDv1 [7]ResNet3472.3017016.890.7070.2059.5069.3044.4085.7069.50203766.70
UFLDv2 [25]ResNet1875.0153.5514214.191.8073.3065.3075.1047.6087.9068.50207570.70
UFLDv2 [25]ResNet3476.0075.509127.092.5074.8065.5074.1049.2088.8070.10191070.80
LaneATT [8]ResNet1875.1351.291539.491.1772.7165.8268.0349.1387.8263.75102068.58
LaneATT [8]ResNet3476.6854.3412918.092.1475.0366.4778.1549.3988.3867.72133070.72
Laneformer [26]ResNet5077.0657.5058.195.7775.4770.1475.7648.7387.6565.241971.08
FOLOLane [27]ERFNet78.804092.7077.8075.2079.3052.1089.0069.40156974.50
ADNet [28]ResNet1876.3256.088216.291.2374.5468.6170.7349.0186.2267.21112771.02
ADNet [28]ResNet3478.5456.226631.392.7777.3571.7478.0852.5888.9670.46145274.05
CondLane [24]ResNet1878.1457.4217311.092.8775.7970.7280.0152.3989.3772.40136473.23
CondLane [24]ResNet3478.7459.3912819.793.3877.1471.1779.9351.8589.8973.88138773.92
CLRerNet [29]DLA3481.4364.9818318.493.9480.1773.9283.3955.4690.8074.00154076.22
TPDNet (ours)ResNet1880.0561.2413316.292.5678.3774.0883.0255.1091.0878.02167075.16
TPDNet (ours)ResNet3480.7461.7810120.693.3179.2674.9883.1655.7491.7678.61135275.33
TPDNet (ours)ResNet10181.4662.063925.194.3679.5276.9784.8356.7391.3379.03128975.81
Table 2. Comparison with state-of-the-art lane detection methods on the TuSimple dataset. GFlops are reported when available or measured under the same input setting.
Table 2. Comparison with state-of-the-art lane detection methods on the TuSimple dataset. GFlops are reported when available or measured under the same input setting.
ModelBackboneF1 ↑Accuracy ↑FP ↓FN ↓GFlops
SCNN [5]VGG1695.9796.536.171.80271.2
RESA [6]ResNet3496.9396.823.632.4837.1
FOLOLane [27]ERFNet96.5996.924.472.2839.0
UFLDv1 [7]ResNet3488.0295.8618.913.7510.1
UFLDv2 [25]ResNet3488.1495.7218.543.6021.4
ADNet [28]ResNet1896.9096.012.913.2923.3
ADNet [28]ResNet3497.1796.342.872.5330.6
CondLane [24]ResNet1897.0195.482.183.8017.3
CondLane [24]ResNet3496.9895.372.203.8222.1
LaneATT [8]ResNet1896.7195.573.563.0116.6
LaneATT [8]ResNet3496.7795.633.532.9218.1
CLRNet [9]ResNet1897.8996.842.281.9233.9
CLRNet [9]ResNet3497.8296.872.272.0839.1
CLRerNet [29]ResNet3496.7296.033.262.5725.4
TPDNet (ours)ResNet3498.0196.842.291.9120.6
Table 3. Comparison with state-of-the-art lane detection methods on the CurveLanes dataset.
Table 3. Comparison with state-of-the-art lane detection methods on the CurveLanes dataset.
MethodBackbonemF1F1@50F1@75Prec.@50Recall@50FPSGFlops
SCNN [5]VGG16-65.02-76.1356.74-328.4
UFLDv2 [25]Res1849.0680.4554.2381.4979.447948.0
UFLDv2 [25]Res3450.4881.3456.4981.9380.764695.5
CondLaneNet [24]Res1852.5085.0959.0487.7582.5812310.3
CondLaneNet [24]Res3453.7685.9261.0788.2983.688719.7
TPDNetRes1858.6287.1069.2290.1382.7710116.2
TPDNetRes3458.7487.2668.4790.3187.1114120.6
Table 4. Overall ablation study of TPDNet-R34 on CULane.
Table 4. Overall ablation study of TPDNet-R34 on CULane.
Baseline+TPR+TDH+TCLF1@50
Sensors 26 04278 i001 80.13
Sensors 26 04278 i001 80.51 (+0.38)
Sensors 26 04278 i001Sensors 26 04278 i001 80.66 (+0.53)
Sensors 26 04278 i001Sensors 26 04278 i001Sensors 26 04278 i00180.74 (+0.61)
Table 5. Topology-aware structural analysis on CULane. LOA denotes lane ordering accuracy, SE denotes smoothness error, and LCR denotes lane crossing rate.
Table 5. Topology-aware structural analysis on CULane. LOA denotes lane ordering accuracy, SE denotes smoothness error, and LCR denotes lane crossing rate.
VariantF1@50 ↑LOA ↑SE ↓LCR ↓
Baseline80.1382.450.4522.14
+TPR80.5183.120.4181.85
+TPR+TDH80.6683.780.3951.62
+TPR+TDH+TCL80.7484.230.3711.48
Table 6. Multi-run stability analysis on CULane F1@50. Values should be reported over independently trained runs with different random seeds.
Table 6. Multi-run stability analysis on CULane F1@50. Values should be reported over independently trained runs with different random seeds.
MethodSeed 0Seed 1Seed 2Mean ± Std.
TPDNet-R3480.7480.5280.9180.72 ± 0.20
TPDNet-R10181.4681.2182.0181.56 ± 0.41
Table 7. Sensitivity analysis of TCL hyperparameters on CULane validation set.
Table 7. Sensitivity analysis of TCL hyperparameters on CULane validation set.
τ λ order Val F1@50
30.578.10
31.078.33
51.079.58
71.079.21
91.578.05
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Dong, D.; Zhang, Q.; Zhan, Y.; Su, T.; Su, Q.; Mao, S.S.; Xiang, Y. Topology-Aware Lane Detection with Relational Reasoning and Consistency Constraints. Sensors 2026, 26, 4278. https://doi.org/10.3390/s26134278

AMA Style

Dong D, Zhang Q, Zhan Y, Su T, Su Q, Mao SS, Xiang Y. Topology-Aware Lane Detection with Relational Reasoning and Consistency Constraints. Sensors. 2026; 26(13):4278. https://doi.org/10.3390/s26134278

Chicago/Turabian Style

Dong, Danyang, Qibo Zhang, Yihui Zhan, Tianqing Su, Quanke Su, Samuel S. Mao, and Yusheng Xiang. 2026. "Topology-Aware Lane Detection with Relational Reasoning and Consistency Constraints" Sensors 26, no. 13: 4278. https://doi.org/10.3390/s26134278

APA Style

Dong, D., Zhang, Q., Zhan, Y., Su, T., Su, Q., Mao, S. S., & Xiang, Y. (2026). Topology-Aware Lane Detection with Relational Reasoning and Consistency Constraints. Sensors, 26(13), 4278. https://doi.org/10.3390/s26134278

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop