# DBCAN: DFormer-Based Cross-Attention Network for RGB Depth Semantic Segmentation
## 3 Methodology
### Spatial-Semantic Fusion Module  
The Spatial-Semantic Fusion Module is designed to effectively combine spatial and semantic information by leveraging both local and global attention mechanisms. This module enhances feature extraction by preserving the original features while also incorporating attention-based features, ensuring a richer and more comprehensive representation. By integrating these features, the module improves the model's ability to make accurate predictions, highlighting the importance of both spatial and semantic cues in understanding complex visual scenes. Consequently, the fused features, \(f_{last}\), offer a comprehensive representation that combines both spatial and semantic features, thereby contributing to the final predictions of the model. To enhance the effectiveness of the features and integrate RGB and spatial information, we introduce the Spatial-Semantic Fusion Module. However, relying solely on the attention feature \(f_{r3}(f_{s3})\) output from the FRRM may not provide sufficient richness in representation. Taking inspiration from ResNet [25], which effectively preserves original features while enhancing feature extraction, we employ similar techniques to enhance the semantic expression of \(f_{r3}\) and \(f_{s3}\). By applying these operations, we aim to enrich the semantic information embedded within these features. Specifically, these operations can be described as follows:  
\[f_{r4}=Concat(f_{r2},f_{r3}) \tag{10}\]  
\[f_{s4}=Concat(f_{s2},f_{s3}) \tag{11}\]The \(Concat()\) operation represents the concatenation along the channel dimension. Following these two steps, \(f_{74}\) and \(f_{84}\) preserve both the original features and the attention-based features. Subsequently, we propose the Local Attention Module (LAM) and the Global Attention Module (GAM) to enhance feature extraction from both the spatial and channel perspectives. These operations can be expressed as follows:  
\[LAM(x)=Conv_{7\times 7}(Concat(AvgPool_{c}(x),\] \[MaxPool_{c}(x))) \tag{12}\]  
\[GAM(x)=\delta(Conv_{1\times 1}\delta(Conv_{1\times 1}AvgPool(x))) \tag{13}\]  
LAM is designed to focus on capturing fine-grained, localized information by applying global average pooling (\(AvgPool_{c}()\)) and global max pooling (\(MaxPool_{c}()\)) along the channel dimension of the input feature map \(x\). These operations generate two feature maps that, when concatenated and processed through a \(7\times 7\) convolution, allow the module to emphasize important local details across channels. This approach ensures that the model pays attention to both dominant and subtle features within each spatial region, thus preserving local contextual information. GAM, on the other hand, is constructed to capture global context by performing global average pooling (\(AvgPool()\)) across the HW dimensions of the input feature map \(x\). The module then employs convolution operations (\(Conv_{1\times 1}\)) and activation functions (\(\delta()\)) to highlight significant features across the entire image. By emphasizing global patterns, GAM ensures that the model retains an understanding of the broader context, which is essential for accurate semantic interpretation. In the Spatial-Semantic Fusion Module, these operations can be represented as follows:  
\[f_{l}=LAM(f_{74}) \tag{14}\]  
\[f_{g}=GAM(f_{74}) \tag{15}\]  
\[s_{ls}=LAM(f_{84}) \tag{16}\]  
\[s_{gs}=GAM(f_{84}) \tag{17}\]  
As illustrated in Figure 3, the Local Attention Module and the Global Attention Module adjust the weights of RGB features (\(f_{r4}\)) and spatial features (\(f_{s4}\)) based on channels and local feature regions, resulting in local weight features (\(f_{l}\) and \(s_{ls}\)) and global weight features (\(f_{g}\) and \(s_{gs}\)). The local weight features are added to the global weight features as newly incorporated features. These added features undergo the \(Sigmoid()\) operation. Subsequently, the added features are multiplied with the original input feature.