# Side-Scan Sonar Image Augmentation Method Based on CC-WGAN
## 2 Materials and Methods  
### CC-WGAN Network Structure  
The training approach of the GAN involves a competitive interaction between two networks. The generator network transforms random noise into the input space, while the discriminator network is tasked with distinguishing between generated samples and real data samples, i.e., it determines whether the input data to the discriminator come from real data or generated data. The generator is instructed to outperform the discriminator. The objective function of the competition between the generator and the discriminator is shown in Equation (1). \[\min_{G}\max_{D}L_{GAN}(G,D)=\mathbb{E}_{x\sim\mathbb{P}_{r}}[\log(D(x))]+ \mathbb{E}_{x\sim\mathbb{P}_{g}}[\log(1-D\left(\widetilde{x}\right))] \tag{1}\]  
where \(\mathbb{P}_{r}\) is the data distribution, \(\mathbb{P}_{g}\) is the model distribution and implicitly defined as \(\widetilde{x}=G(z)\), \(z\sim p(z)\), and the generator's input z is drawn from a straightforward noise distribution p, like a uniform or spherical Gaussian distribution. If the discriminator is trained to optimality before each update of the generator's parameters, then minimizing the function is equivalent to minimizing the Jensen-Shannon (JS) divergence between \(\mathbb{P}_{r}\) and \(\mathbb{P}_{g}\). However, the saturation of the discriminator can lead to vanishing gradients. In practice, the generator is usually trained to maximize \(\mathbb{E}_{\widetilde{x}\sim\mathbb{P}_{g}}[\log(D(\widetilde{x}))]\), which can partially mitigate this issue. Nevertheless, even this modified loss function can perform poorly with a well-trained discriminator. The advent of the Wasserstein GAN (WGAN) addresses these issues by using the Wasserstein distance instead of JS divergence as the loss function. The Wasserstein distance can reflect the distance between two distributions even when \(\mathbb{P}_{r}\) and \(\mathbb{P}_{g}\) do not overlap (where JS divergence remains constant, leading to zero gradients and causing gradient vanishing and mode collapse problems). However, in practical applications, the WGAN handles the Lipschitz continuity constraint by directly employing a weight clipping strategy [19]. This often results in the discriminator's learned weights being concentrated at the maximum and minimum values, leading to gradient explosion and non-convergence. Therefore, a penalty term is added to the original network's loss function, as shown in Equation (2). \[\underset{G}{\text{minmax}}L_{GP}(G,D)=\underset{\text{Original critic loss}}{\text{L}_{GAN}(G,D)}+\underset{\text{s}}{\text{\lambda}\mathbb{E}_{\hat{x}\sim \mathbb{P}_{\hat{x}}}\left[\left(\left\|\
abla_{\hat{x}}D(\hat{x})\right\|_{2 }-1\right)^{2}\right]} \tag{2}\]In the equation, \(\left\|\cdot\right\|_{2}\) represents the L2 norm, \(\
abla\) denotes the gradient operator, \(\lambda\) is the penalty coefficient, \(\mathbb{P}_{\hat{x}}\) indicates the sampling distribution of the gradient penalty term, and \(\hat{x}\) represents the linear interpolation between real sample data and generated data. This network model, which includes the gradient penalty term, is referred to as the WGAN-GP. By independently applying the gradient penalty to each sample, the WGAN-GP satisfies the Lipschitz continuity while ensuring that the discriminator's weights are evenly distributed within a certain range, thus improving the model's convergence speed and addressing the gradient explosion and non-convergence issues that are often encountered in the WGAN. The structure of the WGAN-GP network is illustrated in Figure 2. In this structure, G is the generator network that generates images. It receives a random noise z and produces an image denoted as G(z). D is the discriminator network, tasked with evaluating the authenticity of an image. The generator is used to generate data distributions that match real SSS images. The information input is evaluated and classified by the discriminator.