## 3 Improvement of PP-LiteSeg Rural Road Recognition Methods
### Parallel Feature Fusion Module  
Bottleneck Attention Module  
BAM (Bottleneck Attention Module) [22] combines channel attention and spatial attention to enhance the network's attention to key features. The specific structure of BAM is shown in Figure 4. Its main idea is to enhance important channels and spatial locations by generating attention maps on feature channels and spatial dimensions, respectively. The specific operation can be divided into the following two parts:  
(1) Channel Attention Module  
Channel attention adaptively adjusts the importance of each channel. Given the input feature map \(X\in R^{H\times W\times C}\), global average pooling and max pooling are first performed to obtain the global features:  
\[\begin{split} X_{avg}&=AvgPool(X)\\ X_{\text{max}}&=MaxPool(X)\end{split} \tag{2}\]  
The features are then scaled through the fully connected layer:  
\[X_{channel}=\sigma(W_{1}(W_{0}(X_{avg})+W_{0}(X_{\text{max}}))) \tag{3}\]  
where \(W_{0}\) and \(W_{1}\) are trainable weight matrices and \(\sigma\) denotes the activation function.  
(2) Spatial Attention Module  
Figure 3: Strip pooling simple pyramid module, where 1D Conv represents a one-dimensional convolution operation, \(1\times 1\) Conv represents a convolution operation with a convolution kernel of 1, sigmoid represents an activation function, Sp represents the strip pooling operation, and Add represents the addition of elements.  
Spatial attention captures important locations in an image. The feature maps are first subjected to max pooling and average pooling operations in the channel dimension to obtain two two-dimensional spatial attention feature maps:  
\[\begin{split} X_{avg}^{spatial}&=AvgPool(X,axis=channel) \\ X_{\text{max}}^{spatial}&=MaxPool(X,axis=channel) \end{split} \tag{4}\]  
They are then concatenated and a spatial attention map is generated by a convolution operation:  
\[X_{spatial}=\sigma(Conv([X_{avg}^{spatial},X_{\text{max}}^{spatial}])) \tag{5}\]  
Finally, the results of channel attention and spatial attention are combined onto the input feature map to obtain an enhanced feature representation:  
\[X_{out}=X\cdot X_{channel}\cdot X_{spatial} \tag{6}\]  
The parallel feature fusion module proposed in this paper is shown in Figure 5. First, the output of the simple pooling pyramid module is multiplied element by element. Then, the two output features go into the B-UAFM module, respectively, while the features of the intermediate stage of the backbone network are fused with it. Finally, the two outputs are multiplied element by element again to output the final result. The specific structure of B-UAFM is shown in the Figure below.  
Figure 4: The overall structure of BAM attention, where \(1\times 1\) Conv and \(3\times 3\) Conv represent \(1\times 1\) convolutional manipulation and \(3\times 3\) convolutional operation, respectively, FC represents fully connected operation, and Sigmoid represents the activation function.  
Figure 5: Overall structure of parallel feature fusion module and detailed structure of B-UAFM, where Upsample represents the upsampling operation, and BAM represents the bottleneck attention module.