# DSA-SOLO: Double Split Attention SOLO for Side-Scan Sonar Target Segmentation
## 3 Methods
### Double Split Attention (DSA) Module
#### 3.2.2 Spatial Attention  
In contrast to channel attention, spatial attention emphasizes 'where' an informational component is, which works in conjunction with channel attention. In this paper, we utilize Group Norm (GN) [36] to obtain spatial-wise features. Feature normalization is a well-known method of increasing the speed of training. Separate from Batch Norm (BN) [37], Layer Norm (LN) [38], and Instance Norm (IN) [39], Group Norm focuses on factors such as frequency, shapes, illumination, and textures. Next, according to these factors, a new grouping method is proposed. A series of feature normalization methods perform the following computation:  
\[\hat{x}_{1}=\frac{1}{\sigma_{i}}(x_{i}-\mu_{i}) \tag{3}\]  
where \(x_{i}\) is the feature map of the \(i\)-th layer. For a 2D image, \(i=(i_{N},i_{C},i_{H},i_{W})\) indicates that the features are indexed in order of (\(N\), \(C\), \(H\), \(W\)), where \(N\) denotes batch, \(C\) denotes channel, and \(H\) and \(W\) the spatial size, respectively. Furthermore, \(\mu\) and \(\sigma\) are the mean and standard deviation, which can be computed by:  
\[\mu_{i}=\frac{1}{m}\underset{k\in S_{i}}{\sum}x_{k} \tag{4}\]  
\[\sigma_{i}=\sqrt{\frac{1}{m}\underset{k\in S_{i}}{\sum}\left(x_{k}-\mu_{i} \right)^{2}+\varepsilon} \tag{5}\]  
where \(S_{i}\) is the set of pixels to compute the mean and standard deviation, and \(m\) is the set size. \(\varepsilon\) is a small constant. Different types of feature normalization methods fundamentally contrast in how the set \(S_{i}\) is defined (as shown in Figure 4). For GN, the \(S_{i}\) is defined as:  
\[S_{i}=\left\{k|k_{N}=i_{N},\left\lfloor\frac{k_{C}}{C/G}\right\rfloor=\left \lfloor\frac{i_{C}}{C/G}\right\rfloor\right\} \tag{6}\]  
Here \(G\) denotes the groups number, \(C\) is the channel number, and \(\left\lfloor\cdot\right\rfloor\) is the floor operation. The equation in (6) indicates that the indexes \(i\) and \(k\) are in the same channel groups. While in GN, the \(\mu\) and \(\sigma\) are computed along the (\(H\), \(W\)) axes and along a group of \(C/G\) channels. Figure 4: Several types of normalization methods. Each subplot shows a feature map tensor, with \(N\) as the batch axis, \(C\) as the channel axis, and (\(H\), \(W\)) as the spatial axes. The pixels in blue are normalized by the same mean and variance parameters. Similar to the channel attention, a \(F_{c}\) is used for enhancing the result of GN \(\widehat{X}\). The final output of spatial attention can be obtained by:  
\[\widehat{X}t=\sigma(W_{2}\widehat{X}+b_{2})\cdot\widehat{X} \tag{7}\]  
where \(W_{2}\) and \(b_{2}\) are parameters with size \(\mathbb{R}^{C/2\times 1\times 1}\). The channel attention module and spatial attention module, respectively, focus on 'what' and 'where' information. Based on this, the two modules can be fused based on parallel or series connection, such as in [20]. Aiming at the weak boundary features of sonar images, we designed a DSA module which combines the two attention modules sequentially in different ways in two branches. The two branches are placed in a parallel arrangement, and the two results are aggregated by a channel shuffle operator. The DSA module is mainly realized by the C-S and S-C units. Specifically, for the two parts \(X_{1}\), \(X_{2}\in\mathbb{R}^{C/2\times H\times W}\) split from the feature map \(X\), C-S unit is a channel-first ordered sequential arrangement, which puts channel attention in front of spatial attention. Therefore, the output of the C-S unit can be computed by:  
\[X_{1}t=\sigma(F_{c}(F_{gap}(X_{1})))\cdot X_{1} \tag{8}\]  
\[X_{1}^{\prime\prime}=\sigma(F_{c}(GN(X_{1}t)))\cdot X_{1}t \tag{9}\]  
where \(F_{c}\) and \(F_{gap}\) are mentioned in the Section 3.2.1. As for the S-C unit, it is a spatial-first ordered sequential arrangement, and the output of the S-C unit can be computed by:  
\[X_{2}t=\sigma(F_{c}(GN(X_{2})))\cdot X_{2} \tag{10}\]  
\[X_{2}^{\prime\prime}=\sigma(F_{c}(F_{gap}(X_{2}t)))\cdot X_{2}t \tag{11}\]  
where \(GN\) is Group Norm.