# CPF-UNet: A Dual-Path U-Net Structure for Semantic Segmentation of Panoramic Surround-View Images
## 2 Methods  
### Attention Mechanisms  
In the early days of deep learning, when networks such as Fully Convolutional Networks (FCN) were utilized for semantic segmentation, although no explicit attention mechanism was introduced, the integration of multi-scale feature fusion within the network structures had already implicitly initiated a focus on how to highlight the significant areas of an image during the segmentation process. In 2017, [PERSON] et al. [29] introduced SENet (Squeeze-and-Excitation Networks), which was the first network to explicitly incorporate an attention mechanism in semantic segmentation. The SE module captures global context information from the entire feature map through global average pooling, followed by two fully connected layers that learn weights for each channel, thereby achieving adaptive recalibration of feature channel responses. CBAM (Convolutional Block Attention Module), proposed in 2018 by [PERSON] et al. [30], integrates both channel attention and spatial attention. Specifically, spatial attention is formed through computing difference maps derived from average pooling and max pooling of the feature maps, creating a spatial attention map that directs the network to focus on particular spatial regions. CCNet [31] introduced CrissCross Attention, which propagates information along the diagonal directions of the feature map, effectively exploiting long-range dependencies. DANet [17] combines self-attention and spatial attention, enabling the model to capture global contextual information while refining the resolution of local spatial features. In this paper, we reference the PAM and CAM modules of DANet. CAM focuses on meaningful information in the input image. This module reorganizes and transforms the input feature maps, calculates the interdependencies between various channels, and extracts attention scores that reflect the importance of features. These scores are then nonlinearly normalized using the softmax function, converting them into attention weight distributions with probabilistic properties. This process further guides the model to assign different levels of importance to different channels of the input feature maps. Next, CAM multiplies the resulting attention weights with the original feature maps channel by channel, achieving a weighted operation on the content of each channel in the feature maps. Finally, the weighted feature maps are integrated with the unmodified original feature maps, and the integration strength is regulated with a learnable parameter gamma. This ensures that the model can automatically learn the most appropriate attention distribution during the training process. This channel-attention-based mechanism enables the model to intelligently identify and amplify those feature channels that are decisive for the target task, resulting in significant performance improvements in various computer vision tasks such as image classification, object detection, and semantic segmentation. The structure of the channel attention module is illustrated in Figure 1a. It directly computes the channel attention map, \(X\in R^{C\times C}\), based on the original features, \(A\in R^{C\times H\times W}\). In this process, we reshape \(A\) to \(R^{C\times N}\), and then perform a matrix multiplication between \(A\) and its transpose. Finally, a softmax layer is applied to process the result, yielding the final channel attention map, \(X\in R^{C\times C}\), as follows:  
\[x_{ij}=\frac{\exp\left(A_{i}\cdot A_{j}\right)}{\sum_{i=1}^{C}\exp\left(A_{i} \cdot A_{j}\right)} \tag{1}\]  
where \(x_{ji}\) measures the \(i^{th}\) channel's impact on the \(j^{th}\) channel. In addition, we perform a matrix multiplication between the transpose of \(X\) and \(A\), and reshape their result to \(R^{C\times H\times W}\).