diff --git a/main.tex b/main.tex index 453a820..b12b458 100644 --- a/main.tex +++ b/main.tex @@ -47,15 +47,14 @@ \maketitle \begin{abstract} - Lane detection is a critical and challenging task in autonomous driving, particularly in real-world scenarios where traffic lanes are often slender, lengthy, and partially obscured by other vehicles, complicating detection efforts. Existing anchor-based methods typically rely on prior straight line anchors to extract features and refine lane location and shape. Though achieving high performance, manually setting prior anchors is cumbersome, and ensuring sufficient anchor coverage across diverse datasets requires a large number of dense anchors. Furthermore, NMS postprocessing should be applied to supress the redundant predictions. In this study, we introduce PolarRCNN, a two-stage nms-free anchor-based method for lane detection. By introducing local polar head, the proposal of anchors are dynamic. The number of anchors are decreasing greatly without sacrificing performace. What's more, a GNN based nms free head is proposed to enable the model reach an end-to-end format, which is deployment friendly. Our model yields competitive results on five popular lane detection benchmarks (Tusimple, CULane, LLAMAS, Curvelanes and DL-Rail) while maintaining a lightweight size and a simple structure. - Our source code are available at \href{https://github.com/ShqWW/PolarRCNN}{\textit{https://github.com/ShqWW/PolarRCNN}}. + Lane detection is a critical and challenging task in autonomous driving, particularly in real-world scenarios where traffic lanes are often slender, lengthy, and partially obscured by other vehicles, complicating detection efforts. Existing anchor-based methods typically rely on prior straight line anchors to extract features and refine lane location and shape. Though achieving high performance, manually setting prior anchors is cumbersome, and ensuring adequate coverage across diverse datasets often requires a large number of dense anchors. Additionally, Non-Maximum Suppression (NMS) is used to suppress redundant predictions, which complicates real-world deployment and may fail in dense scenarios. In this study, we introduce PolarRCNN, a nms-free anchor-based method for lane detection. By incorporating both local and global polar coordinate systems, PolarRCNN enables flexible anchor proposals and significantly reduces the number of anchors required without compromising performance. Additionally, we introduce a heuristic GNN-based NMS-free head that supports an end-to-end paradigm, making the model more deployment-friendly and enhancing performance in dense scenarios. Our method achieves competitive results on five popular lane detection benchmarks—Tusimple, CULane, LLAMAS, Curvelanes, and DL-Rail—while maintaining a lightweight design and straightforward structure. Our source code are available at \href{https://github.com/ShqWW/PolarRCNN}{\textit{https://github.com/ShqWW/PolarRCNN}}. \end{abstract} \begin{IEEEkeywords} -Lane detection. +Lane detection, NMS-free, Graph neural network, Polar coordinate system. \end{IEEEkeywords} \section{Introduction} -\IEEEPARstart{L}{ane} detection is a significant problem in computer vision and autonomous driving, forming the basis for accurately perceiving the driving environment in intelligent driving systems. While extensive research has been conducted in ideal environments, it remains a challenging task in adverse scenarios such as night driving, glare, crowd, and rainy conditions, where lanes may be occluded or damaged. Moreover, the slender shapes, complex topologies of lanes and the global property to the complexity of detection challenges. An effective lane detection method should take into account both global high-level semantic features and local low-level features to address these varied conditions and ensure robust performance in real-time applications such as autonomous driving. +\IEEEPARstart{L}{ane} detection is a significant problem in computer vision and autonomous driving, forming the basis for accurately perceiving the driving environment in intelligent driving systems. While extensive research has been conducted in ideal environments, it remains a challenging task in adverse scenarios such as night driving, glare, crowd, and rainy conditions, where lanes may be occluded or damaged. Moreover, the slender shapes, complex topologies of lanes and the global property add to the complexity of detection challenges. An effective lane detection method should take into account both global high-level semantic features and local low-level features to address these varied conditions and ensure robust performance in real-time applications such as autonomous driving. Traditional methods predominantly concentrate on handcrafted local feature extraction and lane shape modeling. Techniques such as the Canny edge detector\cite{canny1986computational}, Hough transform\cite{houghtransform}, and deformable templates for lane fitting\cite{kluge1995deformable} have been extensively utilized. Nevertheless, these approaches often encounter limitations in practical settings, particularly when low-level and local features lack clarity or distinctiveness. @@ -121,58 +120,51 @@ In recent years, fueled by advancements in deep learning and the availability of -Drawing inspiration from object detection methods such as Yolos and Fast RCNN, several anchor-based approaches have been introduced for lane detection, the representative work including LanesATT and CLRNet. These methods have demonstrated superior performance by leveraging anchor priors and enabling larger receptive fields for feature extraction. However, anchor-based methods encounter similar drawbacks as anchor-based general object detection method as follows: +Drawing inspiration from object detection methods such as Yolos \cite{} and Faster RCNN \cite{}, several anchor-based approaches have been introduced for lane detection, the representative work including LanesATT \cite{} and CLRNet \cite{}. These methods have demonstrated superior performance by leveraging anchor priors and enabling larger receptive fields for feature extraction. However, anchor-based methods encounter similar drawbacks as anchor-based general object detection method as follows: -\begin{itemize} (1) A large amount of dense anchors should be configured to ensure the recall of detection result since the lane distributions are complex in real scenarios (i.e the direction and the localtion), as the Fig. \ref{anchor setting}(a) shows. -\end{itemize} +(1) A large amount of lane anchors are set among the image even in sparse scenarios. -\begin{itemize} (2) Due to the large anchor setting, redundant predictions should be remove by postprocessing such as NMS \cite{} and FastNMS \cite{}, which brings the difficulty to deployment and the threshold of NMS should be manual setting. -\end{itemize} +(2) Non-maximum suppression (NMS) postprocessing is necessary for the remove of redundant prediction but may fail in dense scenarios. -In order to solve the first problem, CLRNet uses learned anchors which location are optimized during training to adapt to the lane distributions (see Fig \ref{anchor setting} (b)) in real scenarios and use cascade cross layer anchor refinement to make the anchor more closer to the groundtruth. However, the anchors in CLRNet are still numerous to cover the potential distributions of lanes. To solve this problem, ADNet \cite{} uses start points generate unit to propose flexible anchors for each image rather than uses the same set of anchors for all images. However, the start points of lanes are subjective and lack of clear visual evidence due to the gloal property of lanes, so the performance of ADNet is not ideal. SRLane uses local angle map to propose sketch anchors according the direction of groundtruth. This method only consider the direction and ignore the accurate location of anchors, leading to worse performance without cascade anchor refinement. Moreover, all methods mentioned above fail to avoid the redundant predictions in the second proplem. - -In order to address the issue we mentioned above better than the previous work, we analysis the reasons causing these issues and proposed a new lane detection method called PolarRCNN, which is two-stage nms-free anchor-based model. PolarRCNN uses local and global coordinates to describe the anchors and the number of proposed anchors are much less than previous work, as shown in fig. \ref{anchor setting} (c). Moreover, aheuristic graph neural network block is proposed to make the model nms-free. The model architecture is simple without complex mechanism using in previous work(i.e. attenion, cascade refinement, etc.), making the model deployment easier and speed faster. Besides, simple architecture helps us to inspect the key factors for performance for anchor based lane detection methods. +Regrading the first issue, \cite{} introduced learned anchors, where the anchor parameters are optimized during training to adapt to the lane distributions (see Fig. \ref{anchor setting} (b)) in real dataset. Additionally, they employ cascade cross-layer anchor refinement to bring the anchors closer to the ground truth. However, the anchors are still numerous to cover the potential distributions of lanes. Moving further, \cite{} proposes flexible anchors for each image by generating start points, rather than using a fixed set of anchors for all images. Nevertheless, the start points of lanes are subjective and lack clear visual evidence due to the global nature of lanes, which affects its performance. \cite{} uses a local angle map to propose sketch anchors according to the direction of ground truth. This approach only considers the direction and neglects the accurate positioning of anchors, resulting in suboptimal performance without cascade anchor refinement. Overall, numerous anchors are unnecessary in sparse scenarios (where lane ground truths are sparse). The trend in newly proposed methods is to reduce the number of anchors and offer more flexible anchor configurations. -We conducted ecperiment on five mainstream benchmarks including TuSimple \cite{}, CULane \cite{}, LLAMAS\cite{}, Curvelanes\cite{} and DL-Rail\cite{}. Our proposed method is blessed with competitive performance with the state-of-art methods. +Regarding the second issue, nearly all anchor-based methods (including those mentioned above) require direct or indirect Non-Maximum Suppression (NMS) post-processing to eliminate redundant predictions. Although it is necessary to eliminate redundant predictions, NMS remains a suboptimal solution. On the one hand, NMS is not deployment-friendly because it involves defining and calculating distances (e.g., Intersection over Union) between lane pairs. This is more challenging than bounding boxes in general object detection due to the complexity of lane geometry. On the other hand, NMS fails in some dense scenarios where the lane ground truths are closer together compared to sparse scenarios. A larger distance threshold may result in false negatives, as some true positive predictions might be eliminated (as shown in Fig. \ref{nms setting} (a) and (b)) by mistake. Conversely, a smaller distance threshold may not eliminate redundant predictions effectively and can leave false positives (as shown in Fig. \ref{nms setting} © and (d)). Achieving an optimal trade-off in all scenarios by manually setting the distance threshold is challenging. The root cause of this problem is that the distance definition in NMS considers only geometric parameters while ignoring the semantic context in the image. Thus, when two predictions are “close” to each other, it is nearly impossible to determine whether one of them is redundant. -Our main contribution are summarized as: +To address the two issues outlined above, we propose PolarRCNN, a novel anchor-based method for lane detection. For the first issue, we introduce local and global heads based on the polar coordinate system to create anchors with more accurate locations and reduce the number of proposed anchors in sparse scenarios, as illustrated in Fig. \ref{anchor setting} (c). Compared to state-of-the-art previous work \cite{} which uses 192 anchors, PolarRCNN employs only 20 anchors to cover potential lane ground truths. For the second issue, we have revised FastNMS to Graph-based FastNMS and introduced a new heuristic graph neural network block (Polar GNN block) integrated into the non-maximum suppression (NMS) head. The Polar GNN block offers a more interpretable structure compared to traditional NMS, achieving nearly equivalent performance in sparse scenarios and superior performance in dense scenarios. We conducted experiments on five major benchmarks: TuSimple \cite{}, CULane \cite{}, LLAMAS \cite{}, Curvelanes \cite{}, and DL-Rail \cite{}. Our proposed method demonstrates competitive performance compared to state-of-the-art methods. + +Our main contributions are summarized as follows: \begin{itemize} -\item We simplified the anchor parameters with local and global polar coordinate systems, and apply them to two-stage lane detection frameworks. Compared with other sparse two-stage methods, the number of porposed anchors are greatly decreasing with a better performace. -\item We proposed a novel heuristic graph neural network (GNN) head to implement a nms-free paradigm. The architecture of GNN is designed according to Fast NMS with interpretability. The whole training and testing process of our model is end-to-end. -\item Our proposed method applies simple model architectures and get competitive performance with other state-of-art methods on five datasets. The high performace with fewer anchors and nms-free paradigm and demonstrate the effectiveness of our method. +\item We simplified the anchor parameters using local and global polar coordinate systems and applied them to two-stage lane detection frameworks. Compared to other anchor-based methods, the number of proposed anchors is greatly reduced while achieving better performance. +\item We introduced a novel heuristic Polar GNN block to implement an NMS-free paradigm. The GNN architecture is designed with reference to Graph-based FastNMS, providing interpretability. Our model supports end-to-end training and testing, but traditional NMS postprocessing can still be used as an option for an NMS version of our model. +\item Our method utilizes two-stage architectures and achieves competitive performance compared to state-of-the-art methods across five datasets. The high performance with fewer anchors and an NMS-free paradigm demonstrates the effectiveness of our approach. Additionally, our model is designed with a straightforward structure (without cascade refinement or attention strategies), which simplifies deployment. \end{itemize} \section{Related Works} -The lane detection aims to detect lane instances in a image. In this section, we only introduce deep-leanrning based methods for lane detection. The lane detection methods can be categorized by segmentation based parameter-based methods and anchor-based methods. +The lane detection aims to detect lane instances in a image. In this section, we only introduce deep-leanrning based methods for lane detection. The lane detection methods can be categorized by segmentation based, parameter-based methods and anchor-based methods. \textbf{Segmentation-based Methods.} Segmentation-based methods focus on pixel-wise prediction. They predefined each pixel into different categories according to different lane instances and background\cite{} and predicted information pixel by pixel. However, these methods overly focus on low-level and local features, neglecting global semantic information and real-time detection. SCNN uses a larger receptive field to overcome this problem. Some methods such as UFLDv1 and v2\cite{}\cite{} and CondLaneNet\cite{} utilize row-wise or column-wise classification instead of pixel classification to improve detection speed. Another issue with these methods is that the lane instance prior is learned by the model itself, leading to a lack of prior knowledge. Lanenet uses post-clustering to distinguish each lane instance. UFLD divides lane instances by angles and locations and can only detect a fixed number of lanes. CondLaneNet utilizes different conditional dynamic kernels to predict different lane instances. Some methods such as FOLOLane\cite{} and GANet\cite{} use bottom-up strategies to detect a few key points and model their global relations to form lane instances. \textbf{Parameter-based Methods.} Instead of predicting a series of points locations or pixel classes, parameter-based methods directly generate the curve parameters of lane instances. PolyLanenet\cite{} and LSTR\cite{} consider the lane instance as a polynomial curve and output the polynomial coefficients directly. BézierLaneNet\cite{} treats the lane instance as a Bézier curve and generates the locations of control points of the curve. BSLane uses B-Spline to describe the lane, and the curve parameters focus on the local shapes of lanes. Parameter-based methods are mostly end-to-end without postprocessing, which grants them faster speed. However, since the final visual lane shapes are sensitive to the lane shape, the robustness and generalization of parameter-based methods may be less than ideal. -\textbf{Anchor-Based Methods.} Inspired by some methods in general object detection like YOLO \cite{} and DETR \cite{}, anchor-based methods have been proposed for lane detection. Line-CNN is the earliest work, to our knowledge, that utilizes line anchors to detect lanes. The lines are designed as rays emitted from the three edges (left, bottom, and right) of an image. However, the receptive field of the model only focuses on edges and is slower than some methods. LaneATT \cite{} employs anchor-based feature pooling to aggregate features along the whole line anchor, achieving faster speed with better performance. Nevertheless, the grid sampling strategy and label assignment limit its potential. CLRNet \cite{} utilizes cross-layer refinement strategies, SimOTA label assignment \cite{}, and Liou loss to enhance anchor-based performance beyond most methods. The main advantage of anchor-based methods is that many strategies from anchor-based general object detection can be easily applied to lane detection, such as label assignment, bounding box refinement, GIOU loss, etc. However, the disadvantages of existing anchor-based lane detection are also evident. The line anchors need to be handcrafted and the anchor number is large, NMS postprocessing are needed, resulting in high computational consumption. -some work such as ADNet\cite{}, SRLane\cite{} and Sparse Laneformer\cite{} attempt to reduce the anchors and give proposals. +\textbf{Anchor-Based Methods.} Inspired by general object detection methods like YOLO \cite{} and DETR \cite{}, anchor-based approaches have been proposed for lane detection. Line-CNN is, to our knowledge, the earliest method that utilizes line anchors for detecting lanes. These lines are designed as rays emitted from the three edges (left, bottom, and right) of an image. However, the model’s receptive field is limited to the edges, making it slower compared to some other methods. LaneATT \cite{} improves upon this by employing anchor-based feature pooling to aggregate features along the entire line anchor, achieving faster speeds and better performance. Nevertheless, its grid sampling strategy and label assignment pose limitations. CLRNet \cite{} enhances anchor-based performance with cross-layer refinement strategies, SimOTA label assignment \cite{}, and Liou loss, surpassing many previous methods. A key advantage of anchor-based methods is their adaptability, allowing the integration of strategies from anchor-based general object detection, such as label assignment, bounding box refinement, and GIOU loss. However, existing anchor-based lane detection methods also have notable drawbacks. Line anchors are often handcrafted and numerous, which can be cumbersome. Some approaches, such as ADNet \cite{}, SRLane \cite{}, and Sparse Laneformer \cite{}, attempt to reduce the number of anchors and provide proposals, but this can slightly impact performance. Additionally, methods such as \cite{} \cite{} still rely on NMS postprocessing, complicating NMS threshold settings and model deployment. Although one-to-one label assignment (during training) without NMS \cite{} (during evaluation) alleviates this issue, its performance remains less satisfactory compared to NMS-based models. \begin{figure*}[ht] \centering \includegraphics[width=\linewidth]{thsis_figure/ovarall_architecture.png} % 替换为你的图片文件名 - \caption{The overall pipeline of PolarRCNN. The architecture is simple and lightweight. The backbone (e.g. ResNet18) and FPN aims to extract feature of the image. And the Local polar head aims to proposed sparse line anchors. After pooling features sample along the line anchors, the global polar head give the final predictions. Trilet subheads are set in the Global polar Head, including an one-to-one classification head (o2o cls head), an one-to-many classification head (o2m cls head) and an one-to-many regression head (o2m Reg Head). The one-to-one cls head aim to replace the NMS postprocessing and select only one positive prediction sample for each groundtruth from the redundant predictions from the o2m head.} + \caption{The overall pipeline of PolarRCNN. The architecture is simple and lightweight. The backbone (e.g. ResNet18) and FPN aims to extract feature of the image. And the Local polar head aims to proposed sparse line anchors. After pooling features sample along the line anchors, the global polar head give the final predictions. Trilet subheads are set in the Global polar Head, including an one-to-one classification head (o2o cls head), an one-to-many classification head (o2m cls head) and an one-to-many regression head (o2m Reg Head). The one-to-one cls head aim to replace the NMS postprocessing and select only one positive prediction sample for each ground truth from the redundant predictions from the o2m head.} \label{overall_architecture} \end{figure*} -\textbf{NMS-Free Object Detections}. NMS is an import postprocessing step in most general object detection methods. Detr \cite{} use one to one label assignment to avoid redundant predictions without NMS. Other nms-free method \cite{} successively proposed. These methods analysis this issue in to aspects, the model architecture and label assignment. \cite{}\cite{} hold the view that one to one assignments are the key points for nms-free predictions. Other works also consider the model expression ability to provided the non-redundant predictions. However, few anchor-based lane detecction methods analysis the nms-free paradigm as the general object detection, and rely on the NMS postprocessing. In our work, we find both the labal assignment and the expressive ability of nms-free module (e.g. the architecture and the inputs of module) both play an important role in the nms-free lane detection task for ancnor-based models. - -This paper aims to address the two issue mentioned above (reducing anchors numbers and nms-free) for the anchor-based lanes proposed methods. - - +\textbf{NMS-Free Object Detections}. Non-Maximum Suppression (NMS) is an important postprocessing step in most general object detection methods. Detr \cite{} employs one-to-one label assignment to avoid redundant predictions without using NMS. Other NMS-free methods \cite{} have also been proposed, addressing this issue from two aspects: model architecture and label assignment. Studies \cite{} \cite{} suggest that one-to-one assignments are crucial for NMS-free predictions, but maintaining one-to-many assignments is still necessary to ensure effective feature learning of the model. Other works \cite{} \cite{} consider the model’s expressive capacity to provide non-redundant predictions. However, few studies have analyzed the NMS-free paradigm for anchor-based lane detection methods as thoroughly as in general object detection. Most anchor-based lane detection methods still rely on NMS postprocessing. In our work, besides label assignment, we extend the analysis to the detection head’s structure, focusing on achieving non-redundant (NMS-free) lane predictions. +In this work, we aim to address to two issues in anchor-based lane detection mentioned above, the sparse lane anchor setting and NMS-free predictions. \section{Method} -The overall architecture of PolarRCNN is illustrated in fig. \ref{overall_architecture}. Our model consists of backbone-FPN, local polar head and global polar head. Only simple network layers such as convolution, MLP and pooling ops are used in each bolck (rather than attention, dynamic kernels, etc.). - +The overall architecture of PolarRCNN is illustrated in Fig. \ref{overall_architecture}. Our model adheres to the Faster R-CNN \cite{} framework, consisting of a backbone, FPN (Feature Pyramid Network), RPN (Region Proposal Network), and RoI (Region of Interest) pooling. To investigate the fundamental factors affecting model performance, such as anchor settings and NMS (Non-Maximum Suppression) postprocessing, and make the model easier to deploy, PolarRCNN employs a simple and straightforward network structure. It relies on basic components including convolutional layers, MLPs (Multi-Layer Perceptrons), and pooling operations, deliberately excluding advanced elements like attention mechanisms, dynamic kernels, and cross-layer refinement used in pervious works \cite{}\cite{}. \begin{table}[h] \centering @@ -211,9 +203,9 @@ The overall architecture of PolarRCNN is illustrated in fig. \ref{overall_archit \subsection{Lane and Line Anchor Representation} -Lanes are thin and long curves, a suitable lane prior helps the model to extract features and predict location and modeling the shapes of lane curves more accurately. Keeping the same as privious works\cite{}\cite{}, the lane prior (also called lane anchor) in our work are straight lines and we sample a sequense of 2D points on each line anchor, i.e. $ P\doteq \left\{ \left( x_1, y_1 \right) , \left( x_2, y_2 \right) , ....,\left( x_n, y_n \right) \right\} $, where N is the number of sampled points, The y coordinate of points is uniform sampled from the image vertically, i.e. $y_i=\frac{H}{N-1}*i$, where H is the image height. The same y coordinate of points are also sampled from the groundtruth lane and the model regress the x coordinate offset from line anchor to lane instance ground truth. The only differernce between PolarRCNN and previous work is the description of straight line anchors. It will be introduced in follows. +Lanes are characterized by their thin and elongated curved shapes. A suitable lane prior aids the model in extracting features, predicting locations, and modeling the shapes of lane curves with greater accuracy. In line with previous works \cite{}\cite{}, our lane priors (also referred to as lane anchors) consists of straight lines. We sample a sequence of 2D points along each lane anchor, denoted as $ P\doteq \left\{ \left( x_1, y_1 \right) , \left( x_2, y_2 \right) , ....,\left( x_n, y_n \right) \right\} $, where N is the number of sampled points. The y-coordinates of these points are uniformly sampled from the vertical axis of the image, specifically $y_i=\frac{H}{N-1}*i$, where H is the image height. These y-coordinates are also sampled from the ground truth lane, and the model is tasked with regressing the x-coordinate offset from the line anchor to the lane instance ground truth. The primary distinction between PolarRCNN and previous approaches lies in the description of the lane anchors (straight line), which will be detailed in the following sections. -\textbf{Polar Coordinate system.} Since the lane anchor are set to be straight by default, it could be described by the straight line parameter. Previous work uses a ray to describe a 2D line anchor, and the parameters of a ray contain the start point's coordinates and the orientation/angle, i.e., $\left\{\theta, P_{xy}\right\}$, as shown in Figure \ref{coord} (a). \cite{}\cite{} define the start points locates on the three image boundary. And \cite{} points out that this not reasonable because the real start point of a lane could be in any location within an image. In our analysis, using a ray may cause ambiguity in describing a line because a line may have infinite start points and the start point of the lane is subjective. As illustrated in Figure \ref{coord} (a), the yellow and darkgreen start points with the same orientation $\theta$ describe the same line, and either of them could be chosen in different datasets. This ambiguity arises because a straight line has two degrees of freedom while a ray has three degrees of freedom. To address this issue, as shown in Figure \ref{coord} (b), we use polar coordinate systems to describe a lane anchor with two parameters for radius and angle $\left\{\theta, r\right\}$, where $\theta \in \left[-\frac{\pi}{2}, \frac{\pi}{2}\right)$ and $r \in \left(-\infty, +\infty\right)$. +\textbf{Polar Coordinate system.} Since lane anchors are typically represented as straight lines, they can be described using straight line parameters. Previous approaches have used rays to describe 2D lane anchors, with the parameters including the coordinates of the starting point and the orientation/angle, denoted as $\left\{\theta, P_{xy}\right\}$, as shown in Fig. \ref{coord} (a). \cite{}\cite{} define the start points as lying on the three image boundaries. However, \cite{} argue that this approach is problematic because the actual starting point of a lane could be located anywhere within the image. In our analysis, using a ray can lead to ambiguity in line representation because a line can have an infinite number of starting points, and the choice of the starting point for a lane is subjective. As illustrated in Fig. \ref{coord} (a), the yellow (the visual start point) and green (the point located on the image boundary) starting points with the same orientation $\theta$ describe the same line, and either could be used in different datasets \cite{}\cite{}. This ambiguity arises because a straight line has two degrees of freedom, whereas a ray has three. To resolve this ussue , we propose using polar coordinates to describe a lane anchor with only two parameters: radius and angle, deoted as $\left\{\theta, r\right\}$, where $\theta \in \left[-\frac{\pi}{2}, \frac{\pi}{2}\right)$ and $r \in \left(-\infty, +\infty\right)$. This representation isillustrated in Fig. \ref{coord} (b). \begin{figure}[t] \centering @@ -229,15 +221,15 @@ Lanes are thin and long curves, a suitable lane prior helps the model to extract \includegraphics[width=\imgwidth]{thsis_figure/coord/polar.png} \caption{} \end{subfigure} - \caption{Different descriptions for anchor parameters. (a) Ray: start point and orientation. (b) polar: radius and angle.} + \caption{Different descriptions for anchor parameters. (a) Ray: start point and orientation. (b) Polar: radius and angle.} \label{coord} \end{figure} -We define two kinds of polar coordinate systems called the global coordinate system and the local coordinate system, with the origin points denoted as the global origin point $P_{0}^{\text{global}}$ and the local origin point $P_{0}^{\text{local}}$, correspondingly. For convenience, the global origin point is set around the static vanishing point of the whole lane image dataset, while the local origin points are set as lattice within the image. From Figure \ref{coord}, it is easy to see that only the radius parameters are influenced by the choise of the origin point, with the angle/orientation parameters keeping consistent. +We define two types of polar coordinate systems: the global coordinate system and the local coordinate system, with the origin points denoted as the global origin $\boldsymbol{c}^{G}$ and the local origin $\boldsymbol{c}^{L}$, respectively. For convenience, the global origin is positioned near the static vanishing point of the entire lane image dataset, while the local origins are set at lattice points within the image. As illustrated in Fig. \ref{coord} (b), only the radius parameters are affected by the choice of the origin point, while the angle/orientation parameters remain consistent. -\subsection{Local polar Head} +\subsection{Local Polar Head} -\textbf{Local Anchor formulation}. Dispired by the region proposal network in Faster RCNN \cite{}, the local polar proposal module aims to propose flexible anchors with high-quality in an image. As fig.\ref{lph} and fig. \ref{overall_architecture}. The highest level ($P_{3} \in \mathbb{R}^{C_{f} \times H_{f} \times W_{f}}$) of FPN feature maps the input of are chosen as the input of Local Polar Head (LPH). After downsampling opereation, the feature map are fed into two branch, namely the regression branch and the classification branch: +\textbf{Anchor formulation in Local polar head}. Inspired by the region proposal network in Faster R-CNN \cite{}, the local polar head (LPH) aims to propose flexible, high-quality anchors aorund the lane ground truths within an image. As Figure \ref{lph} and Figure \ref{overall_architecture} demonstrate, the highest level $P_{3} \in \mathbb{R}^{C_{f} \times H_{f} \times W_{f}}$ of FPN feature maps is selected as the input for the Local Polar Head (LPH). Following a downsampling operation, the feature map is then fed into two branches: the regression branch $\phi _{reg}^{lph}\left(\cdot \right)$ and the classification branch $\phi _{cls}^{lph}\left(\cdot \right)$. \begin{equation} \begin{aligned} @@ -248,7 +240,7 @@ We define two kinds of polar coordinate systems called the global coordinate sys \label{lph equ} \end{equation} - The regression branch aim to proposed lane anchors by predicting the two parameters $F_{reg\,\,} \equiv \left\{\theta_{j}, r^{L}_{j}\right\}_{j=1}^{H^{L}\times W^{L}}$ under the local polar coordinate system, which denotes the angles and the radius. The classification branch predicts the heat map $F_{cls\,\,}\left\{c_{j}\right\}_{j=1}^{H^{L}\times W^{L}}$of the local polar origin grid. By removing the local origin points with lower confidence, the potential positive lane anchors around the groundtruth are more likely to chosen while the background lane anchors are removed. Keeping it simple, the regression branch $\phi _{reg}^{lph}\left(\cdot \right)$ and the classification branch $\phi _{cls}^{lph}\left(\cdot \right)$ consists of one conv 1x1 layers and two conv 1x1 layers correspondingly. + The regression branch aims to propose lane anchors by predicting two parameters $F_{reg\,\,} \equiv \left\{\theta_{j}, r^{L}_{j}\right\}_{j=1}^{H^{L}\times W^{L}}$, within the local polar coordinate system. These parameters represent the angles and the radius.The classification branch, on the other hand, predicts the heat map $F_{cls\,\,}\left\{c_{j}\right\}_{j=1}^{H^{L}\times W^{L}}$ of the local polar origin grid. By discarding local origin points with lower confidence, the module increases the likelihood of selecting potential positive foreground lane anchors while removing background lane anchors to the greatest extent. Keeping it simple, the regression branch $\phi _{reg}^{lph}\left(\cdot \right)$ consists of one $1\times1$ convolutional layer while the classification branch $\phi _{cls}^{lph}\left(\cdot \right)$ consists of two $1\times1$ convolutional layers. \begin{figure}[t] \centering @@ -257,19 +249,19 @@ We define two kinds of polar coordinate systems called the global coordinate sys \label{lph} \end{figure} -During the training stage, as fig. \ref{lphlabel},the ground truth label of local polar head is constructed as follows. The radius ground truth is defined as the shortest distance from a grid point (local plot origin point) to the ground truth lane curve. The ground truth of angle is defined as the orientation of the vector from the grid point to the nearest points on the curve. Only one grid with the label of radius less than a threshold $\tau$ is set as a positive sample, while others are set as negative samples. Once the regression and classification labels are constructed, it can be easy to train the LPH by smooth-l1 loss $d\left(\cdot \right)$ and cross entropy loss $BCE\left( \cdot , \cdot \right)$. The LPH loss function is defined as follows: +\textbf{Loss Function.} During the training phase, as illustrated in Fig. \ref{lphlabel}, the ground truth labels for the Local Polar Head (LPH) are constructed as follows. The radius ground truth is defined as the shortest distance from a grid point (local origin point) to the ground truth lane curve. The angle ground truth is defined as the orientation of the vector from the grid point to the nearest point on the curve. A grid point is designated as a positive sample if its radius label is less than a threshold $\tau_{L}$ ; otherwise, it is considered a negative sample. + +Once the regression and classification labels are established, the LPH can be trained using the smooth L1 loss $d\left(\cdot \right)$ for regression and the binary cross-entropy loss $BCE\left( \cdot , \cdot \right)$. The LPH loss function is defined as follows: \begin{equation} \begin{aligned} \mathcal{L} _{lph}^{cls}&=BCE\left( F_{cls},F_{gt} \right) \\ - \mathcal{L} _{lph}^{r\mathrm{e}g}&=\frac{1}{N_{lph}^{pos}}\sum_{j\in \left\{j|\hat{r}_i<\tau \right\}}{\left( d\left( \theta _j-\hat{\theta}_j \right) +d\left( r_j^L-\hat{r}_j^L \right) \right)}\\ - % \mathcal{L} _{lph}^{r\mathrm{e}g}&=\lambda _{lph}^{cls}\mathcal{L} _{lph}^{cls}+\lambda _{lph}^{reg}\mathcal{L} _{lph}^{r\mathrm{e}g} + \mathcal{L} _{lph}^{r\mathrm{e}g}&=\frac{1}{N_{lph}^{pos}}\sum_{j\in \left\{j|\hat{r}_i<\tau_{L} \right\}}{\left( d\left( \theta _j-\hat{\theta}_j \right) +d\left( r_j^L-\hat{r}_j^L \right) \right)}\\ \end{aligned} - \label{loss_lpm} + \label{loss_lph} \end{equation} -\textbf{Top-$K_{A}$ anchor selectoin}. During training stage, all the $H^{local}\times W^{local}$ anchors are taken as the candidate anchor to be fed into the RCNN module, which aims to force the RCNN module to learn enough negative anchor samples. During evaluation stage, only anchors with top-$K_{A}$ confidence are fed into the RCNN module, aiming to remove the potential negative (background) anchors and reduce the computational complexity for RCNN module. This strategies keeps the adaptability and flexibility for anchor distribution while reducing the numbers of anchors at the same time. Following experiment will show the effectiveness of our top-$K_{A}$ anchor selection. - +\textbf{Top-$K_{A}$ Anchor Selectoin}. During the training stage, all $H^{local}\times W^{local}$ anchors are considered as candidate anchors and fed into the R-CNN module. This approach helps the R-CNN module to learn from sufficient features of negative (background) anchor samples. In the evaluation stage, however, only the top-$K_{A}$ anchors with the highest confidence scores are selected and fed into the R-CNN module. This strategy is designed to filter out potential negative (background) anchors and reduce the computational complexity of the R-CNN module. By doing so, it maintains the adaptability and flexibility of anchor distribution while decreasing the total number of anchors. The following experiments will demonstrate the effectiveness of our top-$K_{A}$ anchor selection strategy. \begin{figure}[t] \centering @@ -278,22 +270,18 @@ During the training stage, as fig. \ref{lphlabel},the ground truth label of loca \label{lphlabel} \end{figure} +\subsection{Global Polar Head.} +Global polar head (GPH) is a crucial component in the second stage of PolarRCNN. It takes lane anchor pooling features as input and predicts the precise lane location and confidence. Fig. \ref{gph} illustrates the structure and pipeline of GPH. GPH comprises RoI pooling modules and three sub-heads (triplet heads), which will be introduced in detail. - - -\subsection{Detection Head} -Fig \ref{detection_head} illustrates the structure and the pipeline of detection head of our model. The detection head contains global polar head and three sub heads (triplet heads), which will be introduced in detail. - -\textbf{Global Polar Head.} Global polar head serves as pooling part in the second stage of PolarRCNN, which accept the lane anchor pooling features as input and predict the accurate lane localtion and confidence. -Once the local polar parameter of a line anchor is provided, it can be transformed to the global polar coordinates with the following euqation: +\textbf{RoI Pooling Module.} RoI pooling module is designed to transform features sampled from lane anchors into a standard feature tensor. Once the local polar parameters of a lane anchor are given, they can be converted to global polar coordinates using the following equation: \begin{equation} \begin{aligned} r^{G}_{j}=r^{L}_{j}+\left( \textbf{c}^{L}_{j}-\textbf{c}^{G}_{j} \right) \left[\cos\theta_{j}, \sin\theta_{j} \right]^{T} \end{aligned} \end{equation} -where $\textbf{c}^{L}_{j} \in \mathbb{R}^{2}$ and $\textbf{c}^{G} \in \mathbb{R}^{2}$ are the Cartesian coordinates of local and global origin points correspondingly. +where $\textbf{c}^{L}_{j} \in \mathbb{R}^{2}$ and $\textbf{c}^{G} \in \mathbb{R}^{2}$ represent the Cartesian coordinates of local and global origins correspondingly. -Then the feature points can be sample on the line anchor. The y coordinate of points is uniform sampled from the image vertically as mentioned before, and the $x_{i}$ is caculated using the global polar axis by the following equation: +Next, feature points are sampled on the lane anchor. The y-coordinates of these points are uniformly sampled vertically from the image, as previously mentioned. The $x_{i}$ coordinates are computed using the global polar axis with the following equation: \begin{equation} \begin{aligned} @@ -304,21 +292,18 @@ Then the feature points can be sample on the line anchor. The y coordinate of po \begin{figure}[t] \centering \includegraphics[width=\linewidth]{thsis_figure/detection_head.png} % 替换为你的图片文件名 - \caption{The main architecture of detection head} - \label{detection_head} + \caption{The main architecture of global polar head} + \label{gph} \end{figure} - - -Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denotes the last three levels from FPN and $\boldsymbol{F}_{L}^{s}\in \mathbb{R} ^{N_p\times d_f}$ is the $L_{th}$ sample point feature from $P_{L}$. The grid featuers from the three levels are extracted and fused together without cross layer cascade refinenment like CLRNet. In order to reduce the number of parameters, we use the weight sum strategy to add features from different layers similar to \cite{}, but more compactness: +Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denote the last three levels from FPN and $\boldsymbol{F}_{L}^{s}\in \mathbb{R} ^{N_p\times d_f}$ represent the $L_{th}$ sample point feature from $P_{L}$. The grid featuers from the three levels are extracted and fused together without cross layer cascade refinenment unlike CLRNet. To reduce the number of parameters, we employ a weight sum strategy to combine features from different layers, similar to \cite{}, but in a more compact form: \begin{equation} \begin{aligned} \boldsymbol{F}^s=\sum_{L=0}^2{\boldsymbol{F}_{L}^{s}\times \frac{e^{\boldsymbol{w}_{L}^{s}}}{\sum_{L=0}^2{e^{\boldsymbol{w}_{L}^{s}}}}} \end{aligned} \end{equation} - - where $\boldsymbol{w}_{L}^{s}\in \mathbb{R} ^{N_p}$ is the learnable aggregate weight, serving as a learned weight of model. Insteading of concationate the three sampleing features to $\boldsymbol{F}^s\in \mathbb{R} ^{N_p\times d_f\times 3}$ directly, the adaptive adding greatly reduce the dimentsion of the features to $\boldsymbol{F}^s\in \mathbb{R} ^{N_p\times d_f}$, which is 1/3 of the former. Then the weighted sumed tensors are fed into a full connection layers to get the pooling roi features of an anchor: +where $\boldsymbol{w}_{L}^{s}\in \mathbb{R} ^{N_p}$ represents the learnable aggregate weight, serving as a learned model weight. Instead of concatenating the three sampling features into $\boldsymbol{F}^s\in \mathbb{R} ^{N_p\times d_f\times 3}$ directly, the adaptive summation significantly reduces the feature dimensions to $\boldsymbol{F}^s\in \mathbb{R} ^{N_p\times d_f}$, which is one-third of the original dimension. The weighted sum tensors are then fed into fully connected layers to obtain the pooled RoI features of an anchor: \begin{equation} \begin{aligned} @@ -338,7 +323,7 @@ Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denotes the last three levels from FPN The positive confidence get from o2m cls head, $s_i$;\\ The positive regressions get from o2m Reg head, the horizontal offset $\varDelta \boldsymbol{x}_{i}^{roi}$ and end point location $\boldsymbol{e}_{i}$;\\ \ENSURE ~~\\ %算法的输出:Output - \STATE Calculate the confidential adjacent matrix $\boldsymbol{C} \in \mathbb{R} ^{n\times n} $, where the element $C_{ij}$ in $\boldsymbol{C}$ is caculate as follows: + \STATE Calculate the confidential adjacent matrix $\boldsymbol{C} \in \mathbb{R} ^{N_{pos} \times N_{pos}} $, where the element $C_{ij}$ in $\boldsymbol{C}$ is caculate as follows: \begin{equation} \begin{aligned} C_{ij}=\begin{cases} @@ -348,7 +333,7 @@ Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denotes the last three levels from FPN \end{aligned} \label{al_1-1} \end{equation} - \STATE Calculate the geometric prior adjacent matrix $\boldsymbol{M} \in \mathbb{R} ^{n\times n} $, where the element $M_{ij}$ in $\boldsymbol{M}$ is caculate as follows: + \STATE Calculate the geometric prior adjacent matrix $\boldsymbol{M} \in \mathbb{R} ^{N_{pos} \times N_{pos}} $, where the element $M_{ij}$ in $\boldsymbol{M}$ is caculate as follows: \begin{equation} \begin{aligned} M_{ij}=\begin{cases} @@ -359,7 +344,7 @@ Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denotes the last three levels from FPN \label{al_1-2} \end{equation} - \STATE Calculate the distance matrix $\boldsymbol{D} \in \mathbb{R} ^{n\times n}$, where the element $D_{ij}$ in $\boldsymbol{D}$ is defined as follows: + \STATE Calculate the distance matrix $\boldsymbol{D} \in \mathbb{R} ^{N_{pos} \times N_{pos}}$, where the element $D_{ij}$ in $\boldsymbol{D}$ is defined as follows: \begin{equation} \begin{aligned} D_{ij} = 1-d\left( \boldsymbol{x}_{i}^{b} + \varDelta \boldsymbol{x}_{i}^{roi}, \boldsymbol{x}_{j}^{b} + \varDelta \boldsymbol{x}_{j}^{roi}, \boldsymbol{e}_{i}, \boldsymbol{e}_{j}\right) @@ -371,7 +356,7 @@ Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denotes the last three levels from FPN \begin{equation} \begin{aligned} \tilde{s}_i=\begin{cases} - 1,\underset{j\in \left\{ j|T_{ij}=1 \right\}}{\max}D_{ij}<\tau\\ + 1,\underset{j\in \left\{ j|T_{ij}=1 \right\}}{\max}D_{ij}<\d_{\tau}\\ 0,others\\ \end{cases} \end{aligned} @@ -390,7 +375,7 @@ Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denotes the last three levels from FPN \label{gnn} \end{figure} -\textbf{NMS vs NMS-free.} Let $\boldsymbol{F}^{roi}_{i}$ denotes the roi features extracted from $i_{th}$ anchors and the three sub heads take $\boldsymbol{F}^{roi}_{i}$ as input. Now, let us only consider the o2m cls head and o2m Reg head, which meets the old paradigm for previous work and can be taken as the baseline for the following new one-to-one paradigm. Keeping it simple and rigorous, both o2m cls head and o2m Reg head consists of two layers with activation function (plain structure without any complex mechanisms such as attention and desformable convolution). To remove the NMS postprocessing, directly replace the one-to-many with one-to-one label assignment is not enough as we mentioned before, because the anchors are highly overlapping or with small distance with each other, as the fig \ref{anchor setting} (b)(c) shows. Let the $\boldsymbol{F}^{roi}_{i}$ and $\boldsymbol{F}^{roi}_{j}$ denote the features form two overlapping (or with very small distance), so the values of $\boldsymbol{F}^{roi}_{i}$ and $\boldsymbol{F}^{roi}_{j}$ is almost the same. Let $f_{plain}^{cls}$ denotes the neural structure the sample as the o2m cls head but trained with one-to-one label assignment. Supposed that $\boldsymbol{F}^{roi}_{i}$ is the positive sample and the $\boldsymbol{F}^{roi}_{j}$ is the negative, the ideal correspondingly output is different as following: +\textbf{NMS vs NMS-free.} Let $\boldsymbol{F}^{roi}_{i}$ denotes the roi features extracted from $i_{th}$ anchors and the three sub heads take $\boldsymbol{F}^{roi}_{i}$ as input. Now, let us only consider the o2m cls head and o2m Reg head, which meets the old paradigm for previous work and can be taken as the baseline for the following new one-to-one paradigm. Keeping it simple and rigorous, both o2m cls head and o2m Reg head consists of two layers with activation function (plain structure without any complex mechanisms such as attention and desformable convolution). To remove the NMS postprocessing, directly replace the one-to-many with one-to-one label assignment is not enough as we mentioned before, because the anchors are highly overlapping or with small distance with each other, as the Fig. \ref{anchor setting} (b)(c) shows. Let the $\boldsymbol{F}^{roi}_{i}$ and $\boldsymbol{F}^{roi}_{j}$ denote the features form two overlapping (or with very small distance), so the values of $\boldsymbol{F}^{roi}_{i}$ and $\boldsymbol{F}^{roi}_{j}$ is almost the same. Let $f_{plain}^{cls}$ denotes the neural structure the sample as the o2m cls head but trained with one-to-one label assignment. Supposed that $\boldsymbol{F}^{roi}_{i}$ is the positive sample and the $\boldsymbol{F}^{roi}_{j}$ is the negative, the ideal correspondingly output is different as following: \begin{equation} @@ -406,20 +391,7 @@ Suppose the $P_{0}$, $P_{1}$ and $P_{2}$ denotes the last three levels from FPN The equatin \ref{sharp fun} implicit the property of $f_{cls}^{plain}$ is sharp, the same issue is also mentioned in \cite{}. Learning the sharp property with the plain structure is hard. In the most extreme case with $\boldsymbol{F}_{i}^{roi} = \boldsymbol{F}_{j}^{roi}$, it's nearly impossible to distinguish the two anchors to positive and negative samples completely, the reality is both the confidence is convergent to around 0.5. The issue is caused by the limitations of the input format and the structure, which limit the expression ability. So it's essential to establish the relations between anchors and design new model structure to express the relation. -It is easy to notice that the "ideal" one-to-one branch is equivalence to o2m cls branch + o2m regression + NMS postprocessing. To deduce the latter more clearly, the process are transfer to the equation as follows: - -\begin{equation} - \begin{aligned} - s_i&\gets f_{o2o}^{cls}\left( \boldsymbol{F}_{i}^{roi} \right) - \\ - \varDelta \boldsymbol{x}_{i}^{roi}, \boldsymbol{e}_{i}&\gets f_{o2o}^{cls}\left( \boldsymbol{F}_{i}^{roi} \right) \,\, \varDelta \boldsymbol{x}_{i}^{roi}\in \mathbb{R} ^{N_r} - \\ - \tilde{s}_i|_{i=1}^{N_{pos}}&\gets NMS\left( s_i|_{i=1}^{N_{pos}}, \varDelta \boldsymbol{x}_{i}^{roi}+\boldsymbol{x}_{i}^{b}|_{i=1}^{N_{pos}}, \boldsymbol{e}_{i}|_{i=1}^{N_{pos}} \right) - \end{aligned} - \label{nms_equ} -\end{equation} - -If the equation \ref{nms_equ} could be replaced by some equivalent but learnable functions (e.g. some neural work), the o2o head is able to be trained and learn the one-to-one assignment. However, the NMS need sequential iteration and confidence sorting process, which is hard to be rewirtten to neural network. Though the RNN based neural work is also porposed \cite{} to replace NMS, it's time comsuming and the iteration process introduce additional difficulty for the model trianing. +It is easy to notice that the "ideal" one-to-one branch is equivalence to o2m cls branch + o2m regression + NMS postprocessing. If the NMS could be replaced by some equivalent but learnable functions (e.g. some neural work), the o2o head is able to be trained and learn the one-to-one assignment. However, the NMS need sequential iteration and confidence sorting process, which is hard to be rewirtten to neural network. Though previous work such as the RNN based neural work is also porposed \cite{} to replace NMS, it's time comsuming and the iteration process introduce additional difficulty for the model trianing. The key rule of the NMS postprocessing is gien as following: Given a series of positive detections with redundancy, a detection lane A is supressed by another detection lane B if and only if: @@ -434,7 +406,7 @@ However, as a simplicity of NMS, FastNMS only need the condition (1) and (2) and It's easy to prove that when the elements in $\boldsymbol{M}$ are all set to 1 (regardless of the geometric priors), the Graph-based FastNMS is equivalent to FastNMS. Based on our newly proposed Graph-based FastNMS, we can construct the structure of o2o cls head reference to Graph-based FastNMS. - According to the analysis of the shortcoming of traditional NMS postprocessing, the essential issue is due to the distance between two prediction and the threshold $\tau$. So we replace the explicit defination of distance function with implicit graph neural work. What's more, the input of x axis is also replace with the anchor features ${F}_{i}^{roi}$. As the \cite{} mentioned, ${F}_{i}^{roi}$ contains the location and classification information, which is enough to modelling the distance by neural work. + According to the analysis of the shortcoming of traditional NMS postprocessing, the essential issue is due to the distance between two prediction and the settting of the threshold $\d_{\tau}$. So we replace the explicit defination of distance function with implicit graph neural work. What's more, the input of x axis is also replace with the anchor features ${F}_{i}^{roi}$. As the \cite{} mentioned, ${F}_{i}^{roi}$ contains the location and classification information, which is enough to modelling the distance by neural work. So the implicit distance is defined as following; \begin{equation} @@ -469,6 +441,21 @@ the equation \ref{edge_layer} is the implicit replacement of equation \ref{al_1- the equation \ref{node_layer} is the implicit replacement of equation \ref{al_1-4}. +It should be noted that the o2o cls head depends on the predictons of o2m cls head. From the perspective of probablity, the confidence output by o2m cls head $s_{j}$ denotes the probablity that the $j_{th}$ detection is the positive sample. The confidence output by o2o cls head $\tilde{s}_i$ denotes the conditional probablity that $i_{th}$ sample shouldn't be supressed given the condition that the $i_{th}$ sample is already the positive sample. + + +\begin{equation} + \begin{aligned} + &s_j|_{j=1}^{N_A}\equiv P\left( a_j\,\,is\,\,pos \right) \,\, + \\ + &\tilde{s}_i|_{i=1}^{N_{pos}}\equiv P\left( a_i\,\,is\,\,saved|a_i\,is\,\,pos \right) + \end{aligned} + \label{probablity} +\end{equation} + + +\textbf{Label assignment and Cost function} We use the label assignment (SimOTA) similar to previous work \cite{}\cite{} but in order to make the function more compact and keep consistant with works of general object detection \cite{}, the lane IoU is redefined. As illustrated in fig,9, the newly-defined lane Iou which we called GLaneIoU is defined as follows: + \begin{figure}[t] \centering \includegraphics[width=\linewidth]{thsis_figure/GLaneIoU.png} % 替换为你的图片文件名 @@ -476,6 +463,64 @@ the equation \ref{node_layer} is the implicit replacement of equation \ref{al_1- \label{glaneiou} \end{figure} +\begin{equation} + \begin{aligned} + &w_{i}^{k}=\frac{\sqrt{\left( \Delta x_{i}^{k} \right) ^2+\left( \Delta y_{i}^{k} \right) ^2}}{\Delta y_{i}^{k}}w + \\ + &\hat{d}_{i}^{\mathcal{O}}=\min \left( x_{i}^{p}+w_{i}^{p}, x_{i}^{q}+w_{i}^{q} \right) -\max \left( x_{i}^{p}-w_{i}^{p}, x_{i}^{q}-w_{i}^{q} \right) + \\ + &\hat{d}_{i}^{\xi}=\max \left( x_{i}^{p}-w_{i}^{p}, x_{i}^{q}-w_{i}^{q} \right) -\min \left( x_{i}^{p}+w_{i}^{p}, x_{i}^{q}+w_{i}^{q} \right) + \\ + &d_{i}^{\mathcal{U}}=\max \left( x_{i}^{p}+w_{i}^{p}, x_{i}^{q}+w_{i}^{q} \right) -\min \left( x_{i}^{p}-w_{i}^{p}, x_{i}^{q}-w_{i}^{q} \right) + \\ + &d_{i}^{\mathcal{O}}=\max \left( \hat{d}_{i}^{\mathcal{O}},0 \right) \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, d_{i}^{\xi}=\max \left( \hat{d}_{i}^{\xi},0 \right) + \end{aligned} +\end{equation} + +The definations of $d_{i}^{\mathcal{O}}$ and $d_{i}^{\mathcal{\xi}}$ is similar but slightly different from \cite{} and \cite{}, which force the value nonnegative. This format aim to be consistant to the IoU definations for bounding box. So the overall GLaneIoU is given as follows; + +\begin{equation} + \begin{aligned} +GLaneIoU\,\,=\,\,\frac{\sum\nolimits_{i=j}^k{d_{i}^{\mathcal{O}}}}{\sum\nolimits_{i=j}^k{d_{i}^{\mathcal{U}}}}-g\frac{\sum\nolimits_{i=j}^k{d_{i}^{\xi}}}{\sum\nolimits_{i=j}^k{d_{i}^{\mathcal{U}}}} +\end{aligned} +\end{equation} +Where j and k is the valid points index (the start point and the end point). It's easy to see that when $g=0$, the GLaneIoU is correspond to IoU for bounding box, and the value range is $\left[0, 1 \right]$. When $g=1$, the GLaneIoU is correspond to GIoU for bounding box, and the value range is $\left(-1, 1 \right]$. Generally, when $g>0$, the value range of GLaneIoU is $\left(-g, 1 \right]$. +Then we can define the cost function between $i_{th}$ prediction and $j_{th}$ ground truth as \cite{}: +\begin{equation} + \begin{aligned} + \mathcal{C} _{ij}=\left(s_i\right)^{\beta_c}\times \left( GLaneIoU_{ij, g=0} \right) ^{\beta_r} +\end{aligned} +\end{equation} +This cost function is more compact than previous work and taken both location and confidenct into account. SimOTA (k=4) \cite{} are used for label assignment for two o2m heads while hungary algorithm for the o2o cls head. + +\textbf{Loss function} We use focal loss \cite{} for o2o cls head and o2m cls head: + +\begin{equation} + \begin{aligned} + \mathcal{L} _{\,\,o2m,cls}&=\sum_{i\in \varOmega _{pos}^{o2m}}{\alpha _{o2m}\left( 1-s_i \right) ^{\gamma}\log \left( s_i \right)}\\&+\sum_{i\in \varOmega _{neg}^{o2m}}{\left( 1-\alpha _{o2m} \right) \left( s_i \right) ^{\gamma}\log \left( 1-s_i \right)} + \\ + \mathcal{L} _{\,\,o2o,cls}&=\sum_{i\in \varOmega _{pos}^{o2o}}{\alpha _{o2o}\left( 1-\tilde{s}_i \right) ^{\gamma}\log \left( \tilde{s}_i \right)}\\&+\sum_{i\in \varOmega _{neg}^{o2o}}{\left( 1-\alpha _{o2o} \right) \left( \tilde{s}_i \right) ^{\gamma}\log \left( 1-\tilde{s}_i \right)} + \\ + \end{aligned} +\end{equation} + +where the set of the one-to-one sample$\varOmega _{pos}^{o2o}$ and $\varOmega _{neg}^{o2o}$ is based on the positive sample from the sample of o2m cls head: +\begin{equation} + \begin{aligned} + \varOmega _{pos}^{o2o}\cup \varOmega _{neg}^{o2o}=\left\{ i|s_i>C_{o2o} \right\} + \end{aligned} +\end{equation} + +only one sample with confidence larger than $C_{o2m}$ is chosed as the canditate sample of o2o cls head. So in ordr to keep the feature quality during training stage, the gradient of o2o cls head are stopped from remain detection head (the roi feature of the anchor $\boldsymbol{F}}_{i}^{roi}$). Additionally, we use the rank loss to increase the gap between positive and negative confidences of o2o cls head: + + +\begin{equation} + \begin{aligned} + &\mathcal{L} _{\,\,rank}=\frac{1}{N_{rank}}\sum_{i\in \varOmega _{pos}^{o2o}}{\sum_{j\in \varOmega _{neg}^{o2o}}{\max \left( 0, \tau _{rank}-\tilde{s}_i+\tilde{s}_j \right)}}\\ + &N_{rank}=\left| \varOmega _{pos}^{o2o} \right|\left| \varOmega _{neg}^{o2o} \right| + \end{aligned} +\end{equation} + \begin{figure}[t] \centering @@ -484,18 +529,38 @@ the equation \ref{node_layer} is the implicit replacement of equation \ref{al_1- \label{auxloss} \end{figure} -The RCNN Module consists of several MLP layers and predicts the confidence and the coordinate offset of $x_{i}$. During the training stage, all the $F\in \mathbb{R} ^{C_{f}\times H_{f}\times W_{f}}$ proposed anchors participate, and the SimOTA\ref{} label assignment strategy is used for the RCNN module to determine which anchors are positive anchors, irrespective of the confidence predicted by the LPM module. These strategies are employed because the negative/background anchors are also crucial for the adaptability of the RCNN module. +We directly use the GLaneIoU loss $\mathcal{L} _{GLaneIoU}$to regression the offset of xs (with g=1) and SmoothL1 loss for the regression of end points (namely the y axis of the start point and the end point) $\mathcal{L} _{end}$. In order to make model learn the global features, we proposed the auxloss: +\begin{equation} + \begin{aligned} + \mathcal{L} _{\,\,aux}=\frac{1}{\left| \varOmega _{pos}^{o2m} \right|N_{seg}}\sum_{i\in \varOmega _{pos}^{o2o}}{\sum_{m=j}^k{l\left( \theta _i-\hat{\theta}_{i}^{seg,m} \right) \\+l\left( r_{i}^{global}-\hat{r}_{i}^{seg,m} \right)}} + \end{aligned} +\end{equation} -The loss function is as follows: + + +\subsection{Loss function} + +The overall loss function of PolarRCNN is given as follows: \begin{equation} \begin{aligned} - \mathcal{L} _{RCNN}=c_{cls}\mathcal{L} _{cls}+c_{loc}\mathcal{L} _{loc} + \mathcal{L}_overall &=\mathcal{L} _{lph}^{cls}+w_{lph}^{reg}\mathcal{L} _{lph}^{reg}\\&+w_{o2m}^{cls}\mathcal{L} _{o2m}^{cls}+w_{o2o}^{cls}\mathcal{L} _{o2o}^{cls}+w_{rank}\mathcal{L} _{rank}\\&+w_{IoU}\mathcal{L} _{IoU}+w_{end}\mathcal{L} _{end}+w_{aux}\mathcal{L} _{aux} \end{aligned} \end{equation} -where $\mathcal{L} _{cls}$ is focal loss, and $\mathcal{L} _{loc}$ is LaneIou loss\cite{}. -In the testing stage, anchors with the top-$k_{l}$ confidence are the chosed as the proposal anchors, and $k_{l}$ anchors are fed into the RCNN module to get the final predictions. +The training process is end-to-end. + + + + + + + + + + + + \section{Experiment} @@ -509,6 +574,14 @@ In the testing stage, anchors with the top-$k_{l}$ confidence are the chosed as \end{figure} +\begin{figure}[t] + \centering + \includegraphics[width=\linewidth]{thsis_figure/speed_method.png} + \caption{Anchor Number and f1-score of different methods on CULane.} + \label{speed_method} +\end{figure} + + \begin{figure*}[htbp] \centering \def\subwidth{0.325\textwidth} diff --git a/thsis_figure/GLaneIoU.png b/thsis_figure/GLaneIoU.png index 863e4eb..a7d8aff 100644 Binary files a/thsis_figure/GLaneIoU.png and b/thsis_figure/GLaneIoU.png differ diff --git a/thsis_figure/anchor_num_method.png b/thsis_figure/anchor_num_method.png index ab76f89..8350d58 100644 Binary files a/thsis_figure/anchor_num_method.png and b/thsis_figure/anchor_num_method.png differ diff --git a/thsis_figure/coord/localpolar.png b/thsis_figure/coord/localpolar.png index 82ca5fb..dee41c3 100644 Binary files a/thsis_figure/coord/localpolar.png and b/thsis_figure/coord/localpolar.png differ diff --git a/thsis_figure/coord/polar.png b/thsis_figure/coord/polar.png index c184451..15b7df1 100644 Binary files a/thsis_figure/coord/polar.png and b/thsis_figure/coord/polar.png differ diff --git a/thsis_figure/coord/ray.png b/thsis_figure/coord/ray.png index 31c1cf7..96c9e4d 100644 Binary files a/thsis_figure/coord/ray.png and b/thsis_figure/coord/ray.png differ diff --git a/thsis_figure/detection_head.png b/thsis_figure/detection_head.png index 75c51c6..2abc5b8 100644 Binary files a/thsis_figure/detection_head.png and b/thsis_figure/detection_head.png differ diff --git a/thsis_figure/gnn.png b/thsis_figure/gnn.png index c715a6f..b66cc48 100644 Binary files a/thsis_figure/gnn.png and b/thsis_figure/gnn.png differ diff --git a/thsis_figure/ovarall_architecture.png b/thsis_figure/ovarall_architecture.png index 9626d34..bc210e9 100644 Binary files a/thsis_figure/ovarall_architecture.png and b/thsis_figure/ovarall_architecture.png differ diff --git a/thsis_figure/thisis_pic.pptx b/thsis_figure/thisis_pic.pptx index 1abfe00..630b29d 100644 Binary files a/thsis_figure/thisis_pic.pptx and b/thsis_figure/thisis_pic.pptx differ diff --git a/thsis_figure/view_nms/less2_gt.jpg b/thsis_figure/view_nms/less2_gt.jpg index 4d95ded..06588f9 100644 Binary files a/thsis_figure/view_nms/less2_gt.jpg and b/thsis_figure/view_nms/less2_gt.jpg differ diff --git a/thsis_figure/view_nms/less2_nmsfree.jpg b/thsis_figure/view_nms/less2_nmsfree.jpg index 564139a..e5da291 100644 Binary files a/thsis_figure/view_nms/less2_nmsfree.jpg and b/thsis_figure/view_nms/less2_nmsfree.jpg differ diff --git a/thsis_figure/view_nms/less2_pred15.jpg b/thsis_figure/view_nms/less2_pred15.jpg index 564139a..e5da291 100644 Binary files a/thsis_figure/view_nms/less2_pred15.jpg and b/thsis_figure/view_nms/less2_pred15.jpg differ diff --git a/thsis_figure/view_nms/less2_pred50.jpg b/thsis_figure/view_nms/less2_pred50.jpg index 31eb801..02e1767 100644 Binary files a/thsis_figure/view_nms/less2_pred50.jpg and b/thsis_figure/view_nms/less2_pred50.jpg differ