# Grid Anchor Lane Detection Based on Attribute Correlation
## 3 Methods
### Network Design  
Lane lines are detection targets that represent elongated structures with a large span but a small area in images, exhibiting long-range dependency relationships. On the other hand, due to occlusions, wear, and dashed types, the lane line features in images tend to be discontinuous. As a result, visible features in the image must be leveraged to complete the missing lane line information. The detection model must not only capture global information and establish long-range feature associations to compensate for missing features but also focus on the fine details within the image to accurately regress the coordinates of the lane lines. The feature pyramid network (FPN) [20] constructs connections between multi-resolution feature maps both in bottom-up and top-down directions, as well as lateral connections within feature maps at the same resolution. This architecture is designed to simultaneously acquire high-level semantic information and low-level detail information, with minimal computational overhead. In the FPN model, lateral connections at the top-level feature map are implemented using 1 \(\times\) 1 convolution [35], which only performs data associations across different channel layers. However, it does not establish data associations across different spatial locations within the high-level feature map. To address this, we have incorporated a multi-layer perceptron (MLP) into the top-down process of the original FPN model, enabling data associations across different spatial locations within the feature map. In Figure 5, the model consists of three-layer lateral connections, comprising the top, middle, and bottom layers, and outputs the corresponding recognition results 0, 1, and 2. The left side of the model is the main architecture of ResNet, and the feature maps from ResNet with successively halved resolutions are used as inputs to the lateral connections. The lateral connection utilizes a 1 \(\times\) 1 convolution (red arrow) to reduce the number of channels, producing the corresponding local feature map (red). To establish data connections across different spatial locations within the feature map and facilitate long-range feature associations, the top-layer local feature map is flattened (yellow arrow) into a 1D vector, which serves as input to the MLP. The 1D vector output from the MLP is then reshaped to the original resolution of the local feature map, resulting in the global feature map (yellow). To simultaneously obtain both the features corresponding to the anchor's position and the globally completed features, at the top layer, the local and global feature maps are concatenated (blue rounded box) along the channel dimension. The concatenated result is then passed through a 3 \(\times\) 3 convolution to output recognition result 0. At the middle and bottom layers, in addition to the local feature maps generated by lateral connections, the results include the diffusion feature map (blue), produced through upsampling (blue arrow), and the global feature map, produced via the MLP. The concatenated result of these three feature maps is passed through a 3 \(\times\) 3 convolution to output recognition results 1 and 2, respectively. A distinguishing characteristic of the bottom layer, compared to the middle layer, is that the upsampling input at the bottom layer is the concatenated result of the middle-layer local and diffusion feature maps, while the upsampling input at the middle layer is the local feature map from the top layer. Figure 6 illustrates the MLP used in the model, corresponding to the processing flow of the red arrow in Figure 5. At the top layer, the number of input and output nodes of the MLP equals the data size of the top-layer local feature map. For cross-layer MLPs, in order to maintain consistent feature map resolutions within the same layer for easy concatenation along the channel dimension, the number of output nodes is four times that of the input nodes.