# Side-Scan Sonar Image Augmentation Method Based on CC-WGAN
## 2 Materials and Methods
### Integration of CBAM in Generator and Discriminator  
It is essential to have a thorough understanding of the specific characteristics and contextual background in side-scan sonar images in order to produce images of a high quality. To compensate for the convolution operation's limitation of only calculating correlations within local pixel regions, improve the integration of global and local information in input images for enhanced learning, and provide better stability while avoiding the inherent mode collapse problem, this paper introduces the CBAM into the generator, as illustrated in Figure 3.  
Figure 2: Structure of the WGAN-GP network.  
Figure 3 depicts the entire structure after incorporating the attention module into the generator. The CBAM comprises both the Channel Attention Module (CAM) and the Spatial Attention Module (SAM), as shown in Figure 4. The CAM focuses on the importance of individual channels in the feature map. It captures the information of the entire feature map through a global pooling operation and compresses it into a vector, which is then fed into a multilayer perceptron (MLP). The MLP generates weight values for each channel, which are used to recalibrate each channel in the original feature map, thus emphasizing the important features and suppressing the less important features. The CAM learns the dependencies between different channels by evaluating the significance of each channel's weight to adjust the response in the feature map. This helps the network focus on the most important feature channels, enhancing the feature representation capability. The SAM, on the other hand, focuses on different spatial locations in the feature map. It generates a weight map by computing the spatial distribution of the input feature map, and this weight map is used to indicate which spatial locations are more important. The SAM typically learns these spatial weights by using a small convolutional network. The SAM focuses on the spatial relationships within the feature map by computing the importance weight of each spatial position to adjust the spatial distribution of the feature map. This allows the network to focus on the spatial locations that are most crucial, thereby enhancing the spatial feature representation. This method enables convenient insertion at different locations in the network and conserves computational resources. In contrast to attention mechanisms that concentrate only on spatial or channel characteristics, this method achieves superior performance.  
To help the model better understand the relevance and importance of input data, improve its generalization ability, enhance target learning, and reduce information diffusion, this paper also introduces the CBAM into the discriminator, as illustrated in Figure 5.  
Figure 4: Structure of the attention module.  
Figure 3: Integration of the CBAM into the generator.  
This model enhances the interaction between channel dimensions and spatial dimensions, improving the network performance and accuracy, which in turn increases the clarity of the generated images. It provides better stability, avoiding the mode collapse problem of the original Generative Adversarial Network, where the generated image modes are concentrated in a few modes lacking diversity. This improves the model's capacity to generalize and the clarity of generated images, contributing to the production of high-quality output images.