# Grid Anchor Lane Detection Based on Attribute Correlation
## 3 Methods
### Grid Anchor Representation Method for Lane Lines
However, in practice, the lane line features within an anchor represent a line segment and include additional features such as the lane line's index, slope, and position. To increase the feature information represented by grid anchors, we introduced additional channel layers (Figure 3) following the binary classification channel for lane line existence in grid anchors (Figure 2). The channel layers that encode feature information within a grid anchor are referred to as attributes. After adding these channel layers, each grid anchor contains five attributes: existence, instance, direction, offset, and slope. The output values of grid anchors at different scales are denoted as \(A^{s}\), where \(A^{s}_{c,i,j}\) represents the value of \(A^{s}\) at channel \(c\), horizontal position \(i\), and vertical position \(j\). As shown in Figure 3, the attributes represented by different channel layers (Figure 3a) are explained in detail using the grid anchor \((s,i,j)\) as an example (Figure 3b). The existence attribute \(\left(A^{s}_{0,i,j}\right)\) corresponds to the original binary classification channel in the grid anchor, indicating whether lane line features exist within the anchor. When the attribute value is set to 1, the grid anchor is classified as a lane line; when the attribute value is set to 0, the grid anchor is classified as background. The instance attributes \(\left(A^{s}_{1,i,j},\cdots,A^{s}_{n,i,j}\right)\) are designed for instance segmentation of lane lines, facilitating the identification of the lane line index to which features within anchors belong. This attribute contains \(n\) channels, where \(n\) corresponds to the maximum number of lane lines present in the image. During prediction, the index of the channel with the maximum value indicates the lane line index to which features within anchors belong. If no lane line features exist, the channel values for this attribute are set to 0. The direction attributes \(\left(A^{s}_{n+1,i,j},A^{s}_{n+2,i,j}\right)\) describe the position of the next anchor to which the lane line within the current anchor extends, provided the lane line exists. The direction of the lane line is defined as extending from the vanishing point of the lane line toward the edge of the image. To ensure the spatial continuity of lane lines, the direction attributes of an anchor must point to another anchor located either to its left, right, or directly below. The direction attribute consists of two channel layers. When a lane line is present, the channel values are determined based on the direction encoding table (Table 2). If no lane line features exist, the channel values for this attribute are set to 0. The offset attribute \(\left(A^{s}_{n+3,i,j},A^{s}_{n+4,i,j}\right)\) is designed to correct errors caused by using the anchor's center coordinates as the detection result. It comprises the horizontal offset \(A^{s}_{n+3,i,j}\) and vertical offset \(A^{s}_{n+4,i,j}\), resulting in two channel layers for this attribute. The slope attribute \(\left(A^{s}_{n+5,i,j}\right)\) indicates the average slope of the lane line segment within the anchor and is represented by a single channel layer. Considering that lane lines may be parallel to the image's \(Y\)-axis, causing the slope to approach infinity, the slope attribute is calculated as the reciprocal of the average slope of the lane line. Based on their definitions, the existence, instance, and direction attributes belong to classification tasks, while the offset and slope attributes belong to regression tasks. Grid anchors are inspired by segmentation and anchor-based methods. The arrangement of grid anchors is similar to pixel points in segmentation, as they are arranged tightly and regularly on the image. Therefore, grid anchors can flexibly represent lane lines of