BezierFormer: A Unified Architecture for 2D and 3D Lane Detection

Zhiwei Dong, Xi Zhu, Xiya Cao, Ran Ding, Wei Li, Caifa Zhou, Yongliang Wang, Qiangbo Liu · DOI

TL;DR

BézierFormer is a unified transformer-based architecture that bridges the gap between 2D and 3D lane detection using Bézier curve representations. By introducing a specialized curve-based attention mechanism and a novel Chamfer IoU loss, it achieves state-of-the-art performance and industry-leading inference speeds across both tasks.

What Problem Does This Paper Address?

Lane detection is a cornerstone of autonomous driving, yet the field has historically been split into two distinct sub-tasks: 2D detection (image-plane) and 3D detection (world-space). Most existing models are specialized for one or the other. 2D models often rely on segmentation or row-based anchors, while 3D models typically require expensive transformations into Bird’s-Eye-View (BEV) space.

The authors identify a major hurdle: there hasn't been a unified architecture that handles both efficiently. Furthermore, standard "object-centric" attention mechanisms (like those in DETR) struggle with lanes because lanes are "slender"—they are long, thin, and occupy very little area relative to their span. A single reference point isn't enough to capture the features of an entire lane.

Methods

BézierFormer treats lane detection as a query-based regression problem, but with several key innovations:

  1. Unified Bézier Representation: The model represents lanes as cubic Bézier curves. A cubic curve is defined by just four control points. This is mathematically elegant because it works for both 2D ($x, y$) and 3D ($x, y, z$) coordinates without changing the underlying logic.
  2. Bézier Curve Attention: To solve the "slender" feature problem, the authors moved away from standard deformable attention. Instead of sampling features around a single point, their module samples multiple reference points along the predicted Bézier curve. This ensures the transformer's receptive field actually follows the geometry of the lane.
  3. Perspective Projection (for 3D): For 3D tasks, the model samples points in 3D space and uses camera intrinsics/extrinsics to project them back onto the 2D front-view feature map. This allows the model to extract 3D features directly from 2D images without needing a heavy, pre-computed BEV feature map.
  4. Chamfer IoU (CIoU) Loss: Regressing control points directly can be unstable. The authors propose a loss based on the Chamfer Distance, which treats the curve as a whole entity. It calculates the shortest distance from sampled points to the target curve and normalizes it into an IoU-like metric, making it more robust to the overall shape and location of the lane.

Datasets

The researchers evaluated BézierFormer on three major benchmarks:

  • CurveLanes: A massive 2D dataset (150,000 images) featuring complex topologies like forked and merged lanes.
  • OpenLane: A large-scale real-world 3D lane dataset (200,000 images).
  • CULane: A classic 2D benchmark used to test robustness in challenging scenarios like night driving and shadows.

Key Insights and Ideas

  • Path-Centric vs. Object-Centric: The "aha" moment here is that lanes shouldn't be treated like bounding boxes. By sampling features along the curve itself, the model gains a much more comprehensive "view" of the lane's texture and context.
  • Bypassing the BEV Bottleneck: Many 3D models struggle with the computational cost of Inverse Perspective Mapping (IPM) or heavy BEV transformers. BézierFormer shows that you can achieve SOTA 3D results by simply projecting query points back to the image plane, keeping the architecture lightweight.
  • The Power of Bézier Curves: While other models use point sets or polynomials, Bézier curves provide a "smooth" prior that naturally fits the way roads are engineered, requiring very few parameters (only 4 points) to describe complex shapes.

Key Results

BézierFormer sets a new bar for both accuracy and efficiency:

  • 2D Performance: On CurveLanes, it achieved a 91.31% F1 score (using a Swin-Tiny backbone), outperforming previous leaders like CLRNet.
  • 3D Performance: On OpenLane, it reached a 58.6% F1 score, significantly higher than other DETR-like methods like CurveFormer (50.5%).
  • Speed: This is perhaps the most impressive result. In 3D scenarios, BézierFormer runs at up to 151 FPS on a ResNet18 backbone. Even with a more powerful Swin-Tiny backbone, it maintains 84-90 FPS, making it highly viable for real-time deployment on edge hardware.

Limitations and Future Work

While the paper demonstrates excellent results on complex topologies (forks, merges), the authors note that regressing sampled points can sometimes be limited by local distance optimization. While their CIoU loss mitigates this, there is still room to improve how the model handles extremely "long-tail" cases or highly occluded lanes.

Future directions suggested by the work include extending the architecture to multi-camera setups (surround-view) and incorporating temporal information (video) to further stabilize 3D predictions in dynamic environments.

Summary updated

BibTeX
@inproceedings{dong2024bezierformer,
  author = {Zhiwei Dong and Xi Zhu and Xiya Cao and Ran Ding and Wei Li and Caifa Zhou and Yongliang Wang and Qiangbo Liu},
  title = {{BezierFormer: A Unified Architecture for 2D and 3D Lane Detection}},
  booktitle = {IEEE International Conference on Multimedia and Expo},
  year = {2024},
  url = {https://openreview.net/forum?id=CZewZvu7Wz},
}

Loading related content...

Figure