# Grid Anchor Lane Detection Based on Attribute Correlation
## 3 Methods
### Grid Anchor Representation Method for Lane Lines  
The segmentation-based method localizes lane lines at the pixel level, while the anchor-based method localizes lane lines at the image region level. Inspired by these two approaches, we propose a grid anchor structure for lane detection. As illustrated in Figure 2, an image of size \(H\times W\) is evenly divided into square regions, with a total of \(H_{s}\times W_{s}\) regions. Each square region is referred to as an anchor. When viewed as a whole, the anchors resemble a grid laid over the image, hence the term \"grid anchor\". The subscript \(s\) represents different division scales, and \(H_{s}\) and \(W_{s}\) denote the number of divisions along the horizontal and vertical axes of the image, respectively, corresponding to the number of grid anchors along the horizontal and vertical directions. To facilitate the computation of grid anchor detection results from extracted feature maps, \(H_{s}\) and \(W_{s}\) are set equal to the resolution of the feature maps. \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Methods** & **Segmentation** & **Keypoint** & **Parameter** & **Anchor** \\ \hline Representative methods & LaneNet SCNN ENet-SAD & PINet FOLOLane GANNet & PolyLaneNet BezierLaneNet E2 ET & Line-CNN LaneATT Ufldv2 \\ \hline Relative advantages of the proposed method & Reduced computational complexity; high speed; indicating internal internal internal internal relationships. & Indicating internal relationships; flexible representation. & Flexible representation; indicating internal relationships. & Simple computation method; flexible representation; correspondence between features and data at the same position; indicating internal relationships. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Relative advantages of the proposed method compared to four deep learning methods. Figure 2: Illustration of grid anchor placement. Each blue square represents a grid anchor, and the yellow curve depicts the lane line on a curved road. Red boxes indicate grid anchors classified as lane lines, while the remaining boxes are classified as background. In the FPN model architecture, three feature maps of different resolutions are used to compute detection results. Thus, \(s\in\{0,1,2\}\), and the number of anchors follows a doubling relationship across scales, expressed as follows:  
\[H_{0}=\frac{H_{1}}{2}=\frac{H_{2}}{4},W_{0}=\frac{W_{1}}{2}=\frac{W_{2}}{4}. \tag{1}\]  
\((s,i,j)\) is used to represent an anchor at scale \(s\), where \(i\) denotes the anchor's position along the horizontal axis (\(i\in\{0,1,\cdots,W_{s}-1\}\)), and \(j\) denotes its position along the vertical axis (\(j\in\{0,1,\cdots,H_{s}-1\}\)). The four boundaries of the anchor \((s,i,j)\), denoted as \(B^{s}_{i,j^{\prime}}\), can be expressed as follows:  
\[ \begin{array}{c}\left\{i\frac{W}{W_{s}}\leq x\leq\frac{(i+1)W}{W_{s}},y=j \frac{H}{H_{1}}\right\}\\ B^{s}_{i,j}=\begin{cases}\cup\left\{x=\frac{(i+1)W}{W_{s}},j\frac{H}{H_{s}}\leq y \leq\frac{(j+1)H}{H_{s}}\right\}\\ \cup\left\{i\frac{W}{W}\leq x\leq\frac{(i+1)W}{W_{s}},y=\frac{(j+1)H}{H_{s}} \right\}\\ \cup\left\{x=i\frac{W}{W_{s}},j\frac{H}{H_{s}}\leq y\leq\frac{(j+1)H}{H_{s}} \right\}\end{cases},\\ \end{array}  \tag{2}\]  
where \(x\) represents the horizontal coordinate in the image, ranging from left to right, and \(y\) represents the vertical coordinate, ranging from top to bottom. The origin of the coordinate system is located in the image's top-left corner. As shown in Figure 2, to align image features with the classification results at corresponding positions, grid anchors containing lane line features are identified as lane lines, while others are labeled as background. This approach is essentially a binary classification of lane line existence, which is conceptually similar to low-resolution segmentation-based methods, as grid anchors only indicate whether lane line features exist within the anchor region.