# RAU-Net++: River Channel Extraction Methods for Remote Sensing Images of Cold and Arid Regions
## 3 Methods
### Feature Extraction
#### 3.2.2 CBAM Attention Network  
In deep learning, attention modules are commonly employed to focus on specific target features and suppress irrelevant features in the interference region, enhancing the model's ability to prioritize relevant information. In the proposed model, we add a CBAM attention module at the end of the encoder to further supplement the learning of the mesh channel features of the river remote sensing image. CBAM consists of two sub-modules: the channel attention module (CAM) and the spatial attention module (SAM) (shown in Figure 4).  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \# & **Layer** & **Input Size** & **Output Size** \\ \hline
1 & Conv3-64 & \(512\times 512\times 3\) & \(512\times 512\times 64\) \\
2 & Maxpool & \(512\times 512\times 64\) & \(512\times 512\times 64\) \\
3 & Conv3-128 & \(256\times 256\times 128\) & \(256\times 256\times 128\) \\
4 & Maxpool & \(256\times 256\times 128\) & \(256\times 256\times 128\) \\
5 & & \(128\times 128\times 128\) & \(128\times 128\times 256\) \\
6 & Conv3-256 & \(128\times 128\times 256\) & \(128\times 128\times 256\) \\
7 & & \(128\times 128\times 256\) & \(128\times 128\times 256\) \\  & Maxpool & \(128\times 128\times 256\) & \(64\times 64\times 256\) \\
8 & & \(64\times 64\times 256\) & \(64\times 64\times 512\) \\
9 & Conv3-512 & \(64\times 64\times 512\) & \(64\times 64\times 512\) \\
10 & & \(64\times 64\times 512\) & \(64\times 64\times 512\) \\  & Maxpool & \(64\times 64\times 512\) & \(32\times 32\times 512\) \\
11 & & \(32\times 32\times 512\) & \(32\times 32\times 512\) \\
12 & Conv3-512 & \(32\times 32\times 512\) & \(32\times 32\times 512\) \\
13 & & \(32\times 32\times 512\) & \(32\times 32\times 512\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: The first 13 layers of VGG16.  
1. Channel Attention Module  
The feature maps are respectively input to two parallel maximum pooling layers and mean pooling layers, then the two results obtained by the multilayer perceptron machine (\(MLP\)) are sent to the fully connected layer operation and summed, and then the Sigmoid activation function generates the channel attention feature maps \(M_{c}(F)\), and then multiply \(M_{c}(F)\) with the input \(F\) again to obtain the adjusted feature maps (\(F^{\prime}\)) of the channel attention. \(M_{c}(F)\) and \(F^{\prime}\) are computed as shown in Equations (1) and (2):  
\[\begin{split} M_{c}(F)&=\sigma(MLP(Avgpool(F))+MLP( Maxpool(F)))\\ &=\sigma\Big{(}W_{1}\left(W_{0}\left(F_{avg}\right)\right)+W_{1}( W_{0}(F_{max}))\Big{)}\end{split} \tag{1}\]  
\[F^{\prime}=M_{c}(F)\otimes F \tag{2}\]  
where \(\sigma\) is the Sigmoid activation function, \(MLP\) denotes a multilayer perceptual machine with respective weights \(W\) and \(W_{1}\), and \(F_{avg}^{c}\) denotes the average pooling operation and \(F_{max}^{c}\) denotes the maximum pooling operation. \(F\) is the input element in Equation (2).
2. Spatial Attention Module  
With maximum pooling and mean pooling performed on F\({}^{\prime}\) to obtain two feature maps and then the two are spliced, the convolution operation is performed to finally generate the spatial attention feature map \(M_{\mathrm{s}}(F)\), which is computed as shown in Equation (3). \(M_{\mathrm{s}}(F)\) is multiplied with \(F^{\prime}\) by element to obtain the final feature map \(F^{\prime}\), which is calculated as shown in Equation (4).  
\[\begin{split} M_{\mathrm{s}}(F)&=\sigma\big{(}f^{ \prime 7\times 7}([Avgpool(F);Maxpool(F)])\big{)}\\ &=\sigma\Big{(}f^{\prime 7\times 7}\Big{(}\Big{[}F_{avg}^{ \mathrm{s}};F_{max}^{\mathrm{s}}\Big{]}\Big{)}\Big{)}\end{split} \tag{3}\]  
\[F^{\prime}=M_{\mathrm{s}}\left(F^{\prime}\right)\otimes F^{\prime} \tag{4}\]  
where \(\sigma\) is the sigmoid activation function and \(f^{\prime 7\times 7}\) is the convolution kernel of size \(7\times 7\). Equation (4) takes the output \(F^{\prime}\) of Equation (2) as input.